From 26271c811815b8feab8552d31aba846ed5de9c03 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 3 Jan 2025 11:42:40 +0000 Subject: [PATCH 01/12] chore: fix `punycode` warning --- package.json | 1 + pnpm-lock.yaml | 131 ++++++++++++++++++++----------------------------- 2 files changed, 55 insertions(+), 77 deletions(-) diff --git a/package.json b/package.json index fa3798c102..cdd208f34d 100644 --- a/package.json +++ b/package.json @@ -128,6 +128,7 @@ }, "pnpm": { "overrides": { + "whatwg-url": "14.1.0", "cross-fetch": "4.0.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f53eba3c4c..b712c8768a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: + whatwg-url: 14.1.0 cross-fetch: 4.0.0 importers: @@ -6470,6 +6471,9 @@ packages: ajv@8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + ajv@8.14.0: + resolution: {integrity: sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==} + algoliasearch@4.22.1: resolution: {integrity: sha512-jwydKFQJKIx9kIZ8Jm44SdpigFwRGPESaxZBaHSV0XWN2yBJAOT4mT7ppvlrpA4UGzz92pqFnVKr/kaZXrcreg==} @@ -12655,8 +12659,8 @@ packages: punycode@1.4.1: resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} - punycode@2.3.0: - resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} pupa@2.1.1: @@ -14206,15 +14210,9 @@ packages: resolution: {integrity: sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==} engines: {node: '>=6'} - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tr46@1.0.1: - resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} - - tr46@2.1.0: - resolution: {integrity: sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==} - engines: {node: '>=8'} + tr46@5.0.0: + resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==} + engines: {node: '>=18'} transform-ast@2.4.4: resolution: {integrity: sha512-AxjeZAcIOUO2lev2GDe3/xZ1Q0cVGjIMk5IsriTy8zbWlsEnjeB025AhkhBJHoy997mXpLd4R+kRbvnnQVuQHQ==} @@ -15012,12 +15010,6 @@ packages: webfontloader@1.6.28: resolution: {integrity: sha512-Egb0oFEga6f+nSgasH3E0M405Pzn6y3/9tOVanv/DLfa1YBIgcv90L18YyWnvXkRbIM17v5Kv6IT2N6g1x5tvQ==} - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - webidl-conversions@4.0.2: - resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} - webidl-conversions@5.0.0: resolution: {integrity: sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==} engines: {node: '>=8'} @@ -15026,6 +15018,10 @@ packages: resolution: {integrity: sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==} engines: {node: '>=10.4'} + webidl-conversions@7.0.0: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + webpack-dev-middleware@5.3.3: resolution: {integrity: sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA==} engines: {node: '>= 12.13.0'} @@ -15103,15 +15099,9 @@ packages: resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} engines: {node: '>=18'} - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - whatwg-url@7.1.0: - resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} - - whatwg-url@8.7.0: - resolution: {integrity: sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==} - engines: {node: '>=10'} + whatwg-url@14.1.0: + resolution: {integrity: sha512-jlf/foYIKywAt3x/XWKZ/3rz8OSJPiWktjmk891alJUEjiVxKX9LEO92qH3hv4aJ0mN3MWPvGMCy8jQi95xK4w==} + engines: {node: '>=18'} which-boxed-primitive@1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} @@ -15429,7 +15419,7 @@ snapshots: 0x@5.7.0: dependencies: - ajv: 8.12.0 + ajv: 8.14.0 browserify: 17.0.0 concat-stream: 2.0.0 d3-fg: 6.14.0 @@ -15578,9 +15568,9 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@apideck/better-ajv-errors@0.3.6(ajv@8.12.0)': + '@apideck/better-ajv-errors@0.3.6(ajv@8.14.0)': dependencies: - ajv: 8.12.0 + ajv: 8.14.0 json-schema: 0.4.0 jsonpointer: 5.0.1 leven: 3.1.0 @@ -22676,17 +22666,17 @@ snapshots: clean-stack: 2.2.0 indent-string: 4.0.0 - ajv-formats@2.1.1(ajv@8.12.0): + ajv-formats@2.1.1(ajv@8.14.0): optionalDependencies: - ajv: 8.12.0 + ajv: 8.14.0 ajv-keywords@3.5.2(ajv@6.12.6): dependencies: ajv: 6.12.6 - ajv-keywords@5.1.0(ajv@8.12.0): + ajv-keywords@5.1.0(ajv@8.14.0): dependencies: - ajv: 8.12.0 + ajv: 8.14.0 fast-deep-equal: 3.1.3 ajv@6.12.6: @@ -22703,6 +22693,13 @@ snapshots: require-from-string: 2.0.2 uri-js: 4.4.1 + ajv@8.14.0: + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + algoliasearch@4.22.1: dependencies: '@algolia/cache-browser-local-storage': 4.22.1 @@ -24107,8 +24104,8 @@ snapshots: conf@10.2.0: dependencies: - ajv: 8.12.0 - ajv-formats: 2.1.1(ajv@8.12.0) + ajv: 8.14.0 + ajv-formats: 2.1.1(ajv@8.14.0) atomically: 1.7.0 debounce-fn: 4.0.0 dot-prop: 6.0.1 @@ -24602,7 +24599,7 @@ snapshots: dependencies: abab: 2.0.6 whatwg-mimetype: 2.3.0 - whatwg-url: 8.7.0 + whatwg-url: 14.1.0 data-view-buffer@1.0.1: dependencies: @@ -28214,7 +28211,7 @@ snapshots: webidl-conversions: 6.1.0 whatwg-encoding: 1.0.5 whatwg-mimetype: 2.3.0 - whatwg-url: 8.7.0 + whatwg-url: 14.1.0 ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) xml-name-validator: 3.0.0 transitivePeerDependencies: @@ -28248,7 +28245,7 @@ snapshots: webidl-conversions: 6.1.0 whatwg-encoding: 1.0.5 whatwg-mimetype: 2.3.0 - whatwg-url: 8.7.0 + whatwg-url: 14.1.0 ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@6.0.4) xml-name-validator: 3.0.0 transitivePeerDependencies: @@ -29384,11 +29381,11 @@ snapshots: node-fetch@2.6.13: dependencies: - whatwg-url: 5.0.0 + whatwg-url: 14.1.0 node-fetch@2.7.0: dependencies: - whatwg-url: 5.0.0 + whatwg-url: 14.1.0 node-fetch@3.3.2: dependencies: @@ -30659,7 +30656,7 @@ snapshots: punycode@1.4.1: {} - punycode@2.3.0: {} + punycode@2.3.1: {} pupa@2.1.1: dependencies: @@ -31515,9 +31512,9 @@ snapshots: schema-utils@4.2.0: dependencies: '@types/json-schema': 7.0.12 - ajv: 8.12.0 - ajv-formats: 2.1.1(ajv@8.12.0) - ajv-keywords: 5.1.0(ajv@8.12.0) + ajv: 8.14.0 + ajv-formats: 2.1.1(ajv@8.14.0) + ajv-keywords: 5.1.0(ajv@8.14.0) scope-analyzer@2.1.2: dependencies: @@ -31874,7 +31871,7 @@ snapshots: source-map@0.8.0-beta.0: dependencies: - whatwg-url: 7.1.0 + whatwg-url: 14.1.0 sourcemap-codec@1.4.8: {} @@ -32611,24 +32608,18 @@ snapshots: tough-cookie@2.5.0: dependencies: psl: 1.9.0 - punycode: 2.3.0 + punycode: 2.3.1 tough-cookie@4.1.4: dependencies: psl: 1.9.0 - punycode: 2.3.0 + punycode: 2.3.1 universalify: 0.2.0 url-parse: 1.5.10 - tr46@0.0.3: {} - - tr46@1.0.1: - dependencies: - punycode: 2.3.0 - - tr46@2.1.0: + tr46@5.0.0: dependencies: - punycode: 2.3.0 + punycode: 2.3.1 transform-ast@2.4.4: dependencies: @@ -33100,7 +33091,7 @@ snapshots: uri-js@4.4.1: dependencies: - punycode: 2.3.0 + punycode: 2.3.1 url-parse-lax@3.0.0: dependencies: @@ -33633,14 +33624,12 @@ snapshots: webfontloader@1.6.28: {} - webidl-conversions@3.0.1: {} - - webidl-conversions@4.0.2: {} - webidl-conversions@5.0.0: {} webidl-conversions@6.1.0: {} + webidl-conversions@7.0.0: {} + webpack-dev-middleware@5.3.3(webpack@5.88.0(@swc/core@1.7.14)(esbuild@0.17.19)): dependencies: colorette: 2.0.20 @@ -33765,22 +33754,10 @@ snapshots: whatwg-mimetype@4.0.0: {} - whatwg-url@5.0.0: + whatwg-url@14.1.0: dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - whatwg-url@7.1.0: - dependencies: - lodash.sortby: 4.7.0 - tr46: 1.0.1 - webidl-conversions: 4.0.2 - - whatwg-url@8.7.0: - dependencies: - lodash: 4.17.21 - tr46: 2.1.0 - webidl-conversions: 6.1.0 + tr46: 5.0.0 + webidl-conversions: 7.0.0 which-boxed-primitive@1.0.2: dependencies: @@ -33863,7 +33840,7 @@ snapshots: workbox-build@6.6.0(@types/babel__core@7.20.5): dependencies: - '@apideck/better-ajv-errors': 0.3.6(ajv@8.12.0) + '@apideck/better-ajv-errors': 0.3.6(ajv@8.14.0) '@babel/core': 7.25.8 '@babel/preset-env': 7.22.5(@babel/core@7.25.8) '@babel/runtime': 7.25.7 @@ -33871,7 +33848,7 @@ snapshots: '@rollup/plugin-node-resolve': 11.2.1(rollup@2.79.2) '@rollup/plugin-replace': 2.4.2(rollup@2.79.2) '@surma/rollup-plugin-off-main-thread': 2.2.3 - ajv: 8.12.0 + ajv: 8.14.0 common-tags: 1.8.2 fast-json-stable-stringify: 2.1.0 fs-extra: 9.1.0 From bae90db038de6088474c762499229cf35000cd79 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 3 Jan 2025 11:44:11 +0000 Subject: [PATCH 02/12] chore: changeset --- .changeset/seven-balloons-kick.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changeset/seven-balloons-kick.md diff --git a/.changeset/seven-balloons-kick.md b/.changeset/seven-balloons-kick.md new file mode 100644 index 0000000000..b9c9f4b1e9 --- /dev/null +++ b/.changeset/seven-balloons-kick.md @@ -0,0 +1,4 @@ +--- +--- + +fix: resolve punycode deprecation notice From e6ab7aa63ae602f847d2c1b827fa867b584fa941 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 3 Jan 2025 12:11:41 +0000 Subject: [PATCH 03/12] Update .changeset/seven-balloons-kick.md --- .changeset/seven-balloons-kick.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/seven-balloons-kick.md b/.changeset/seven-balloons-kick.md index b9c9f4b1e9..0d5e35a678 100644 --- a/.changeset/seven-balloons-kick.md +++ b/.changeset/seven-balloons-kick.md @@ -1,4 +1,4 @@ --- --- -fix: resolve punycode deprecation notice +fix: resolve `punycode` deprecation notice From cfb855b20b80356389f893b493d38de17a462c40 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 3 Jan 2025 13:17:31 +0000 Subject: [PATCH 04/12] chore: release to npm --- .github/workflows/pr-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index 6eeca1f3f0..593d7fce14 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -8,7 +8,7 @@ jobs: name: "Release PR to npm" runs-on: ubuntu-latest # comment out if:false to enable release PR to npm - if: false + # if: false permissions: write-all steps: - name: Checkout From 04950a898f86f375171b1291c85db13c6996f0aa Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 3 Jan 2025 14:12:25 +0000 Subject: [PATCH 05/12] chore: clean up CLI paths --- packages/create-fuels/test/cli.test.ts | 6 ++---- packages/create-fuels/test/integration.test.ts | 2 +- packages/create-fuels/test/utils/bootstrapProject.ts | 9 ++++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/create-fuels/test/cli.test.ts b/packages/create-fuels/test/cli.test.ts index ad6447ceec..a4a85733cc 100644 --- a/packages/create-fuels/test/cli.test.ts +++ b/packages/create-fuels/test/cli.test.ts @@ -79,8 +79,7 @@ describe('CLI', { timeout: 15_000 }, () => { args, }); - const fuelToolchainPath = join(paths.projectRoot, 'fuel-toolchain.toml'); - const fuelToolchain = readFileSync(fuelToolchainPath, 'utf-8'); + const fuelToolchain = readFileSync(paths.fuelToolchainPath, 'utf-8'); const parsedFuelToolchain = toml.parse(fuelToolchain); const { toolchain, components } = parsedFuelToolchain; @@ -107,8 +106,7 @@ describe('CLI', { timeout: 15_000 }, () => { args, }); - const packageJsonPath = join(paths.projectRoot, 'package.json'); - const packageJson = readFileSync(packageJsonPath, 'utf-8'); + const packageJson = readFileSync(paths.packageJsonPath, 'utf-8'); expect(packageJson).toContain('bun run prebuild'); const readmePath = join(paths.projectRoot, 'README.md'); diff --git a/packages/create-fuels/test/integration.test.ts b/packages/create-fuels/test/integration.test.ts index ff4c65c6f8..bd151f91b2 100644 --- a/packages/create-fuels/test/integration.test.ts +++ b/packages/create-fuels/test/integration.test.ts @@ -68,7 +68,7 @@ describe('`create fuels` package integrity', () => { expect(createFuelsError).toBeUndefined(); const actualTemplateFiles = await getAllFiles(paths.projectRoot); expect(actualTemplateFiles.sort()).toEqual(expectedTemplateFiles.sort()); - const packageJson = readFileSync(paths.projectPackageJson, 'utf-8'); + const packageJson = readFileSync(paths.packageJsonPath, 'utf-8'); expect(packageJson).toEqual(expect.stringMatching(expectedPackageJsonInstall)); }, { timeout: 30000 } diff --git a/packages/create-fuels/test/utils/bootstrapProject.ts b/packages/create-fuels/test/utils/bootstrapProject.ts index b13f15fdbb..28205fae35 100644 --- a/packages/create-fuels/test/utils/bootstrapProject.ts +++ b/packages/create-fuels/test/utils/bootstrapProject.ts @@ -6,7 +6,8 @@ import { rewriteTemplateFiles } from '../../src/lib/rewriteTemplateFiles'; export type ProjectPaths = { // Project paths projectRoot: string; - projectPackageJson: string; + packageJsonPath: string; + fuelToolchainPath: string; // Template paths templateName: string; @@ -28,7 +29,8 @@ export const bootstrapProject = (testFilepath: string, template: string = 'vite' // Project paths const projectName = `__temp__project_${testFilename}_${new Date().getTime()}`; const projectRoot = join(testDir, projectName); - const projectPackageJson = join(projectRoot, 'package.json'); + const packageJsonPath = join(projectRoot, 'package.json'); + const fuelToolchainPath = join(projectRoot, 'fuel-toolchain.toml'); // Template paths const templateName = `__temp__template_${template}_${testFilename}_${new Date().getTime()}`; @@ -38,7 +40,8 @@ export const bootstrapProject = (testFilepath: string, template: string = 'vite' return { // Project paths projectRoot, - projectPackageJson, + packageJsonPath, + fuelToolchainPath, // Template paths templateName, From d70dbd55e81e8c1503e471697b96c293e0f5501d Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 3 Jan 2025 14:36:01 +0000 Subject: [PATCH 06/12] chore: added overrides for templates chore: added overrides for templates --- packages/create-fuels/src/cli.ts | 14 ++++++- packages/create-fuels/test/cli.test.ts | 53 ++++++++++++++++++++++++++ templates/nextjs/package.json | 3 ++ templates/vite/package.json | 3 ++ 4 files changed, 72 insertions(+), 1 deletion(-) diff --git a/packages/create-fuels/src/cli.ts b/packages/create-fuels/src/cli.ts index 2b9078f83c..a601e93d7c 100644 --- a/packages/create-fuels/src/cli.ts +++ b/packages/create-fuels/src/cli.ts @@ -123,10 +123,22 @@ export const runScaffoldCli = async ({ const packageJsonPath = join(projectPath, 'package.json'); const packageJsonContents = readFileSync(packageJsonPath, 'utf-8'); const fuelsVersion = getPackageVersion(args); - const newPackageJsonContents = packageJsonContents + let newPackageJsonContents = packageJsonContents .replace(`pnpm run prebuild`, packageManager.run('prebuild')) .replace(`"fuels": "${versions.FUELS}"`, `"fuels": "${fuelsVersion}"`); + if (packageManager.name === 'pnpm') { + let newPackageJsonObject = JSON.parse(newPackageJsonContents); + newPackageJsonObject = { + ...newPackageJsonObject, + overrides: undefined, + pnpm: { + overrides: newPackageJsonObject.overrides, + }, + }; + newPackageJsonContents = JSON.stringify(newPackageJsonObject, null, 2); + } + writeFileSync(packageJsonPath, newPackageJsonContents); // Rewrite the README.md file diff --git a/packages/create-fuels/test/cli.test.ts b/packages/create-fuels/test/cli.test.ts index a4a85733cc..4745d39846 100644 --- a/packages/create-fuels/test/cli.test.ts +++ b/packages/create-fuels/test/cli.test.ts @@ -162,4 +162,57 @@ describe('CLI', { timeout: 15_000 }, () => { expect(log).toHaveBeenCalledWith(` - ${template}`); } }); + + test('should have a package.json with overrides', async () => { + const args = generateArgv({ + projectName: paths.projectRoot, + template: paths.templateName, + }); + + vi.spyOn(doesTemplateExistMod, 'doesTemplateExist').mockReturnValueOnce(true); + + await runScaffoldCli({ + program: setupProgram(), + args, + }); + + const packageJson = readFileSync(paths.packageJsonPath, 'utf-8'); + const packageJsonObject = JSON.parse(packageJson); + + expect(packageJsonObject).toEqual( + expect.objectContaining({ + overrides: expect.any(Object), + }) + ); + }); + + test('should rewrite overrides for pnpm', async () => { + process.env.npm_config_user_agent = 'pnpm'; + + const args = generateArgv({ + projectName: paths.projectRoot, + template: paths.templateName, + }); + + vi.spyOn(doesTemplateExistMod, 'doesTemplateExist').mockReturnValueOnce(true); + + await runScaffoldCli({ + program: setupProgram(), + args, + }); + + const packageJson = readFileSync(paths.packageJsonPath, 'utf-8'); + const packageJsonObject = JSON.parse(packageJson); + + expect(packageJsonObject.overrides).toBeUndefined(); + expect(packageJsonObject).toEqual( + expect.objectContaining({ + pnpm: { + overrides: expect.any(Object), + }, + }) + ); + + delete process.env.npm_config_user_agent; + }); }); diff --git a/templates/nextjs/package.json b/templates/nextjs/package.json index ecfcf9208a..1d7b9df2a5 100644 --- a/templates/nextjs/package.json +++ b/templates/nextjs/package.json @@ -39,5 +39,8 @@ "tailwindcss": "3.4.14", "typescript": "5.6.3", "vitest": "2.0.5" + }, + "overrides": { + "whatwg-url": "10.1.0" } } diff --git a/templates/vite/package.json b/templates/vite/package.json index b0aa258327..6236ca1bc9 100644 --- a/templates/vite/package.json +++ b/templates/vite/package.json @@ -43,5 +43,8 @@ "typescript-eslint": "8.8.0", "vite": "5.4.9", "vitest": "2.0.5" + }, + "overrides": { + "whatwg-url": "10.1.0" } } From 18073b245b9b36d2a7d468cf88fa2d1907f2b60a Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 3 Jan 2025 15:33:45 +0000 Subject: [PATCH 07/12] chore: pls resolve --- packages/account/package.json | 2 +- pnpm-lock.yaml | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/account/package.json b/packages/account/package.json index 446a5ecad1..fb465a0be2 100644 --- a/packages/account/package.json +++ b/packages/account/package.json @@ -63,7 +63,7 @@ "@noble/curves": "1.6.0", "events": "3.3.0", "graphql": "16.9.0", - "graphql-request": "6.1.0", + "graphql-request": "7.1.2", "graphql-tag": "2.12.6", "ramda": "0.30.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b712c8768a..0669b4b457 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -736,8 +736,8 @@ importers: specifier: 16.9.0 version: 16.9.0 graphql-request: - specifier: 6.1.0 - version: 6.1.0(graphql@16.9.0) + specifier: 7.1.2 + version: 7.1.2(graphql@16.9.0) graphql-tag: specifier: 2.12.6 version: 2.12.6(graphql@16.9.0) @@ -9411,6 +9411,11 @@ packages: peerDependencies: graphql: 14 - 16 + graphql-request@7.1.2: + resolution: {integrity: sha512-+XE3iuC55C2di5ZUrB4pjgwe+nIQBuXVIK9J98wrVwojzDW3GMdSBZfxUk8l4j9TieIpjpggclxhNEU9ebGF8w==} + peerDependencies: + graphql: 14 - 16 + graphql-tag@2.12.6: resolution: {integrity: sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==} engines: {node: '>=10'} @@ -26738,6 +26743,11 @@ snapshots: transitivePeerDependencies: - encoding + graphql-request@7.1.2(graphql@16.9.0): + dependencies: + '@graphql-typed-document-node/core': 3.2.0(graphql@16.9.0) + graphql: 16.9.0 + graphql-tag@2.12.6(graphql@16.9.0): dependencies: graphql: 16.9.0 From e12169d9e975397a85ece352e31994ec0377fb0b Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 3 Jan 2025 15:40:44 +0000 Subject: [PATCH 08/12] Revert "chore: pls resolve" This reverts commit 18073b245b9b36d2a7d468cf88fa2d1907f2b60a. --- packages/account/package.json | 2 +- pnpm-lock.yaml | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/account/package.json b/packages/account/package.json index fb465a0be2..446a5ecad1 100644 --- a/packages/account/package.json +++ b/packages/account/package.json @@ -63,7 +63,7 @@ "@noble/curves": "1.6.0", "events": "3.3.0", "graphql": "16.9.0", - "graphql-request": "7.1.2", + "graphql-request": "6.1.0", "graphql-tag": "2.12.6", "ramda": "0.30.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0669b4b457..b712c8768a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -736,8 +736,8 @@ importers: specifier: 16.9.0 version: 16.9.0 graphql-request: - specifier: 7.1.2 - version: 7.1.2(graphql@16.9.0) + specifier: 6.1.0 + version: 6.1.0(graphql@16.9.0) graphql-tag: specifier: 2.12.6 version: 2.12.6(graphql@16.9.0) @@ -9411,11 +9411,6 @@ packages: peerDependencies: graphql: 14 - 16 - graphql-request@7.1.2: - resolution: {integrity: sha512-+XE3iuC55C2di5ZUrB4pjgwe+nIQBuXVIK9J98wrVwojzDW3GMdSBZfxUk8l4j9TieIpjpggclxhNEU9ebGF8w==} - peerDependencies: - graphql: 14 - 16 - graphql-tag@2.12.6: resolution: {integrity: sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==} engines: {node: '>=10'} @@ -26743,11 +26738,6 @@ snapshots: transitivePeerDependencies: - encoding - graphql-request@7.1.2(graphql@16.9.0): - dependencies: - '@graphql-typed-document-node/core': 3.2.0(graphql@16.9.0) - graphql: 16.9.0 - graphql-tag@2.12.6(graphql@16.9.0): dependencies: graphql: 16.9.0 From 51dbec9cb7fce8cf35829368f56587744c90b39d Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Fri, 3 Jan 2025 16:28:10 +0000 Subject: [PATCH 09/12] chore: corrected overrides --- templates/nextjs/package.json | 2 +- templates/vite/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/nextjs/package.json b/templates/nextjs/package.json index 1d7b9df2a5..b7f18b1308 100644 --- a/templates/nextjs/package.json +++ b/templates/nextjs/package.json @@ -41,6 +41,6 @@ "vitest": "2.0.5" }, "overrides": { - "whatwg-url": "10.1.0" + "whatwg-url": "14.1.0" } } diff --git a/templates/vite/package.json b/templates/vite/package.json index 6236ca1bc9..ad8c67df71 100644 --- a/templates/vite/package.json +++ b/templates/vite/package.json @@ -45,6 +45,6 @@ "vitest": "2.0.5" }, "overrides": { - "whatwg-url": "10.1.0" + "whatwg-url": "14.1.0" } } From 0ad68eedc55065cf5fd380843f4c1e07f90ebf06 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Mon, 6 Jan 2025 10:31:59 +0000 Subject: [PATCH 10/12] Update .github/workflows/pr-release.yaml --- .github/workflows/pr-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index 593d7fce14..6eeca1f3f0 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -8,7 +8,7 @@ jobs: name: "Release PR to npm" runs-on: ubuntu-latest # comment out if:false to enable release PR to npm - # if: false + if: false permissions: write-all steps: - name: Checkout From 6d5f7b86be3a13f4d3c8579ed64593310ff8a7bd Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Mon, 6 Jan 2025 10:32:04 +0000 Subject: [PATCH 11/12] Update packages/create-fuels/src/cli.ts --- packages/create-fuels/src/cli.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/create-fuels/src/cli.ts b/packages/create-fuels/src/cli.ts index a601e93d7c..73bf34e581 100644 --- a/packages/create-fuels/src/cli.ts +++ b/packages/create-fuels/src/cli.ts @@ -127,6 +127,8 @@ export const runScaffoldCli = async ({ .replace(`pnpm run prebuild`, packageManager.run('prebuild')) .replace(`"fuels": "${versions.FUELS}"`, `"fuels": "${fuelsVersion}"`); + // TODO: remove once upgraded to `graphql-request@v7` + // https://github.com/FuelLabs/fuels-ts/issues/3546 if (packageManager.name === 'pnpm') { let newPackageJsonObject = JSON.parse(newPackageJsonContents); newPackageJsonObject = { From beb35890ac7558cad0bd45908832c06e86c67105 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Mon, 6 Jan 2025 10:32:33 +0000 Subject: [PATCH 12/12] Update .changeset/seven-balloons-kick.md --- .changeset/seven-balloons-kick.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.changeset/seven-balloons-kick.md b/.changeset/seven-balloons-kick.md index 0d5e35a678..669766d32d 100644 --- a/.changeset/seven-balloons-kick.md +++ b/.changeset/seven-balloons-kick.md @@ -1,4 +1,5 @@ --- +"create-fuels": patch --- fix: resolve `punycode` deprecation notice