Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/smart-eyes-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"google-sr-selectors": minor
"google-that": minor
"google-sr": minor
---

Migrate packages to ESM-first with CJS compatibility via dual build

All packages have been migrated from CJS-first to ESM-first architecture. Existing users can continue using the packages without any code changes as both ESM and CJS builds are provided.
85 changes: 44 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
{
"name": "gsr",
"private": true,
"repository": "https://github.com/typicalninja/google-sr",
"scripts": {
"build": "turbo run build --no-daemon",
"dev": "turbo run dev --parallel --no-daemon",
"test": "turbo run test --no-daemon --filter=google-sr -- --watch=false",
"build:packages": "turbo run build --no-daemon",
"build:docs": "typedoc ",
"lint": "biome lint --write",
"format": "biome format --write",
"check": "biome check --write",
"ci:publish": "pnpm publish -r --no-git-checks",
"ci:version": "changeset version",
"prepare": "is-ci || lefthook install"
},
"author": "typicalninja",
"license": "Apache-2.0",
"engines": {
"node": ">=20.0.0",
"pnpm": ">=10.13.1"
},
"name": "gsr",
"private": true,
"author": "typicalninja",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/typicalninja/google-sr.git"
},
"scripts": {
"build": "turbo run build --no-daemon",
"dev": "turbo run dev --parallel --no-daemon",
"test": "turbo run test --no-daemon --filter=google-sr -- --watch=false",
"build:packages": "turbo run build --no-daemon",
"build:docs": "typedoc ",
"lint": "biome lint --write",
"format": "biome format --write",
"check": "biome check --write",
"ci:publish": "pnpm publish -r --no-git-checks",
"ci:version": "changeset version",
"prepare": "is-ci || lefthook install"
},
"devDependencies": {
"@biomejs/biome": "2.0.6",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.5",
"@commitlint/cli": "19.8.1",
"@commitlint/config-conventional": "19.8.1",
"is-ci": "4.1.0",
"lefthook": "^1.11.16",
"pkg-pr-new": "^0.0.54",
"tsup": "^8.5.0",
"turbo": "^2.5.4",
"typedoc": "^0.28.7",
"typescript": "^5.8.3"
},
"packageManager": "pnpm@10.13.1",
"devDependencies": {
"@biomejs/biome": "2.0.6",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.5",
"@commitlint/cli": "19.8.1",
"@commitlint/config-conventional": "19.8.1",
"is-ci": "4.1.0",
"lefthook": "^1.11.16",
"pkg-pr-new": "^0.0.54",
"tsup": "^8.5.0",
"turbo": "^2.5.4",
"typedoc": "^0.28.7",
"typescript": "^5.8.3"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
}
"engines": {
"node": ">=20.0.0",
"pnpm": ">=10.13.1"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
}
}
14 changes: 0 additions & 14 deletions packages/google-sr-selectors/.npmignore

This file was deleted.

71 changes: 40 additions & 31 deletions packages/google-sr-selectors/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
{
"name": "google-sr-selectors",
"version": "2.0.0",
"description": "Html selectors for google search result pages.",
"repository": "https://github.com/typicalninja/google-sr",
"homepage": "https://typicalninja.github.io/google-sr/",
"exports": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch"
},
"keywords": [
"google-sr",
"gsr",
"google",
"googlesr",
"search",
"google-search",
"googlesearch",
"scraping",
"selectors",
"cheerio"
],
"author": "typicalninja",
"license": "Apache-2.0",
"name": "google-sr-selectors",
"version": "2.0.0",
"description": "Html selectors for google search result pages.",
"repository": {
"type": "git",
"url": "git+https://github.com/typicalninja/google-sr.git"
},
"homepage": "https://typicalninja.github.io/google-sr/",
"author": "typicalninja",
"license": "Apache-2.0",
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"scripts": {
"build": "tsup",
"dev": "tsup --watch"
},
"engines": {
"node": ">=20.0.0",
"pnpm": ">=10.13.1"
}
"node": ">=20.0.0",
"pnpm": ">=10.13.1"
},
"files": [
"dist/",
"README.md"
],
"keywords": [
"google-sr",
"gsr",
"google",
"googlesr",
"search",
"google-search",
"googlesearch",
"scraping",
"selectors",
"cheerio"
]
}
2 changes: 1 addition & 1 deletion packages/google-sr-selectors/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { createTsupConfig } from "../../tsup.config";
import { createTsupConfig } from "../../tsup.config.js";

export default [createTsupConfig()];
19 changes: 0 additions & 19 deletions packages/google-sr/.npmignore

This file was deleted.

88 changes: 48 additions & 40 deletions packages/google-sr/package.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,51 @@
{
"name": "google-sr",
"version": "5.0.0",
"description": "Fast and efficient Package for scraping Google search results without the need for an API key",
"repository": "https://github.com/typicalninja/google-sr",
"homepage": "https://typicalninja.github.io/google-sr/",
"exports": {
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"scripts": {
"test": "vitest",
"build": "tsup",
"dev": "tsup --watch"
},
"keywords": [
"google-sr",
"gsr",
"google",
"googlesr",
"search",
"google-search",
"googlesearch",
"scraping"
],
"author": "typicalninja",
"license": "Apache-2.0",
"dependencies": {
"cheerio": "1.1.0",
"google-sr-selectors": "workspace:^"
},
"devDependencies": {
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "3.2.4",
"is-ci": "4.1.0",
"vitest": "^3.2.4"
},
"name": "google-sr",
"version": "5.0.0",
"description": "Fast and efficient Package for scraping Google search results without the need for an API key",
"repository": {
"type": "git",
"url": "git+https://github.com/typicalninja/google-sr.git"
},
"homepage": "https://typicalninja.github.io/google-sr/",
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"scripts": {
"test": "vitest",
"build": "tsup",
"dev": "tsup --watch"
},
"author": "typicalninja",
"license": "Apache-2.0",
"dependencies": {
"cheerio": "1.1.0",
"google-sr-selectors": "workspace:^"
},
"devDependencies": {
"@vitest/coverage-v8": "^3.2.4",
"@vitest/ui": "3.2.4",
"vitest": "^3.2.4"
},
"engines": {
"node": ">=20.0.0",
"pnpm": ">=10.13.1"
}
"node": ">=20.0.0",
"pnpm": ">=10.13.1"
},
"files": [
"dist/",
"README.md"
],
"keywords": [
"google-sr",
"gsr",
"google",
"googlesr",
"search",
"google-search",
"googlesearch",
"scraping"
]
}
2 changes: 1 addition & 1 deletion packages/google-sr/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
TimeResultNode,
TranslateResultNode,
UnitConversionResultNode,
} from "./results";
} from "./results/index.js";

export const ResultTypes = {
OrganicResult: "ORGANIC",
Expand Down
8 changes: 4 additions & 4 deletions packages/google-sr/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from "./constants";
export * from "./results";
export * from "./search";
export * from "./constants.js";
export * from "./results/index.js";
export * from "./search.js";

export type { SearchResultTypeFromParser } from "./utils";
export type { SearchResultTypeFromParser } from "./utils.js";
4 changes: 2 additions & 2 deletions packages/google-sr/src/results/conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
type ResultParser,
ResultTypes,
type SearchResultNodeLike,
} from "../constants";
import { coerceToStringOrUndefined, throwNoCheerioError } from "../utils";
} from "../constants.js";
import { coerceToStringOrUndefined, throwNoCheerioError } from "../utils.js";

export interface UnitConversionResultNode extends SearchResultNodeLike {
type: typeof ResultTypes.UnitConversionResult;
Expand Down
4 changes: 2 additions & 2 deletions packages/google-sr/src/results/dictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
type ResultParser,
ResultTypes,
type SearchResultNodeLike,
} from "../constants";
import { coerceToStringOrUndefined, throwNoCheerioError } from "../utils";
} from "../constants.js";
import { coerceToStringOrUndefined, throwNoCheerioError } from "../utils.js";

export interface DictionaryDefinition {
definition: string; // The definition text
Expand Down
14 changes: 7 additions & 7 deletions packages/google-sr/src/results/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from "./conversion";
export * from "./dictionary";
export * from "./knowledge-panel";
export * from "./news";
export * from "./organic";
export * from "./time";
export * from "./translate";
export * from "./conversion.js";
export * from "./dictionary.js";
export * from "./knowledge-panel.js";
export * from "./news.js";
export * from "./organic.js";
export * from "./time.js";
export * from "./translate.js";
4 changes: 2 additions & 2 deletions packages/google-sr/src/results/knowledge-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {
type ResultParser,
ResultTypes,
type SearchResultNodeLike,
} from "../constants";
} from "../constants.js";
import {
coerceToStringOrUndefined,
extractUrlFromGoogleLink,
throwNoCheerioError,
} from "../utils";
} from "../utils.js";

export interface KnowledgePanelMetadata {
label: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/google-sr/src/results/news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {
type ResultParser,
ResultTypes,
type SearchResultNodeLike,
} from "../constants";
} from "../constants.js";
import {
coerceToStringOrUndefined,
extractUrlFromGoogleLink,
throwNoCheerioError,
} from "../utils";
} from "../utils.js";

export interface NewsResultNode extends SearchResultNodeLike {
type: typeof ResultTypes.NewsResult;
Expand Down
Loading