Skip to content

Commit fd32f40

Browse files
committed
chore!: move to ESM, pnpm
BREAKING CHANGE: Not a breaking change, source in ESM, but still compiles to CJS. However, releasing as major version due to potential for failures because of a new build process.
1 parent 1865487 commit fd32f40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5948
-185
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
4-
directory: "/"
3+
- package-ecosystem: 'npm'
4+
directory: '/'
55
schedule:
6-
interval: "weekly"
7-
assignees:
8-
- "edosrecki"
9-
- package-ecosystem: "github-actions"
10-
directory: "/"
6+
interval: 'weekly'
7+
ignore:
8+
- dependency-name: '@types/node'
9+
update-types: ['version-update:semver-major']
10+
11+
- package-ecosystem: 'github-actions'
12+
directory: '/'
1113
schedule:
12-
interval: "weekly"
13-
assignees:
14-
- "edosrecki"
14+
interval: 'weekly'

.github/workflows/continuous-deployment.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,29 @@ jobs:
1313
name: Build and deploy app
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Checkout code
16+
- name: 📂 Checkout code
1717
uses: actions/checkout@v6
1818

19-
- name: Setup Node.js
19+
- name: 📦 Setup pnpm
20+
uses: pnpm/action-setup@v4
21+
22+
- name: 💚 Setup Node.js
2023
uses: actions/setup-node@v6
2124
with:
2225
node-version-file: package.json
26+
cache: 'pnpm'
27+
28+
- name: 📦 Install dependencies
29+
run: pnpm install
2330

24-
- name: Install packages
25-
run: npm install
31+
- name: 🔎 Typecheck code
32+
run: pnpm typecheck
2633

27-
- name: Lint
28-
run: npm run lint
34+
- name: 🔎 Lint code
35+
run: pnpm lint
2936

30-
- name: Build & Deploy
31-
run: npx semantic-release
37+
- name: 🚀 Build code and deploy app
38+
run: pnpm exec semantic-release
3239
env:
3340
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3441
HOMEBREW_TOOLS_TOKEN: ${{ secrets.HOMEBREW_TOOLS_TOKEN }}

.github/workflows/continuous-integration.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,30 @@ jobs:
1010
matrix:
1111
node-version: [24, 25]
1212
steps:
13-
- name: Checkout code
13+
- name: 📂 Checkout code
1414
uses: actions/checkout@v6
1515

16-
- name: Setup Node.js
16+
- name: 📦 Setup pnpm
17+
uses: pnpm/action-setup@v4
18+
19+
- name: 💚 Setup Node.js
1720
uses: actions/setup-node@v6
1821
with:
1922
node-version: ${{ matrix.node-version }}
23+
cache: 'pnpm'
24+
25+
- name: 📦 Install dependencies
26+
run: pnpm install
2027

21-
- name: Install packages
22-
run: npm install
28+
- name: 🔎 Typecheck code
29+
run: pnpm typecheck
2330

24-
- name: Lint
25-
run: npm run lint
31+
- name: 🔎 Lint code
32+
run: pnpm lint
2633

27-
- name: Build
28-
run: npm run build
34+
- name: 🚀 Build code
35+
run: pnpm build
2936

30-
- name: Bundle
37+
- name: 📦 Bundle app
3138
if: ${{ matrix.node-version == 24 }}
32-
run: npm run bundle
39+
run: pnpm bundle

.husky/pre-commit

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
npm run lint
1+
pnpm typecheck
2+
pnpm lint

.npmignore

Lines changed: 0 additions & 10 deletions
This file was deleted.

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.releaserc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[
1313
"@semantic-release/exec",
1414
{
15-
"publishCmd": "./tools/package-google-cloud-sql.sh ${nextRelease.version}"
15+
"prepareCmd": "./tools/package-google-cloud-sql.sh ${nextRelease.version}"
1616
}
1717
],
1818
"@semantic-release/npm",

README.adoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,25 +82,24 @@ Migration from v1 to v2 is done automatically when the app is run for the first
8282
== Build
8383
[source,bash]
8484
----
85-
npm run clean
86-
npm run build
85+
pnpm build
8786
----
8887

8988
== Package
9089
=== Pre-configured
91-
Package the app for Node.JS 18 on MacOS, Linux, and Windows.
90+
Package the app for Node.JS 24 on MacOS, Linux, and Windows.
9291

9392
[source,bash]
9493
----
95-
npm run bundle
94+
pnpm bundle
9695
----
9796

9897
=== Manual
9998
See https://www.npmjs.com/package/pkg#targets[pkg] for details.
10099

101100
[source,bash]
102101
----
103-
npx pkg <NODE_RANGE>-<PLATFORM>-<ARCH>
102+
pnpm exec pkg <NODE_RANGE>-<PLATFORM>-<ARCH>
104103
----
105104

106105
== Deploy

mise.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[tools]
2-
node = "24"
2+
node = "24.12.0"
3+
pnpm = "10.28.0"

package.json

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "google-cloud-sql",
33
"version": "2.0.0",
44
"description": "Connect to private Google Cloud SQL/AlloyDB instance through Cloud SQL/AlloyDB Auth Proxy running in GKE cluster.",
5+
"type": "module",
56
"license": "UNLICENSED",
67
"author": "Dinko Osrecki <[email protected]>",
78
"homepage": "https://github.com/edosrecki/google-cloud-sql-cli",
@@ -13,60 +14,67 @@
1314
"url": "https://github.com/edosrecki/google-cloud-sql-cli/issues"
1415
},
1516
"bin": {
16-
"google-cloud-sql": "dist/index.js"
17+
"google-cloud-sql": "dist/index.cjs"
1718
},
19+
"files": [
20+
"dist"
21+
],
22+
"packageManager": "[email protected]",
1823
"engines": {
19-
"node": "24"
24+
"node": "24.12.0",
25+
"pnpm": "10.28.0"
2026
},
2127
"scripts": {
2228
"clean": "rimraf dist bin",
23-
"prebuild": "npm run clean",
24-
"build": "tsc",
25-
"bundle": "npm run build && pkg . --targets node24-linux,node24-macos,node24-win --out-dir bin",
26-
"exec:dev": "ts-node src/index.ts",
27-
"exec:dist": "node dist/index.js",
29+
"prebuild": "pnpm clean",
30+
"build": "tsdown",
31+
"bundle": "pkg dist/index.cjs --targets node24-linux,node24-macos,node24-win --out-dir bin",
32+
"exec:dev": "tsx src/index.ts",
33+
"exec:dist": "node dist/index.cjs",
2834
"lint": "eslint .",
2935
"lint:fix": "eslint . --fix",
30-
"test": "npm run lint",
36+
"test": "pnpm lint",
37+
"typecheck": "tsc --noEmit",
3138
"prepare": "husky",
3239
"prettify-package-json": "prettier-package-json --write"
3340
},
3441
"dependencies": {
35-
"boxen": "5.1.2",
36-
"chalk": "4.1.2",
42+
"boxen": "8.0.1",
43+
"chalk": "5.6.2",
3744
"commander": "14.0.2",
38-
"conf": "10.2.0",
39-
"exit-hook": "2.2.1",
45+
"conf": "15.0.2",
46+
"exit-hook": "5.0.1",
4047
"fuse.js": "7.1.0",
41-
"inquirer": "8.2.5",
42-
"inquirer-autocomplete-prompt": "2.0.0",
43-
"lodash": "4.17.21",
48+
"inquirer": "9.3.8",
49+
"inquirer-autocomplete-prompt": "3.0.1",
50+
"lodash-es": "4.17.22",
4451
"memoizee": "0.4.17",
4552
"shelljs": "0.10.0",
46-
"update-notifier": "5.1.0"
53+
"update-notifier": "7.3.1"
4754
},
4855
"devDependencies": {
4956
"@eslint/js": "9.39.2",
5057
"@semantic-release/changelog": "6.0.3",
5158
"@semantic-release/exec": "7.1.0",
5259
"@semantic-release/git": "10.0.1",
53-
"@stylistic/eslint-plugin": "5.6.1",
60+
"@stylistic/eslint-plugin": "5.7.0",
5461
"@tsconfig/node24": "24.0.3",
55-
"@types/inquirer": "8.2.6",
56-
"@types/inquirer-autocomplete-prompt": "2.0.0",
57-
"@types/lodash": "4.17.21",
62+
"@types/inquirer": "^9.0.9",
63+
"@types/inquirer-autocomplete-prompt": "3.0.3",
64+
"@types/lodash-es": "4.17.12",
5865
"@types/memoizee": "0.4.12",
5966
"@types/node": "24.10.6",
60-
"@types/shelljs": "0.8.17",
61-
"@types/update-notifier": "5.1.0",
67+
"@types/shelljs": "0.10.0",
68+
"@types/update-notifier": "6.0.8",
6269
"@yao-pkg/pkg": "6.11.0",
6370
"eslint": "9.39.2",
6471
"husky": "9.1.7",
6572
"prettier-package-json": "2.8.0",
6673
"rimraf": "6.1.2",
6774
"semantic-release": "25.0.2",
68-
"ts-node": "10.9.2",
75+
"tsdown": "0.19.0",
76+
"tsx": "4.21.0",
6977
"typescript": "5.9.3",
70-
"typescript-eslint": "8.50.0"
78+
"typescript-eslint": "8.52.0"
7179
}
7280
}

0 commit comments

Comments
 (0)