From e6a3429175133d369892c007bf2094d5a7811a02 Mon Sep 17 00:00:00 2001 From: typicalninja <65993466+typicalninja@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:52:55 +0530 Subject: [PATCH 01/10] chore: cleanup root package.json --- package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index b7025f5..f4bdfbb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,9 @@ "name": "gsr", "private": true, "repository": "https://github.com/typicalninja/google-sr", - "scripts": { + "author": "typicalninja", + "license": "Apache-2.0", + "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", @@ -15,13 +17,6 @@ "ci:version": "changeset version", "prepare": "is-ci || lefthook install" }, - "author": "typicalninja", - "license": "Apache-2.0", - "engines": { - "node": ">=20.0.0", - "pnpm": ">=10.13.1" - }, - "packageManager": "pnpm@10.13.1", "devDependencies": { "@biomejs/biome": "2.0.6", "@changesets/changelog-github": "^0.5.1", @@ -35,6 +30,11 @@ "turbo": "^2.5.4", "typedoc": "^0.28.7", "typescript": "^5.8.3" + }, + "packageManager": "pnpm@10.13.1", + "engines": { + "node": ">=20.0.0", + "pnpm": ">=10.13.1" }, "commitlint": { "extends": [ From 9a86551b6a7fa11106d228ba16c8976136bbf28c Mon Sep 17 00:00:00 2001 From: typicalninja <65993466+typicalninja@users.noreply.github.com> Date: Sat, 26 Jul 2025 22:59:13 +0530 Subject: [PATCH 02/10] refactor(google-sr): use full relative file paths for imports --- packages/google-sr/src/constants.ts | 2 +- packages/google-sr/src/index.ts | 8 ++++---- packages/google-sr/src/results/conversion.ts | 4 ++-- packages/google-sr/src/results/dictionary.ts | 4 ++-- packages/google-sr/src/results/index.ts | 14 +++++++------- packages/google-sr/src/results/knowledge-panel.ts | 4 ++-- packages/google-sr/src/results/news.ts | 4 ++-- packages/google-sr/src/results/organic.ts | 4 ++-- packages/google-sr/src/results/time.ts | 4 ++-- packages/google-sr/src/results/translate.ts | 4 ++-- packages/google-sr/src/search.ts | 6 +++--- packages/google-sr/src/utils.ts | 4 ++-- packages/google-sr/tests/results.test.ts | 2 +- packages/google-sr/tests/search.test.ts | 4 ++-- packages/google-sr/tests/utils.test.ts | 2 +- packages/google-sr/tsup.config.ts | 2 +- 16 files changed, 36 insertions(+), 36 deletions(-) diff --git a/packages/google-sr/src/constants.ts b/packages/google-sr/src/constants.ts index 14eb6e2..a3f5e51 100644 --- a/packages/google-sr/src/constants.ts +++ b/packages/google-sr/src/constants.ts @@ -7,7 +7,7 @@ import type { TimeResultNode, TranslateResultNode, UnitConversionResultNode, -} from "./results"; +} from "./results/index.js"; export const ResultTypes = { OrganicResult: "ORGANIC", diff --git a/packages/google-sr/src/index.ts b/packages/google-sr/src/index.ts index 41213cd..55f2618 100644 --- a/packages/google-sr/src/index.ts +++ b/packages/google-sr/src/index.ts @@ -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"; diff --git a/packages/google-sr/src/results/conversion.ts b/packages/google-sr/src/results/conversion.ts index 65edb56..caaed8f 100644 --- a/packages/google-sr/src/results/conversion.ts +++ b/packages/google-sr/src/results/conversion.ts @@ -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; diff --git a/packages/google-sr/src/results/dictionary.ts b/packages/google-sr/src/results/dictionary.ts index 1fd9a71..8e066b2 100644 --- a/packages/google-sr/src/results/dictionary.ts +++ b/packages/google-sr/src/results/dictionary.ts @@ -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 diff --git a/packages/google-sr/src/results/index.ts b/packages/google-sr/src/results/index.ts index 684123f..1dd418d 100644 --- a/packages/google-sr/src/results/index.ts +++ b/packages/google-sr/src/results/index.ts @@ -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"; diff --git a/packages/google-sr/src/results/knowledge-panel.ts b/packages/google-sr/src/results/knowledge-panel.ts index 5d3c93e..88602cb 100644 --- a/packages/google-sr/src/results/knowledge-panel.ts +++ b/packages/google-sr/src/results/knowledge-panel.ts @@ -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; diff --git a/packages/google-sr/src/results/news.ts b/packages/google-sr/src/results/news.ts index b4f103c..b182ffa 100644 --- a/packages/google-sr/src/results/news.ts +++ b/packages/google-sr/src/results/news.ts @@ -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; diff --git a/packages/google-sr/src/results/organic.ts b/packages/google-sr/src/results/organic.ts index 6147ddf..e6de132 100644 --- a/packages/google-sr/src/results/organic.ts +++ b/packages/google-sr/src/results/organic.ts @@ -3,13 +3,13 @@ import { type ResultParser, ResultTypes, type SearchResultNodeLike, -} from "../constants"; +} from "../constants.js"; import { coerceToStringOrUndefined, extractUrlFromGoogleLink, type PartialExceptType, throwNoCheerioError, -} from "../utils"; +} from "../utils.js"; export interface OrganicResultNode extends SearchResultNodeLike { type: typeof ResultTypes.OrganicResult; diff --git a/packages/google-sr/src/results/time.ts b/packages/google-sr/src/results/time.ts index 7f1d7af..4df4f6c 100644 --- a/packages/google-sr/src/results/time.ts +++ b/packages/google-sr/src/results/time.ts @@ -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 TimeResultNode extends SearchResultNodeLike { type: typeof ResultTypes.TimeResult; diff --git a/packages/google-sr/src/results/translate.ts b/packages/google-sr/src/results/translate.ts index 76b9465..692e864 100644 --- a/packages/google-sr/src/results/translate.ts +++ b/packages/google-sr/src/results/translate.ts @@ -4,8 +4,8 @@ import { ResultTypes, type SearchResultNodeLike, TranslateSourceTextRegex, -} from "../constants"; -import { coerceToStringOrUndefined, throwNoCheerioError } from "../utils"; +} from "../constants.js"; +import { coerceToStringOrUndefined, throwNoCheerioError } from "../utils.js"; export interface TranslateResultNode extends SearchResultNodeLike { type: typeof ResultTypes.TranslateResult; diff --git a/packages/google-sr/src/search.ts b/packages/google-sr/src/search.ts index 99f7e8b..f8a9393 100644 --- a/packages/google-sr/src/search.ts +++ b/packages/google-sr/src/search.ts @@ -3,14 +3,14 @@ import type { ResultParser, SearchOptions, SearchOptionsWithPages, -} from "./constants"; -import { OrganicResult } from "./results"; +} from "./constants.js"; +import { OrganicResult } from "./results/index.js"; import { decodeResponse, prepareRequestConfig, type SearchResultTypeFromParser, safeGetFetch, -} from "./utils"; +} from "./utils.js"; export async function search( searchOptions: SearchOptions, diff --git a/packages/google-sr/src/utils.ts b/packages/google-sr/src/utils.ts index 94dc928..98e9075 100644 --- a/packages/google-sr/src/utils.ts +++ b/packages/google-sr/src/utils.ts @@ -3,8 +3,8 @@ import type { ResultParser, ResultTypes, SearchOptions, -} from "./constants"; -import { GOOGLE_SEARCH_URL } from "./constants"; +} from "./constants.js"; +import { GOOGLE_SEARCH_URL } from "./constants.js"; const baseHeaders = { Accept: "text/html", diff --git a/packages/google-sr/tests/results.test.ts b/packages/google-sr/tests/results.test.ts index 3735d97..cb8cc90 100644 --- a/packages/google-sr/tests/results.test.ts +++ b/packages/google-sr/tests/results.test.ts @@ -9,7 +9,7 @@ import { TimeResult, TranslateResult, UnitConversionResult, -} from "../src"; +} from "../src/index.js"; // Live tests require querying google, which can lead to rate limiting or blocking. // on development machines, we run live tests only if explicitly enabled diff --git a/packages/google-sr/tests/search.test.ts b/packages/google-sr/tests/search.test.ts index ed279e9..cf30d14 100644 --- a/packages/google-sr/tests/search.test.ts +++ b/packages/google-sr/tests/search.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it } from "vitest"; -import { OrganicResult, ResultTypes } from "../src"; -import { search, searchWithPages } from "../src/search"; +import { OrganicResult, ResultTypes } from "../src/index.js"; +import { search, searchWithPages } from "../src/search.js"; // Live tests require querying google, which can lead to rate limiting or blocking. // on development machines, we run live tests only if explicitly enabled diff --git a/packages/google-sr/tests/utils.test.ts b/packages/google-sr/tests/utils.test.ts index 37a60eb..f4b8eee 100644 --- a/packages/google-sr/tests/utils.test.ts +++ b/packages/google-sr/tests/utils.test.ts @@ -5,7 +5,7 @@ import { prepareRequestConfig, safeGetFetch, throwNoCheerioError, -} from "../src/utils"; +} from "../src/utils.js"; function createMockResponse(bytes: number[]): Response { const buffer = new Uint8Array(bytes); diff --git a/packages/google-sr/tsup.config.ts b/packages/google-sr/tsup.config.ts index 340312a..f3b6e6c 100644 --- a/packages/google-sr/tsup.config.ts +++ b/packages/google-sr/tsup.config.ts @@ -1,3 +1,3 @@ -import { createTsupConfig } from "../../tsup.config"; +import { createTsupConfig } from "../../tsup.config.js"; export default [createTsupConfig()]; From 38cd831b41f2c1daf88d9504917c257f9d060482 Mon Sep 17 00:00:00 2001 From: typicalninja <65993466+typicalninja@users.noreply.github.com> Date: Sat, 26 Jul 2025 23:19:09 +0530 Subject: [PATCH 03/10] refactor(google-sr): migrate to esm & add export maps --- packages/google-sr/package.json | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/google-sr/package.json b/packages/google-sr/package.json index 6c0bf73..ff66dda 100644 --- a/packages/google-sr/package.json +++ b/packages/google-sr/package.json @@ -4,26 +4,18 @@ "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/", + "type": "module", "exports": { - "types": "./dist/index.d.mts", - "import": "./dist/index.mjs", - "require": "./dist/index.js" + ".": { + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } }, "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": { @@ -39,5 +31,15 @@ "engines": { "node": ">=20.0.0", "pnpm": ">=10.13.1" - } + }, + "keywords": [ + "google-sr", + "gsr", + "google", + "googlesr", + "search", + "google-search", + "googlesearch", + "scraping" + ] } From c8d5898a1e0a0ddc2b4b43fb961310897628a4fc Mon Sep 17 00:00:00 2001 From: typicalninja <65993466+typicalninja@users.noreply.github.com> Date: Sun, 27 Jul 2025 11:51:26 +0530 Subject: [PATCH 04/10] chore(google-sr): remove is-ci dev dependency --- packages/google-sr/package.json | 7 +++---- pnpm-lock.yaml | 3 --- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/google-sr/package.json b/packages/google-sr/package.json index ff66dda..a9b83c1 100644 --- a/packages/google-sr/package.json +++ b/packages/google-sr/package.json @@ -4,7 +4,7 @@ "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/", - "type": "module", + "type": "module", "exports": { ".": { "import": "./dist/index.js", @@ -25,14 +25,13 @@ "devDependencies": { "@vitest/coverage-v8": "^3.2.4", "@vitest/ui": "3.2.4", - "is-ci": "4.1.0", "vitest": "^3.2.4" }, - "engines": { + "engines": { "node": ">=20.0.0", "pnpm": ">=10.13.1" }, - "keywords": [ + "keywords": [ "google-sr", "gsr", "google", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 474bb67..5ca66f6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -83,9 +83,6 @@ importers: '@vitest/ui': specifier: 3.2.4 version: 3.2.4(vitest@3.2.4) - is-ci: - specifier: 4.1.0 - version: 4.1.0 vitest: specifier: ^3.2.4 version: 3.2.4(@types/node@24.0.10)(@vitest/ui@3.2.4)(jiti@2.4.2)(tsx@4.20.3)(yaml@2.8.0) From 400b836cbbe1a45b9d6905df4235e8fc716323b9 Mon Sep 17 00:00:00 2001 From: typicalninja <65993466+typicalninja@users.noreply.github.com> Date: Sun, 27 Jul 2025 12:59:25 +0530 Subject: [PATCH 05/10] chore(google-sr-selectors): convert to esm --- packages/google-sr-selectors/package.json | 64 ++++++++++++----------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/packages/google-sr-selectors/package.json b/packages/google-sr-selectors/package.json index b22e0c4..46f08e3 100644 --- a/packages/google-sr-selectors/package.json +++ b/packages/google-sr-selectors/package.json @@ -1,34 +1,36 @@ { - "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": "https://github.com/typicalninja/google-sr", + "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" + }, + "keywords": [ + "google-sr", + "gsr", + "google", + "googlesr", + "search", + "google-search", + "googlesearch", + "scraping", + "selectors", + "cheerio" + ] } From 1a3f01d2bc5ec615e36e32c3556307f8c73fdf6c Mon Sep 17 00:00:00 2001 From: typicalninja <65993466+typicalninja@users.noreply.github.com> Date: Sun, 27 Jul 2025 13:00:21 +0530 Subject: [PATCH 06/10] chore(google-sr-selectors): use full relative paths in config --- packages/google-sr-selectors/tsup.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-sr-selectors/tsup.config.ts b/packages/google-sr-selectors/tsup.config.ts index 340312a..f3b6e6c 100644 --- a/packages/google-sr-selectors/tsup.config.ts +++ b/packages/google-sr-selectors/tsup.config.ts @@ -1,3 +1,3 @@ -import { createTsupConfig } from "../../tsup.config"; +import { createTsupConfig } from "../../tsup.config.js"; export default [createTsupConfig()]; From fb6612589d9a0adb8e3aa889db98f9f0d4d72422 Mon Sep 17 00:00:00 2001 From: typicalninja <65993466+typicalninja@users.noreply.github.com> Date: Sun, 27 Jul 2025 15:12:57 +0530 Subject: [PATCH 07/10] chore: apply publint suggestion to repo field --- package.json | 81 +++++++++++---------- packages/google-sr-selectors/package.json | 5 +- packages/google-sr/package.json | 87 ++++++++++++----------- packages/google-that/package.json | 79 ++++++++++---------- 4 files changed, 132 insertions(+), 120 deletions(-) diff --git a/package.json b/package.json index f4bdfbb..e61e78c 100644 --- a/package.json +++ b/package.json @@ -1,44 +1,47 @@ { - "name": "gsr", - "private": true, - "repository": "https://github.com/typicalninja/google-sr", - "author": "typicalninja", - "license": "Apache-2.0", + "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" - }, + "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", "engines": { - "node": ">=20.0.0", - "pnpm": ">=10.13.1" - }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - } + "node": ">=20.0.0", + "pnpm": ">=10.13.1" + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + } } diff --git a/packages/google-sr-selectors/package.json b/packages/google-sr-selectors/package.json index 46f08e3..855330b 100644 --- a/packages/google-sr-selectors/package.json +++ b/packages/google-sr-selectors/package.json @@ -2,7 +2,10 @@ "name": "google-sr-selectors", "version": "2.0.0", "description": "Html selectors for google search result pages.", - "repository": "https://github.com/typicalninja/google-sr", + "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", diff --git a/packages/google-sr/package.json b/packages/google-sr/package.json index a9b83c1..f7fa17f 100644 --- a/packages/google-sr/package.json +++ b/packages/google-sr/package.json @@ -1,44 +1,47 @@ { - "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/", - "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" - }, - "keywords": [ - "google-sr", - "gsr", - "google", - "googlesr", - "search", - "google-search", - "googlesearch", - "scraping" - ] + "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" + }, + "keywords": [ + "google-sr", + "gsr", + "google", + "googlesr", + "search", + "google-search", + "googlesearch", + "scraping" + ] } diff --git a/packages/google-that/package.json b/packages/google-that/package.json index 5d6a02d..c5beff8 100644 --- a/packages/google-that/package.json +++ b/packages/google-that/package.json @@ -1,40 +1,43 @@ { - "name": "google-that", - "version": "1.1.1", - "description": "CLI tool to scrape google search results without a api key", - "repository": "https://github.com/typicalninja/google-sr", - "homepage": "https://github.com/typicalninja/google-sr", - "exports": null, - "bin": "./dist/index.js", - "type": "module", - "scripts": { - "build": "tsup", - "dev": "tsx src/index.ts" - }, - "keywords": [ - "google-sr", - "gsr", - "google", - "googlesr", - "search", - "google-search", - "googlesearch", - "scraping", - "cli" - ], - "author": "typicalninja", - "license": "Apache-2.0", - "dependencies": { - "@types/node": "^24.0.10", - "google-sr": "workspace:*", - "yargs": "^18.0.0" - }, - "engines": { - "node": ">=20.0.0", - "pnpm": ">=10.13.1" - }, - "devDependencies": { - "@types/yargs": "^17.0.33", - "tsx": "^4.20.3" - } + "name": "google-that", + "version": "1.1.1", + "description": "CLI tool to scrape google search results without a api key", + "author": "typicalninja", + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "git+https://github.com/typicalninja/google-sr.git" + }, + "homepage": "https://github.com/typicalninja/google-sr", + "exports": null, + "bin": "./dist/index.js", + "type": "module", + "scripts": { + "build": "tsup", + "dev": "tsx src/index.ts" + }, + "dependencies": { + "@types/node": "^24.0.10", + "google-sr": "workspace:*", + "yargs": "^18.0.0" + }, + "engines": { + "node": ">=20.0.0", + "pnpm": ">=10.13.1" + }, + "devDependencies": { + "@types/yargs": "^17.0.33", + "tsx": "^4.20.3" + }, + "keywords": [ + "google-sr", + "gsr", + "google", + "googlesr", + "search", + "google-search", + "googlesearch", + "scraping", + "cli" + ] } From e594a1b352a6bec47582a10cae62ffc01e2dfc54 Mon Sep 17 00:00:00 2001 From: typicalninja <65993466+typicalninja@users.noreply.github.com> Date: Sun, 27 Jul 2025 15:32:45 +0530 Subject: [PATCH 08/10] chore: replace .npmignore with package.json files property Instead of ignoring specific files, do the reverse and specify the files to be package --- packages/google-sr-selectors/.npmignore | 14 -------------- packages/google-sr-selectors/package.json | 4 ++++ packages/google-sr/.npmignore | 19 ------------------- packages/google-sr/package.json | 4 ++++ packages/google-that/.npmignore | 13 ------------- packages/google-that/package.json | 12 ++++++++---- 6 files changed, 16 insertions(+), 50 deletions(-) delete mode 100644 packages/google-sr-selectors/.npmignore delete mode 100644 packages/google-sr/.npmignore delete mode 100644 packages/google-that/.npmignore diff --git a/packages/google-sr-selectors/.npmignore b/packages/google-sr-selectors/.npmignore deleted file mode 100644 index 2d350c0..0000000 --- a/packages/google-sr-selectors/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ - -# Stop npm from publishing ts files -src -# Typescript -tsup.config.ts -tsconfig.json - -# tools -.turbo - -# Ignore api docs -API.md -# Ignore changelog -CHANGELOG.md \ No newline at end of file diff --git a/packages/google-sr-selectors/package.json b/packages/google-sr-selectors/package.json index 855330b..d9b54d4 100644 --- a/packages/google-sr-selectors/package.json +++ b/packages/google-sr-selectors/package.json @@ -24,6 +24,10 @@ "node": ">=20.0.0", "pnpm": ">=10.13.1" }, + "files": [ + "dist/", + "README.md" + ], "keywords": [ "google-sr", "gsr", diff --git a/packages/google-sr/.npmignore b/packages/google-sr/.npmignore deleted file mode 100644 index 9102fa1..0000000 --- a/packages/google-sr/.npmignore +++ /dev/null @@ -1,19 +0,0 @@ - -# Stop npm from publishing ts files -src - -# Stop npm from publishing test files -tests - -# Typescript -tsup.config.ts -tsconfig.json - -# tools -.turbo - - -# Ignore api docs -API.md -# Ignore changelog -CHANGELOG.md \ No newline at end of file diff --git a/packages/google-sr/package.json b/packages/google-sr/package.json index f7fa17f..84e36d8 100644 --- a/packages/google-sr/package.json +++ b/packages/google-sr/package.json @@ -34,6 +34,10 @@ "node": ">=20.0.0", "pnpm": ">=10.13.1" }, + "files": [ + "dist/", + "README.md" + ], "keywords": [ "google-sr", "gsr", diff --git a/packages/google-that/.npmignore b/packages/google-that/.npmignore deleted file mode 100644 index b5d83e2..0000000 --- a/packages/google-that/.npmignore +++ /dev/null @@ -1,13 +0,0 @@ - -# Stop npm from publishing ts files -src - -# Typescript -tsup.config.ts -tsconfig.json - -# tools -.turbo - -# Ignore changelog -CHANGELOG.md \ No newline at end of file diff --git a/packages/google-that/package.json b/packages/google-that/package.json index c5beff8..d271583 100644 --- a/packages/google-that/package.json +++ b/packages/google-that/package.json @@ -16,19 +16,23 @@ "build": "tsup", "dev": "tsx src/index.ts" }, + "engines": { + "node": ">=20.0.0", + "pnpm": ">=10.13.1" + }, "dependencies": { "@types/node": "^24.0.10", "google-sr": "workspace:*", "yargs": "^18.0.0" }, - "engines": { - "node": ">=20.0.0", - "pnpm": ">=10.13.1" - }, "devDependencies": { "@types/yargs": "^17.0.33", "tsx": "^4.20.3" }, + "files": [ + "dist/", + "README.md" + ], "keywords": [ "google-sr", "gsr", From bd1bedc1d2158b8185031f2c8700f0790e95fb28 Mon Sep 17 00:00:00 2001 From: typicalninja <65993466+typicalninja@users.noreply.github.com> Date: Sun, 27 Jul 2025 15:34:39 +0530 Subject: [PATCH 09/10] chore(google-that): move @types/node to dev dependency --- packages/google-that/package.json | 2 +- pnpm-lock.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-that/package.json b/packages/google-that/package.json index d271583..0895fd5 100644 --- a/packages/google-that/package.json +++ b/packages/google-that/package.json @@ -21,11 +21,11 @@ "pnpm": ">=10.13.1" }, "dependencies": { - "@types/node": "^24.0.10", "google-sr": "workspace:*", "yargs": "^18.0.0" }, "devDependencies": { + "@types/node": "^24.0.10", "@types/yargs": "^17.0.33", "tsx": "^4.20.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5ca66f6..1befec9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -91,9 +91,6 @@ importers: packages/google-that: dependencies: - '@types/node': - specifier: ^24.0.10 - version: 24.0.10 google-sr: specifier: workspace:* version: link:../google-sr @@ -101,6 +98,9 @@ importers: specifier: ^18.0.0 version: 18.0.0 devDependencies: + '@types/node': + specifier: ^24.0.10 + version: 24.0.10 '@types/yargs': specifier: ^17.0.33 version: 17.0.33 From 202c17f429365212e2ee1d4889e2056ca12085cc Mon Sep 17 00:00:00 2001 From: typicalninja <65993466+typicalninja@users.noreply.github.com> Date: Sun, 27 Jul 2025 16:12:02 +0530 Subject: [PATCH 10/10] chore: add changeset --- .changeset/smart-eyes-report.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .changeset/smart-eyes-report.md diff --git a/.changeset/smart-eyes-report.md b/.changeset/smart-eyes-report.md new file mode 100644 index 0000000..007029a --- /dev/null +++ b/.changeset/smart-eyes-report.md @@ -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. \ No newline at end of file