diff --git a/package.json b/package.json index 8caadece..63ab2242 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@clack/prompts": "^0.9.0", "@prettier/sync": "^0.5.2", "chalk": "^5.4.1", - "create": "0.1.0-alpha.8", + "create": "0.1.0-alpha.10", "cspell-populate-words": "^0.3.0", "execa": "^9.5.2", "git-remote-origin-url": "^4.0.0", @@ -89,7 +89,7 @@ "all-contributors-cli": "6.26.1", "c8": "10.1.3", "console-fail-test": "0.5.0", - "create-testers": "0.1.0-alpha.8", + "create-testers": "0.1.0-alpha.10", "cspell": "8.17.1", "eslint": "9.17.0", "eslint-plugin-jsdoc": "50.6.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aa664944..bfe3b4e9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ importers: specifier: ^5.4.1 version: 5.4.1 create: - specifier: 0.1.0-alpha.8 - version: 0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) + specifier: 0.1.0-alpha.10 + version: 0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) cspell-populate-words: specifier: ^0.3.0 version: 0.3.0 @@ -40,13 +40,13 @@ importers: version: 1.2.0 input-from-file: specifier: 0.1.0-alpha.4 - version: 0.1.0-alpha.4(create@0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)) + version: 0.1.0-alpha.4(create@0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)) input-from-file-json: specifier: 0.1.0-alpha.4 - version: 0.1.0-alpha.4(create@0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)) + version: 0.1.0-alpha.4(create@0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)) input-from-script: specifier: 0.1.0-alpha.4 - version: 0.1.0-alpha.4(create@0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)) + version: 0.1.0-alpha.4(create@0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)) js-yaml: specifier: ^4.1.0 version: 4.1.0 @@ -148,8 +148,8 @@ importers: specifier: 0.5.0 version: 0.5.0 create-testers: - specifier: 0.1.0-alpha.8 - version: 0.1.0-alpha.8(create@0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)) + specifier: 0.1.0-alpha.10 + version: 0.1.0-alpha.10(create@0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)) cspell: specifier: 8.17.1 version: 8.17.1 @@ -290,15 +290,9 @@ packages: resolution: {integrity: sha512-W+a0/JpU28AqH4IKtwUPcEUnUyXMDLALcn5/JLczGGT9fHE2sIby/xP/oQnx3nxkForzgzPy201RAKcB4xPAFQ==} engines: {node: '>=18'} - '@clack/core@0.3.5': - resolution: {integrity: sha512-5cfhQNH+1VQ2xLQlmzXMqUoiaH0lRBq9/CLW9lTyMbuKLC3+xEK01tHVvyut++mLOn5urSHmkm6I0Lg9MaJSTQ==} - '@clack/core@0.4.0': resolution: {integrity: sha512-YJCYBsyJfNDaTbvDUVSJ3SgSuPrcujarRgkJ5NLjexDZKvaOiVVJvAQYx8lIgG0qRT8ff0fPgqyBCVivanIZ+A==} - '@clack/prompts@0.8.2': - resolution: {integrity: sha512-6b9Ab2UiZwJYA9iMyboYyW9yJvAO9V753ZhS+DHKEjZRKAxPPOb7MXXu84lsPFG+vZt6FRFniZ8rXi+zCIw4yQ==} - '@clack/prompts@0.9.0': resolution: {integrity: sha512-nGsytiExgUr4FL0pR/LeqxA28nz3E0cW7eLTSh3Iod9TGrbBt8Y7BHbV3mmkNC4G0evdYyQ3ZsbiBkk7ektArA==} @@ -1964,14 +1958,14 @@ packages: typescript: optional: true - create-testers@0.1.0-alpha.8: - resolution: {integrity: sha512-bSmPqWcxfi4d1NzArb/iGbjr9RSqwvcPBmgpqarp+IB5+4pwNJmhjQT6Dls2QL+owgbSwRo3sDOy0Ejlyst3kg==} + create-testers@0.1.0-alpha.10: + resolution: {integrity: sha512-8eW2q6aiArfiqZgASXvQU9Uk1b/vCDWnn1/BhSGj/COhoMlJOU/3sGQfdYJPDbobzZctMvkLI8cPosgzOQyF0w==} engines: {node: '>=18'} peerDependencies: - create: 0.1.0-alpha.8 + create: ^0.1.0-alpha.10 - create@0.1.0-alpha.8: - resolution: {integrity: sha512-9KGTgLqt27/7r//sG3zG4fYHERrs4KMlJNn3rZUAdCyA4nujrOAj/yVI8txqonXjvE92NDOCZYSNvGsN91CM7g==} + create@0.1.0-alpha.10: + resolution: {integrity: sha512-ihNTfUL3wFcFsi6Rem+nwkZRVsP9fipuO6ZbkRp9V8M5F5g5k0zX0au9loHTLE1Tqx/bTm53r3P91DGJnwvK9g==} engines: {node: '>=18'} hasBin: true @@ -2626,6 +2620,10 @@ packages: resolution: {integrity: sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==} engines: {node: ^16.14.0 || >=18.0.0} + hosted-git-info@8.0.2: + resolution: {integrity: sha512-sYKnA7eGln5ov8T8gnYlkSOxFJvywzEx9BueN6xo/GKO8PGiI6uK6xx+DIGe45T3bdVjLAQDQW1aicT8z8JwQg==} + engines: {node: ^18.17.0 || >=20.5.0} + html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} @@ -4501,22 +4499,11 @@ snapshots: '@bcoe/v8-coverage@1.0.1': {} - '@clack/core@0.3.5': - dependencies: - picocolors: 1.1.1 - sisteransi: 1.0.5 - '@clack/core@0.4.0': dependencies: picocolors: 1.1.1 sisteransi: 1.0.5 - '@clack/prompts@0.8.2': - dependencies: - '@clack/core': 0.3.5 - picocolors: 1.1.1 - sisteransi: 1.0.5 - '@clack/prompts@0.9.0': dependencies: '@clack/core': 0.4.0 @@ -6032,22 +6019,24 @@ snapshots: optionalDependencies: typescript: 5.7.2 - create-testers@0.1.0-alpha.8(create@0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)): + create-testers@0.1.0-alpha.10(create@0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)): dependencies: - create: 0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) + create: 0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) octokit: 4.0.2 - create@0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2): + create@0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2): dependencies: - '@clack/prompts': 0.8.2 + '@clack/prompts': 0.9.0 cached-factory: 0.1.0 chalk: 5.4.1 execa: 9.5.2 get-github-auth-token: 0.1.0 hash-object: 5.0.1 + hosted-git-info: 8.0.2 import-local-or-npx: 0.1.0(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) octokit: 4.0.2 prettier: 3.4.2 + read-pkg: 9.0.1 without-undefined-properties: 0.1.1 zod: 3.24.1 transitivePeerDependencies: @@ -6906,6 +6895,10 @@ snapshots: dependencies: lru-cache: 10.4.3 + hosted-git-info@8.0.2: + dependencies: + lru-cache: 10.4.3 + html-escaper@2.0.2: {} html-to-text@9.0.5: @@ -6999,20 +6992,20 @@ snapshots: ini@4.1.1: {} - input-from-file-json@0.1.0-alpha.4(create@0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)): + input-from-file-json@0.1.0-alpha.4(create@0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)): dependencies: - create: 0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) - input-from-file: 0.1.0-alpha.4(create@0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)) + create: 0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) + input-from-file: 0.1.0-alpha.4(create@0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)) zod: 3.24.1 - input-from-file@0.1.0-alpha.4(create@0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)): + input-from-file@0.1.0-alpha.4(create@0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)): dependencies: - create: 0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) + create: 0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) zod: 3.24.1 - input-from-script@0.1.0-alpha.4(create@0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)): + input-from-script@0.1.0-alpha.4(create@0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2)): dependencies: - create: 0.1.0-alpha.8(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) + create: 0.1.0-alpha.10(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(typescript@5.7.2) zod: 3.24.1 inquirer@7.3.3: diff --git a/src/next/blocks/blockPackageJson.test.ts b/src/next/blocks/blockPackageJson.test.ts index 91d1a90c..1908b08d 100644 --- a/src/next/blocks/blockPackageJson.test.ts +++ b/src/next/blocks/blockPackageJson.test.ts @@ -13,12 +13,12 @@ describe("blockPackageJson", () => { expect(creation).toMatchInlineSnapshot(` { "files": { - "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"]}", + "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"]}", }, "scripts": [ { "commands": [ - "pnpm install", + "pnpm install --offline", ], "phase": 1, }, @@ -36,12 +36,12 @@ describe("blockPackageJson", () => { expect(creation).toMatchInlineSnapshot(` { "files": { - "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"]}", + "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"]}", }, "scripts": [ { "commands": [ - "pnpm install", + "pnpm install --offline", ], "phase": 1, }, @@ -73,12 +73,12 @@ describe("blockPackageJson", () => { expect(creation).toMatchInlineSnapshot(` { "files": { - "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"other":true}", + "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"other":true}", }, "scripts": [ { "commands": [ - "pnpm install", + "pnpm install --offline", "pnpm dedupe", ], "phase": 1, @@ -108,12 +108,12 @@ describe("blockPackageJson", () => { expect(creation).toMatchInlineSnapshot(` { "files": { - "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"devDependencies":{"is-even":"4.5.6"},"other":true}", + "package.json": "{"name":"test-repository","version":"0.0.0","description":"Test description","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"./lib/index.js","files":["README.md","package.json"],"dependencies":{"is-odd":"1.2.3"},"devDependencies":{"is-even":"4.5.6"},"other":true}", }, "scripts": [ { "commands": [ - "pnpm install", + "pnpm install --offline", "pnpm dedupe", ], "phase": 1, diff --git a/src/next/blocks/blockPackageJson.ts b/src/next/blocks/blockPackageJson.ts index 86bb96fc..5995c201 100644 --- a/src/next/blocks/blockPackageJson.ts +++ b/src/next/blocks/blockPackageJson.ts @@ -36,7 +36,7 @@ export const blockPackageJson = base.createBlock({ ], }; }, - produce({ addons, options }) { + produce({ addons, offline, options }) { const dependencies = { ...options.packageData?.dependencies, ...addons.properties.dependencies, @@ -97,7 +97,10 @@ export const blockPackageJson = base.createBlock({ }, scripts: [ { - commands: ["pnpm install", ...addons.cleanupCommands], + commands: [ + offline ? "pnpm install" : "pnpm install --offline", + ...addons.cleanupCommands, + ], phase: CommandPhase.Install, }, ], diff --git a/src/steps/writing/creation/writePackageJson.test.ts b/src/steps/writing/creation/writePackageJson.test.ts index 7d489bcb..69c197c9 100644 --- a/src/steps/writing/creation/writePackageJson.test.ts +++ b/src/steps/writing/creation/writePackageJson.test.ts @@ -96,7 +96,7 @@ describe("writePackageJson", () => { }, "repository": { "type": "git", - "url": "https://github.com/test-owner/test-repository.git", + "url": "git+https://github.com/test-owner/test-repository.git", }, "scripts": { "build": "tsup", @@ -168,7 +168,7 @@ describe("writePackageJson", () => { }, "repository": { "type": "git", - "url": "https://github.com/test-owner/test-repository.git", + "url": "git+https://github.com/test-owner/test-repository.git", }, "scripts": { "format": "prettier .",