@ykdz/template 0.0.41 → 0.1.0-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application.d.ts +38 -4
- package/dist/application.js +199 -138
- package/dist/cli.js +0 -5
- package/dist/input-schemas.d.ts +14 -0
- package/dist/input-schemas.js +27 -8
- package/dist/input-validation.d.ts +43 -0
- package/dist/input-validation.js +129 -0
- package/dist/main.js +157 -6
- package/dist/preset-catalog.d.ts +36 -0
- package/dist/preset-catalog.js +41 -0
- package/dist/result-schemas.d.ts +63 -34
- package/dist/result-schemas.js +5 -4
- package/dist/standard-schema.d.ts +1 -1
- package/dist/standard-schema.js +1 -9
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/util.d.ts +7 -4
- package/node_modules/@typescript/typescript-linux-x64/LICENSE +55 -0
- package/node_modules/@typescript/typescript-linux-x64/NOTICE.txt +436 -0
- package/node_modules/@typescript/typescript-linux-x64/README.md +3 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.d.ts +20 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.decorators.d.ts +382 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.decorators.legacy.d.ts +20 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.asynciterable.d.ts +18 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.d.ts +45125 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.iterable.d.ts +18 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.collection.d.ts +159 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.core.d.ts +595 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.d.ts +26 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.generator.d.ts +75 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.iterable.d.ts +603 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.promise.d.ts +79 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.proxy.d.ts +126 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.reflect.d.ts +142 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.symbol.d.ts +44 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.symbol.wellknown.d.ts +324 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.array.include.d.ts +114 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.d.ts +19 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.full.d.ts +21 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.intl.d.ts +29 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.arraybuffer.d.ts +19 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.d.ts +24 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.date.d.ts +29 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.full.d.ts +21 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.intl.d.ts +42 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.object.d.ts +47 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.sharedmemory.d.ts +133 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.string.d.ts +47 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.typedarrays.d.ts +51 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.asyncgenerator.d.ts +75 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.asynciterable.d.ts +51 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.full.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.intl.d.ts +81 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.promise.d.ts +28 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.regexp.d.ts +35 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.array.d.ts +77 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.full.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.intl.d.ts +21 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.object.d.ts +31 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.string.d.ts +35 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.symbol.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.bigint.d.ts +763 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.d.ts +25 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.date.d.ts +40 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.full.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.intl.d.ts +472 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.number.d.ts +26 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.promise.d.ts +45 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.sharedmemory.d.ts +97 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.string.d.ts +42 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.symbol.wellknown.d.ts +39 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.d.ts +21 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.full.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.intl.d.ts +164 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.promise.d.ts +46 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.string.d.ts +31 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.weakref.d.ts +76 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.array.d.ts +119 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.d.ts +23 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.error.d.ts +73 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.full.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.intl.d.ts +143 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.object.d.ts +24 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.regexp.d.ts +37 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.string.d.ts +23 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.array.d.ts +922 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.collection.d.ts +19 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.d.ts +20 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.full.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.intl.d.ts +62 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.arraybuffer.d.ts +63 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.collection.d.ts +27 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.d.ts +24 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.full.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.object.d.ts +27 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.promise.d.ts +33 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.regexp.d.ts +23 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.sharedmemory.d.ts +66 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.string.d.ts +27 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.collection.d.ts +94 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.d.ts +23 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.float16.d.ts +443 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.full.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.intl.d.ts +200 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.iterator.d.ts +146 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.promise.d.ts +32 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.regexp.d.ts +30 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es5.d.ts +4599 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es6.d.ts +21 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.array.d.ts +33 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.collection.d.ts +47 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.d.ts +27 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.date.d.ts +21 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.decorators.d.ts +26 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.disposable.d.ts +191 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.error.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.full.d.ts +22 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.intl.d.ts +107 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.sharedmemory.d.ts +23 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.temporal.d.ts +485 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.typedarrays.d.ts +90 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.scripthost.d.ts +320 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.asynciterable.d.ts +18 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.d.ts +15606 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.importscripts.d.ts +21 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.iterable.d.ts +18 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/tsc +0 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/tsc.sig +11 -0
- package/node_modules/@typescript/typescript-linux-x64/package.json +45 -0
- package/node_modules/@ykdz/cli-contract/dist/cli-contract.d.ts +689 -184
- package/node_modules/@ykdz/cli-contract/dist/cli-contract.js +816 -243
- package/node_modules/@ykdz/cli-contract/dist/cli-execution.d.ts +11 -7
- package/node_modules/@ykdz/cli-contract/dist/cli-execution.js +69 -22
- package/node_modules/@ykdz/cli-contract/dist/cli-invocation.d.ts +80 -31
- package/node_modules/@ykdz/cli-contract/dist/cli-invocation.js +84 -26
- package/node_modules/@ykdz/cli-contract/dist/contract-definition-error.d.ts +40 -7
- package/node_modules/@ykdz/cli-contract/dist/contract-definition-error.js +28 -6
- package/node_modules/@ykdz/cli-contract/dist/contract-schema-compiler.js +17 -3
- package/node_modules/@ykdz/cli-contract/dist/contract-schema.d.ts +4 -0
- package/node_modules/@ykdz/cli-contract/dist/field-identity.d.ts +2 -0
- package/node_modules/@ykdz/cli-contract/dist/field-identity.js +16 -0
- package/node_modules/@ykdz/cli-contract/dist/index.d.ts +4 -3
- package/node_modules/@ykdz/cli-contract/dist/index.js +2 -2
- package/node_modules/@ykdz/cli-contract/dist/node.d.ts +1 -1
- package/node_modules/@ykdz/cli-contract/dist/node.js +1 -1
- package/node_modules/@ykdz/cli-contract/dist/outcome-fact.d.ts +42 -9
- package/node_modules/@ykdz/cli-contract/dist/outcome-fact.js +98 -24
- package/node_modules/@ykdz/cli-contract/dist/outcome-wire.d.ts +5 -5
- package/node_modules/@ykdz/cli-contract/dist/outcome-wire.js +75 -15
- package/node_modules/@ykdz/cli-contract/package.json +6 -5
- package/node_modules/@ykdz/preset-rust-bin/native/package.json +46 -0
- package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.d.ts +43 -0
- package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.d.ts.map +1 -0
- package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.js +21 -0
- package/node_modules/@ykdz/preset-rust-bin/package.json +20 -0
- package/node_modules/@ykdz/preset-ts-cli/native/package.json +48 -0
- package/node_modules/@ykdz/preset-ts-cli/native/template-dist/definition.d.ts +23 -0
- package/node_modules/@ykdz/preset-ts-cli/native/template-dist/definition.d.ts.map +1 -0
- package/node_modules/@ykdz/preset-ts-cli/native/template-dist/definition.js +23 -0
- package/node_modules/@ykdz/preset-ts-cli/package.json +20 -0
- package/node_modules/@ykdz/preset-ts-lib/native/package.json +45 -0
- package/node_modules/@ykdz/preset-ts-lib/native/template-dist/definition.d.ts +23 -0
- package/node_modules/@ykdz/preset-ts-lib/native/template-dist/definition.d.ts.map +1 -0
- package/node_modules/@ykdz/preset-ts-lib/native/template-dist/definition.js +21 -0
- package/node_modules/@ykdz/preset-ts-lib/package.json +20 -0
- package/node_modules/@ykdz/preset-vike-app/native/package.json +55 -0
- package/node_modules/@ykdz/preset-vike-app/native/resources/deployment/Dockerfile +76 -0
- package/node_modules/@ykdz/preset-vike-app/native/resources/deployment/container.dockerignore +11 -0
- package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → preset-vike-app/native/resources/deployment}/scripts/container-entrypoint.sh +0 -0
- package/node_modules/@ykdz/preset-vike-app/native/resources/deployment/setup-buildx-step.yml +3 -0
- package/node_modules/@ykdz/preset-vike-app/native/scripts/check-standalone-deployment.ts +570 -0
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.d.ts +35 -0
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.d.ts.map +1 -0
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.js +61 -0
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.d.ts +20 -0
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.d.ts.map +1 -0
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.js +277 -0
- package/node_modules/@ykdz/preset-vike-app/package.json +24 -0
- package/node_modules/@ykdz/preset-vue-app/native/package.json +44 -0
- package/node_modules/@ykdz/preset-vue-app/native/template-dist/definition.d.ts +23 -0
- package/node_modules/@ykdz/preset-vue-app/native/template-dist/definition.d.ts.map +1 -0
- package/node_modules/@ykdz/preset-vue-app/native/template-dist/definition.js +21 -0
- package/node_modules/@ykdz/preset-vue-app/package.json +20 -0
- package/node_modules/@ykdz/preset-vue-hono-app/native/package.json +50 -0
- package/node_modules/@ykdz/preset-vue-hono-app/native/resources/joint-e2e/playwright.config.ts +35 -0
- package/node_modules/@ykdz/preset-vue-hono-app/native/resources/joint-e2e/test/e2e/app.spec.ts +10 -0
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.d.ts +33 -0
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.d.ts.map +1 -0
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.js +129 -0
- package/node_modules/@ykdz/preset-vue-hono-app/package.json +21 -0
- package/node_modules/@ykdz/reference-hono-api/native/package.json +55 -0
- package/node_modules/@ykdz/reference-hono-api/native/template-dist/definition.d.ts +1 -0
- package/node_modules/@ykdz/reference-hono-api/native/template-dist/definition.js +33 -0
- package/node_modules/@ykdz/reference-hono-api/native/test/app.test.ts +11 -0
- package/node_modules/@ykdz/reference-hono-api/native/tsconfig.build.json +11 -0
- package/node_modules/@ykdz/reference-hono-api/native/tsconfig.json +15 -0
- package/node_modules/@ykdz/reference-hono-api/native/turbo.json +67 -0
- package/node_modules/@ykdz/reference-hono-api/package.json +19 -0
- package/node_modules/@ykdz/reference-npm-publication/native/.changeset/config.json +4 -0
- package/node_modules/@ykdz/reference-npm-publication/native/README.md +11 -0
- package/node_modules/@ykdz/reference-npm-publication/native/package.json +38 -0
- package/node_modules/@ykdz/reference-npm-publication/native/resources/gitignore +1 -0
- package/node_modules/@ykdz/reference-npm-publication/native/resources/release.yml +70 -0
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.d.ts +5 -0
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.js +39 -0
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.d.ts +13 -0
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.js +30 -0
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.d.ts +11 -0
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.js +51 -0
- package/node_modules/@ykdz/reference-npm-publication/package.json +19 -0
- package/node_modules/@ykdz/reference-rust-bin/native/Cargo.lock +16 -0
- package/node_modules/@ykdz/reference-rust-bin/native/Cargo.toml +27 -0
- package/node_modules/@ykdz/reference-rust-bin/native/package.json +38 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template/rust-toolchain.toml +3 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.d.ts +15 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.js +145 -0
- package/node_modules/@ykdz/reference-rust-bin/native/tsconfig.json +8 -0
- package/node_modules/@ykdz/reference-rust-bin/native/turbo.json +63 -0
- package/node_modules/@ykdz/reference-rust-bin/package.json +20 -0
- package/node_modules/@ykdz/reference-tooling-config/native/node.json +13 -0
- package/node_modules/@ykdz/reference-tooling-config/native/oxlint.config.ts +8 -0
- package/node_modules/@ykdz/reference-tooling-config/native/package.json +37 -0
- package/node_modules/@ykdz/reference-tooling-config/native/template-dist/definition.d.ts +27 -0
- package/node_modules/@ykdz/reference-tooling-config/native/template-dist/definition.js +27 -0
- package/node_modules/@ykdz/reference-tooling-config/native/tsconfig.json +9 -0
- package/node_modules/@ykdz/reference-tooling-config/native/turbo.json +51 -0
- package/node_modules/@ykdz/reference-tooling-config/package.json +16 -0
- package/node_modules/@ykdz/reference-ts-cli/native/package.json +56 -0
- package/node_modules/@ykdz/reference-ts-cli/native/src/cli.ts +17 -0
- package/node_modules/@ykdz/reference-ts-cli/native/src/main.ts +162 -0
- package/node_modules/@ykdz/reference-ts-cli/native/src/publication/cli-command-identity.ts +88 -0
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.d.ts +8 -0
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.js +80 -0
- package/node_modules/@ykdz/reference-ts-cli/native/test/e2e/journey.ts +31 -0
- package/node_modules/@ykdz/reference-ts-cli/native/test/e2e/journeys/lookup.journey.ts +76 -0
- package/node_modules/@ykdz/reference-ts-cli/native/test/e2e/run-journeys.ts +240 -0
- package/node_modules/@ykdz/reference-ts-cli/native/test/e2e/source-journeys.test.ts +9 -0
- package/node_modules/@ykdz/reference-ts-cli/native/test/integration/command.test.ts +147 -0
- package/node_modules/@ykdz/reference-ts-cli/native/test/unit/cli-command-identity.test.ts +76 -0
- package/node_modules/@ykdz/reference-ts-cli/native/tsconfig.build.json +12 -0
- package/node_modules/@ykdz/reference-ts-cli/native/tsconfig.json +8 -0
- package/node_modules/@ykdz/reference-ts-cli/native/tsconfig.node.json +7 -0
- package/node_modules/@ykdz/reference-ts-cli/native/turbo.json +75 -0
- package/node_modules/@ykdz/reference-ts-cli/package.json +20 -0
- package/node_modules/@ykdz/reference-ts-lib/native/package.json +54 -0
- package/node_modules/@ykdz/reference-ts-lib/native/template-dist/definition.d.ts +1 -0
- package/node_modules/@ykdz/reference-ts-lib/native/template-dist/definition.js +43 -0
- package/node_modules/@ykdz/reference-ts-lib/native/test/greet.test.ts +20 -0
- package/node_modules/@ykdz/reference-ts-lib/native/tsconfig.build.json +9 -0
- package/node_modules/@ykdz/reference-ts-lib/native/tsconfig.json +8 -0
- package/node_modules/@ykdz/reference-ts-lib/native/tsconfig.node.json +8 -0
- package/node_modules/@ykdz/reference-ts-lib/native/turbo.json +63 -0
- package/node_modules/@ykdz/reference-ts-lib/package.json +20 -0
- package/node_modules/@ykdz/reference-vike-db/native/package.json +83 -0
- package/node_modules/@ykdz/reference-vike-db/native/template-dist/definition.d.ts +1 -0
- package/node_modules/@ykdz/reference-vike-db/native/template-dist/definition.js +39 -0
- package/node_modules/@ykdz/reference-vike-db/native/test/todos.test.ts +20 -0
- package/node_modules/@ykdz/reference-vike-db/native/tsconfig.build.json +12 -0
- package/node_modules/@ykdz/reference-vike-db/native/tsconfig.json +11 -0
- package/node_modules/@ykdz/reference-vike-db/native/tsconfig.node.json +19 -0
- package/node_modules/@ykdz/reference-vike-db/native/tsconfig.scripts.json +13 -0
- package/node_modules/@ykdz/reference-vike-db/native/turbo.json +67 -0
- package/node_modules/@ykdz/reference-vike-db/package.json +19 -0
- package/node_modules/@ykdz/reference-vike-migrations/native/drizzle.config.ts +22 -0
- package/node_modules/@ykdz/reference-vike-migrations/native/package.json +51 -0
- package/node_modules/@ykdz/reference-vike-migrations/native/template-dist/definition.d.ts +1 -0
- package/node_modules/@ykdz/reference-vike-migrations/native/template-dist/definition.js +39 -0
- package/node_modules/@ykdz/reference-vike-migrations/native/tsconfig.json +15 -0
- package/node_modules/@ykdz/reference-vike-migrations/native/turbo.json +76 -0
- package/node_modules/@ykdz/reference-vike-migrations/package.json +19 -0
- package/node_modules/@ykdz/reference-vike-web/native/TESTING.md +7 -0
- package/node_modules/@ykdz/reference-vike-web/native/package.json +84 -0
- package/node_modules/@ykdz/reference-vike-web/native/pages/index/+Page.telefunc.ts +12 -0
- package/node_modules/@ykdz/reference-vike-web/native/pages/index/+Page.vue +89 -0
- package/node_modules/@ykdz/reference-vike-web/native/playwright.config.ts +156 -0
- package/node_modules/@ykdz/reference-vike-web/native/server/app.ts +36 -0
- package/node_modules/@ykdz/reference-vike-web/native/server/database.ts +2 -0
- package/node_modules/@ykdz/reference-vike-web/native/template-dist/definition.d.ts +1 -0
- package/node_modules/@ykdz/reference-vike-web/native/template-dist/definition.js +59 -0
- package/node_modules/@ykdz/reference-vike-web/native/test/e2e/app.spec.ts +16 -0
- package/node_modules/@ykdz/reference-vike-web/native/test/todos.browser.test.ts +37 -0
- package/node_modules/@ykdz/reference-vike-web/native/tooling/vite.ts +5 -0
- package/node_modules/@ykdz/reference-vike-web/native/tsconfig.app.json +27 -0
- package/node_modules/@ykdz/reference-vike-web/native/tsconfig.json +11 -0
- package/node_modules/@ykdz/reference-vike-web/native/tsconfig.node.json +33 -0
- package/node_modules/@ykdz/reference-vike-web/native/turbo.json +92 -0
- package/node_modules/@ykdz/reference-vike-web/native/types/global.d.ts +9 -0
- package/node_modules/@ykdz/reference-vike-web/native/vite.config.ts +16 -0
- package/node_modules/@ykdz/reference-vike-web/native/vitest.config.ts +37 -0
- package/node_modules/@ykdz/reference-vike-web/package.json +20 -0
- package/node_modules/@ykdz/reference-vue-app/native/TESTING.md +7 -0
- package/node_modules/@ykdz/reference-vue-app/native/package.json +70 -0
- package/node_modules/@ykdz/reference-vue-app/native/src/App.vue +43 -0
- package/node_modules/@ykdz/reference-vue-app/native/src/components/CounterButton.vue +18 -0
- package/node_modules/@ykdz/reference-vue-app/native/src/style.css +2 -0
- package/node_modules/@ykdz/reference-vue-app/native/template-dist/definition.d.ts +1 -0
- package/node_modules/@ykdz/reference-vue-app/native/template-dist/definition.js +53 -0
- package/node_modules/@ykdz/reference-vue-app/native/test/app.browser.test.ts +13 -0
- package/node_modules/@ykdz/reference-vue-app/native/test/counter.node.test.ts +15 -0
- package/node_modules/@ykdz/reference-vue-app/native/test/e2e/app.spec.ts +15 -0
- package/node_modules/@ykdz/reference-vue-app/native/tsconfig.app.json +18 -0
- package/node_modules/@ykdz/reference-vue-app/native/tsconfig.json +11 -0
- package/node_modules/@ykdz/reference-vue-app/native/tsconfig.node.json +25 -0
- package/node_modules/@ykdz/reference-vue-app/native/turbo.json +84 -0
- package/node_modules/@ykdz/reference-vue-app/native/vite.config.ts +8 -0
- package/node_modules/@ykdz/reference-vue-app/native/vitest.config.ts +37 -0
- package/node_modules/@ykdz/reference-vue-app/package.json +20 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/TESTING.md +7 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/package.json +66 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/src/App.vue +49 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/src/main.ts +7 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/src/style.css +2 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/template-dist/definition.d.ts +1 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/template-dist/definition.js +49 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/test/app.browser.test.ts +13 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/tsconfig.app.json +18 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/tsconfig.json +11 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/tsconfig.node.json +25 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/turbo.json +74 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/vite.config.ts +28 -0
- package/node_modules/@ykdz/reference-vue-hono-web/native/vitest.config.ts +37 -0
- package/node_modules/@ykdz/reference-vue-hono-web/package.json +20 -0
- package/node_modules/@ykdz/template-content/dist/index.d.ts +14 -0
- package/node_modules/@ykdz/template-content/dist/index.js +9 -0
- package/node_modules/@ykdz/template-content/dist/template-members.d.ts +9 -0
- package/node_modules/@ykdz/template-content/dist/template-members.js +16 -0
- package/node_modules/@ykdz/template-content/package.json +18 -0
- package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/dist/index.d.ts +45 -0
- package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/dist/index.js +30 -0
- package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/package.json +35 -0
- package/node_modules/@ykdz/template-core/dist/content-identity.d.ts +42 -0
- package/node_modules/@ykdz/template-core/dist/content-identity.js +117 -0
- package/node_modules/@ykdz/template-core/dist/generation-record.d.ts +28 -0
- package/node_modules/@ykdz/template-core/dist/generation-record.js +45 -0
- package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +3 -81
- package/node_modules/@ykdz/template-core/dist/package-contribution.js +19 -106
- package/node_modules/@ykdz/template-core/dist/preset-definition.d.ts +73 -97
- package/node_modules/@ykdz/template-core/dist/preset-definition.js +107 -15
- package/node_modules/@ykdz/template-core/dist/project-blueprint.d.ts +3 -11
- package/node_modules/@ykdz/template-core/dist/project-blueprint.js +23 -71
- package/node_modules/@ykdz/template-core/dist/project-projection.js +4 -17
- package/node_modules/@ykdz/template-core/dist/renderer-policy-snapshot.d.ts +1 -0
- package/node_modules/@ykdz/template-core/dist/renderer-policy-snapshot.js +2 -0
- package/node_modules/@ykdz/template-core/dist/renderer.d.ts +8 -25
- package/node_modules/@ykdz/template-core/dist/renderer.js +53 -253
- package/node_modules/@ykdz/template-core/dist/toml.d.ts +6 -0
- package/node_modules/@ykdz/template-core/dist/toml.js +31 -0
- package/node_modules/@ykdz/template-core/dist/workspace-strategy.d.ts +188 -0
- package/node_modules/@ykdz/template-core/dist/workspace-strategy.js +1 -0
- package/node_modules/@ykdz/template-core/package.json +24 -25
- package/node_modules/@ykdz/template-environment/dist/development-container-tool-layer.d.ts +65 -0
- package/node_modules/@ykdz/template-environment/dist/development-container-tool-layer.js +414 -0
- package/node_modules/@ykdz/template-environment/package.json +36 -0
- package/node_modules/@ykdz/template-generator/dist/content-source.d.ts +13 -0
- package/node_modules/@ykdz/template-generator/dist/content-source.js +181 -0
- package/node_modules/@ykdz/template-generator/dist/index.d.ts +82 -0
- package/node_modules/@ykdz/template-generator/dist/index.js +1147 -0
- package/node_modules/@ykdz/template-generator/package.json +41 -0
- package/node_modules/@ykdz/template-workspace/assets/agent-instructions.md +25 -0
- package/node_modules/@ykdz/template-workspace/assets/environment/devcontainer/workspace-template.json +16 -0
- package/node_modules/@ykdz/template-workspace/assets/github/check.yml +83 -0
- package/node_modules/@ykdz/template-workspace/assets/github/dependabot.yml +49 -0
- package/node_modules/@ykdz/template-workspace/assets/gitignore +12 -0
- package/node_modules/@ykdz/template-workspace/assets/next-steps.md +3 -0
- package/node_modules/@ykdz/template-workspace/assets/tsconfig.config.json +6 -0
- package/node_modules/@ykdz/template-workspace/assets/turbo.json +64 -0
- package/node_modules/@ykdz/template-workspace/dist/application-requirements.d.ts +14 -0
- package/node_modules/@ykdz/template-workspace/dist/application-requirements.js +42 -0
- package/node_modules/@ykdz/template-workspace/dist/ci-diagnostic-artifact.d.ts +17 -0
- package/node_modules/@ykdz/template-workspace/dist/ci-diagnostic-artifact.js +74 -0
- package/node_modules/@ykdz/template-workspace/dist/default-environment-sources.d.ts +5 -0
- package/node_modules/@ykdz/template-workspace/dist/default-environment-sources.js +8 -0
- package/node_modules/@ykdz/template-workspace/dist/default-environment.d.ts +9 -0
- package/node_modules/@ykdz/template-workspace/dist/default-environment.js +5 -0
- package/node_modules/@ykdz/template-workspace/dist/default-package-identity.d.ts +19 -0
- package/node_modules/@ykdz/template-workspace/dist/default-package-identity.js +128 -0
- package/node_modules/@ykdz/template-workspace/dist/default-package-role.d.ts +4 -0
- package/node_modules/@ykdz/template-workspace/dist/default-package-role.js +9 -0
- package/node_modules/@ykdz/template-workspace/dist/default-workspace-strategy.d.ts +89 -0
- package/node_modules/@ykdz/template-workspace/dist/default-workspace-strategy.js +967 -0
- package/node_modules/@ykdz/template-workspace/dist/dependency-catalog.d.ts +25 -0
- package/node_modules/@ykdz/template-workspace/dist/dependency-catalog.js +159 -0
- package/node_modules/@ykdz/template-workspace/dist/development-container.d.ts +3 -0
- package/node_modules/@ykdz/template-workspace/dist/development-container.js +36 -0
- package/node_modules/@ykdz/template-workspace/dist/development-environment.d.ts +36 -0
- package/node_modules/@ykdz/template-workspace/dist/development-environment.js +241 -0
- package/node_modules/@ykdz/template-workspace/dist/editor-customization.d.ts +18 -0
- package/node_modules/@ykdz/template-workspace/dist/editor-customization.js +83 -0
- package/node_modules/@ykdz/template-workspace/dist/environment-needs.d.ts +51 -0
- package/node_modules/@ykdz/template-workspace/dist/environment-needs.js +167 -0
- package/node_modules/@ykdz/template-workspace/dist/generation-context.d.ts +14 -0
- package/node_modules/@ykdz/template-workspace/dist/package-addition-facts.d.ts +21 -0
- package/node_modules/@ykdz/template-workspace/dist/package-addition-facts.js +90 -0
- package/node_modules/@ykdz/template-workspace/dist/package-contribution.d.ts +64 -0
- package/node_modules/@ykdz/template-workspace/dist/package-contribution.js +65 -0
- package/node_modules/@ykdz/template-workspace/dist/project-github.d.ts +24 -0
- package/node_modules/@ykdz/template-workspace/dist/project-github.js +98 -0
- package/node_modules/@ykdz/template-workspace/dist/project-linking.d.ts +48 -0
- package/node_modules/@ykdz/template-workspace/dist/project-linking.js +218 -0
- package/node_modules/@ykdz/template-workspace/dist/project-requirements.d.ts +17 -0
- package/node_modules/@ykdz/template-workspace/dist/reference-package.d.ts +146 -0
- package/node_modules/@ykdz/template-workspace/dist/reference-package.js +521 -0
- package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.d.ts +6 -0
- package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.js +6 -0
- package/node_modules/@ykdz/template-workspace/dist/root-projection.d.ts +29 -0
- package/node_modules/@ykdz/template-workspace/dist/root-projection.js +144 -0
- package/node_modules/@ykdz/template-workspace/dist/rust-target-projection.d.ts +35 -0
- package/node_modules/@ykdz/template-workspace/dist/rust-target-projection.js +74 -0
- package/node_modules/@ykdz/template-workspace/dist/rust-toolchain-facts.d.ts +22 -0
- package/node_modules/@ykdz/template-workspace/dist/rust-toolchain-facts.js +64 -0
- package/node_modules/@ykdz/template-workspace/dist/shared-root-files.d.ts +99 -0
- package/node_modules/@ykdz/template-workspace/dist/shared-root-files.js +159 -0
- package/node_modules/@ykdz/template-workspace/dist/vue-policy.d.ts +5 -0
- package/node_modules/@ykdz/template-workspace/dist/vue-policy.js +5 -0
- package/node_modules/@ykdz/template-workspace/dist/workspace-policy-snapshot.d.ts +20 -0
- package/node_modules/@ykdz/template-workspace/dist/workspace-policy-snapshot.js +86 -0
- package/node_modules/@ykdz/template-workspace/dist/workspace-resources.d.ts +23 -0
- package/node_modules/@ykdz/template-workspace/dist/workspace-resources.js +83 -0
- package/node_modules/@ykdz/template-workspace/package.json +135 -0
- package/node_modules/@ykdz/template-workspace/resources/oxfmt.config.ts +1 -0
- package/node_modules/@ykdz/template-workspace/resources/oxlint.config.ts +4 -0
- package/node_modules/@ykdz/template-workspace/scripts/sync-snapshot.ts +27 -0
- package/node_modules/@ykdz/template-workspace/scripts/task-gates.ts +631 -0
- package/node_modules/@ykdz/template-workspace-authoring/dist/content-artifact.d.ts +57 -0
- package/node_modules/@ykdz/template-workspace-authoring/dist/content-artifact.js +168 -0
- package/node_modules/@ykdz/template-workspace-authoring/dist/package-name-projection.d.ts +2 -0
- package/node_modules/@ykdz/template-workspace-authoring/dist/package-name-projection.js +22 -0
- package/node_modules/@ykdz/template-workspace-authoring/dist/resource-ignore-snapshot.d.ts +1 -0
- package/node_modules/@ykdz/template-workspace-authoring/dist/resource-ignore-snapshot.js +2 -0
- package/node_modules/@ykdz/template-workspace-authoring/dist/typescript-module-specifiers.d.ts +2 -0
- package/node_modules/@ykdz/template-workspace-authoring/dist/typescript-module-specifiers.js +36 -0
- package/node_modules/@ykdz/template-workspace-authoring/package.json +55 -0
- package/node_modules/eslint-visitor-keys/LICENSE +201 -0
- package/node_modules/eslint-visitor-keys/README.md +123 -0
- package/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +187 -0
- package/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +28 -0
- package/node_modules/eslint-visitor-keys/dist/index.d.ts +16 -0
- package/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +12 -0
- package/node_modules/eslint-visitor-keys/lib/index.js +67 -0
- package/node_modules/eslint-visitor-keys/lib/visitor-keys.js +118 -0
- package/node_modules/eslint-visitor-keys/package.json +57 -0
- package/node_modules/ignore/LICENSE-MIT +21 -0
- package/node_modules/ignore/README.md +501 -0
- package/node_modules/ignore/index.d.ts +81 -0
- package/node_modules/ignore/index.js +1566 -0
- package/node_modules/ignore/legacy.js +1346 -0
- package/node_modules/ignore/package.json +93 -0
- package/node_modules/smol-toml/dist/extract.js +5 -1
- package/node_modules/smol-toml/dist/index.cjs +2 -1
- package/node_modules/smol-toml/package.json +6 -6
- package/node_modules/toml-eslint-parser/LICENSE +21 -0
- package/node_modules/toml-eslint-parser/README.md +192 -0
- package/node_modules/toml-eslint-parser/lib/chunk-15K8U1wQ.mjs +18 -0
- package/node_modules/toml-eslint-parser/lib/index.d.mts +284 -0
- package/node_modules/toml-eslint-parser/lib/index.mjs +2219 -0
- package/node_modules/toml-eslint-parser/package.json +102 -0
- package/node_modules/typescript-7/LICENSE +55 -0
- package/node_modules/typescript-7/NOTICE.txt +436 -0
- package/node_modules/typescript-7/README.md +49 -0
- package/node_modules/typescript-7/bin/tsc +2 -0
- package/node_modules/typescript-7/dist/api/async/api.d.ts +529 -0
- package/node_modules/typescript-7/dist/api/async/api.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/async/api.js +1657 -0
- package/node_modules/typescript-7/dist/api/async/api.js.map +1 -0
- package/node_modules/typescript-7/dist/api/async/client.d.ts +39 -0
- package/node_modules/typescript-7/dist/api/async/client.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/async/client.js +211 -0
- package/node_modules/typescript-7/dist/api/async/client.js.map +1 -0
- package/node_modules/typescript-7/dist/api/async/types.d.ts +310 -0
- package/node_modules/typescript-7/dist/api/async/types.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/async/types.js +2 -0
- package/node_modules/typescript-7/dist/api/async/types.js.map +1 -0
- package/node_modules/typescript-7/dist/api/compilerOptions.d.ts +109 -0
- package/node_modules/typescript-7/dist/api/compilerOptions.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/compilerOptions.js +2 -0
- package/node_modules/typescript-7/dist/api/compilerOptions.js.map +1 -0
- package/node_modules/typescript-7/dist/api/fs.d.ts +23 -0
- package/node_modules/typescript-7/dist/api/fs.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/fs.js +109 -0
- package/node_modules/typescript-7/dist/api/fs.js.map +1 -0
- package/node_modules/typescript-7/dist/api/node/encoder.d.ts +15 -0
- package/node_modules/typescript-7/dist/api/node/encoder.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/node/encoder.generated.d.ts +5 -0
- package/node_modules/typescript-7/dist/api/node/encoder.generated.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/node/encoder.generated.js +74 -0
- package/node_modules/typescript-7/dist/api/node/encoder.generated.js.map +1 -0
- package/node_modules/typescript-7/dist/api/node/encoder.js +287 -0
- package/node_modules/typescript-7/dist/api/node/encoder.js.map +1 -0
- package/node_modules/typescript-7/dist/api/node/msgpack.d.ts +32 -0
- package/node_modules/typescript-7/dist/api/node/msgpack.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/node/msgpack.js +213 -0
- package/node_modules/typescript-7/dist/api/node/msgpack.js.map +1 -0
- package/node_modules/typescript-7/dist/api/node/node.d.ts +76 -0
- package/node_modules/typescript-7/dist/api/node/node.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/node/node.generated.d.ts +182 -0
- package/node_modules/typescript-7/dist/api/node/node.generated.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/node/node.generated.js +835 -0
- package/node_modules/typescript-7/dist/api/node/node.generated.js.map +1 -0
- package/node_modules/typescript-7/dist/api/node/node.infrastructure.d.ts +62 -0
- package/node_modules/typescript-7/dist/api/node/node.infrastructure.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/node/node.infrastructure.js +122 -0
- package/node_modules/typescript-7/dist/api/node/node.infrastructure.js.map +1 -0
- package/node_modules/typescript-7/dist/api/node/node.js +298 -0
- package/node_modules/typescript-7/dist/api/node/node.js.map +1 -0
- package/node_modules/typescript-7/dist/api/node/protocol.d.ts +29 -0
- package/node_modules/typescript-7/dist/api/node/protocol.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/node/protocol.generated.d.ts +4 -0
- package/node_modules/typescript-7/dist/api/node/protocol.generated.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/node/protocol.generated.js +241 -0
- package/node_modules/typescript-7/dist/api/node/protocol.generated.js.map +1 -0
- package/node_modules/typescript-7/dist/api/node/protocol.js +30 -0
- package/node_modules/typescript-7/dist/api/node/protocol.js.map +1 -0
- package/node_modules/typescript-7/dist/api/node/wtf8.d.ts +6 -0
- package/node_modules/typescript-7/dist/api/node/wtf8.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/node/wtf8.js +61 -0
- package/node_modules/typescript-7/dist/api/node/wtf8.js.map +1 -0
- package/node_modules/typescript-7/dist/api/options.d.ts +32 -0
- package/node_modules/typescript-7/dist/api/options.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/options.js +11 -0
- package/node_modules/typescript-7/dist/api/options.js.map +1 -0
- package/node_modules/typescript-7/dist/api/path.d.ts +110 -0
- package/node_modules/typescript-7/dist/api/path.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/path.js +508 -0
- package/node_modules/typescript-7/dist/api/path.js.map +1 -0
- package/node_modules/typescript-7/dist/api/proto.d.ts +239 -0
- package/node_modules/typescript-7/dist/api/proto.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/proto.js +37 -0
- package/node_modules/typescript-7/dist/api/proto.js.map +1 -0
- package/node_modules/typescript-7/dist/api/sourceFileCache.d.ts +79 -0
- package/node_modules/typescript-7/dist/api/sourceFileCache.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/sourceFileCache.js +169 -0
- package/node_modules/typescript-7/dist/api/sourceFileCache.js.map +1 -0
- package/node_modules/typescript-7/dist/api/sync/api.d.ts +529 -0
- package/node_modules/typescript-7/dist/api/sync/api.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/sync/api.js +1665 -0
- package/node_modules/typescript-7/dist/api/sync/api.js.map +1 -0
- package/node_modules/typescript-7/dist/api/sync/client.d.ts +30 -0
- package/node_modules/typescript-7/dist/api/sync/client.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/sync/client.js +124 -0
- package/node_modules/typescript-7/dist/api/sync/client.js.map +1 -0
- package/node_modules/typescript-7/dist/api/sync/types.d.ts +310 -0
- package/node_modules/typescript-7/dist/api/sync/types.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/sync/types.js +2 -0
- package/node_modules/typescript-7/dist/api/sync/types.js.map +1 -0
- package/node_modules/typescript-7/dist/api/syncChannel.d.ts +114 -0
- package/node_modules/typescript-7/dist/api/syncChannel.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/syncChannel.js +508 -0
- package/node_modules/typescript-7/dist/api/syncChannel.js.map +1 -0
- package/node_modules/typescript-7/dist/api/timing.d.ts +175 -0
- package/node_modules/typescript-7/dist/api/timing.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/api/timing.js +149 -0
- package/node_modules/typescript-7/dist/api/timing.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/ast.d.ts +100 -0
- package/node_modules/typescript-7/dist/ast/ast.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/ast.generated.d.ts +1161 -0
- package/node_modules/typescript-7/dist/ast/ast.generated.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/ast.generated.js +4 -0
- package/node_modules/typescript-7/dist/ast/ast.generated.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/ast.js +7 -0
- package/node_modules/typescript-7/dist/ast/ast.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/astnav.d.ts +19 -0
- package/node_modules/typescript-7/dist/ast/astnav.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/astnav.js +596 -0
- package/node_modules/typescript-7/dist/ast/astnav.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/clone.d.ts +16 -0
- package/node_modules/typescript-7/dist/ast/clone.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/clone.js +104 -0
- package/node_modules/typescript-7/dist/ast/clone.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/factory.generated.d.ts +520 -0
- package/node_modules/typescript-7/dist/ast/factory.generated.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/factory.generated.js +3057 -0
- package/node_modules/typescript-7/dist/ast/factory.generated.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/index.d.ts +20 -0
- package/node_modules/typescript-7/dist/ast/index.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/index.js +20 -0
- package/node_modules/typescript-7/dist/ast/index.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/is.d.ts +35 -0
- package/node_modules/typescript-7/dist/ast/is.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/is.generated.d.ts +329 -0
- package/node_modules/typescript-7/dist/ast/is.generated.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/is.generated.js +1103 -0
- package/node_modules/typescript-7/dist/ast/is.generated.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/is.js +233 -0
- package/node_modules/typescript-7/dist/ast/is.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/jsdoc.d.ts +11 -0
- package/node_modules/typescript-7/dist/ast/jsdoc.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/jsdoc.js +202 -0
- package/node_modules/typescript-7/dist/ast/jsdoc.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/scanner.d.ts +97 -0
- package/node_modules/typescript-7/dist/ast/scanner.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/scanner.js +2230 -0
- package/node_modules/typescript-7/dist/ast/scanner.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/utils.d.ts +17 -0
- package/node_modules/typescript-7/dist/ast/utils.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/utils.js +67 -0
- package/node_modules/typescript-7/dist/ast/utils.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/visitor.d.ts +14 -0
- package/node_modules/typescript-7/dist/ast/visitor.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/visitor.generated.d.ts +50 -0
- package/node_modules/typescript-7/dist/ast/visitor.generated.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/ast/visitor.generated.js +978 -0
- package/node_modules/typescript-7/dist/ast/visitor.generated.js.map +1 -0
- package/node_modules/typescript-7/dist/ast/visitor.js +47 -0
- package/node_modules/typescript-7/dist/ast/visitor.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/characterCodes.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/characterCodes.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/characterCodes.enum.d.ts +129 -0
- package/node_modules/typescript-7/dist/enums/characterCodes.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/characterCodes.enum.js +132 -0
- package/node_modules/typescript-7/dist/enums/characterCodes.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/characterCodes.js +130 -0
- package/node_modules/typescript-7/dist/enums/characterCodes.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.d.ts +5 -0
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.js +6 -0
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.js +6 -0
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/completionItemKind.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/completionItemKind.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/completionItemKind.enum.d.ts +28 -0
- package/node_modules/typescript-7/dist/enums/completionItemKind.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/completionItemKind.enum.js +30 -0
- package/node_modules/typescript-7/dist/enums/completionItemKind.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/completionItemKind.js +30 -0
- package/node_modules/typescript-7/dist/enums/completionItemKind.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.d.ts +7 -0
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.js +9 -0
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.js +9 -0
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/elementFlags.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/elementFlags.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/elementFlags.enum.d.ts +12 -0
- package/node_modules/typescript-7/dist/enums/elementFlags.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/elementFlags.enum.js +14 -0
- package/node_modules/typescript-7/dist/enums/elementFlags.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/elementFlags.js +14 -0
- package/node_modules/typescript-7/dist/enums/elementFlags.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/internalSymbolName.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/internalSymbolName.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.d.ts +23 -0
- package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.js +25 -0
- package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/internalSymbolName.js +25 -0
- package/node_modules/typescript-7/dist/enums/internalSymbolName.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/jsxEmit.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/jsxEmit.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/jsxEmit.enum.d.ts +9 -0
- package/node_modules/typescript-7/dist/enums/jsxEmit.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/jsxEmit.enum.js +11 -0
- package/node_modules/typescript-7/dist/enums/jsxEmit.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/jsxEmit.js +11 -0
- package/node_modules/typescript-7/dist/enums/jsxEmit.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/languageVariant.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/languageVariant.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/languageVariant.enum.d.ts +5 -0
- package/node_modules/typescript-7/dist/enums/languageVariant.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/languageVariant.enum.js +6 -0
- package/node_modules/typescript-7/dist/enums/languageVariant.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/languageVariant.js +6 -0
- package/node_modules/typescript-7/dist/enums/languageVariant.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/modifierFlags.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/modifierFlags.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/modifierFlags.enum.d.ts +42 -0
- package/node_modules/typescript-7/dist/enums/modifierFlags.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/modifierFlags.enum.js +44 -0
- package/node_modules/typescript-7/dist/enums/modifierFlags.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/modifierFlags.js +44 -0
- package/node_modules/typescript-7/dist/enums/modifierFlags.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.d.ts +7 -0
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.js +9 -0
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.js +9 -0
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleKind.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/moduleKind.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleKind.enum.d.ts +17 -0
- package/node_modules/typescript-7/dist/enums/moduleKind.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleKind.enum.js +19 -0
- package/node_modules/typescript-7/dist/enums/moduleKind.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleKind.js +19 -0
- package/node_modules/typescript-7/dist/enums/moduleKind.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.d.ts +9 -0
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.js +11 -0
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.js +11 -0
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/newLineKind.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/newLineKind.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/newLineKind.enum.d.ts +6 -0
- package/node_modules/typescript-7/dist/enums/newLineKind.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/newLineKind.enum.js +8 -0
- package/node_modules/typescript-7/dist/enums/newLineKind.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/newLineKind.js +8 -0
- package/node_modules/typescript-7/dist/enums/newLineKind.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.d.ts +36 -0
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.js +38 -0
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.js +38 -0
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/nodeFlags.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/nodeFlags.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/nodeFlags.enum.d.ts +44 -0
- package/node_modules/typescript-7/dist/enums/nodeFlags.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/nodeFlags.enum.js +46 -0
- package/node_modules/typescript-7/dist/enums/nodeFlags.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/nodeFlags.js +46 -0
- package/node_modules/typescript-7/dist/enums/nodeFlags.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/objectFlags.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/objectFlags.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/objectFlags.enum.d.ts +50 -0
- package/node_modules/typescript-7/dist/enums/objectFlags.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/objectFlags.enum.js +52 -0
- package/node_modules/typescript-7/dist/enums/objectFlags.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/objectFlags.js +52 -0
- package/node_modules/typescript-7/dist/enums/objectFlags.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.d.ts +16 -0
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.js +18 -0
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.js +18 -0
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.d.ts +13 -0
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.js +14 -0
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.js +14 -0
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/scriptKind.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/scriptKind.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/scriptKind.enum.d.ts +11 -0
- package/node_modules/typescript-7/dist/enums/scriptKind.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/scriptKind.enum.js +12 -0
- package/node_modules/typescript-7/dist/enums/scriptKind.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/scriptKind.js +12 -0
- package/node_modules/typescript-7/dist/enums/scriptKind.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/scriptTarget.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/scriptTarget.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/scriptTarget.enum.d.ts +17 -0
- package/node_modules/typescript-7/dist/enums/scriptTarget.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/scriptTarget.enum.js +18 -0
- package/node_modules/typescript-7/dist/enums/scriptTarget.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/scriptTarget.js +18 -0
- package/node_modules/typescript-7/dist/enums/scriptTarget.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/signatureFlags.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/signatureFlags.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/signatureFlags.enum.d.ts +15 -0
- package/node_modules/typescript-7/dist/enums/signatureFlags.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/signatureFlags.enum.js +17 -0
- package/node_modules/typescript-7/dist/enums/signatureFlags.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/signatureFlags.js +17 -0
- package/node_modules/typescript-7/dist/enums/signatureFlags.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/signatureKind.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/signatureKind.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/signatureKind.enum.d.ts +5 -0
- package/node_modules/typescript-7/dist/enums/signatureKind.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/signatureKind.enum.js +7 -0
- package/node_modules/typescript-7/dist/enums/signatureKind.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/signatureKind.js +7 -0
- package/node_modules/typescript-7/dist/enums/signatureKind.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/symbolFlags.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/symbolFlags.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/symbolFlags.enum.d.ts +71 -0
- package/node_modules/typescript-7/dist/enums/symbolFlags.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/symbolFlags.enum.js +73 -0
- package/node_modules/typescript-7/dist/enums/symbolFlags.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/symbolFlags.js +73 -0
- package/node_modules/typescript-7/dist/enums/symbolFlags.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/syntaxKind.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/syntaxKind.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/syntaxKind.enum.d.ts +389 -0
- package/node_modules/typescript-7/dist/enums/syntaxKind.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/syntaxKind.enum.js +391 -0
- package/node_modules/typescript-7/dist/enums/syntaxKind.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/syntaxKind.js +391 -0
- package/node_modules/typescript-7/dist/enums/syntaxKind.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/tokenFlags.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/tokenFlags.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/tokenFlags.enum.d.ts +30 -0
- package/node_modules/typescript-7/dist/enums/tokenFlags.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/tokenFlags.enum.js +32 -0
- package/node_modules/typescript-7/dist/enums/tokenFlags.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/tokenFlags.js +32 -0
- package/node_modules/typescript-7/dist/enums/tokenFlags.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/typeFlags.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/typeFlags.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/typeFlags.enum.d.ts +76 -0
- package/node_modules/typescript-7/dist/enums/typeFlags.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/typeFlags.enum.js +78 -0
- package/node_modules/typescript-7/dist/enums/typeFlags.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/typeFlags.js +78 -0
- package/node_modules/typescript-7/dist/enums/typeFlags.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/typePredicateKind.d.ts +2 -0
- package/node_modules/typescript-7/dist/enums/typePredicateKind.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.d.ts +7 -0
- package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.js +9 -0
- package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.js.map +1 -0
- package/node_modules/typescript-7/dist/enums/typePredicateKind.js +9 -0
- package/node_modules/typescript-7/dist/enums/typePredicateKind.js.map +1 -0
- package/node_modules/typescript-7/dist/internal/utils.d.ts +23 -0
- package/node_modules/typescript-7/dist/internal/utils.d.ts.map +1 -0
- package/node_modules/typescript-7/dist/internal/utils.js +25 -0
- package/node_modules/typescript-7/dist/internal/utils.js.map +1 -0
- package/node_modules/typescript-7/lib/getExePath.d.ts +2 -0
- package/node_modules/typescript-7/lib/getExePath.js +70 -0
- package/node_modules/typescript-7/lib/tsc.js +28 -0
- package/node_modules/typescript-7/lib/version.cjs +3 -0
- package/node_modules/typescript-7/lib/version.d.cts +2 -0
- package/node_modules/typescript-7/package.json +87 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/License.txt +11 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/README.md +54 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/main.d.ts +17 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/main.js +83 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +22 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/ril.js +210 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/api.d.ts +14 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/api.js +87 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +32 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/cancellation.js +132 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/connection.d.ts +367 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/connection.js +1271 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +9 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/disposable.js +16 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +52 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/encoding.js +70 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/events.d.ts +39 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/events.js +135 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/is.d.ts +7 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/is.js +34 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +55 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/linkedMap.js +412 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +18 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +155 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +77 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageReader.js +246 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +60 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageWriter.js +157 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messages.d.ts +369 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messages.js +436 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/ral.d.ts +74 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/ral.js +23 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +10 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/semaphore.js +74 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +15 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +77 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/main.d.ts +58 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/main.js +289 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/ril.d.ts +12 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/ril.js +163 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/package.json +54 -0
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/typings/thenable.d.ts +5 -0
- package/package.json +110 -40
- package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.d.ts +0 -243
- package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +0 -3555
- package/node_modules/@ykdz/template-builtin-presets/dist/src/generation-record.d.ts +0 -58
- package/node_modules/@ykdz/template-builtin-presets/dist/src/generation-record.js +0 -178
- package/node_modules/@ykdz/template-builtin-presets/dist/src/index.d.ts +0 -4
- package/node_modules/@ykdz/template-builtin-presets/dist/src/index.js +0 -3
- package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.d.ts +0 -31
- package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.js +0 -168
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/development-container.d.ts +0 -3
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/development-container.js +0 -52
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/typescript.d.ts +0 -16
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/typescript.js +0 -74
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.d.ts +0 -36
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +0 -108
- package/node_modules/@ykdz/template-builtin-presets/dist/src/template-sources.d.ts +0 -15
- package/node_modules/@ykdz/template-builtin-presets/dist/src/template-sources.js +0 -27
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-cli/definition.d.ts +0 -31
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-cli/definition.js +0 -243
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.d.ts +0 -31
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.js +0 -142
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.d.ts +0 -48
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.js +0 -507
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.d.ts +0 -26
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.js +0 -110
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.d.ts +0 -22
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.js +0 -193
- package/node_modules/@ykdz/template-builtin-presets/package.json +0 -94
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/dependabot-rust.yml +0 -41
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/dependabot.dynamic.template +0 -4
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/dependabot.yml +0 -33
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment-diagnostics.yml +0 -81
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment.yml +0 -55
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-diagnostics.yml +0 -64
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.yml +0 -38
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.pnpmfile.mjs +0 -19
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/AGENTS.md.template +0 -19
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/TODO.md.template +0 -5
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/devcontainer.json +0 -18
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/gitignore +0 -11
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.dynamic.txt +0 -24
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +0 -32
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/check-toolchain-versions.ts +0 -556
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/tsconfig.packing-hook.json +0 -7
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-boundary-tags/app.json +0 -7
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-boundary-tags/library.json +0 -7
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo.json +0 -21
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/typescript-config/turbo.json +0 -4
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.github/dependabot.yml +0 -41
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.github/workflows/check.yml +0 -23
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.vscode/extensions.json +0 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.vscode/settings.json +0 -5
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.lock +0 -16
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.toml +0 -27
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/rust-toolchain.toml +0 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/turbo.json +0 -22
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/node/oxlint.config.ts +0 -8
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/tsconfig.config.json +0 -12
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/src/style.css +0 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/test/app.test.ts +0 -14
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.app.json +0 -18
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.json +0 -8
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.node.json +0 -21
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.test.json +0 -10
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/typescript/run-vue-tsc.ts +0 -12
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/CHANGELOG.md.template +0 -17
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/RELEASING.md +0 -17
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/artifact.ts +0 -1340
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/changelog.ts +0 -283
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/check-artifact.ts +0 -99
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/check-readiness.ts +0 -66
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/cli-command-identity.ts +0 -4
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/handoff.ts +0 -522
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/publish.ts +0 -483
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/readiness.ts +0 -1150
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/release.ts +0 -819
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/release.yml +0 -119
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/root-tsconfig.json +0 -8
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/tsconfig.json +0 -4
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/turbo.json +0 -6
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/README.md +0 -48
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/CHANGELOG.md.template +0 -17
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/LICENSE-APACHE-2.0.txt +0 -202
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/LICENSE-MIT.txt +0 -21
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/README.md.template +0 -5
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/bridge.ts +0 -3336
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/setup.sh +0 -221
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/cli-command-identity.ts +0 -133
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/cli.ts +0 -17
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/main.ts +0 -162
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/standard-schema.ts +0 -37
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/e2e/journey.ts +0 -31
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/e2e/journeys/lookup.journey.ts +0 -71
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/e2e/run-journeys.ts +0 -255
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/integration/command.test.ts +0 -142
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/unit/cli-command-identity.test.ts +0 -76
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/tsconfig.build.json +0 -12
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/tsconfig.json +0 -14
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/turbo.json +0 -9
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/.github/dependabot.yml +0 -33
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/.github/workflows/check.yml +0 -19
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/tsconfig.build.json +0 -9
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/tsconfig.json +0 -14
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/turbo.json +0 -4
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/scripts/reset.ts +0 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/test/todos.test.ts +0 -23
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/tsconfig.build.json +0 -12
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/tsconfig.json +0 -18
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/turbo.json +0 -9
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/drizzle.config.ts +0 -21
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/tsconfig.json +0 -14
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/turbo.json +0 -10
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/Dockerfile +0 -81
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/Dockerfile.dockerignore +0 -14
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/components/CounterButton.vue +0 -21
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/pages/index/+Page.telefunc.ts +0 -12
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/pages/index/+Page.vue +0 -93
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/playwright.config.ts +0 -140
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/check-standalone-deployment.ts +0 -553
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/server/app.ts +0 -36
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/test/e2e/app.spec.ts +0 -18
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.app.json +0 -26
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.json +0 -8
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.node.json +0 -21
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.test.json +0 -9
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/turbo.json +0 -9
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/types/global.d.ts +0 -9
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/vite.config.ts +0 -14
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/vitest.config.ts +0 -8
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/.github/dependabot.yml +0 -33
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/.github/workflows/check.yml +0 -20
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/src/App.vue +0 -53
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/test/e2e/app.spec.ts +0 -14
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/turbo.json +0 -13
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/vite.config.ts +0 -7
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/vitest.config.ts +0 -8
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/test/app.test.ts +0 -10
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.build.json +0 -10
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.json +0 -21
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/turbo.json +0 -9
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/vitest.config.ts +0 -15
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/root/playwright.config.ts +0 -34
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/root/test/e2e/app.spec.ts +0 -15
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/root/tsconfig.json +0 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/src/App.vue +0 -60
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/turbo.json +0 -9
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/vite.config.ts +0 -27
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/vitest.config.ts +0 -10
- package/node_modules/@ykdz/template-core/dist/Cargo.lock +0 -16
- package/node_modules/@ykdz/template-core/dist/Cargo.toml +0 -12
- package/node_modules/@ykdz/template-core/dist/ci-diagnostic-artifact.d.ts +0 -19
- package/node_modules/@ykdz/template-core/dist/ci-diagnostic-artifact.js +0 -73
- package/node_modules/@ykdz/template-core/dist/dependency-catalog.d.ts +0 -33
- package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +0 -238
- package/node_modules/@ykdz/template-core/dist/development-container-tool-layer.d.ts +0 -56
- package/node_modules/@ykdz/template-core/dist/development-container-tool-layer.js +0 -361
- package/node_modules/@ykdz/template-core/dist/editor-customization.d.ts +0 -17
- package/node_modules/@ykdz/template-core/dist/editor-customization.js +0 -73
- package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +0 -62
- package/node_modules/@ykdz/template-core/dist/module-graph.js +0 -207
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +0 -72
- package/node_modules/@ykdz/template-core/dist/project-github.d.ts +0 -25
- package/node_modules/@ykdz/template-core/dist/project-github.js +0 -84
- package/node_modules/@ykdz/template-core/dist/project-linking-v2.d.ts +0 -31
- package/node_modules/@ykdz/template-core/dist/project-linking-v2.js +0 -143
- package/node_modules/@ykdz/template-core/dist/release-toolchain-snapshot.d.ts +0 -10
- package/node_modules/@ykdz/template-core/dist/release-toolchain-snapshot.js +0 -9
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.d.ts +0 -58
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +0 -821
- package/node_modules/@ykdz/template-core/node_modules/valibot/LICENSE.md +0 -9
- package/node_modules/@ykdz/template-core/node_modules/valibot/README.md +0 -94
- package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.cjs +0 -7897
- package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.d.cts +0 -16579
- package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.d.mts +0 -16579
- package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.min.cjs +0 -2
- package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.min.mjs +0 -2
- package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.mjs +0 -7577
- package/node_modules/@ykdz/template-core/node_modules/valibot/package.json +0 -84
- package/node_modules/npm-package-arg/node_modules/semver/LICENSE +0 -15
- package/node_modules/npm-package-arg/node_modules/semver/README.md +0 -680
- package/node_modules/npm-package-arg/node_modules/semver/bin/semver.js +0 -195
- package/node_modules/npm-package-arg/node_modules/semver/classes/comparator.js +0 -143
- package/node_modules/npm-package-arg/node_modules/semver/classes/index.js +0 -7
- package/node_modules/npm-package-arg/node_modules/semver/classes/range.js +0 -577
- package/node_modules/npm-package-arg/node_modules/semver/classes/semver.js +0 -350
- package/node_modules/npm-package-arg/node_modules/semver/functions/clean.js +0 -8
- package/node_modules/npm-package-arg/node_modules/semver/functions/cmp.js +0 -54
- package/node_modules/npm-package-arg/node_modules/semver/functions/coerce.js +0 -62
- package/node_modules/npm-package-arg/node_modules/semver/functions/compare-build.js +0 -9
- package/node_modules/npm-package-arg/node_modules/semver/functions/compare-loose.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/compare.js +0 -7
- package/node_modules/npm-package-arg/node_modules/semver/functions/diff.js +0 -60
- package/node_modules/npm-package-arg/node_modules/semver/functions/eq.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/gt.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/gte.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/inc.js +0 -21
- package/node_modules/npm-package-arg/node_modules/semver/functions/lt.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/lte.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/major.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/minor.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/neq.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/parse.js +0 -18
- package/node_modules/npm-package-arg/node_modules/semver/functions/patch.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/prerelease.js +0 -8
- package/node_modules/npm-package-arg/node_modules/semver/functions/rcompare.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/rsort.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/satisfies.js +0 -12
- package/node_modules/npm-package-arg/node_modules/semver/functions/sort.js +0 -5
- package/node_modules/npm-package-arg/node_modules/semver/functions/truncate.js +0 -48
- package/node_modules/npm-package-arg/node_modules/semver/functions/valid.js +0 -8
- package/node_modules/npm-package-arg/node_modules/semver/index.js +0 -93
- package/node_modules/npm-package-arg/node_modules/semver/internal/constants.js +0 -37
- package/node_modules/npm-package-arg/node_modules/semver/internal/debug.js +0 -11
- package/node_modules/npm-package-arg/node_modules/semver/internal/identifiers.js +0 -29
- package/node_modules/npm-package-arg/node_modules/semver/internal/lrucache.js +0 -42
- package/node_modules/npm-package-arg/node_modules/semver/internal/parse-options.js +0 -17
- package/node_modules/npm-package-arg/node_modules/semver/internal/re.js +0 -223
- package/node_modules/npm-package-arg/node_modules/semver/package.json +0 -78
- package/node_modules/npm-package-arg/node_modules/semver/preload.js +0 -4
- package/node_modules/npm-package-arg/node_modules/semver/range.bnf +0 -17
- package/node_modules/npm-package-arg/node_modules/semver/ranges/gtr.js +0 -6
- package/node_modules/npm-package-arg/node_modules/semver/ranges/intersects.js +0 -9
- package/node_modules/npm-package-arg/node_modules/semver/ranges/ltr.js +0 -6
- package/node_modules/npm-package-arg/node_modules/semver/ranges/max-satisfying.js +0 -27
- package/node_modules/npm-package-arg/node_modules/semver/ranges/min-satisfying.js +0 -26
- package/node_modules/npm-package-arg/node_modules/semver/ranges/min-version.js +0 -63
- package/node_modules/npm-package-arg/node_modules/semver/ranges/outside.js +0 -82
- package/node_modules/npm-package-arg/node_modules/semver/ranges/simplify.js +0 -49
- package/node_modules/npm-package-arg/node_modules/semver/ranges/subset.js +0 -249
- package/node_modules/npm-package-arg/node_modules/semver/ranges/to-comparators.js +0 -10
- package/node_modules/npm-package-arg/node_modules/semver/ranges/valid.js +0 -13
- package/node_modules/unbash/LICENSE +0 -15
- package/node_modules/unbash/README.md +0 -289
- package/node_modules/unbash/dist/ansi-c.d.ts +0 -5
- package/node_modules/unbash/dist/ansi-c.js +0 -130
- package/node_modules/unbash/dist/arithmetic.d.ts +0 -11
- package/node_modules/unbash/dist/arithmetic.js +0 -530
- package/node_modules/unbash/dist/assignment.d.ts +0 -15
- package/node_modules/unbash/dist/assignment.js +0 -118
- package/node_modules/unbash/dist/chars.d.ts +0 -41
- package/node_modules/unbash/dist/chars.js +0 -41
- package/node_modules/unbash/dist/command.d.ts +0 -14
- package/node_modules/unbash/dist/command.js +0 -41
- package/node_modules/unbash/dist/heredoc.d.ts +0 -18
- package/node_modules/unbash/dist/heredoc.js +0 -25
- package/node_modules/unbash/dist/internal-types.d.ts +0 -87
- package/node_modules/unbash/dist/lexer.d.ts +0 -202
- package/node_modules/unbash/dist/lexer.js +0 -3930
- package/node_modules/unbash/dist/parser.d.ts +0 -4
- package/node_modules/unbash/dist/parser.js +0 -1295
- package/node_modules/unbash/dist/parts.d.ts +0 -17
- package/node_modules/unbash/dist/parts.js +0 -82
- package/node_modules/unbash/dist/printer.d.ts +0 -2
- package/node_modules/unbash/dist/printer.js +0 -536
- package/node_modules/unbash/dist/types.d.ts +0 -494
- package/node_modules/unbash/dist/word.d.ts +0 -22
- package/node_modules/unbash/dist/word.js +0 -102
- package/node_modules/unbash/package.json +0 -80
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/root → preset-vue-hono-app/native/resources/joint-e2e}/test/e2e/fixtures.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/api → reference-hono-api/native}/src/index.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/api → reference-hono-api/native}/src/runtime.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/api → reference-hono-api/native}/src/server.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/rust-bin → reference-rust-bin/native}/rustfmt.toml +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/rust-bin → reference-rust-bin/native}/src/main.rs +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/foundation/typescript-config → reference-tooling-config/native}/base.json +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/shared/oxc → reference-tooling-config/native}/oxfmt.config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/ts-lib → reference-ts-lib/native}/src/index.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/ts-lib → reference-ts-lib/native}/src/name-schema.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/scripts/seed-example.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/db.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/index.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/queries/todos.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/readiness.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/schema.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/seed/example.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/storage.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/types.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db-migrations → reference-vike-migrations/native}/drizzle/migrations/20260709120325_old_captain_flint/migration.sql +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db-migrations → reference-vike-migrations/native}/drizzle/migrations/20260709120325_old_captain_flint/snapshot.json +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db-migrations → reference-vike-migrations/native}/tsconfig.build.json +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/+server.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/.env.example +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/assets/logo.svg +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/components/PageShell.vue +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/pages/+Head.vue +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/pages/+Layout.vue +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/pages/+config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/pages/tailwind.css +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/server/api.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/test/playwright-teardown.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/types/env.d.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-app → reference-vue-app/native}/env.d.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-app → reference-vue-app/native}/index.html +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-app → reference-vue-app/native}/playwright.config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/shared/vue → reference-vue-app/native}/src/main.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/shared/vue → reference-vue-app/native}/src/stores/counter.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/web → reference-vue-hono-web/native}/env.d.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/web → reference-vue-hono-web/native}/index.html +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/web → reference-vue-hono-web/native}/src/api.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/foundation/devcontainer → template-workspace/assets/environment}/base.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/shared → template-workspace/assets/environment}/devcontainer/browser-test.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/shared → template-workspace/assets/environment}/devcontainer/github-cli.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/rust-bin → template-workspace/assets/environment}/devcontainer/rust.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app → template-workspace/assets/environment}/devcontainer/shellcheck.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/shared → template-workspace/assets/environment}/editor-customization/capabilities.json +0 -0
- /package/node_modules/@ykdz/{template-builtin-presets/templates/foundation → template-workspace/assets}/tsconfig.json +0 -0
- /package/node_modules/{unbash/dist/internal-types.js → @ykdz/template-workspace/dist/generation-context.js} +0 -0
- /package/node_modules/{unbash/dist/types.js → @ykdz/template-workspace/dist/project-requirements.js} +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/LICENSE +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/README.md +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/bin/semver.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/classes/comparator.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/classes/index.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/classes/range.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/classes/semver.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/clean.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/cmp.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/coerce.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/compare-build.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/compare-loose.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/compare.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/diff.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/eq.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/gt.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/gte.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/inc.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/lt.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/lte.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/major.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/minor.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/neq.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/parse.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/patch.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/prerelease.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/rcompare.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/rsort.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/satisfies.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/sort.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/truncate.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/valid.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/index.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/constants.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/debug.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/identifiers.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/lrucache.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/parse-options.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/re.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/package.json +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/preload.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/range.bnf +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/gtr.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/intersects.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/ltr.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/max-satisfying.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/min-satisfying.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/min-version.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/outside.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/simplify.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/subset.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/to-comparators.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/valid.js +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/LICENSE.md +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/README.md +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.cjs +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.d.cts +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.d.mts +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.min.cjs +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.min.mjs +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.mjs +0 -0
- /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/package.json +0 -0
package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/bridge.ts
DELETED
|
@@ -1,3336 +0,0 @@
|
|
|
1
|
-
// Private implementation bridge for setup.sh; it is not a supported entrypoint.
|
|
2
|
-
import { execFileSync, spawn, type ChildProcess } from "node:child_process";
|
|
3
|
-
import { createHash } from "node:crypto";
|
|
4
|
-
import {
|
|
5
|
-
cpSync,
|
|
6
|
-
existsSync,
|
|
7
|
-
lstatSync,
|
|
8
|
-
mkdirSync,
|
|
9
|
-
mkdtempSync,
|
|
10
|
-
readdirSync,
|
|
11
|
-
readFileSync,
|
|
12
|
-
realpathSync,
|
|
13
|
-
renameSync,
|
|
14
|
-
rmSync,
|
|
15
|
-
writeFileSync,
|
|
16
|
-
} from "node:fs";
|
|
17
|
-
import { tmpdir } from "node:os";
|
|
18
|
-
import path from "node:path";
|
|
19
|
-
import { pathToFileURL } from "node:url";
|
|
20
|
-
|
|
21
|
-
import parseSpdxExpression from "spdx-expression-parse";
|
|
22
|
-
|
|
23
|
-
import {
|
|
24
|
-
verifyNpmPublicationArtifact,
|
|
25
|
-
type VerifiedPublicationArtifactReceipt,
|
|
26
|
-
} from "#npm-publication/artifact";
|
|
27
|
-
import {
|
|
28
|
-
acceptDownloadedPublicationArtifact,
|
|
29
|
-
type AcceptedPublicationArtifact,
|
|
30
|
-
} from "#npm-publication/handoff";
|
|
31
|
-
import { inspectNpmPublicationReadiness } from "#npm-publication/readiness";
|
|
32
|
-
|
|
33
|
-
type JsonObject = Record<string, unknown>;
|
|
34
|
-
|
|
35
|
-
type SetupFacts = {
|
|
36
|
-
workingTree: "clean" | "dirty" | null;
|
|
37
|
-
currentBranch: string | null;
|
|
38
|
-
defaultBranch: string | null;
|
|
39
|
-
headMatchesRemoteDefault: boolean | null;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
type Manifest = JsonObject & {
|
|
43
|
-
private?: boolean;
|
|
44
|
-
name?: string;
|
|
45
|
-
description?: string;
|
|
46
|
-
license?: string;
|
|
47
|
-
repository?: string | { readonly url?: string };
|
|
48
|
-
bin?: Record<string, string>;
|
|
49
|
-
};
|
|
50
|
-
type Blueprint = JsonObject & {
|
|
51
|
-
packages: readonly (JsonObject & { readonly path?: string })[];
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
type Isolation = {
|
|
55
|
-
readonly root: string;
|
|
56
|
-
readonly home: string;
|
|
57
|
-
readonly pnpmConfig: string;
|
|
58
|
-
readonly pnpmStore: string;
|
|
59
|
-
readonly npmCache: string;
|
|
60
|
-
readonly session: string;
|
|
61
|
-
readonly download: string;
|
|
62
|
-
readonly userConfig: string;
|
|
63
|
-
readonly globalConfig: string;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
type NpmClient = { readonly repositoryRoot: string };
|
|
67
|
-
type NpmResult = {
|
|
68
|
-
readonly status: number;
|
|
69
|
-
readonly signal: NodeJS.Signals | null;
|
|
70
|
-
readonly stdout: string;
|
|
71
|
-
readonly stderr: string;
|
|
72
|
-
readonly error: Error | undefined;
|
|
73
|
-
};
|
|
74
|
-
type InteractiveResult = {
|
|
75
|
-
readonly status: number;
|
|
76
|
-
readonly signal: string | null;
|
|
77
|
-
};
|
|
78
|
-
type RegistryExactArtifact = {
|
|
79
|
-
readonly tgz: string;
|
|
80
|
-
readonly size: number;
|
|
81
|
-
readonly integrity: string;
|
|
82
|
-
};
|
|
83
|
-
type TrustExpectation = {
|
|
84
|
-
readonly packageName: string;
|
|
85
|
-
readonly repository: string;
|
|
86
|
-
};
|
|
87
|
-
type TrustRecord =
|
|
88
|
-
| {
|
|
89
|
-
readonly id: string;
|
|
90
|
-
readonly type: "github";
|
|
91
|
-
readonly repository: string;
|
|
92
|
-
readonly file: "release.yml";
|
|
93
|
-
readonly environment: null;
|
|
94
|
-
readonly permissions: readonly ["createPackage"];
|
|
95
|
-
}
|
|
96
|
-
| {
|
|
97
|
-
readonly package: string;
|
|
98
|
-
readonly type: "github";
|
|
99
|
-
readonly repository: string;
|
|
100
|
-
readonly file: "release.yml";
|
|
101
|
-
readonly environment: null;
|
|
102
|
-
readonly permissions: readonly ["createPackage"];
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
let activeChild: ChildProcess | undefined;
|
|
106
|
-
let activePrompt: { abort(): void } | undefined;
|
|
107
|
-
let receivedSignal: NodeJS.Signals | undefined;
|
|
108
|
-
|
|
109
|
-
function isObject(value: unknown): value is JsonObject {
|
|
110
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function stringValue(value: unknown): string | undefined {
|
|
114
|
-
return typeof value === "string" ? value : undefined;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const root = process.env.REPOSITORY_ROOT ?? "";
|
|
118
|
-
const packagePath = "{{PUBLIC_CLI_PACKAGE_PATH}}";
|
|
119
|
-
const oneLine = (value: unknown): string =>
|
|
120
|
-
(typeof value === "string"
|
|
121
|
-
? value
|
|
122
|
-
: value === undefined || value === null
|
|
123
|
-
? ""
|
|
124
|
-
: JSON.stringify(value)
|
|
125
|
-
)
|
|
126
|
-
.replaceAll(/[\p{Cc}]/gu, "")
|
|
127
|
-
.replace(/(https?:\/\/)[^/@\s]+@/gu, "$1[REDACTED]@")
|
|
128
|
-
.replace(
|
|
129
|
-
/(token|password|otp|session|authorization|auth|config)[=:][^\s]+/giu,
|
|
130
|
-
"$1=[REDACTED]",
|
|
131
|
-
)
|
|
132
|
-
.replace(/(bearer|basic)\s+[^\s]+/giu, "$1 [REDACTED]");
|
|
133
|
-
const print = (value: unknown): void => {
|
|
134
|
-
process.stdout.write(`${JSON.stringify(value)}\n`);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
class SetupFailure extends Error {
|
|
138
|
-
readonly code: string;
|
|
139
|
-
readonly observed: unknown;
|
|
140
|
-
readonly expected: unknown;
|
|
141
|
-
readonly next: unknown;
|
|
142
|
-
readonly exitCode: number;
|
|
143
|
-
|
|
144
|
-
constructor(
|
|
145
|
-
code: string,
|
|
146
|
-
observed: unknown,
|
|
147
|
-
expected: unknown,
|
|
148
|
-
next: unknown,
|
|
149
|
-
exitCode = 4,
|
|
150
|
-
) {
|
|
151
|
-
super(code);
|
|
152
|
-
this.code = code;
|
|
153
|
-
this.observed = observed;
|
|
154
|
-
this.expected = expected;
|
|
155
|
-
this.next = next;
|
|
156
|
-
this.exitCode = exitCode;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function gitFacts() {
|
|
161
|
-
const facts: SetupFacts = {
|
|
162
|
-
workingTree: null,
|
|
163
|
-
currentBranch: null,
|
|
164
|
-
defaultBranch: null,
|
|
165
|
-
headMatchesRemoteDefault: null,
|
|
166
|
-
};
|
|
167
|
-
let unavailable = false;
|
|
168
|
-
let remote = null;
|
|
169
|
-
let detached = false;
|
|
170
|
-
try {
|
|
171
|
-
const run = (...args: string[]): string =>
|
|
172
|
-
execFileSync("git", args, {
|
|
173
|
-
cwd: root,
|
|
174
|
-
encoding: "utf8",
|
|
175
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
176
|
-
}).trim();
|
|
177
|
-
facts.workingTree = run("status", "--porcelain") === "" ? "clean" : "dirty";
|
|
178
|
-
try {
|
|
179
|
-
facts.currentBranch =
|
|
180
|
-
run("symbolic-ref", "--quiet", "--short", "HEAD") || null;
|
|
181
|
-
} catch (error) {
|
|
182
|
-
if (isObject(error) && error.status === 1) detached = true;
|
|
183
|
-
else throw error;
|
|
184
|
-
}
|
|
185
|
-
remote = run("remote", "get-url", "origin");
|
|
186
|
-
const remoteListing = run("ls-remote", "--symref", "origin", "HEAD").split(
|
|
187
|
-
"\n",
|
|
188
|
-
);
|
|
189
|
-
facts.defaultBranch =
|
|
190
|
-
remoteListing
|
|
191
|
-
.find((line) => line.startsWith("ref: "))
|
|
192
|
-
?.match(/refs\/heads\/([^\t]+)/u)?.[1] ?? null;
|
|
193
|
-
const remoteHead = remoteListing
|
|
194
|
-
.find((line) => /^[0-9a-f]{40}\s+HEAD$/u.test(line))
|
|
195
|
-
?.split(/\s+/u)[0];
|
|
196
|
-
facts.headMatchesRemoteDefault =
|
|
197
|
-
remoteHead === undefined ? null : run("rev-parse", "HEAD") === remoteHead;
|
|
198
|
-
} catch {
|
|
199
|
-
unavailable = true;
|
|
200
|
-
}
|
|
201
|
-
return { facts, unavailable, remote, detached };
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
async function status() {
|
|
205
|
-
let readiness = "unavailable";
|
|
206
|
-
let blockers: {
|
|
207
|
-
readonly code: string;
|
|
208
|
-
readonly observed: string;
|
|
209
|
-
readonly expected: string;
|
|
210
|
-
readonly nextAction: string;
|
|
211
|
-
}[] = [];
|
|
212
|
-
let publication;
|
|
213
|
-
let statusExitCode = 0;
|
|
214
|
-
try {
|
|
215
|
-
const result = await inspectNpmPublicationReadiness({
|
|
216
|
-
repositoryRoot: root,
|
|
217
|
-
packagePath,
|
|
218
|
-
});
|
|
219
|
-
if (result.kind === "ready") {
|
|
220
|
-
readiness = "ready";
|
|
221
|
-
publication = result.publication;
|
|
222
|
-
} else {
|
|
223
|
-
readiness =
|
|
224
|
-
result.mode === "safe-unconfigured"
|
|
225
|
-
? "safe-unconfigured"
|
|
226
|
-
: "public-intent-blocked";
|
|
227
|
-
blockers = result.blockers.map((item) => ({
|
|
228
|
-
code: item.code,
|
|
229
|
-
observed: oneLine(item.observed),
|
|
230
|
-
expected: oneLine(item.expected),
|
|
231
|
-
nextAction: oneLine(item.nextAction),
|
|
232
|
-
}));
|
|
233
|
-
}
|
|
234
|
-
} catch (error) {
|
|
235
|
-
statusExitCode = 5;
|
|
236
|
-
blockers = [
|
|
237
|
-
{
|
|
238
|
-
code: "readiness-unavailable",
|
|
239
|
-
observed: oneLine(error),
|
|
240
|
-
expected: "Readable local publication facts",
|
|
241
|
-
nextAction: "Correct the repository facts and retry.",
|
|
242
|
-
},
|
|
243
|
-
];
|
|
244
|
-
}
|
|
245
|
-
const {
|
|
246
|
-
facts: git,
|
|
247
|
-
unavailable: gitUnavailable,
|
|
248
|
-
remote,
|
|
249
|
-
detached,
|
|
250
|
-
} = gitFacts();
|
|
251
|
-
if (readiness === "ready" && gitUnavailable) {
|
|
252
|
-
statusExitCode = 5;
|
|
253
|
-
blockers = [
|
|
254
|
-
...blockers,
|
|
255
|
-
{
|
|
256
|
-
code: "git-status-unavailable",
|
|
257
|
-
observed: "Git facts could not be read",
|
|
258
|
-
expected: "Readable public Git default branch facts",
|
|
259
|
-
nextAction: "Correct the Git or network failure and retry.",
|
|
260
|
-
},
|
|
261
|
-
];
|
|
262
|
-
}
|
|
263
|
-
if (
|
|
264
|
-
readiness === "ready" &&
|
|
265
|
-
!gitUnavailable &&
|
|
266
|
-
!remoteMatchesPublicOwner(remote)
|
|
267
|
-
) {
|
|
268
|
-
statusExitCode = 4;
|
|
269
|
-
blockers = [
|
|
270
|
-
...blockers,
|
|
271
|
-
{
|
|
272
|
-
code: "repository-remote-conflict",
|
|
273
|
-
observed: oneLine(redactRemote(remote)),
|
|
274
|
-
expected: "The public package owner GitHub repository",
|
|
275
|
-
nextAction: "Correct the normal Git remote and retry.",
|
|
276
|
-
},
|
|
277
|
-
];
|
|
278
|
-
}
|
|
279
|
-
if (readiness === "ready" && !gitUnavailable && detached) {
|
|
280
|
-
statusExitCode = 3;
|
|
281
|
-
blockers = [
|
|
282
|
-
...blockers,
|
|
283
|
-
{
|
|
284
|
-
code: "git-handoff-required",
|
|
285
|
-
observed: "HEAD is detached",
|
|
286
|
-
expected: "A checked-out public default branch",
|
|
287
|
-
nextAction: "Complete the normal Git handoff and rerun setup.",
|
|
288
|
-
},
|
|
289
|
-
];
|
|
290
|
-
}
|
|
291
|
-
const prerequisiteBlocked =
|
|
292
|
-
readiness === "unavailable" ||
|
|
293
|
-
blockers.some(
|
|
294
|
-
(blocker) =>
|
|
295
|
-
blocker.code.startsWith("local-template-metadata-") ||
|
|
296
|
-
blocker.code === "private-runtime-dependency",
|
|
297
|
-
);
|
|
298
|
-
const currentStage = prerequisiteBlocked
|
|
299
|
-
? {
|
|
300
|
-
id: "check-prerequisites",
|
|
301
|
-
number: 1,
|
|
302
|
-
name: "Check prerequisites",
|
|
303
|
-
}
|
|
304
|
-
: readiness === "ready" &&
|
|
305
|
-
git.workingTree === "clean" &&
|
|
306
|
-
git.currentBranch !== null &&
|
|
307
|
-
git.currentBranch === git.defaultBranch &&
|
|
308
|
-
git.headMatchesRemoteDefault
|
|
309
|
-
? {
|
|
310
|
-
id: "verify-first-release-artifact",
|
|
311
|
-
number: 4,
|
|
312
|
-
name: "Verify the first release artifact",
|
|
313
|
-
}
|
|
314
|
-
: readiness === "ready"
|
|
315
|
-
? {
|
|
316
|
-
id: "commit-publication-configuration",
|
|
317
|
-
number: 3,
|
|
318
|
-
name: "Commit the publication configuration",
|
|
319
|
-
}
|
|
320
|
-
: {
|
|
321
|
-
id: "configure-public-package",
|
|
322
|
-
number: 2,
|
|
323
|
-
name: "Configure the public package",
|
|
324
|
-
};
|
|
325
|
-
if (blockers.length === 0 && currentStage.number === 3)
|
|
326
|
-
blockers = [
|
|
327
|
-
{
|
|
328
|
-
code: "git-handoff-required",
|
|
329
|
-
observed: oneLine(git.workingTree),
|
|
330
|
-
expected: "A clean synchronized public default branch",
|
|
331
|
-
nextAction:
|
|
332
|
-
"Use the normal Git review and merge flow, then rerun setup.",
|
|
333
|
-
},
|
|
334
|
-
];
|
|
335
|
-
print({
|
|
336
|
-
schemaVersion: 1,
|
|
337
|
-
currentStage,
|
|
338
|
-
observations: {
|
|
339
|
-
packagePath,
|
|
340
|
-
packageName: publication?.packageName ?? null,
|
|
341
|
-
commandName: publication?.commandName ?? null,
|
|
342
|
-
version: publication?.version ?? null,
|
|
343
|
-
repository: publication?.repository ?? null,
|
|
344
|
-
readiness,
|
|
345
|
-
git,
|
|
346
|
-
},
|
|
347
|
-
blockers,
|
|
348
|
-
nextAction: {
|
|
349
|
-
kind:
|
|
350
|
-
currentStage.number === 1
|
|
351
|
-
? "retry-external-check"
|
|
352
|
-
: currentStage.number === 2
|
|
353
|
-
? "provide-public-facts"
|
|
354
|
-
: currentStage.number === 3
|
|
355
|
-
? "normal-git-handoff"
|
|
356
|
-
: "verify-artifact",
|
|
357
|
-
command: "./scripts/npm-publication-setup/setup.sh",
|
|
358
|
-
},
|
|
359
|
-
});
|
|
360
|
-
process.exitCode = statusExitCode;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
async function preflight() {
|
|
364
|
-
let readiness;
|
|
365
|
-
try {
|
|
366
|
-
readiness = await inspectNpmPublicationReadiness({
|
|
367
|
-
repositoryRoot: root,
|
|
368
|
-
packagePath,
|
|
369
|
-
});
|
|
370
|
-
} catch {
|
|
371
|
-
stop(
|
|
372
|
-
"readiness-unavailable",
|
|
373
|
-
"Ticket 08 readiness could not read local publication facts",
|
|
374
|
-
"Readable local publication facts",
|
|
375
|
-
"Correct the repository facts and retry.",
|
|
376
|
-
5,
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
if (readiness.kind === "ready") return;
|
|
380
|
-
const nonConfigurationBlocker = readiness.blockers.find(
|
|
381
|
-
(item) =>
|
|
382
|
-
item.code.startsWith("local-template-metadata-") ||
|
|
383
|
-
item.code === "private-runtime-dependency",
|
|
384
|
-
);
|
|
385
|
-
if (nonConfigurationBlocker !== undefined)
|
|
386
|
-
stop(
|
|
387
|
-
nonConfigurationBlocker.code,
|
|
388
|
-
nonConfigurationBlocker.observed,
|
|
389
|
-
nonConfigurationBlocker.expected,
|
|
390
|
-
nonConfigurationBlocker.nextAction,
|
|
391
|
-
);
|
|
392
|
-
if (readiness.mode === "safe-unconfigured") return;
|
|
393
|
-
const blocker = readiness.blockers[0];
|
|
394
|
-
stop(blocker.code, blocker.observed, blocker.expected, blocker.nextAction);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
function canonicalGitHubRepository(value: unknown): string | null {
|
|
398
|
-
try {
|
|
399
|
-
if (typeof value !== "string") return null;
|
|
400
|
-
const candidate = value
|
|
401
|
-
.replace(/^git\+/u, "")
|
|
402
|
-
.replace(/^git@github\.com:/u, "https://github.com/");
|
|
403
|
-
const url = new URL(candidate);
|
|
404
|
-
if (url.username.length > 0 || url.password.length > 0) return null;
|
|
405
|
-
const pathname = url.pathname.replace(/^\//u, "").replace(/\.git$/u, "");
|
|
406
|
-
return url.hostname.toLowerCase() === "github.com" &&
|
|
407
|
-
/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u.test(pathname)
|
|
408
|
-
? `https://github.com/${pathname}`
|
|
409
|
-
: null;
|
|
410
|
-
} catch {
|
|
411
|
-
return null;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
function redactRemote(value: unknown): string {
|
|
416
|
-
return oneLine(value);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
function repositoryOwner() {
|
|
420
|
-
try {
|
|
421
|
-
const manifest = JSON.parse(
|
|
422
|
-
readFileSync(path.join(root, packagePath, "package.json"), "utf8"),
|
|
423
|
-
);
|
|
424
|
-
const repository =
|
|
425
|
-
typeof manifest.repository === "object" && manifest.repository !== null
|
|
426
|
-
? manifest.repository.url
|
|
427
|
-
: manifest.repository;
|
|
428
|
-
return canonicalGitHubRepository(repository);
|
|
429
|
-
} catch {
|
|
430
|
-
return null;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
function remoteMatchesPublicOwner(remote: unknown): boolean {
|
|
435
|
-
const owner = repositoryOwner();
|
|
436
|
-
return owner !== null && owner === canonicalGitHubRepository(remote);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
function remoteMatchesOwner() {
|
|
440
|
-
process.exitCode = remoteMatchesPublicOwner(process.env.REMOTE_URL) ? 0 : 1;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
function receiptLines(receipt: VerifiedPublicationArtifactReceipt): string[] {
|
|
444
|
-
const lines = [
|
|
445
|
-
`Package: ${oneLine(receipt.publication.packageName)}@${oneLine(receipt.publication.version)}`,
|
|
446
|
-
`Command: ${oneLine(receipt.publication.commandName)}`,
|
|
447
|
-
`Repository: ${oneLine(receipt.publication.repository)}`,
|
|
448
|
-
`Release date: ${oneLine(receipt.publication.releaseDate)}`,
|
|
449
|
-
`Release notes: ${oneLine(receipt.publication.releaseNotes)}`,
|
|
450
|
-
`Artifact: ${oneLine(receipt.artifact.file)} (${receipt.artifact.size} bytes)`,
|
|
451
|
-
`Integrity: ${oneLine(receipt.artifact.integrity)}`,
|
|
452
|
-
`Checksum: ${oneLine(receipt.artifact.checksumFile)}`,
|
|
453
|
-
`Packed manifest: ${oneLine(JSON.stringify(receipt.packedManifest))}`,
|
|
454
|
-
];
|
|
455
|
-
for (const file of receipt.files)
|
|
456
|
-
lines.push(
|
|
457
|
-
`File: ${oneLine(file.path)} mode ${file.mode} size ${file.size}`,
|
|
458
|
-
);
|
|
459
|
-
lines.push(
|
|
460
|
-
`Bin: ${oneLine(receipt.bin.path)} mode ${receipt.bin.mode}`,
|
|
461
|
-
`Bin shebang: ${oneLine(receipt.bin.shebang)}`,
|
|
462
|
-
);
|
|
463
|
-
for (const smoke of receipt.smokes)
|
|
464
|
-
lines.push(
|
|
465
|
-
`Smoke: ${oneLine(smoke.name)} args ${oneLine(JSON.stringify(smoke.args))} stdout ${oneLine(smoke.stdout)}`,
|
|
466
|
-
);
|
|
467
|
-
lines.push(
|
|
468
|
-
`ACCEPT ${oneLine(receipt.publication.packageName)}@${oneLine(receipt.publication.version)} ${oneLine(receipt.artifact.integrity)}`,
|
|
469
|
-
);
|
|
470
|
-
return lines;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
async function artifact() {
|
|
474
|
-
const outputDirectory = process.env.ARTIFACT_OUTPUT_DIRECTORY;
|
|
475
|
-
if (typeof outputDirectory !== "string" || outputDirectory.length === 0) {
|
|
476
|
-
reportFailure(
|
|
477
|
-
new SetupFailure(
|
|
478
|
-
"artifact-temporary-output",
|
|
479
|
-
"artifact output directory is unavailable",
|
|
480
|
-
"an owned local temporary directory",
|
|
481
|
-
"Correct temporary directory permissions and retry.",
|
|
482
|
-
5,
|
|
483
|
-
),
|
|
484
|
-
);
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
try {
|
|
488
|
-
const result = await verifyNpmPublicationArtifact({
|
|
489
|
-
repositoryRoot: root,
|
|
490
|
-
packagePath,
|
|
491
|
-
outputDirectory,
|
|
492
|
-
});
|
|
493
|
-
if (result.kind === "blocked") {
|
|
494
|
-
for (const blocker of result.readiness.blockers)
|
|
495
|
-
process.stdout.write(
|
|
496
|
-
`ERROR ${oneLine(blocker.code)}\nObserved: ${oneLine(blocker.observed)}\nExpected: ${oneLine(blocker.expected)}\nNext action: ${oneLine(blocker.nextAction)}\n`,
|
|
497
|
-
);
|
|
498
|
-
process.exitCode = 4;
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
if (result.kind === "failed") {
|
|
502
|
-
const { failure } = result;
|
|
503
|
-
process.stdout.write(
|
|
504
|
-
`ERROR ${oneLine(failure.code)}\nObserved: ${oneLine(failure.observed)}\nExpected: ${oneLine(failure.expected)}\nNext action: ${oneLine(failure.nextAction)}\n`,
|
|
505
|
-
);
|
|
506
|
-
process.exitCode = 5;
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
process.stdout.write(`${receiptLines(result.receipt).join("\n")}\n`);
|
|
510
|
-
} catch {
|
|
511
|
-
reportFailure(
|
|
512
|
-
new SetupFailure(
|
|
513
|
-
"artifact-verification-failed",
|
|
514
|
-
"the Ticket 09 artifact verifier could not complete",
|
|
515
|
-
"a verified local publication artifact",
|
|
516
|
-
"Correct the local artifact failure and retry.",
|
|
517
|
-
5,
|
|
518
|
-
),
|
|
519
|
-
);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
function stop(
|
|
524
|
-
code: string,
|
|
525
|
-
observed: unknown,
|
|
526
|
-
expected: unknown,
|
|
527
|
-
next: unknown,
|
|
528
|
-
exitCode = 4,
|
|
529
|
-
): never {
|
|
530
|
-
throw new SetupFailure(code, observed, expected, next, exitCode);
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
function reportFailure(failure: SetupFailure): void {
|
|
534
|
-
process.stderr.write(
|
|
535
|
-
`${failure.exitCode === 3 ? "ACTION REQUIRED" : "ERROR"} ${failure.code}\nObserved: ${oneLine(failure.observed)}\nExpected: ${oneLine(failure.expected)}\nNext action: ${oneLine(failure.next)}\n`,
|
|
536
|
-
);
|
|
537
|
-
process.exitCode = failure.exitCode;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
function placeholder(key: string): string {
|
|
541
|
-
return `{{${key}}}`;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
function validGregorianDate(value: string): boolean {
|
|
545
|
-
const match = /^(\d{4})-(\d{2})-(\d{2})$/u.exec(value);
|
|
546
|
-
if (match === null) return false;
|
|
547
|
-
const [year, month, day] = match.slice(1).map(Number) as [
|
|
548
|
-
number,
|
|
549
|
-
number,
|
|
550
|
-
number,
|
|
551
|
-
];
|
|
552
|
-
const date = new Date(Date.UTC(year, month - 1, day));
|
|
553
|
-
return (
|
|
554
|
-
date.getUTCFullYear() === year &&
|
|
555
|
-
date.getUTCMonth() === month - 1 &&
|
|
556
|
-
date.getUTCDate() === day
|
|
557
|
-
);
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
function asset(file: string): string {
|
|
561
|
-
const setupDirectory = process.env.SETUP_DIR;
|
|
562
|
-
if (setupDirectory === undefined)
|
|
563
|
-
throw new Error("setup directory is unavailable");
|
|
564
|
-
return readFileSync(path.join(setupDirectory, "assets", file), "utf8");
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
async function configure() {
|
|
568
|
-
const packageRoot = path.join(root, packagePath);
|
|
569
|
-
const files: readonly [string, string, string, string, string, string] = [
|
|
570
|
-
path.join(packageRoot, "package.json"),
|
|
571
|
-
path.join(root, ".template/blueprint.json"),
|
|
572
|
-
path.join(root, "LICENSE"),
|
|
573
|
-
path.join(packageRoot, "LICENSE"),
|
|
574
|
-
path.join(packageRoot, "README.md"),
|
|
575
|
-
path.join(packageRoot, "CHANGELOG.md"),
|
|
576
|
-
];
|
|
577
|
-
const beforeExists = new Map(files.map((file) => [file, existsSync(file)]));
|
|
578
|
-
const before = new Map(
|
|
579
|
-
files.map((file) => [
|
|
580
|
-
file,
|
|
581
|
-
beforeExists.get(file) ? readFileSync(file) : null,
|
|
582
|
-
]),
|
|
583
|
-
);
|
|
584
|
-
let manifest: Manifest;
|
|
585
|
-
let blueprint: Blueprint;
|
|
586
|
-
try {
|
|
587
|
-
const parsedManifest: unknown = JSON.parse(readFileSync(files[0], "utf8"));
|
|
588
|
-
const parsedBlueprint: unknown = JSON.parse(readFileSync(files[1], "utf8"));
|
|
589
|
-
if (
|
|
590
|
-
!isObject(parsedManifest) ||
|
|
591
|
-
!isObject(parsedBlueprint) ||
|
|
592
|
-
!Array.isArray(parsedBlueprint.packages)
|
|
593
|
-
)
|
|
594
|
-
stop(
|
|
595
|
-
"owner-fact-invalid",
|
|
596
|
-
"owner JSON has an unsupported shape",
|
|
597
|
-
"readable owner JSON",
|
|
598
|
-
"Repair the owner file and retry.",
|
|
599
|
-
5,
|
|
600
|
-
);
|
|
601
|
-
manifest = parsedManifest;
|
|
602
|
-
blueprint = parsedBlueprint as Blueprint;
|
|
603
|
-
} catch (error) {
|
|
604
|
-
stop(
|
|
605
|
-
"owner-fact-invalid",
|
|
606
|
-
error,
|
|
607
|
-
"readable owner JSON",
|
|
608
|
-
"Repair the owner file and retry.",
|
|
609
|
-
);
|
|
610
|
-
}
|
|
611
|
-
const input = {
|
|
612
|
-
packageName: process.env.PACKAGE_NAME,
|
|
613
|
-
commandName: process.env.COMMAND_NAME,
|
|
614
|
-
description: process.env.DESCRIPTION,
|
|
615
|
-
license: process.env.LICENSE_NAME,
|
|
616
|
-
copyrightHolder: process.env.COPYRIGHT_HOLDER,
|
|
617
|
-
repository: process.env.REPOSITORY_URL,
|
|
618
|
-
};
|
|
619
|
-
const existingRepository =
|
|
620
|
-
typeof manifest.repository === "object" && manifest.repository !== null
|
|
621
|
-
? manifest.repository.url?.replace(/^git\+/u, "").replace(/\.git$/u, "")
|
|
622
|
-
: undefined;
|
|
623
|
-
const existingHolder = before
|
|
624
|
-
.get(files[2])
|
|
625
|
-
?.toString()
|
|
626
|
-
.match(/^Copyright(?: \(c\))?\s+(.+)$/mu)?.[1];
|
|
627
|
-
const facts = {
|
|
628
|
-
name: input.packageName || manifest.name,
|
|
629
|
-
command: input.commandName || Object.keys(manifest.bin ?? {})[0],
|
|
630
|
-
description: input.description || manifest.description,
|
|
631
|
-
license: input.license || manifest.license,
|
|
632
|
-
holder: input.copyrightHolder || existingHolder,
|
|
633
|
-
repository: input.repository || existingRepository,
|
|
634
|
-
};
|
|
635
|
-
const initialPrivateBin =
|
|
636
|
-
typeof manifest.bin === "object" &&
|
|
637
|
-
manifest.bin !== null &&
|
|
638
|
-
!Array.isArray(manifest.bin) &&
|
|
639
|
-
Object.keys(manifest.bin).length === 1 &&
|
|
640
|
-
Object.values(manifest.bin).every((value) => value === "./dist/cli.js");
|
|
641
|
-
if (manifest.private === true && !initialPrivateBin)
|
|
642
|
-
stop(
|
|
643
|
-
"owner-fact-conflict",
|
|
644
|
-
"package bin has reviewed private intent",
|
|
645
|
-
"the generated placeholder CLI bin before public configuration",
|
|
646
|
-
"Resolve the package bin through normal review.",
|
|
647
|
-
);
|
|
648
|
-
const publicOwnerConflicts = [
|
|
649
|
-
["description", input.description, manifest.description],
|
|
650
|
-
["license", input.license, manifest.license],
|
|
651
|
-
["repository", input.repository, existingRepository],
|
|
652
|
-
["copyright holder", input.copyrightHolder, existingHolder],
|
|
653
|
-
].filter(
|
|
654
|
-
([, supplied, existing]) => supplied && existing && supplied !== existing,
|
|
655
|
-
);
|
|
656
|
-
const publicManifestConflicts = [
|
|
657
|
-
["package name", input.packageName, manifest.name],
|
|
658
|
-
["command", input.commandName, Object.keys(manifest.bin ?? {})[0]],
|
|
659
|
-
].filter(
|
|
660
|
-
([, supplied, existing]) =>
|
|
661
|
-
!manifest.private && supplied && existing && supplied !== existing,
|
|
662
|
-
);
|
|
663
|
-
const explicitConflicts = [
|
|
664
|
-
...publicOwnerConflicts,
|
|
665
|
-
...publicManifestConflicts,
|
|
666
|
-
];
|
|
667
|
-
if (explicitConflicts.length > 0) {
|
|
668
|
-
const [field, supplied, existing] = explicitConflicts[0] ?? [];
|
|
669
|
-
stop(
|
|
670
|
-
"owner-fact-conflict",
|
|
671
|
-
`${field}: ${supplied}`,
|
|
672
|
-
`${field}: ${existing}`,
|
|
673
|
-
"Use the existing public owner fact or resolve the conflict through normal review.",
|
|
674
|
-
);
|
|
675
|
-
}
|
|
676
|
-
const holderRequired =
|
|
677
|
-
facts.license === "MIT" || facts.license === "Apache-2.0";
|
|
678
|
-
if (
|
|
679
|
-
!facts.name ||
|
|
680
|
-
!facts.command ||
|
|
681
|
-
!facts.description?.trim() ||
|
|
682
|
-
!facts.license?.trim() ||
|
|
683
|
-
!facts.repository ||
|
|
684
|
-
(holderRequired && !facts.holder?.trim())
|
|
685
|
-
)
|
|
686
|
-
stop(
|
|
687
|
-
"public-fact-required",
|
|
688
|
-
"missing public fact",
|
|
689
|
-
"six valid public facts",
|
|
690
|
-
"Provide public flags or run interactively.",
|
|
691
|
-
3,
|
|
692
|
-
);
|
|
693
|
-
if (
|
|
694
|
-
!/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u.test(facts.name) ||
|
|
695
|
-
!/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u.test(
|
|
696
|
-
facts.repository,
|
|
697
|
-
)
|
|
698
|
-
)
|
|
699
|
-
stop(
|
|
700
|
-
"public-fact-invalid",
|
|
701
|
-
"invalid package name or repository",
|
|
702
|
-
"a valid public npm package name and GitHub HTTPS repository",
|
|
703
|
-
"Correct the supplied public fact and retry.",
|
|
704
|
-
2,
|
|
705
|
-
);
|
|
706
|
-
try {
|
|
707
|
-
const identity = await import(
|
|
708
|
-
pathToFileURL(
|
|
709
|
-
path.join(root, packagePath, "src", "cli-command-identity.ts"),
|
|
710
|
-
).href
|
|
711
|
-
);
|
|
712
|
-
identity.validateCliCommandName(facts.command);
|
|
713
|
-
} catch {
|
|
714
|
-
stop(
|
|
715
|
-
"public-fact-invalid",
|
|
716
|
-
"invalid command name",
|
|
717
|
-
"a portable unreserved CLI command name",
|
|
718
|
-
"Correct --bin and retry.",
|
|
719
|
-
2,
|
|
720
|
-
);
|
|
721
|
-
}
|
|
722
|
-
try {
|
|
723
|
-
parseSpdxExpression(facts.license);
|
|
724
|
-
} catch {
|
|
725
|
-
stop(
|
|
726
|
-
"public-fact-invalid",
|
|
727
|
-
facts.license,
|
|
728
|
-
"a valid SPDX license expression",
|
|
729
|
-
"Provide a valid --license value.",
|
|
730
|
-
2,
|
|
731
|
-
);
|
|
732
|
-
}
|
|
733
|
-
if (!manifest.private && manifest.name !== facts.name)
|
|
734
|
-
stop(
|
|
735
|
-
"owner-fact-conflict",
|
|
736
|
-
manifest.name,
|
|
737
|
-
facts.name,
|
|
738
|
-
"Use the existing public package name.",
|
|
739
|
-
);
|
|
740
|
-
let licenseBytes: string | Buffer;
|
|
741
|
-
if (facts.license === "MIT")
|
|
742
|
-
licenseBytes = asset("LICENSE-MIT.txt").replaceAll(
|
|
743
|
-
placeholder("COPYRIGHT_HOLDER"),
|
|
744
|
-
facts.holder ?? "",
|
|
745
|
-
);
|
|
746
|
-
else if (facts.license === "Apache-2.0")
|
|
747
|
-
licenseBytes = asset("LICENSE-APACHE-2.0.txt").replaceAll(
|
|
748
|
-
" Copyright [yyyy] [name of copyright owner]",
|
|
749
|
-
`Copyright (c) ${facts.holder}`,
|
|
750
|
-
);
|
|
751
|
-
else {
|
|
752
|
-
if (!before.get(files[2]))
|
|
753
|
-
stop(
|
|
754
|
-
"license-owner-required",
|
|
755
|
-
"missing root LICENSE",
|
|
756
|
-
"existing custom SPDX license",
|
|
757
|
-
"Add the custom license through normal review.",
|
|
758
|
-
);
|
|
759
|
-
licenseBytes = before.get(files[2]) ?? Buffer.alloc(0);
|
|
760
|
-
}
|
|
761
|
-
const oldChangelog = before.get(files[5])?.toString() ?? "";
|
|
762
|
-
const dates: string[] = [
|
|
763
|
-
...oldChangelog.matchAll(/^## \[1\.0\.0\] - (\d{4}-\d{2}-\d{2})$/gmu),
|
|
764
|
-
].flatMap((item) => (item[1] === undefined ? [] : [item[1]]));
|
|
765
|
-
if (
|
|
766
|
-
dates.length > 1 ||
|
|
767
|
-
dates.some((date) => !validGregorianDate(date)) ||
|
|
768
|
-
(oldChangelog.includes("## [1.0.0]") && dates.length !== 1)
|
|
769
|
-
)
|
|
770
|
-
stop(
|
|
771
|
-
"owner-fact-conflict",
|
|
772
|
-
"invalid or duplicate 1.0.0 date",
|
|
773
|
-
"one valid owner date",
|
|
774
|
-
"Correct CHANGELOG through normal review.",
|
|
775
|
-
);
|
|
776
|
-
const date = dates[0] ?? new Date().toISOString().slice(0, 10);
|
|
777
|
-
const render = (file: string, values: Record<string, string>) =>
|
|
778
|
-
Object.entries(values).reduce(
|
|
779
|
-
(text, [key, value]) => text.replaceAll(placeholder(key), value),
|
|
780
|
-
asset(file),
|
|
781
|
-
);
|
|
782
|
-
const nextManifest = {
|
|
783
|
-
...manifest,
|
|
784
|
-
name: facts.name,
|
|
785
|
-
version: "1.0.0",
|
|
786
|
-
description: facts.description,
|
|
787
|
-
license: facts.license,
|
|
788
|
-
homepage: `${facts.repository}#readme`,
|
|
789
|
-
bugs: { url: `${facts.repository}/issues` },
|
|
790
|
-
repository: {
|
|
791
|
-
type: "git",
|
|
792
|
-
url: `git+${facts.repository}.git`,
|
|
793
|
-
directory: packagePath,
|
|
794
|
-
},
|
|
795
|
-
bin: { [facts.command]: "./dist/cli.js" },
|
|
796
|
-
files: ["dist", "README.md", "LICENSE", "CHANGELOG.md"],
|
|
797
|
-
publishConfig: {
|
|
798
|
-
access: "public",
|
|
799
|
-
registry: "https://registry.npmjs.org/",
|
|
800
|
-
},
|
|
801
|
-
};
|
|
802
|
-
delete nextManifest.private;
|
|
803
|
-
const target = new Map([
|
|
804
|
-
[files[0], Buffer.from(`${JSON.stringify(nextManifest, null, 2)}\n`)],
|
|
805
|
-
[
|
|
806
|
-
files[1],
|
|
807
|
-
Buffer.from(
|
|
808
|
-
`${JSON.stringify({ ...blueprint, packages: blueprint.packages.map((item) => (item.path === packagePath ? { ...item, name: facts.name } : item)) }, null, 2)}\n`,
|
|
809
|
-
),
|
|
810
|
-
],
|
|
811
|
-
[files[2], Buffer.from(licenseBytes)],
|
|
812
|
-
[files[3], Buffer.from(licenseBytes)],
|
|
813
|
-
[
|
|
814
|
-
files[4],
|
|
815
|
-
Buffer.from(
|
|
816
|
-
render("README.md.template", {
|
|
817
|
-
PACKAGE_NAME: facts.name,
|
|
818
|
-
DESCRIPTION: facts.description,
|
|
819
|
-
COMMAND_NAME: facts.command,
|
|
820
|
-
}),
|
|
821
|
-
),
|
|
822
|
-
],
|
|
823
|
-
[
|
|
824
|
-
files[5],
|
|
825
|
-
Buffer.from(
|
|
826
|
-
render("CHANGELOG.md.template", {
|
|
827
|
-
RELEASE_DATE: date,
|
|
828
|
-
REPOSITORY_URL: facts.repository,
|
|
829
|
-
}),
|
|
830
|
-
),
|
|
831
|
-
],
|
|
832
|
-
]);
|
|
833
|
-
for (const file of files.slice(2)) {
|
|
834
|
-
const source = before.get(file);
|
|
835
|
-
if (
|
|
836
|
-
source !== null &&
|
|
837
|
-
source !== undefined &&
|
|
838
|
-
source.byteLength > 0 &&
|
|
839
|
-
Buffer.compare(source, target.get(file) ?? Buffer.alloc(0)) !== 0
|
|
840
|
-
)
|
|
841
|
-
stop(
|
|
842
|
-
"owner-fact-conflict",
|
|
843
|
-
path.relative(root, file),
|
|
844
|
-
"a missing owner file or the exact partial setup owner bytes",
|
|
845
|
-
"Resolve reviewed owner content through normal review.",
|
|
846
|
-
);
|
|
847
|
-
}
|
|
848
|
-
if (
|
|
849
|
-
dates.length === 1 &&
|
|
850
|
-
Buffer.compare(
|
|
851
|
-
before.get(files[5]) ?? Buffer.alloc(0),
|
|
852
|
-
target.get(files[5]) ?? Buffer.alloc(0),
|
|
853
|
-
) !== 0
|
|
854
|
-
)
|
|
855
|
-
stop(
|
|
856
|
-
"owner-fact-conflict",
|
|
857
|
-
"CHANGELOG is not an exact previous target",
|
|
858
|
-
"an exact partial setup owner fact",
|
|
859
|
-
"Resolve CHANGELOG through normal review.",
|
|
860
|
-
);
|
|
861
|
-
const overlay = mkdtempSync(
|
|
862
|
-
path.join(tmpdir(), "npm-publication-setup-overlay-"),
|
|
863
|
-
);
|
|
864
|
-
const ownerTemporaryPaths = new Set<string>();
|
|
865
|
-
const ownsOverlay =
|
|
866
|
-
path.dirname(overlay) === path.resolve(tmpdir()) &&
|
|
867
|
-
path.basename(overlay).startsWith("npm-publication-setup-overlay-");
|
|
868
|
-
const ownsTemporary = (temporary: string): boolean =>
|
|
869
|
-
files.some(
|
|
870
|
-
(file) => temporary === `${file}.npm-publication-setup-${process.pid}`,
|
|
871
|
-
);
|
|
872
|
-
try {
|
|
873
|
-
rmSync(overlay, { recursive: true, force: true });
|
|
874
|
-
cpSync(root, overlay, {
|
|
875
|
-
recursive: true,
|
|
876
|
-
filter: (source) =>
|
|
877
|
-
!source.includes("/.git") && !source.includes("/node_modules"),
|
|
878
|
-
});
|
|
879
|
-
for (const [file, bytes] of target)
|
|
880
|
-
writeFileSync(path.join(overlay, path.relative(root, file)), bytes);
|
|
881
|
-
const readiness = await inspectNpmPublicationReadiness({
|
|
882
|
-
repositoryRoot: overlay,
|
|
883
|
-
packagePath,
|
|
884
|
-
});
|
|
885
|
-
if (readiness.kind !== "ready")
|
|
886
|
-
stop(
|
|
887
|
-
"configuration-plan-blocked",
|
|
888
|
-
readiness.blockers[0]?.code ?? "blocked",
|
|
889
|
-
"Ticket 08 readiness",
|
|
890
|
-
"Correct the public facts and retry.",
|
|
891
|
-
);
|
|
892
|
-
for (const [file, bytes] of before)
|
|
893
|
-
if (
|
|
894
|
-
existsSync(file) !== beforeExists.get(file) ||
|
|
895
|
-
Buffer.compare(
|
|
896
|
-
existsSync(file) ? readFileSync(file) : Buffer.alloc(0),
|
|
897
|
-
bytes ?? Buffer.alloc(0),
|
|
898
|
-
) !== 0
|
|
899
|
-
)
|
|
900
|
-
stop(
|
|
901
|
-
"configuration-preimage-changed",
|
|
902
|
-
path.relative(root, file),
|
|
903
|
-
"unchanged owner preimages",
|
|
904
|
-
"Retry from a stable working tree.",
|
|
905
|
-
);
|
|
906
|
-
for (const [file, bytes] of target)
|
|
907
|
-
if (Buffer.compare(before.get(file) ?? Buffer.alloc(0), bytes) !== 0) {
|
|
908
|
-
const temporary = `${file}.npm-publication-setup-${process.pid}`;
|
|
909
|
-
ownerTemporaryPaths.add(temporary);
|
|
910
|
-
writeFileSync(temporary, bytes);
|
|
911
|
-
renameSync(temporary, file);
|
|
912
|
-
ownerTemporaryPaths.delete(temporary);
|
|
913
|
-
}
|
|
914
|
-
const actualReadiness = await inspectNpmPublicationReadiness({
|
|
915
|
-
repositoryRoot: root,
|
|
916
|
-
packagePath,
|
|
917
|
-
});
|
|
918
|
-
if (
|
|
919
|
-
actualReadiness.kind !== "ready" ||
|
|
920
|
-
actualReadiness.publication.packageName !== facts.name ||
|
|
921
|
-
actualReadiness.publication.commandName !== facts.command ||
|
|
922
|
-
actualReadiness.publication.repository !== `git+${facts.repository}.git`
|
|
923
|
-
)
|
|
924
|
-
stop(
|
|
925
|
-
"configuration-actual-readiness-blocked",
|
|
926
|
-
actualReadiness.kind === "ready"
|
|
927
|
-
? "public identity did not match the applied plan"
|
|
928
|
-
: (actualReadiness.blockers[0]?.code ?? "blocked"),
|
|
929
|
-
"the Ticket 08 actual repository readiness result for this plan",
|
|
930
|
-
"Correct the owner facts through normal review and retry.",
|
|
931
|
-
);
|
|
932
|
-
} finally {
|
|
933
|
-
for (const temporary of ownerTemporaryPaths)
|
|
934
|
-
if (ownsTemporary(temporary)) {
|
|
935
|
-
try {
|
|
936
|
-
rmSync(temporary, { force: true });
|
|
937
|
-
} catch {
|
|
938
|
-
// Best-effort cleanup must not replace the structured failure.
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
if (ownsOverlay)
|
|
942
|
-
try {
|
|
943
|
-
rmSync(overlay, { recursive: true, force: true });
|
|
944
|
-
} catch {
|
|
945
|
-
// Best-effort cleanup must not replace the structured failure.
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
const publicRegistry = "https://registry.npmjs.org/";
|
|
951
|
-
|
|
952
|
-
function externalFailure(
|
|
953
|
-
code: string,
|
|
954
|
-
observed: unknown,
|
|
955
|
-
expected: unknown,
|
|
956
|
-
next: unknown,
|
|
957
|
-
exitCode = 4,
|
|
958
|
-
): SetupFailure {
|
|
959
|
-
return new SetupFailure(code, observed, expected, next, exitCode);
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
function requireExternalTty() {
|
|
963
|
-
if (!process.stdin.isTTY || !process.stdout.isTTY || !process.stderr.isTTY)
|
|
964
|
-
throw externalFailure(
|
|
965
|
-
"npm-interactive-terminal-required",
|
|
966
|
-
"stdin, stdout, and stderr are not all terminals",
|
|
967
|
-
"an interactive terminal for npm authentication and confirmation",
|
|
968
|
-
"Run setup directly from a terminal.",
|
|
969
|
-
3,
|
|
970
|
-
);
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
function rejectAmbientCredentials() {
|
|
974
|
-
for (const key of Object.keys(process.env)) {
|
|
975
|
-
const canonical = key.toLowerCase().replaceAll(/[^a-z0-9]/gu, "");
|
|
976
|
-
const credentialKey =
|
|
977
|
-
canonical === "nodeauthtoken" ||
|
|
978
|
-
canonical === "npmtoken" ||
|
|
979
|
-
canonical === "npmauthtoken" ||
|
|
980
|
-
((canonical.startsWith("npmconfig") ||
|
|
981
|
-
canonical.startsWith("pnpmconfig")) &&
|
|
982
|
-
/(auth|token|password|username|certificate|key)/u.test(canonical));
|
|
983
|
-
if (credentialKey)
|
|
984
|
-
throw externalFailure(
|
|
985
|
-
"ambient-npm-credential-rejected",
|
|
986
|
-
`environment key ${key}`,
|
|
987
|
-
"no ambient npm or pnpm credential configuration",
|
|
988
|
-
"Remove the credential environment variable and retry.",
|
|
989
|
-
4,
|
|
990
|
-
);
|
|
991
|
-
}
|
|
992
|
-
try {
|
|
993
|
-
lstatSync(path.join(root, ".npmrc"));
|
|
994
|
-
} catch (error) {
|
|
995
|
-
if (isObject(error) && error.code === "ENOENT") return;
|
|
996
|
-
throw externalFailure(
|
|
997
|
-
"repository-npmrc-unreadable",
|
|
998
|
-
"repository .npmrc could not be checked",
|
|
999
|
-
"no repository .npmrc",
|
|
1000
|
-
"Correct the repository filesystem and retry.",
|
|
1001
|
-
5,
|
|
1002
|
-
);
|
|
1003
|
-
}
|
|
1004
|
-
throw externalFailure(
|
|
1005
|
-
"repository-npmrc-rejected",
|
|
1006
|
-
"repository .npmrc exists",
|
|
1007
|
-
"no repository .npmrc file, directory, or symlink",
|
|
1008
|
-
"Remove the repository npm configuration and retry.",
|
|
1009
|
-
4,
|
|
1010
|
-
);
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
function controlledTemporaryParent(): string {
|
|
1014
|
-
const configured = process.env.TMPDIR || "/tmp";
|
|
1015
|
-
try {
|
|
1016
|
-
const parent = realpathSync(path.resolve(configured));
|
|
1017
|
-
if (!lstatSync(parent).isDirectory()) throw new Error("not a directory");
|
|
1018
|
-
return parent;
|
|
1019
|
-
} catch {
|
|
1020
|
-
throw externalFailure(
|
|
1021
|
-
"npm-temporary-directory-invalid",
|
|
1022
|
-
"TMPDIR is not a readable temporary directory",
|
|
1023
|
-
"a readable local temporary directory",
|
|
1024
|
-
"Correct TMPDIR and retry.",
|
|
1025
|
-
5,
|
|
1026
|
-
);
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
function createIsolationRoot(register: (root: string) => void): string {
|
|
1031
|
-
const base = mkdtempSync(
|
|
1032
|
-
path.join(controlledTemporaryParent(), "npm-publication-setup-session-"),
|
|
1033
|
-
);
|
|
1034
|
-
// Registration is deliberately the first operation after mkdtemp: every
|
|
1035
|
-
// later validation or construction failure still has one external owner.
|
|
1036
|
-
register(base);
|
|
1037
|
-
const isolationRoot = realpathSync(base);
|
|
1038
|
-
if (!lstatSync(isolationRoot).isDirectory())
|
|
1039
|
-
throw externalFailure(
|
|
1040
|
-
"npm-temporary-directory-invalid",
|
|
1041
|
-
"created isolation root is not a directory",
|
|
1042
|
-
"an owned temporary directory",
|
|
1043
|
-
"Correct temporary directory permissions and retry.",
|
|
1044
|
-
5,
|
|
1045
|
-
);
|
|
1046
|
-
return isolationRoot;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
function completeIsolation(isolationRoot: string): Isolation {
|
|
1050
|
-
const home = path.join(isolationRoot, "home");
|
|
1051
|
-
const pnpmConfig = path.join(isolationRoot, "pnpm-config");
|
|
1052
|
-
const pnpmStore = path.join(isolationRoot, "pnpm-store");
|
|
1053
|
-
const npmCache = path.join(isolationRoot, "npm-cache");
|
|
1054
|
-
const session = path.join(isolationRoot, "session");
|
|
1055
|
-
const download = path.join(isolationRoot, "download");
|
|
1056
|
-
for (const directory of [
|
|
1057
|
-
home,
|
|
1058
|
-
pnpmConfig,
|
|
1059
|
-
pnpmStore,
|
|
1060
|
-
npmCache,
|
|
1061
|
-
session,
|
|
1062
|
-
download,
|
|
1063
|
-
])
|
|
1064
|
-
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
1065
|
-
const userConfig = path.join(isolationRoot, "npm-userconfig");
|
|
1066
|
-
const globalConfig = path.join(isolationRoot, "npm-globalconfig");
|
|
1067
|
-
writeFileSync(userConfig, "", { mode: 0o600 });
|
|
1068
|
-
writeFileSync(globalConfig, "", { mode: 0o600 });
|
|
1069
|
-
writeFileSync(path.join(session, ".npmrc"), `registry=${publicRegistry}\n`, {
|
|
1070
|
-
mode: 0o600,
|
|
1071
|
-
});
|
|
1072
|
-
return {
|
|
1073
|
-
root: isolationRoot,
|
|
1074
|
-
home,
|
|
1075
|
-
pnpmConfig,
|
|
1076
|
-
pnpmStore,
|
|
1077
|
-
npmCache,
|
|
1078
|
-
session,
|
|
1079
|
-
download,
|
|
1080
|
-
userConfig,
|
|
1081
|
-
globalConfig,
|
|
1082
|
-
};
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
function isolatedEnvironment(isolation: Isolation): NodeJS.ProcessEnv {
|
|
1086
|
-
const environment: NodeJS.ProcessEnv = {};
|
|
1087
|
-
for (const key of ["PATH", "LANG", "LC_ALL", "TERM", "COLORTERM", "NO_COLOR"])
|
|
1088
|
-
if (process.env[key] !== undefined) environment[key] = process.env[key];
|
|
1089
|
-
return {
|
|
1090
|
-
...environment,
|
|
1091
|
-
HOME: isolation.home,
|
|
1092
|
-
XDG_CONFIG_HOME: isolation.pnpmConfig,
|
|
1093
|
-
PNPM_HOME: path.join(isolation.root, "pnpm-home"),
|
|
1094
|
-
NPM_CONFIG_USERCONFIG: isolation.userConfig,
|
|
1095
|
-
NPM_CONFIG_GLOBALCONFIG: isolation.globalConfig,
|
|
1096
|
-
NPM_CONFIG_CACHE: isolation.npmCache,
|
|
1097
|
-
NPM_CONFIG_REGISTRY: publicRegistry,
|
|
1098
|
-
};
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
function throwIfSignalled(): void {
|
|
1102
|
-
if (receivedSignal !== undefined)
|
|
1103
|
-
throw new Error("external setup interrupted");
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
async function runChild(options: {
|
|
1107
|
-
readonly command: string;
|
|
1108
|
-
readonly arguments: readonly string[];
|
|
1109
|
-
readonly cwd: string;
|
|
1110
|
-
readonly env: NodeJS.ProcessEnv;
|
|
1111
|
-
readonly captured: boolean;
|
|
1112
|
-
readonly allowSignal?: boolean;
|
|
1113
|
-
}): Promise<NpmResult> {
|
|
1114
|
-
if (!options.allowSignal) throwIfSignalled();
|
|
1115
|
-
return new Promise((resolve) => {
|
|
1116
|
-
let settled = false;
|
|
1117
|
-
const stdout: Buffer[] = [];
|
|
1118
|
-
const stderr: Buffer[] = [];
|
|
1119
|
-
const settle = (result: NpmResult): void => {
|
|
1120
|
-
if (settled) return;
|
|
1121
|
-
settled = true;
|
|
1122
|
-
if (activeChild === child) activeChild = undefined;
|
|
1123
|
-
resolve(result);
|
|
1124
|
-
};
|
|
1125
|
-
let child: ChildProcess | undefined;
|
|
1126
|
-
try {
|
|
1127
|
-
child = spawn(options.command, [...options.arguments], {
|
|
1128
|
-
cwd: options.cwd,
|
|
1129
|
-
env: options.env,
|
|
1130
|
-
stdio: options.captured ? ["ignore", "pipe", "pipe"] : "inherit",
|
|
1131
|
-
});
|
|
1132
|
-
activeChild = child;
|
|
1133
|
-
child.stdout?.on("data", (chunk: Buffer) =>
|
|
1134
|
-
stdout.push(Buffer.from(chunk)),
|
|
1135
|
-
);
|
|
1136
|
-
child.stderr?.on("data", (chunk: Buffer) =>
|
|
1137
|
-
stderr.push(Buffer.from(chunk)),
|
|
1138
|
-
);
|
|
1139
|
-
child.once("error", (error) =>
|
|
1140
|
-
settle({
|
|
1141
|
-
status: 5,
|
|
1142
|
-
signal: null,
|
|
1143
|
-
stdout: Buffer.concat(stdout).toString("utf8"),
|
|
1144
|
-
stderr: Buffer.concat(stderr).toString("utf8"),
|
|
1145
|
-
error,
|
|
1146
|
-
}),
|
|
1147
|
-
);
|
|
1148
|
-
child.once("close", (status, signal) =>
|
|
1149
|
-
settle({
|
|
1150
|
-
status: status ?? 5,
|
|
1151
|
-
signal,
|
|
1152
|
-
stdout: Buffer.concat(stdout).toString("utf8"),
|
|
1153
|
-
stderr: Buffer.concat(stderr).toString("utf8"),
|
|
1154
|
-
error: undefined,
|
|
1155
|
-
}),
|
|
1156
|
-
);
|
|
1157
|
-
} catch (error) {
|
|
1158
|
-
settle({
|
|
1159
|
-
status: 5,
|
|
1160
|
-
signal: null,
|
|
1161
|
-
stdout: "",
|
|
1162
|
-
stderr: "",
|
|
1163
|
-
error: error instanceof Error ? error : new Error("child spawn failed"),
|
|
1164
|
-
});
|
|
1165
|
-
}
|
|
1166
|
-
});
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
async function bootstrapClient(isolation: Isolation): Promise<NpmClient> {
|
|
1170
|
-
const result = await runChild({
|
|
1171
|
-
command: "corepack",
|
|
1172
|
-
arguments: [
|
|
1173
|
-
"pnpm",
|
|
1174
|
-
"install",
|
|
1175
|
-
"--frozen-lockfile",
|
|
1176
|
-
"--ignore-scripts",
|
|
1177
|
-
`--registry=${publicRegistry}`,
|
|
1178
|
-
`--store-dir=${isolation.pnpmStore}`,
|
|
1179
|
-
`--config-dir=${isolation.pnpmConfig}`,
|
|
1180
|
-
],
|
|
1181
|
-
cwd: root,
|
|
1182
|
-
env: isolatedEnvironment(isolation),
|
|
1183
|
-
captured: true,
|
|
1184
|
-
});
|
|
1185
|
-
throwIfSignalled();
|
|
1186
|
-
if (result.error || result.status !== 0)
|
|
1187
|
-
throw externalFailure(
|
|
1188
|
-
"npm-client-pin-invalid",
|
|
1189
|
-
"isolated Corepack bootstrap failed",
|
|
1190
|
-
"a successful frozen, lifecycle-free npm client bootstrap",
|
|
1191
|
-
"Correct the generated dependency installation and retry.",
|
|
1192
|
-
5,
|
|
1193
|
-
);
|
|
1194
|
-
return { repositoryRoot: root };
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
function npmFlags(isolation: Isolation): string[] {
|
|
1198
|
-
return [
|
|
1199
|
-
`--registry=${publicRegistry}`,
|
|
1200
|
-
`--prefix=${isolation.session}`,
|
|
1201
|
-
`--userconfig=${isolation.userConfig}`,
|
|
1202
|
-
`--globalconfig=${isolation.globalConfig}`,
|
|
1203
|
-
`--cache=${isolation.npmCache}`,
|
|
1204
|
-
];
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
async function capturedNpm(
|
|
1208
|
-
client: NpmClient,
|
|
1209
|
-
isolation: Isolation,
|
|
1210
|
-
arguments_: readonly string[],
|
|
1211
|
-
allowSignal = false,
|
|
1212
|
-
): Promise<NpmResult> {
|
|
1213
|
-
const result = await runChild({
|
|
1214
|
-
command: "corepack",
|
|
1215
|
-
arguments: [
|
|
1216
|
-
"pnpm",
|
|
1217
|
-
"--dir",
|
|
1218
|
-
client.repositoryRoot,
|
|
1219
|
-
"exec",
|
|
1220
|
-
"npm",
|
|
1221
|
-
...arguments_,
|
|
1222
|
-
...npmFlags(isolation),
|
|
1223
|
-
],
|
|
1224
|
-
cwd: isolation.session,
|
|
1225
|
-
env: isolatedEnvironment(isolation),
|
|
1226
|
-
captured: true,
|
|
1227
|
-
allowSignal,
|
|
1228
|
-
});
|
|
1229
|
-
if (!allowSignal) throwIfSignalled();
|
|
1230
|
-
return result;
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
async function interactiveNpm(
|
|
1234
|
-
client: NpmClient,
|
|
1235
|
-
isolation: Isolation,
|
|
1236
|
-
name: string,
|
|
1237
|
-
arguments_: readonly string[],
|
|
1238
|
-
): Promise<InteractiveResult> {
|
|
1239
|
-
process.stdout.write(`INTERACTIVE ${name} BEGIN\n`);
|
|
1240
|
-
const result = await runChild({
|
|
1241
|
-
command: "corepack",
|
|
1242
|
-
arguments: [
|
|
1243
|
-
"pnpm",
|
|
1244
|
-
"--dir",
|
|
1245
|
-
client.repositoryRoot,
|
|
1246
|
-
"exec",
|
|
1247
|
-
"npm",
|
|
1248
|
-
...arguments_,
|
|
1249
|
-
...npmFlags(isolation),
|
|
1250
|
-
],
|
|
1251
|
-
cwd: isolation.session,
|
|
1252
|
-
env: isolatedEnvironment(isolation),
|
|
1253
|
-
captured: false,
|
|
1254
|
-
});
|
|
1255
|
-
process.stdout.write(
|
|
1256
|
-
`INTERACTIVE ${name} END ${result.signal ?? result.status}\n`,
|
|
1257
|
-
);
|
|
1258
|
-
return { status: result.status, signal: result.signal };
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
async function readExactPhrase(
|
|
1262
|
-
expected: string,
|
|
1263
|
-
code = "npm-confirmation-required",
|
|
1264
|
-
): Promise<void> {
|
|
1265
|
-
throwIfSignalled();
|
|
1266
|
-
const { createInterface } = await import("node:readline/promises");
|
|
1267
|
-
const lineReader = createInterface({
|
|
1268
|
-
input: process.stdin,
|
|
1269
|
-
output: process.stdout,
|
|
1270
|
-
terminal: true,
|
|
1271
|
-
});
|
|
1272
|
-
const controller = new AbortController();
|
|
1273
|
-
activePrompt = controller;
|
|
1274
|
-
try {
|
|
1275
|
-
const entered = await lineReader.question("Confirmation: ", {
|
|
1276
|
-
signal: controller.signal,
|
|
1277
|
-
});
|
|
1278
|
-
throwIfSignalled();
|
|
1279
|
-
if (entered !== expected)
|
|
1280
|
-
throw externalFailure(
|
|
1281
|
-
code,
|
|
1282
|
-
"confirmation did not match",
|
|
1283
|
-
expected,
|
|
1284
|
-
"Review the displayed registry action and enter the exact confirmation.",
|
|
1285
|
-
3,
|
|
1286
|
-
);
|
|
1287
|
-
} catch (error) {
|
|
1288
|
-
throwIfSignalled();
|
|
1289
|
-
throw error;
|
|
1290
|
-
} finally {
|
|
1291
|
-
activePrompt = undefined;
|
|
1292
|
-
lineReader.close();
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
function strictJsonObject(result: NpmResult, code: string): JsonObject {
|
|
1297
|
-
if (result.status !== 0 || result.stderr !== "")
|
|
1298
|
-
throw externalFailure(
|
|
1299
|
-
code,
|
|
1300
|
-
"npm command did not return clean JSON",
|
|
1301
|
-
"exit 0 with JSON only on stdout",
|
|
1302
|
-
"Correct the registry or account state and retry.",
|
|
1303
|
-
5,
|
|
1304
|
-
);
|
|
1305
|
-
try {
|
|
1306
|
-
const value = JSON.parse(result.stdout);
|
|
1307
|
-
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
1308
|
-
throw new Error("not object");
|
|
1309
|
-
return value;
|
|
1310
|
-
} catch {
|
|
1311
|
-
throw externalFailure(
|
|
1312
|
-
code,
|
|
1313
|
-
"npm command returned invalid JSON",
|
|
1314
|
-
"one top-level JSON object",
|
|
1315
|
-
"Correct the registry response and retry.",
|
|
1316
|
-
5,
|
|
1317
|
-
);
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
async function classifyPackageExistence(
|
|
1322
|
-
client: NpmClient,
|
|
1323
|
-
isolation: Isolation,
|
|
1324
|
-
packageName: string,
|
|
1325
|
-
): Promise<"absent" | "present" | "unknown"> {
|
|
1326
|
-
const result = await capturedNpm(client, isolation, [
|
|
1327
|
-
"view",
|
|
1328
|
-
packageName,
|
|
1329
|
-
"--json",
|
|
1330
|
-
]);
|
|
1331
|
-
if (result.status === 0) {
|
|
1332
|
-
try {
|
|
1333
|
-
const value: unknown = JSON.parse(result.stdout);
|
|
1334
|
-
if (
|
|
1335
|
-
!isObject(value) ||
|
|
1336
|
-
value.name !== packageName ||
|
|
1337
|
-
result.stderr !== ""
|
|
1338
|
-
)
|
|
1339
|
-
return "unknown";
|
|
1340
|
-
return "present";
|
|
1341
|
-
} catch {
|
|
1342
|
-
return "unknown";
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
if (result.stdout !== "") return "unknown";
|
|
1346
|
-
try {
|
|
1347
|
-
const error: unknown = JSON.parse(result.stderr);
|
|
1348
|
-
return isObject(error) &&
|
|
1349
|
-
error.code === "E404" &&
|
|
1350
|
-
error.pkgid === packageName
|
|
1351
|
-
? "absent"
|
|
1352
|
-
: "unknown";
|
|
1353
|
-
} catch {
|
|
1354
|
-
return "unknown";
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
|
-
async function classifyVersion(
|
|
1359
|
-
client: NpmClient,
|
|
1360
|
-
isolation: Isolation,
|
|
1361
|
-
packageName: string,
|
|
1362
|
-
): Promise<
|
|
1363
|
-
| { readonly kind: "absent" | "unknown" }
|
|
1364
|
-
| { readonly kind: "present"; readonly value: JsonObject }
|
|
1365
|
-
| { readonly kind: "package-present-version-absent" }
|
|
1366
|
-
> {
|
|
1367
|
-
const result = await capturedNpm(client, isolation, [
|
|
1368
|
-
"view",
|
|
1369
|
-
`${packageName}@1.0.0`,
|
|
1370
|
-
"--json",
|
|
1371
|
-
]);
|
|
1372
|
-
if (result.status === 0)
|
|
1373
|
-
return {
|
|
1374
|
-
kind: "present",
|
|
1375
|
-
value: strictJsonObject(result, "npm-registry-schema-unsupported"),
|
|
1376
|
-
};
|
|
1377
|
-
if (result.stdout !== "") return { kind: "unknown" };
|
|
1378
|
-
try {
|
|
1379
|
-
const error = JSON.parse(result.stderr);
|
|
1380
|
-
if (
|
|
1381
|
-
isObject(error) &&
|
|
1382
|
-
error.code === "E404" &&
|
|
1383
|
-
error.pkgid === `${packageName}@1.0.0`
|
|
1384
|
-
) {
|
|
1385
|
-
const packageExistence = await classifyPackageExistence(
|
|
1386
|
-
client,
|
|
1387
|
-
isolation,
|
|
1388
|
-
packageName,
|
|
1389
|
-
);
|
|
1390
|
-
return packageExistence === "absent"
|
|
1391
|
-
? { kind: "absent" }
|
|
1392
|
-
: packageExistence === "present"
|
|
1393
|
-
? { kind: "package-present-version-absent" }
|
|
1394
|
-
: { kind: "unknown" };
|
|
1395
|
-
}
|
|
1396
|
-
} catch {
|
|
1397
|
-
// Only a structured target-specific E404 is absence.
|
|
1398
|
-
}
|
|
1399
|
-
return { kind: "unknown" };
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
async function assertCollaboratorWrite(
|
|
1403
|
-
client: NpmClient,
|
|
1404
|
-
isolation: Isolation,
|
|
1405
|
-
packageName: string,
|
|
1406
|
-
whoami: string,
|
|
1407
|
-
): Promise<void> {
|
|
1408
|
-
const value = strictJsonObject(
|
|
1409
|
-
await capturedNpm(client, isolation, [
|
|
1410
|
-
"access",
|
|
1411
|
-
"list",
|
|
1412
|
-
"collaborators",
|
|
1413
|
-
packageName,
|
|
1414
|
-
"--json",
|
|
1415
|
-
]),
|
|
1416
|
-
"npm-access-schema-unsupported",
|
|
1417
|
-
);
|
|
1418
|
-
if (!Object.hasOwn(value, whoami) || value[whoami] !== "read-write")
|
|
1419
|
-
throw externalFailure(
|
|
1420
|
-
"npm-write-permission-required",
|
|
1421
|
-
"current npm user has no exact read-write collaborator fact",
|
|
1422
|
-
"an own JSON property for the current username with value read-write",
|
|
1423
|
-
"Grant package write access through npm and retry.",
|
|
1424
|
-
4,
|
|
1425
|
-
);
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
function sha512Integrity(bytes: Uint8Array): string {
|
|
1429
|
-
return `sha512-${createHash("sha512").update(bytes).digest("base64")}`;
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
function repositoryNameFromReceipt(repository: unknown): string | null {
|
|
1433
|
-
const url = canonicalGitHubRepository(repository);
|
|
1434
|
-
return url?.replace("https://github.com/", "") ?? null;
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
async function exactRemoteArtifact(
|
|
1438
|
-
client: NpmClient,
|
|
1439
|
-
isolation: Isolation,
|
|
1440
|
-
accepted: AcceptedPublicationArtifact,
|
|
1441
|
-
packageName: string,
|
|
1442
|
-
metadata: JsonObject,
|
|
1443
|
-
): Promise<RegistryExactArtifact> {
|
|
1444
|
-
// Every reacceptance receives a new owned directory. A previous registry
|
|
1445
|
-
// download must never be mistaken for this attempt's single remote tgz.
|
|
1446
|
-
const download = mkdtempSync(path.join(isolation.root, "registry-download-"));
|
|
1447
|
-
const dist = isObject(metadata.dist) ? metadata.dist : undefined;
|
|
1448
|
-
const repository = isObject(metadata.repository)
|
|
1449
|
-
? metadata.repository
|
|
1450
|
-
: undefined;
|
|
1451
|
-
const expectedRepository = accepted.receipt.packedManifest.repository;
|
|
1452
|
-
const tags = strictJsonObject(
|
|
1453
|
-
await capturedNpm(client, isolation, [
|
|
1454
|
-
"view",
|
|
1455
|
-
packageName,
|
|
1456
|
-
"dist-tags",
|
|
1457
|
-
"--json",
|
|
1458
|
-
]),
|
|
1459
|
-
"npm-registry-schema-unsupported",
|
|
1460
|
-
);
|
|
1461
|
-
if (
|
|
1462
|
-
metadata.name !== packageName ||
|
|
1463
|
-
metadata.version !== "1.0.0" ||
|
|
1464
|
-
!isObject(expectedRepository) ||
|
|
1465
|
-
repository === undefined ||
|
|
1466
|
-
Object.keys(repository).length !== 3 ||
|
|
1467
|
-
repository.type !== expectedRepository.type ||
|
|
1468
|
-
repository.url !== expectedRepository.url ||
|
|
1469
|
-
repository.directory !== expectedRepository.directory ||
|
|
1470
|
-
dist?.integrity !== accepted.receipt.artifact.integrity ||
|
|
1471
|
-
tags.latest !== "1.0.0"
|
|
1472
|
-
)
|
|
1473
|
-
throw externalFailure(
|
|
1474
|
-
"npm-existing-version-conflict",
|
|
1475
|
-
"registry metadata differs from the accepted artifact",
|
|
1476
|
-
"matching repository, SRI, and latest 1.0.0",
|
|
1477
|
-
"Investigate the existing npm package outside this wizard.",
|
|
1478
|
-
4,
|
|
1479
|
-
);
|
|
1480
|
-
const result = await capturedNpm(client, isolation, [
|
|
1481
|
-
"pack",
|
|
1482
|
-
`${packageName}@1.0.0`,
|
|
1483
|
-
`--pack-destination=${download}`,
|
|
1484
|
-
]);
|
|
1485
|
-
if (result.status !== 0 || result.stderr !== "")
|
|
1486
|
-
throw externalFailure(
|
|
1487
|
-
"npm-remote-artifact-unavailable",
|
|
1488
|
-
"could not download a clean registry tarball",
|
|
1489
|
-
"one downloadable registry tarball",
|
|
1490
|
-
"Correct the registry failure and retry.",
|
|
1491
|
-
5,
|
|
1492
|
-
);
|
|
1493
|
-
const entries = readdirSync(download, { withFileTypes: true });
|
|
1494
|
-
const entry = entries[0];
|
|
1495
|
-
if (
|
|
1496
|
-
entries.length !== 1 ||
|
|
1497
|
-
entry === undefined ||
|
|
1498
|
-
!entry.isFile() ||
|
|
1499
|
-
entry.name !== accepted.receipt.artifact.file
|
|
1500
|
-
)
|
|
1501
|
-
throw externalFailure(
|
|
1502
|
-
"npm-remote-artifact-invalid",
|
|
1503
|
-
"download did not contain one regular tgz",
|
|
1504
|
-
"one registry tarball",
|
|
1505
|
-
"Investigate the registry package outside this wizard.",
|
|
1506
|
-
4,
|
|
1507
|
-
);
|
|
1508
|
-
const remotePath = path.join(download, entry.name);
|
|
1509
|
-
const remoteBytes = readFileSync(remotePath);
|
|
1510
|
-
const localBytes = readFileSync(accepted.tgz);
|
|
1511
|
-
if (
|
|
1512
|
-
remoteBytes.byteLength !== accepted.receipt.artifact.size ||
|
|
1513
|
-
sha512Integrity(remoteBytes) !== accepted.receipt.artifact.integrity ||
|
|
1514
|
-
!remoteBytes.equals(localBytes)
|
|
1515
|
-
)
|
|
1516
|
-
throw externalFailure(
|
|
1517
|
-
"npm-existing-version-conflict",
|
|
1518
|
-
"downloaded registry bytes differ from the accepted artifact",
|
|
1519
|
-
"the exact accepted npm tarball",
|
|
1520
|
-
"Investigate the existing npm package outside this wizard.",
|
|
1521
|
-
4,
|
|
1522
|
-
);
|
|
1523
|
-
return {
|
|
1524
|
-
tgz: remotePath,
|
|
1525
|
-
size: remoteBytes.byteLength,
|
|
1526
|
-
integrity: sha512Integrity(remoteBytes),
|
|
1527
|
-
};
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
function parseTrustObjectStream(raw: string): JsonObject[] {
|
|
1531
|
-
const isAsciiWhitespace = (character: string): boolean =>
|
|
1532
|
-
character === " " ||
|
|
1533
|
-
character === "\t" ||
|
|
1534
|
-
character === "\n" ||
|
|
1535
|
-
character === "\r" ||
|
|
1536
|
-
character === "\f";
|
|
1537
|
-
if (raw.split("").every(isAsciiWhitespace)) return [];
|
|
1538
|
-
const objects: JsonObject[] = [];
|
|
1539
|
-
let index = 0;
|
|
1540
|
-
while (index < raw.length) {
|
|
1541
|
-
if (raw[index] !== "{")
|
|
1542
|
-
throw externalFailure(
|
|
1543
|
-
"npm-trust-schema-unsupported",
|
|
1544
|
-
"trust JSON is not an object stream",
|
|
1545
|
-
"blank output or whitespace-separated top-level objects",
|
|
1546
|
-
"Update the locked npm adapter before retrying.",
|
|
1547
|
-
5,
|
|
1548
|
-
);
|
|
1549
|
-
const start = index;
|
|
1550
|
-
let depth = 0;
|
|
1551
|
-
let inString = false;
|
|
1552
|
-
let escaped = false;
|
|
1553
|
-
for (; index < raw.length; index += 1) {
|
|
1554
|
-
const character = raw[index];
|
|
1555
|
-
if (inString) {
|
|
1556
|
-
if (escaped) escaped = false;
|
|
1557
|
-
else if (character === "\\") escaped = true;
|
|
1558
|
-
else if (character === '"') inString = false;
|
|
1559
|
-
continue;
|
|
1560
|
-
}
|
|
1561
|
-
if (character === '"') inString = true;
|
|
1562
|
-
else if (character === "{" || character === "[") depth += 1;
|
|
1563
|
-
else if (character === "}" || character === "]") {
|
|
1564
|
-
depth -= 1;
|
|
1565
|
-
if (depth < 0) break;
|
|
1566
|
-
if (depth === 0) {
|
|
1567
|
-
index += 1;
|
|
1568
|
-
break;
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
if (depth !== 0 || inString || escaped)
|
|
1573
|
-
throw externalFailure(
|
|
1574
|
-
"npm-trust-schema-unsupported",
|
|
1575
|
-
"trust JSON object is incomplete",
|
|
1576
|
-
"complete JSON objects",
|
|
1577
|
-
"Update the locked npm adapter before retrying.",
|
|
1578
|
-
5,
|
|
1579
|
-
);
|
|
1580
|
-
try {
|
|
1581
|
-
const parsed: unknown = JSON.parse(raw.slice(start, index));
|
|
1582
|
-
if (!isObject(parsed)) throw new Error("not object");
|
|
1583
|
-
objects.push(parsed);
|
|
1584
|
-
} catch {
|
|
1585
|
-
throw externalFailure(
|
|
1586
|
-
"npm-trust-schema-unsupported",
|
|
1587
|
-
"trust JSON object is invalid",
|
|
1588
|
-
"valid JSON objects",
|
|
1589
|
-
"Update the locked npm adapter before retrying.",
|
|
1590
|
-
5,
|
|
1591
|
-
);
|
|
1592
|
-
}
|
|
1593
|
-
if (index === raw.length) break;
|
|
1594
|
-
const whitespaceStart = index;
|
|
1595
|
-
while (index < raw.length && isAsciiWhitespace(raw[index] ?? ""))
|
|
1596
|
-
index += 1;
|
|
1597
|
-
if (
|
|
1598
|
-
index === whitespaceStart ||
|
|
1599
|
-
(index === raw.length && whitespaceStart === index)
|
|
1600
|
-
)
|
|
1601
|
-
throw externalFailure(
|
|
1602
|
-
"npm-trust-schema-unsupported",
|
|
1603
|
-
"trust objects are not whitespace-separated",
|
|
1604
|
-
"ASCII whitespace between JSON objects",
|
|
1605
|
-
"Update the locked npm adapter before retrying.",
|
|
1606
|
-
5,
|
|
1607
|
-
);
|
|
1608
|
-
}
|
|
1609
|
-
return objects;
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
function normalizeTrust(
|
|
1613
|
-
record: JsonObject,
|
|
1614
|
-
expected: TrustExpectation,
|
|
1615
|
-
dryRun: boolean,
|
|
1616
|
-
): TrustRecord | null {
|
|
1617
|
-
if (typeof record !== "object" || record === null || Array.isArray(record))
|
|
1618
|
-
return null;
|
|
1619
|
-
const allowed = dryRun
|
|
1620
|
-
? new Set(["package", "type", "repository", "file", "permissions"])
|
|
1621
|
-
: new Set(["id", "type", "repository", "file", "permissions"]);
|
|
1622
|
-
if (
|
|
1623
|
-
Object.keys(record).some((key) => !allowed.has(key)) ||
|
|
1624
|
-
Object.hasOwn(record, "environment")
|
|
1625
|
-
)
|
|
1626
|
-
return null;
|
|
1627
|
-
const id = stringValue(record.id);
|
|
1628
|
-
if (
|
|
1629
|
-
(!dryRun && (id === undefined || id.length === 0)) ||
|
|
1630
|
-
(dryRun && record.package !== expected.packageName) ||
|
|
1631
|
-
record.type !== "github" ||
|
|
1632
|
-
record.repository !== expected.repository ||
|
|
1633
|
-
record.file !== "release.yml" ||
|
|
1634
|
-
!Array.isArray(record.permissions) ||
|
|
1635
|
-
record.permissions.length !== 1 ||
|
|
1636
|
-
record.permissions[0] !== "createPackage"
|
|
1637
|
-
)
|
|
1638
|
-
return null;
|
|
1639
|
-
return dryRun
|
|
1640
|
-
? {
|
|
1641
|
-
package: expected.packageName,
|
|
1642
|
-
type: "github",
|
|
1643
|
-
repository: expected.repository,
|
|
1644
|
-
file: "release.yml",
|
|
1645
|
-
environment: null,
|
|
1646
|
-
permissions: ["createPackage"],
|
|
1647
|
-
}
|
|
1648
|
-
: {
|
|
1649
|
-
id: id ?? "",
|
|
1650
|
-
type: "github",
|
|
1651
|
-
repository: expected.repository,
|
|
1652
|
-
file: "release.yml",
|
|
1653
|
-
environment: null,
|
|
1654
|
-
permissions: ["createPackage"],
|
|
1655
|
-
};
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
async function trustList(
|
|
1659
|
-
client: NpmClient,
|
|
1660
|
-
isolation: Isolation,
|
|
1661
|
-
expected: TrustExpectation,
|
|
1662
|
-
): Promise<TrustRecord[]> {
|
|
1663
|
-
const result = await capturedNpm(client, isolation, [
|
|
1664
|
-
"trust",
|
|
1665
|
-
"list",
|
|
1666
|
-
expected.packageName,
|
|
1667
|
-
"--json",
|
|
1668
|
-
]);
|
|
1669
|
-
if (result.status !== 0 || result.stderr !== "")
|
|
1670
|
-
throw externalFailure(
|
|
1671
|
-
"npm-trust-schema-unsupported",
|
|
1672
|
-
"trust list did not return clean JSON",
|
|
1673
|
-
"exit 0 with JSON only on stdout",
|
|
1674
|
-
"Correct the npm registry response and retry.",
|
|
1675
|
-
5,
|
|
1676
|
-
);
|
|
1677
|
-
const values = parseTrustObjectStream(result.stdout);
|
|
1678
|
-
const normalized = values.map((value) =>
|
|
1679
|
-
normalizeTrust(value, expected, false),
|
|
1680
|
-
);
|
|
1681
|
-
if (normalized.some((value) => value === null))
|
|
1682
|
-
throw externalFailure(
|
|
1683
|
-
"npm-trust-schema-unsupported",
|
|
1684
|
-
"trust list has an unsupported item shape",
|
|
1685
|
-
"the locked npm trust shape",
|
|
1686
|
-
"Update the locked npm adapter before retrying.",
|
|
1687
|
-
5,
|
|
1688
|
-
);
|
|
1689
|
-
return normalized.filter((value): value is TrustRecord => value !== null);
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
async function configureTrust(
|
|
1693
|
-
client: NpmClient,
|
|
1694
|
-
isolation: Isolation,
|
|
1695
|
-
expected: TrustExpectation,
|
|
1696
|
-
): Promise<void> {
|
|
1697
|
-
const existing = await trustList(client, isolation, expected);
|
|
1698
|
-
if (existing.length === 1) {
|
|
1699
|
-
const confirmed = await trustList(client, isolation, expected);
|
|
1700
|
-
if (confirmed.length === 1) return;
|
|
1701
|
-
throw externalFailure(
|
|
1702
|
-
"npm-trust-conflict",
|
|
1703
|
-
"trusted publisher changed during exact resume confirmation",
|
|
1704
|
-
"one exact trusted publisher relationship",
|
|
1705
|
-
"Resolve the npm trust configuration manually.",
|
|
1706
|
-
4,
|
|
1707
|
-
);
|
|
1708
|
-
}
|
|
1709
|
-
if (existing.length !== 0)
|
|
1710
|
-
throw externalFailure(
|
|
1711
|
-
"npm-trust-conflict",
|
|
1712
|
-
"a different or extra trusted publisher exists",
|
|
1713
|
-
"no trusted publisher or one exact relationship",
|
|
1714
|
-
"Resolve the npm trust configuration manually.",
|
|
1715
|
-
4,
|
|
1716
|
-
);
|
|
1717
|
-
const dryRun = await capturedNpm(client, isolation, [
|
|
1718
|
-
"trust",
|
|
1719
|
-
"github",
|
|
1720
|
-
expected.packageName,
|
|
1721
|
-
`--repository=${expected.repository}`,
|
|
1722
|
-
"--file=release.yml",
|
|
1723
|
-
"--allow-publish",
|
|
1724
|
-
"--dry-run",
|
|
1725
|
-
"--json",
|
|
1726
|
-
]);
|
|
1727
|
-
if (dryRun.status !== 0 || dryRun.stderr !== "")
|
|
1728
|
-
throw externalFailure(
|
|
1729
|
-
"npm-trust-schema-unsupported",
|
|
1730
|
-
"trust dry run did not return clean JSON",
|
|
1731
|
-
"one clean JSON object",
|
|
1732
|
-
"Correct the npm registry response and retry.",
|
|
1733
|
-
5,
|
|
1734
|
-
);
|
|
1735
|
-
const preview = parseTrustObjectStream(dryRun.stdout);
|
|
1736
|
-
if (
|
|
1737
|
-
preview.length !== 1 ||
|
|
1738
|
-
normalizeTrust(preview[0] ?? {}, expected, true) === null
|
|
1739
|
-
)
|
|
1740
|
-
throw externalFailure(
|
|
1741
|
-
"npm-trust-schema-unsupported",
|
|
1742
|
-
"trust dry run differs from the required direct publish relationship",
|
|
1743
|
-
"one exact GitHub release.yml createPackage object",
|
|
1744
|
-
"Correct the npm trust facts and retry.",
|
|
1745
|
-
4,
|
|
1746
|
-
);
|
|
1747
|
-
process.stdout.write("TRUST PREVIEW no Environment; no stage publish.\n");
|
|
1748
|
-
await readExactPhrase(
|
|
1749
|
-
`TRUST ${expected.packageName} GITHUB ${expected.repository} release.yml createPackage`,
|
|
1750
|
-
);
|
|
1751
|
-
throwIfSignalled();
|
|
1752
|
-
const raced = await trustList(client, isolation, expected);
|
|
1753
|
-
if (raced.length === 1) return;
|
|
1754
|
-
if (raced.length !== 0)
|
|
1755
|
-
throw externalFailure(
|
|
1756
|
-
"npm-trust-conflict",
|
|
1757
|
-
"trusted publisher changed before write",
|
|
1758
|
-
"an empty or exact trusted publisher list",
|
|
1759
|
-
"Resolve the npm trust configuration manually.",
|
|
1760
|
-
4,
|
|
1761
|
-
);
|
|
1762
|
-
const write = await interactiveNpm(client, isolation, "npm-trust-write", [
|
|
1763
|
-
"trust",
|
|
1764
|
-
"github",
|
|
1765
|
-
expected.packageName,
|
|
1766
|
-
`--repository=${expected.repository}`,
|
|
1767
|
-
"--file=release.yml",
|
|
1768
|
-
"--allow-publish",
|
|
1769
|
-
"--yes",
|
|
1770
|
-
]);
|
|
1771
|
-
throwIfSignalled();
|
|
1772
|
-
const readback = await trustList(client, isolation, expected);
|
|
1773
|
-
if (readback.length !== 1 || write.signal)
|
|
1774
|
-
throw externalFailure(
|
|
1775
|
-
"npm-trust-readback-failed",
|
|
1776
|
-
"trusted publisher write did not read back exactly",
|
|
1777
|
-
"one exact trusted publisher relationship",
|
|
1778
|
-
"Inspect npm trusted publishing outside this wizard.",
|
|
1779
|
-
4,
|
|
1780
|
-
);
|
|
1781
|
-
}
|
|
1782
|
-
|
|
1783
|
-
function ownedArtifactRoot(value: unknown): string {
|
|
1784
|
-
if (typeof value !== "string" || !path.isAbsolute(value))
|
|
1785
|
-
throw externalFailure(
|
|
1786
|
-
"artifact-unavailable",
|
|
1787
|
-
"accepted artifact root is unavailable",
|
|
1788
|
-
"the accepted Stage 4 artifact root",
|
|
1789
|
-
"Rerun setup from Stage 1.",
|
|
1790
|
-
5,
|
|
1791
|
-
);
|
|
1792
|
-
const parent = controlledTemporaryParent();
|
|
1793
|
-
let resolved: string;
|
|
1794
|
-
try {
|
|
1795
|
-
const entry = lstatSync(value);
|
|
1796
|
-
if (entry.isSymbolicLink() || !entry.isDirectory())
|
|
1797
|
-
throw new Error("not an owned directory");
|
|
1798
|
-
resolved = realpathSync(value);
|
|
1799
|
-
if (
|
|
1800
|
-
path.dirname(resolved) !== parent ||
|
|
1801
|
-
!/^npm-publication-setup-artifact\.[A-Za-z0-9]+$/u.test(
|
|
1802
|
-
path.basename(resolved),
|
|
1803
|
-
) ||
|
|
1804
|
-
lstatSync(resolved).isSymbolicLink()
|
|
1805
|
-
)
|
|
1806
|
-
throw new Error("outside owned artifact parent");
|
|
1807
|
-
} catch {
|
|
1808
|
-
throw externalFailure(
|
|
1809
|
-
"artifact-unavailable",
|
|
1810
|
-
"accepted artifact root is not an owned temporary artifact directory",
|
|
1811
|
-
"an exact non-symlink npm-publication-setup-artifact directory",
|
|
1812
|
-
"Rerun setup from Stage 1.",
|
|
1813
|
-
5,
|
|
1814
|
-
);
|
|
1815
|
-
}
|
|
1816
|
-
return resolved;
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
function removeOwnedDirectory(value: string): void {
|
|
1820
|
-
const entry = lstatSync(value);
|
|
1821
|
-
if (entry.isSymbolicLink() || !entry.isDirectory())
|
|
1822
|
-
throw new Error("owned path changed before cleanup");
|
|
1823
|
-
rmSync(value, { recursive: true, force: true });
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
type GithubAsset = {
|
|
1827
|
-
readonly id: number;
|
|
1828
|
-
readonly name: string;
|
|
1829
|
-
readonly size: number;
|
|
1830
|
-
readonly label: string | null;
|
|
1831
|
-
readonly state: "uploaded";
|
|
1832
|
-
};
|
|
1833
|
-
type GithubRelease = {
|
|
1834
|
-
readonly tag: string;
|
|
1835
|
-
readonly title: string;
|
|
1836
|
-
readonly body: string;
|
|
1837
|
-
readonly draft: boolean;
|
|
1838
|
-
readonly prerelease: boolean;
|
|
1839
|
-
readonly immutable: boolean;
|
|
1840
|
-
readonly publishedAt: string | null;
|
|
1841
|
-
readonly assets: readonly GithubAsset[];
|
|
1842
|
-
};
|
|
1843
|
-
type GithubState = "Fresh" | "ExactTagOnly" | "ExactDraft" | "ExactPublic";
|
|
1844
|
-
|
|
1845
|
-
function githubFailure(
|
|
1846
|
-
code: string,
|
|
1847
|
-
observed: unknown,
|
|
1848
|
-
expected: unknown,
|
|
1849
|
-
): SetupFailure {
|
|
1850
|
-
return externalFailure(
|
|
1851
|
-
code,
|
|
1852
|
-
observed,
|
|
1853
|
-
expected,
|
|
1854
|
-
"Inspect the GitHub repository outside this wizard and rerun setup.",
|
|
1855
|
-
4,
|
|
1856
|
-
);
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
async function capturedGh(arguments_: readonly string[]): Promise<NpmResult> {
|
|
1860
|
-
const environment: NodeJS.ProcessEnv = {
|
|
1861
|
-
GH_PROMPT_DISABLED: "1",
|
|
1862
|
-
PAGER: "cat",
|
|
1863
|
-
NO_COLOR: "1",
|
|
1864
|
-
};
|
|
1865
|
-
for (const key of ["PATH", "HOME", "XDG_CONFIG_HOME", "GH_CONFIG_DIR"])
|
|
1866
|
-
if (process.env[key] !== undefined) environment[key] = process.env[key];
|
|
1867
|
-
const result = await runChild({
|
|
1868
|
-
command: "gh",
|
|
1869
|
-
arguments:
|
|
1870
|
-
arguments_[0] === "api"
|
|
1871
|
-
? ["api", "--hostname", "github.com", ...arguments_.slice(1)]
|
|
1872
|
-
: arguments_,
|
|
1873
|
-
cwd: root,
|
|
1874
|
-
env: environment,
|
|
1875
|
-
captured: true,
|
|
1876
|
-
});
|
|
1877
|
-
throwIfSignalled();
|
|
1878
|
-
return result;
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1881
|
-
function ghJson(result: NpmResult, code: string): JsonObject {
|
|
1882
|
-
if (result.status !== 0 || result.stderr !== "")
|
|
1883
|
-
throw githubFailure(
|
|
1884
|
-
code,
|
|
1885
|
-
"GitHub did not return clean JSON",
|
|
1886
|
-
"one exact GitHub JSON response",
|
|
1887
|
-
);
|
|
1888
|
-
return strictJsonObject(result, code);
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
function githubAsset(value: unknown): GithubAsset | undefined {
|
|
1892
|
-
if (
|
|
1893
|
-
!isObject(value) ||
|
|
1894
|
-
typeof value.id !== "number" ||
|
|
1895
|
-
!Number.isSafeInteger(value.id) ||
|
|
1896
|
-
value.id <= 0 ||
|
|
1897
|
-
typeof value.name !== "string" ||
|
|
1898
|
-
typeof value.size !== "number" ||
|
|
1899
|
-
!Number.isSafeInteger(value.size) ||
|
|
1900
|
-
value.size < 0 ||
|
|
1901
|
-
(value.label !== null && typeof value.label !== "string") ||
|
|
1902
|
-
value.state !== "uploaded"
|
|
1903
|
-
)
|
|
1904
|
-
return undefined;
|
|
1905
|
-
return {
|
|
1906
|
-
id: value.id,
|
|
1907
|
-
name: value.name,
|
|
1908
|
-
size: value.size,
|
|
1909
|
-
label: value.label,
|
|
1910
|
-
state: "uploaded",
|
|
1911
|
-
};
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
|
-
function githubRelease(value: unknown): GithubRelease | undefined {
|
|
1915
|
-
if (
|
|
1916
|
-
!isObject(value) ||
|
|
1917
|
-
typeof value.tag_name !== "string" ||
|
|
1918
|
-
typeof value.name !== "string" ||
|
|
1919
|
-
typeof value.body !== "string" ||
|
|
1920
|
-
typeof value.draft !== "boolean" ||
|
|
1921
|
-
typeof value.prerelease !== "boolean" ||
|
|
1922
|
-
typeof value.immutable !== "boolean" ||
|
|
1923
|
-
(value.published_at !== null && typeof value.published_at !== "string") ||
|
|
1924
|
-
!Array.isArray(value.assets)
|
|
1925
|
-
)
|
|
1926
|
-
return undefined;
|
|
1927
|
-
const assets = value.assets.map(githubAsset);
|
|
1928
|
-
if (!assets.every((asset): asset is GithubAsset => asset !== undefined))
|
|
1929
|
-
return undefined;
|
|
1930
|
-
return {
|
|
1931
|
-
tag: value.tag_name,
|
|
1932
|
-
title: value.name,
|
|
1933
|
-
body: value.body,
|
|
1934
|
-
draft: value.draft,
|
|
1935
|
-
prerelease: value.prerelease,
|
|
1936
|
-
immutable: value.immutable,
|
|
1937
|
-
publishedAt: value.published_at,
|
|
1938
|
-
assets,
|
|
1939
|
-
};
|
|
1940
|
-
}
|
|
1941
|
-
|
|
1942
|
-
function isGithubTimestamp(value: string | null): value is string {
|
|
1943
|
-
if (
|
|
1944
|
-
value === null ||
|
|
1945
|
-
!/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/u.test(value)
|
|
1946
|
-
)
|
|
1947
|
-
return false;
|
|
1948
|
-
const [, year, month, day, hour, minute, second] =
|
|
1949
|
-
/^(.{4})-(.{2})-(.{2})T(.{2}):(.{2}):(.{2})Z$/u.exec(value)!;
|
|
1950
|
-
const instant = new Date(
|
|
1951
|
-
Date.UTC(
|
|
1952
|
-
Number(year),
|
|
1953
|
-
Number(month) - 1,
|
|
1954
|
-
Number(day),
|
|
1955
|
-
Number(hour),
|
|
1956
|
-
Number(minute),
|
|
1957
|
-
Number(second),
|
|
1958
|
-
),
|
|
1959
|
-
);
|
|
1960
|
-
return (
|
|
1961
|
-
!Number.isNaN(instant.valueOf()) &&
|
|
1962
|
-
instant.toISOString() === `${value.slice(0, -1)}.000Z`
|
|
1963
|
-
);
|
|
1964
|
-
}
|
|
1965
|
-
|
|
1966
|
-
function isGithubObjectSha(value: unknown): value is string {
|
|
1967
|
-
return typeof value === "string" && /^[0-9a-f]{40}$/u.test(value);
|
|
1968
|
-
}
|
|
1969
|
-
|
|
1970
|
-
async function githubImmutable(
|
|
1971
|
-
repository: string,
|
|
1972
|
-
): Promise<"enabled" | "disabled"> {
|
|
1973
|
-
const result = await capturedGh([
|
|
1974
|
-
"api",
|
|
1975
|
-
"--include",
|
|
1976
|
-
"--method",
|
|
1977
|
-
"GET",
|
|
1978
|
-
"-H",
|
|
1979
|
-
"Accept: application/vnd.github+json",
|
|
1980
|
-
"-H",
|
|
1981
|
-
"X-GitHub-Api-Version: 2026-03-10",
|
|
1982
|
-
`repos/${repository}/immutable-releases`,
|
|
1983
|
-
]);
|
|
1984
|
-
const included =
|
|
1985
|
-
/^HTTP\/\d(?:\.\d)? (\d{3})[^\r\n]*\r?\n(?:[^\r\n]*\r?\n)*\r?\n([\s\S]*)$/u.exec(
|
|
1986
|
-
result.stdout,
|
|
1987
|
-
);
|
|
1988
|
-
const status = included?.[1];
|
|
1989
|
-
const body = included?.[2] ?? "";
|
|
1990
|
-
if (result.status !== 0 || status !== "200") {
|
|
1991
|
-
if (status === "404") return "disabled";
|
|
1992
|
-
if (status === "401" || status === "403")
|
|
1993
|
-
throw githubFailure(
|
|
1994
|
-
"github-administration-permission-required",
|
|
1995
|
-
"immutable releases endpoint denied administration access",
|
|
1996
|
-
"repository administration permission",
|
|
1997
|
-
);
|
|
1998
|
-
if (status === "409")
|
|
1999
|
-
throw githubFailure(
|
|
2000
|
-
"github-immutable-setting-conflict",
|
|
2001
|
-
"immutable releases endpoint reported a conflict",
|
|
2002
|
-
"one stable immutable releases setting",
|
|
2003
|
-
);
|
|
2004
|
-
throw githubFailure(
|
|
2005
|
-
"github-immutable-state-unknown",
|
|
2006
|
-
"immutable releases endpoint was unavailable",
|
|
2007
|
-
"an exact enabled or disabled immutable-releases response",
|
|
2008
|
-
);
|
|
2009
|
-
}
|
|
2010
|
-
if (result.stderr !== "")
|
|
2011
|
-
throw githubFailure(
|
|
2012
|
-
"github-immutable-state-unknown",
|
|
2013
|
-
"immutable releases response had stderr",
|
|
2014
|
-
"one clean HTTP 200 immutable releases response",
|
|
2015
|
-
);
|
|
2016
|
-
let value: unknown;
|
|
2017
|
-
try {
|
|
2018
|
-
value = JSON.parse(body ?? "");
|
|
2019
|
-
} catch {
|
|
2020
|
-
throw githubFailure(
|
|
2021
|
-
"github-immutable-state-unknown",
|
|
2022
|
-
"immutable releases response was not JSON",
|
|
2023
|
-
"{ enabled: true, enforced_by_owner: boolean }",
|
|
2024
|
-
);
|
|
2025
|
-
}
|
|
2026
|
-
if (
|
|
2027
|
-
!isObject(value) ||
|
|
2028
|
-
value.enabled !== true ||
|
|
2029
|
-
typeof value.enforced_by_owner !== "boolean"
|
|
2030
|
-
)
|
|
2031
|
-
throw githubFailure(
|
|
2032
|
-
"github-immutable-state-unknown",
|
|
2033
|
-
"immutable releases response was not exact",
|
|
2034
|
-
"{ enabled: true, enforced_by_owner: boolean }",
|
|
2035
|
-
);
|
|
2036
|
-
return "enabled";
|
|
2037
|
-
}
|
|
2038
|
-
|
|
2039
|
-
async function ensureGithubPreimage(
|
|
2040
|
-
repository: string,
|
|
2041
|
-
sha: string,
|
|
2042
|
-
expectedBranch: string,
|
|
2043
|
-
): Promise<void> {
|
|
2044
|
-
const status = await capturedGh([
|
|
2045
|
-
"auth",
|
|
2046
|
-
"status",
|
|
2047
|
-
"--active",
|
|
2048
|
-
"--hostname",
|
|
2049
|
-
"github.com",
|
|
2050
|
-
]);
|
|
2051
|
-
if (status.status !== 0)
|
|
2052
|
-
throw githubFailure(
|
|
2053
|
-
"github-session-required",
|
|
2054
|
-
"no active github.com gh session",
|
|
2055
|
-
"an authenticated github.com gh session",
|
|
2056
|
-
);
|
|
2057
|
-
const user = ghJson(
|
|
2058
|
-
await capturedGh(["api", "user"]),
|
|
2059
|
-
"github-identity-unknown",
|
|
2060
|
-
);
|
|
2061
|
-
if (typeof user.login !== "string")
|
|
2062
|
-
throw githubFailure(
|
|
2063
|
-
"github-identity-unknown",
|
|
2064
|
-
"GitHub user response was not exact",
|
|
2065
|
-
"one authenticated GitHub login",
|
|
2066
|
-
);
|
|
2067
|
-
const viewed = ghJson(
|
|
2068
|
-
await capturedGh([
|
|
2069
|
-
"repo",
|
|
2070
|
-
"view",
|
|
2071
|
-
repository,
|
|
2072
|
-
"--json",
|
|
2073
|
-
"nameWithOwner,visibility,defaultBranchRef,viewerCanAdminister,viewerPermission",
|
|
2074
|
-
]),
|
|
2075
|
-
"github-repository-unknown",
|
|
2076
|
-
);
|
|
2077
|
-
if (
|
|
2078
|
-
viewed.nameWithOwner !== repository ||
|
|
2079
|
-
viewed.visibility !== "PUBLIC" ||
|
|
2080
|
-
viewed.viewerCanAdminister !== true ||
|
|
2081
|
-
viewed.viewerPermission !== "ADMIN" ||
|
|
2082
|
-
!isObject(viewed.defaultBranchRef) ||
|
|
2083
|
-
typeof viewed.defaultBranchRef.name !== "string" ||
|
|
2084
|
-
typeof viewed.defaultBranchRef.target !== "object"
|
|
2085
|
-
)
|
|
2086
|
-
throw githubFailure(
|
|
2087
|
-
"github-repository-conflict",
|
|
2088
|
-
"GitHub repository identity or visibility differs",
|
|
2089
|
-
`public repository ${repository}`,
|
|
2090
|
-
);
|
|
2091
|
-
const branch = viewed.defaultBranchRef.name;
|
|
2092
|
-
if (branch !== expectedBranch)
|
|
2093
|
-
throw githubFailure(
|
|
2094
|
-
"github-branch-conflict",
|
|
2095
|
-
`GitHub default branch ${branch}`,
|
|
2096
|
-
`local and origin default branch ${expectedBranch}`,
|
|
2097
|
-
);
|
|
2098
|
-
const apiRepository = ghJson(
|
|
2099
|
-
await capturedGh(["api", `repos/${repository}`]),
|
|
2100
|
-
"github-repository-unknown",
|
|
2101
|
-
);
|
|
2102
|
-
if (
|
|
2103
|
-
apiRepository.full_name !== repository ||
|
|
2104
|
-
apiRepository.visibility !== "public" ||
|
|
2105
|
-
apiRepository.default_branch !== expectedBranch ||
|
|
2106
|
-
!isObject(apiRepository.permissions) ||
|
|
2107
|
-
apiRepository.permissions.admin !== true ||
|
|
2108
|
-
apiRepository.permissions.push !== true
|
|
2109
|
-
)
|
|
2110
|
-
throw githubFailure(
|
|
2111
|
-
"github-repository-conflict",
|
|
2112
|
-
"GitHub repository permissions or default branch differ",
|
|
2113
|
-
`public repository ${repository} with administration and contents write facts`,
|
|
2114
|
-
);
|
|
2115
|
-
const ref = ghJson(
|
|
2116
|
-
await capturedGh([
|
|
2117
|
-
"api",
|
|
2118
|
-
`repos/${repository}/git/ref/heads/${expectedBranch}`,
|
|
2119
|
-
]),
|
|
2120
|
-
"github-branch-unknown",
|
|
2121
|
-
);
|
|
2122
|
-
if (
|
|
2123
|
-
!isObject(ref.object) ||
|
|
2124
|
-
ref.object.type !== "commit" ||
|
|
2125
|
-
ref.object.sha !== sha
|
|
2126
|
-
)
|
|
2127
|
-
throw githubFailure(
|
|
2128
|
-
"github-branch-conflict",
|
|
2129
|
-
"GitHub default branch commit differs",
|
|
2130
|
-
`default branch commit ${sha}`,
|
|
2131
|
-
);
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
async function githubTag(
|
|
2135
|
-
repository: string,
|
|
2136
|
-
tag: string,
|
|
2137
|
-
sha: string,
|
|
2138
|
-
annotation: string,
|
|
2139
|
-
): Promise<"absent" | "exact"> {
|
|
2140
|
-
const ref = await capturedGh([
|
|
2141
|
-
"api",
|
|
2142
|
-
"--include",
|
|
2143
|
-
`repos/${repository}/git/ref/tags/${tag}`,
|
|
2144
|
-
]);
|
|
2145
|
-
if (ref.status !== 0) {
|
|
2146
|
-
if (/^HTTP\/\d(?:\.\d)? 404(?:\s|$)/mu.test(ref.stdout)) return "absent";
|
|
2147
|
-
throw githubFailure(
|
|
2148
|
-
"github-release-state-unknown",
|
|
2149
|
-
"tag reference could not be classified",
|
|
2150
|
-
"an absent or exact annotated tag",
|
|
2151
|
-
);
|
|
2152
|
-
}
|
|
2153
|
-
const body = /\r?\n\r?\n([\s\S]*)$/u.exec(ref.stdout)?.[1];
|
|
2154
|
-
let parsed: unknown;
|
|
2155
|
-
try {
|
|
2156
|
-
parsed = JSON.parse(body ?? "");
|
|
2157
|
-
} catch {
|
|
2158
|
-
throw githubFailure(
|
|
2159
|
-
"github-release-state-unknown",
|
|
2160
|
-
"tag reference was not JSON",
|
|
2161
|
-
"an exact annotated tag",
|
|
2162
|
-
);
|
|
2163
|
-
}
|
|
2164
|
-
if (
|
|
2165
|
-
!isObject(parsed) ||
|
|
2166
|
-
!isObject(parsed.object) ||
|
|
2167
|
-
parsed.object.type !== "tag" ||
|
|
2168
|
-
!isGithubObjectSha(parsed.object.sha)
|
|
2169
|
-
)
|
|
2170
|
-
throw githubFailure(
|
|
2171
|
-
"github-release-conflict",
|
|
2172
|
-
"tag is not annotated",
|
|
2173
|
-
"an exact annotated tag",
|
|
2174
|
-
);
|
|
2175
|
-
const object = ghJson(
|
|
2176
|
-
await capturedGh([
|
|
2177
|
-
"api",
|
|
2178
|
-
`repos/${repository}/git/tags/${parsed.object.sha}`,
|
|
2179
|
-
]),
|
|
2180
|
-
"github-release-state-unknown",
|
|
2181
|
-
);
|
|
2182
|
-
if (
|
|
2183
|
-
object.tag !== tag ||
|
|
2184
|
-
object.message !== annotation ||
|
|
2185
|
-
!isObject(object.object) ||
|
|
2186
|
-
object.object.type !== "commit" ||
|
|
2187
|
-
object.object.sha !== sha
|
|
2188
|
-
)
|
|
2189
|
-
throw githubFailure(
|
|
2190
|
-
"github-release-conflict",
|
|
2191
|
-
"tag differs from the accepted artifact preimage",
|
|
2192
|
-
"the exact annotated first-release tag",
|
|
2193
|
-
);
|
|
2194
|
-
return "exact";
|
|
2195
|
-
}
|
|
2196
|
-
|
|
2197
|
-
async function githubReleaseForTag(
|
|
2198
|
-
repository: string,
|
|
2199
|
-
tag: string,
|
|
2200
|
-
): Promise<GithubRelease | undefined> {
|
|
2201
|
-
const result = await capturedGh([
|
|
2202
|
-
"api",
|
|
2203
|
-
"--paginate",
|
|
2204
|
-
"--slurp",
|
|
2205
|
-
`repos/${repository}/releases?per_page=100`,
|
|
2206
|
-
]);
|
|
2207
|
-
if (result.status !== 0 || result.stderr !== "")
|
|
2208
|
-
throw githubFailure(
|
|
2209
|
-
"github-release-state-unknown",
|
|
2210
|
-
"releases could not be listed",
|
|
2211
|
-
"one complete release listing",
|
|
2212
|
-
);
|
|
2213
|
-
let pages: unknown;
|
|
2214
|
-
try {
|
|
2215
|
-
pages = JSON.parse(result.stdout);
|
|
2216
|
-
} catch {
|
|
2217
|
-
throw githubFailure(
|
|
2218
|
-
"github-release-state-unknown",
|
|
2219
|
-
"release listing was not JSON",
|
|
2220
|
-
"one complete release listing",
|
|
2221
|
-
);
|
|
2222
|
-
}
|
|
2223
|
-
if (!Array.isArray(pages) || pages.some((page) => !Array.isArray(page)))
|
|
2224
|
-
throw githubFailure(
|
|
2225
|
-
"github-release-state-unknown",
|
|
2226
|
-
"release listing had an unsupported shape",
|
|
2227
|
-
"one complete release listing",
|
|
2228
|
-
);
|
|
2229
|
-
const rawMatches = pages
|
|
2230
|
-
.flat()
|
|
2231
|
-
.filter(
|
|
2232
|
-
(item): item is JsonObject => isObject(item) && item.tag_name === tag,
|
|
2233
|
-
);
|
|
2234
|
-
if (rawMatches.length > 1) {
|
|
2235
|
-
if (rawMatches.some((release) => release.draft === false))
|
|
2236
|
-
throw githubFailure(
|
|
2237
|
-
"github-release-incident-required",
|
|
2238
|
-
"multiple releases include a public target-tag release",
|
|
2239
|
-
"one complete exact public release",
|
|
2240
|
-
);
|
|
2241
|
-
throw githubFailure(
|
|
2242
|
-
"github-release-state-unknown",
|
|
2243
|
-
"release state is ambiguous",
|
|
2244
|
-
"at most one exact first release",
|
|
2245
|
-
);
|
|
2246
|
-
}
|
|
2247
|
-
const raw = rawMatches[0];
|
|
2248
|
-
const release = raw === undefined ? undefined : githubRelease(raw);
|
|
2249
|
-
if (release === undefined && raw !== undefined) {
|
|
2250
|
-
if (isObject(raw) && raw.draft === false)
|
|
2251
|
-
throw githubFailure(
|
|
2252
|
-
"github-release-incident-required",
|
|
2253
|
-
"a public release did not return exact immutable release facts",
|
|
2254
|
-
"a complete exact public release",
|
|
2255
|
-
);
|
|
2256
|
-
throw githubFailure(
|
|
2257
|
-
"github-release-conflict",
|
|
2258
|
-
"release state is not an exact draft release",
|
|
2259
|
-
"one exact first release",
|
|
2260
|
-
);
|
|
2261
|
-
}
|
|
2262
|
-
return release;
|
|
2263
|
-
}
|
|
2264
|
-
|
|
2265
|
-
async function githubWriteFailure(
|
|
2266
|
-
repository: string,
|
|
2267
|
-
tag: string,
|
|
2268
|
-
sha: string,
|
|
2269
|
-
annotation: string,
|
|
2270
|
-
accepted: AcceptedPublicationArtifact,
|
|
2271
|
-
downloads: string,
|
|
2272
|
-
observed: unknown,
|
|
2273
|
-
expected: unknown,
|
|
2274
|
-
): Promise<never> {
|
|
2275
|
-
// A failed or indeterminate write gets exactly one bounded, read-only target
|
|
2276
|
-
// diagnosis. It is evidence for a human; it never becomes a repair loop.
|
|
2277
|
-
const diagnosis: string[] = [];
|
|
2278
|
-
let remoteImmutable: "enabled" | "disabled" | "unknown" = "unknown";
|
|
2279
|
-
try {
|
|
2280
|
-
remoteImmutable = await githubImmutable(repository);
|
|
2281
|
-
diagnosis.push(`immutable=${remoteImmutable}`);
|
|
2282
|
-
} catch {
|
|
2283
|
-
diagnosis.push("immutable=unknown");
|
|
2284
|
-
}
|
|
2285
|
-
let remoteTag: "absent" | "exact" | undefined;
|
|
2286
|
-
let tagProblem: string | undefined;
|
|
2287
|
-
try {
|
|
2288
|
-
remoteTag = await githubTag(repository, tag, sha, annotation);
|
|
2289
|
-
} catch (error) {
|
|
2290
|
-
tagProblem = error instanceof SetupFailure ? error.code : "unknown";
|
|
2291
|
-
}
|
|
2292
|
-
let release: GithubRelease | undefined;
|
|
2293
|
-
let releaseProblem: string | undefined;
|
|
2294
|
-
try {
|
|
2295
|
-
release = await githubReleaseForTag(repository, tag);
|
|
2296
|
-
} catch (error) {
|
|
2297
|
-
releaseProblem = error instanceof SetupFailure ? error.code : "unknown";
|
|
2298
|
-
}
|
|
2299
|
-
const publicObserved =
|
|
2300
|
-
release?.draft === false ||
|
|
2301
|
-
releaseProblem === "github-release-incident-required";
|
|
2302
|
-
if (publicObserved) {
|
|
2303
|
-
// Public is irreversible. Keep reading bounded proof facts for the
|
|
2304
|
-
// diagnosis, but never let a healthy-looking readback downgrade it.
|
|
2305
|
-
let publicFact = "release-fact-invalid";
|
|
2306
|
-
if (release !== undefined) {
|
|
2307
|
-
try {
|
|
2308
|
-
await assertGithubRelease(
|
|
2309
|
-
repository,
|
|
2310
|
-
release,
|
|
2311
|
-
accepted,
|
|
2312
|
-
tag,
|
|
2313
|
-
false,
|
|
2314
|
-
downloads,
|
|
2315
|
-
);
|
|
2316
|
-
if (remoteImmutable !== "enabled")
|
|
2317
|
-
publicFact = `immutable-${remoteImmutable}`;
|
|
2318
|
-
else if (!release.immutable) publicFact = "nonimmutable";
|
|
2319
|
-
else if (!isGithubTimestamp(release.publishedAt))
|
|
2320
|
-
publicFact = "published-fact-invalid";
|
|
2321
|
-
else {
|
|
2322
|
-
publicFact = "exact-readback";
|
|
2323
|
-
for (const arguments_ of [
|
|
2324
|
-
["release", "verify", tag, "--repo", repository],
|
|
2325
|
-
[
|
|
2326
|
-
"release",
|
|
2327
|
-
"verify-asset",
|
|
2328
|
-
tag,
|
|
2329
|
-
accepted.tgz,
|
|
2330
|
-
"--repo",
|
|
2331
|
-
repository,
|
|
2332
|
-
],
|
|
2333
|
-
[
|
|
2334
|
-
"release",
|
|
2335
|
-
"verify-asset",
|
|
2336
|
-
tag,
|
|
2337
|
-
accepted.checksum,
|
|
2338
|
-
"--repo",
|
|
2339
|
-
repository,
|
|
2340
|
-
],
|
|
2341
|
-
] as const)
|
|
2342
|
-
if ((await capturedGh(arguments_)).status !== 0) {
|
|
2343
|
-
publicFact = "attestation-invalid";
|
|
2344
|
-
break;
|
|
2345
|
-
}
|
|
2346
|
-
}
|
|
2347
|
-
} catch {
|
|
2348
|
-
publicFact = "release-fact-invalid";
|
|
2349
|
-
}
|
|
2350
|
-
}
|
|
2351
|
-
if (tagProblem !== undefined) diagnosis.push(`tag=${tagProblem}`);
|
|
2352
|
-
if (releaseProblem !== undefined)
|
|
2353
|
-
diagnosis.push(`release=${releaseProblem}`);
|
|
2354
|
-
diagnosis.push(`state=PublicIncident:${publicFact}`);
|
|
2355
|
-
} else if (tagProblem === undefined && releaseProblem === undefined) {
|
|
2356
|
-
if (remoteTag === "absent" && release === undefined)
|
|
2357
|
-
diagnosis.push("state=Fresh");
|
|
2358
|
-
else if (remoteTag === "exact" && release === undefined)
|
|
2359
|
-
diagnosis.push("state=ExactTagOnly");
|
|
2360
|
-
else if (remoteTag === "exact" && release?.draft) {
|
|
2361
|
-
try {
|
|
2362
|
-
await assertGithubRelease(
|
|
2363
|
-
repository,
|
|
2364
|
-
release,
|
|
2365
|
-
accepted,
|
|
2366
|
-
tag,
|
|
2367
|
-
true,
|
|
2368
|
-
downloads,
|
|
2369
|
-
);
|
|
2370
|
-
diagnosis.push("state=ExactDraft");
|
|
2371
|
-
} catch (error) {
|
|
2372
|
-
const code = error instanceof SetupFailure ? error.code : "unknown";
|
|
2373
|
-
const state = [
|
|
2374
|
-
"github-release-conflict",
|
|
2375
|
-
"github-release-asset-conflict",
|
|
2376
|
-
].includes(code)
|
|
2377
|
-
? "Conflict"
|
|
2378
|
-
: "Unknown";
|
|
2379
|
-
diagnosis.push(`state=${state}:${code}`);
|
|
2380
|
-
}
|
|
2381
|
-
} else diagnosis.push("state=Conflict");
|
|
2382
|
-
} else {
|
|
2383
|
-
const problems = [tagProblem, releaseProblem].filter(
|
|
2384
|
-
(problem): problem is string => problem !== undefined,
|
|
2385
|
-
);
|
|
2386
|
-
const state = problems.every((problem) =>
|
|
2387
|
-
[
|
|
2388
|
-
"github-release-conflict",
|
|
2389
|
-
"github-release-asset-conflict",
|
|
2390
|
-
"github-immutable-setting-conflict",
|
|
2391
|
-
].includes(problem),
|
|
2392
|
-
)
|
|
2393
|
-
? "Conflict"
|
|
2394
|
-
: "Unknown";
|
|
2395
|
-
diagnosis.push(`state=${state}:${problems.join("+")}`);
|
|
2396
|
-
}
|
|
2397
|
-
throw githubFailure(
|
|
2398
|
-
"github-release-write-failed",
|
|
2399
|
-
`${String(observed)}; read-only diagnosis: ${diagnosis.join(", ")}`,
|
|
2400
|
-
expected,
|
|
2401
|
-
);
|
|
2402
|
-
}
|
|
2403
|
-
|
|
2404
|
-
async function assertGithubRelease(
|
|
2405
|
-
repository: string,
|
|
2406
|
-
release: GithubRelease,
|
|
2407
|
-
accepted: AcceptedPublicationArtifact,
|
|
2408
|
-
tag: string,
|
|
2409
|
-
draft: boolean,
|
|
2410
|
-
downloads: string,
|
|
2411
|
-
): Promise<void> {
|
|
2412
|
-
const checksum = readFileSync(accepted.checksum);
|
|
2413
|
-
const expected = new Map([
|
|
2414
|
-
[path.basename(accepted.tgz), accepted.receipt.artifact.size],
|
|
2415
|
-
["SHA512SUMS", checksum.byteLength],
|
|
2416
|
-
]);
|
|
2417
|
-
if (
|
|
2418
|
-
release.tag !== tag ||
|
|
2419
|
-
release.title !== tag ||
|
|
2420
|
-
release.body !== accepted.receipt.publication.releaseNotes ||
|
|
2421
|
-
release.draft !== draft ||
|
|
2422
|
-
release.prerelease ||
|
|
2423
|
-
release.assets.length !== 2 ||
|
|
2424
|
-
release.assets.some(
|
|
2425
|
-
(asset) =>
|
|
2426
|
-
expected.get(asset.name) !== asset.size ||
|
|
2427
|
-
asset.label !== null ||
|
|
2428
|
-
asset.state !== "uploaded" ||
|
|
2429
|
-
release.assets.filter((candidate) => candidate.name === asset.name)
|
|
2430
|
-
.length !== 1,
|
|
2431
|
-
)
|
|
2432
|
-
)
|
|
2433
|
-
throw githubFailure(
|
|
2434
|
-
"github-release-conflict",
|
|
2435
|
-
"release identity or assets differ",
|
|
2436
|
-
"the exact first-release draft",
|
|
2437
|
-
);
|
|
2438
|
-
for (const asset of release.assets) {
|
|
2439
|
-
const destination = path.join(downloads, `asset-${asset.id}`);
|
|
2440
|
-
const result = await capturedGh([
|
|
2441
|
-
"api",
|
|
2442
|
-
"--method",
|
|
2443
|
-
"GET",
|
|
2444
|
-
"-H",
|
|
2445
|
-
"Accept: application/octet-stream",
|
|
2446
|
-
`repos/${repository}/releases/assets/${asset.id}`,
|
|
2447
|
-
`--output=${destination}`,
|
|
2448
|
-
]);
|
|
2449
|
-
if (result.status !== 0)
|
|
2450
|
-
throw githubFailure(
|
|
2451
|
-
"github-release-asset-conflict",
|
|
2452
|
-
"release asset could not be downloaded",
|
|
2453
|
-
"exact release asset bytes",
|
|
2454
|
-
);
|
|
2455
|
-
const bytes = readFileSync(destination);
|
|
2456
|
-
const local =
|
|
2457
|
-
asset.name === "SHA512SUMS" ? checksum : readFileSync(accepted.tgz);
|
|
2458
|
-
if (!bytes.equals(local))
|
|
2459
|
-
throw githubFailure(
|
|
2460
|
-
"github-release-asset-conflict",
|
|
2461
|
-
"release asset bytes differ",
|
|
2462
|
-
"the accepted artifact bytes",
|
|
2463
|
-
);
|
|
2464
|
-
rmSync(destination, { force: true });
|
|
2465
|
-
}
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
|
-
async function runGithubFirstRelease(options: {
|
|
2469
|
-
readonly isolation: Isolation;
|
|
2470
|
-
readonly client: NpmClient;
|
|
2471
|
-
readonly accepted: AcceptedPublicationArtifact;
|
|
2472
|
-
readonly repository: string;
|
|
2473
|
-
readonly sha: string;
|
|
2474
|
-
readonly branch: string;
|
|
2475
|
-
}): Promise<void> {
|
|
2476
|
-
const { isolation, client, accepted, repository, sha, branch } = options;
|
|
2477
|
-
// Stage 8 deliberately receives a new registry download, even after Stage 6
|
|
2478
|
-
// already proved publication. ExactPublic therefore never verifies a stale
|
|
2479
|
-
// handoff tarball.
|
|
2480
|
-
const initialView = await classifyVersion(
|
|
2481
|
-
client,
|
|
2482
|
-
isolation,
|
|
2483
|
-
accepted.receipt.publication.packageName,
|
|
2484
|
-
);
|
|
2485
|
-
if (initialView.kind !== "present")
|
|
2486
|
-
throw githubFailure(
|
|
2487
|
-
"github-preimage-changed",
|
|
2488
|
-
"registry publication is no longer the accepted exact version",
|
|
2489
|
-
"the exact published registry artifact",
|
|
2490
|
-
);
|
|
2491
|
-
const initialRegistryArtifact = await exactRemoteArtifact(
|
|
2492
|
-
client,
|
|
2493
|
-
isolation,
|
|
2494
|
-
accepted,
|
|
2495
|
-
accepted.receipt.publication.packageName,
|
|
2496
|
-
initialView.value,
|
|
2497
|
-
);
|
|
2498
|
-
const initialExactArtifact: AcceptedPublicationArtifact = {
|
|
2499
|
-
...accepted,
|
|
2500
|
-
tgz: initialRegistryArtifact.tgz,
|
|
2501
|
-
};
|
|
2502
|
-
const tag = "v1.0.0";
|
|
2503
|
-
const annotation = `npm artifact SHA-512: ${accepted.sha512}`;
|
|
2504
|
-
await ensureGithubPreimage(repository, sha, branch);
|
|
2505
|
-
const initialImmutable = await githubImmutable(repository);
|
|
2506
|
-
let immutable = initialImmutable;
|
|
2507
|
-
const tagState = await githubTag(repository, tag, sha, annotation);
|
|
2508
|
-
let release = await githubReleaseForTag(repository, tag);
|
|
2509
|
-
let state: GithubState;
|
|
2510
|
-
if (tagState === "absent" && release === undefined) state = "Fresh";
|
|
2511
|
-
else if (tagState === "exact" && release === undefined)
|
|
2512
|
-
state = "ExactTagOnly";
|
|
2513
|
-
else if (tagState === "exact" && release !== undefined && release.draft)
|
|
2514
|
-
state = "ExactDraft";
|
|
2515
|
-
else if (
|
|
2516
|
-
tagState === "exact" &&
|
|
2517
|
-
release !== undefined &&
|
|
2518
|
-
!release.draft &&
|
|
2519
|
-
release.immutable &&
|
|
2520
|
-
isGithubTimestamp(release.publishedAt)
|
|
2521
|
-
)
|
|
2522
|
-
state = "ExactPublic";
|
|
2523
|
-
else
|
|
2524
|
-
throw githubFailure(
|
|
2525
|
-
"github-release-conflict",
|
|
2526
|
-
"remote tag and release state is not an exact resumable state",
|
|
2527
|
-
"Fresh, ExactTagOnly, ExactDraft, or ExactPublic",
|
|
2528
|
-
);
|
|
2529
|
-
const downloads = mkdtempSync(
|
|
2530
|
-
path.join(isolation.root, "github-release-assets-"),
|
|
2531
|
-
);
|
|
2532
|
-
if (state === "ExactPublic") {
|
|
2533
|
-
if (immutable !== "enabled")
|
|
2534
|
-
throw githubFailure(
|
|
2535
|
-
"github-immutable-state-unknown",
|
|
2536
|
-
"immutable releases is not enabled",
|
|
2537
|
-
"enabled immutable releases",
|
|
2538
|
-
);
|
|
2539
|
-
await assertGithubRelease(
|
|
2540
|
-
repository,
|
|
2541
|
-
release!,
|
|
2542
|
-
initialExactArtifact,
|
|
2543
|
-
tag,
|
|
2544
|
-
false,
|
|
2545
|
-
downloads,
|
|
2546
|
-
);
|
|
2547
|
-
for (const arguments_ of [
|
|
2548
|
-
["release", "verify", tag, "--repo", repository],
|
|
2549
|
-
[
|
|
2550
|
-
"release",
|
|
2551
|
-
"verify-asset",
|
|
2552
|
-
tag,
|
|
2553
|
-
initialExactArtifact.tgz,
|
|
2554
|
-
"--repo",
|
|
2555
|
-
repository,
|
|
2556
|
-
],
|
|
2557
|
-
[
|
|
2558
|
-
"release",
|
|
2559
|
-
"verify-asset",
|
|
2560
|
-
tag,
|
|
2561
|
-
initialExactArtifact.checksum,
|
|
2562
|
-
"--repo",
|
|
2563
|
-
repository,
|
|
2564
|
-
],
|
|
2565
|
-
] as const)
|
|
2566
|
-
if ((await capturedGh(arguments_)).status !== 0)
|
|
2567
|
-
throw githubFailure(
|
|
2568
|
-
"github-release-attestation-invalid",
|
|
2569
|
-
"GitHub release attestation was not accepted",
|
|
2570
|
-
"three successful GitHub release verification commands",
|
|
2571
|
-
);
|
|
2572
|
-
return;
|
|
2573
|
-
}
|
|
2574
|
-
if (state === "ExactDraft")
|
|
2575
|
-
await assertGithubRelease(
|
|
2576
|
-
repository,
|
|
2577
|
-
release!,
|
|
2578
|
-
initialExactArtifact,
|
|
2579
|
-
tag,
|
|
2580
|
-
true,
|
|
2581
|
-
downloads,
|
|
2582
|
-
);
|
|
2583
|
-
const phrase = `RELEASE ${accepted.receipt.publication.packageName}@1.0.0 ${accepted.receipt.artifact.integrity} TO ${repository} ${tag} AT ${sha}`;
|
|
2584
|
-
process.stdout.write(
|
|
2585
|
-
`GitHub release preview: ${state}; immutable releases ${immutable}.\n`,
|
|
2586
|
-
);
|
|
2587
|
-
await readExactPhrase(phrase, "github-release-confirmation-required");
|
|
2588
|
-
// A confirmation authorizes one bounded attempt only. Re-observe every fact
|
|
2589
|
-
// before its first GitHub write and never repair a partial remote result.
|
|
2590
|
-
const refreshed = await acceptDownloadedPublicationArtifact({
|
|
2591
|
-
repositoryRoot: root,
|
|
2592
|
-
packagePath,
|
|
2593
|
-
artifactDirectory: process.env.ARTIFACT_ROOT!,
|
|
2594
|
-
githubRepository: repository,
|
|
2595
|
-
}).catch(() => {
|
|
2596
|
-
throw githubFailure(
|
|
2597
|
-
"github-preimage-changed",
|
|
2598
|
-
"accepted artifact changed after confirmation",
|
|
2599
|
-
"the accepted receipt-bound artifact",
|
|
2600
|
-
);
|
|
2601
|
-
});
|
|
2602
|
-
if (
|
|
2603
|
-
refreshed.tgz !== accepted.tgz ||
|
|
2604
|
-
refreshed.checksum !== accepted.checksum ||
|
|
2605
|
-
refreshed.sha512 !== accepted.sha512 ||
|
|
2606
|
-
JSON.stringify(refreshed.receipt) !== JSON.stringify(accepted.receipt)
|
|
2607
|
-
)
|
|
2608
|
-
throw githubFailure(
|
|
2609
|
-
"github-preimage-changed",
|
|
2610
|
-
"receipt, notes, checksum, or artifact identity changed after confirmation",
|
|
2611
|
-
"the original confirmation-bound publication preimage",
|
|
2612
|
-
);
|
|
2613
|
-
const registryArtifact = await exactRemoteArtifact(
|
|
2614
|
-
client,
|
|
2615
|
-
isolation,
|
|
2616
|
-
accepted,
|
|
2617
|
-
accepted.receipt.publication.packageName,
|
|
2618
|
-
strictJsonObject(
|
|
2619
|
-
await capturedNpm(client, isolation, [
|
|
2620
|
-
"view",
|
|
2621
|
-
`${accepted.receipt.publication.packageName}@1.0.0`,
|
|
2622
|
-
"--json",
|
|
2623
|
-
]),
|
|
2624
|
-
"npm-registry-schema-unsupported",
|
|
2625
|
-
),
|
|
2626
|
-
);
|
|
2627
|
-
const exactArtifact: AcceptedPublicationArtifact = {
|
|
2628
|
-
...accepted,
|
|
2629
|
-
tgz: registryArtifact.tgz,
|
|
2630
|
-
};
|
|
2631
|
-
await ensureGithubPreimage(repository, sha, branch);
|
|
2632
|
-
const recheckedGit = gitFacts();
|
|
2633
|
-
if (
|
|
2634
|
-
recheckedGit.unavailable ||
|
|
2635
|
-
recheckedGit.detached ||
|
|
2636
|
-
recheckedGit.facts.workingTree !== "clean" ||
|
|
2637
|
-
recheckedGit.facts.currentBranch !== branch ||
|
|
2638
|
-
recheckedGit.facts.defaultBranch !== branch ||
|
|
2639
|
-
!recheckedGit.facts.headMatchesRemoteDefault ||
|
|
2640
|
-
!remoteMatchesPublicOwner(recheckedGit.remote) ||
|
|
2641
|
-
execFileSync("git", ["rev-parse", "HEAD"], {
|
|
2642
|
-
cwd: root,
|
|
2643
|
-
encoding: "utf8",
|
|
2644
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
2645
|
-
}).trim() !== sha
|
|
2646
|
-
)
|
|
2647
|
-
throw githubFailure(
|
|
2648
|
-
"github-preimage-changed",
|
|
2649
|
-
"local Git handoff facts changed after confirmation",
|
|
2650
|
-
"the accepted clean synchronized default-branch preimage",
|
|
2651
|
-
);
|
|
2652
|
-
immutable = await githubImmutable(repository);
|
|
2653
|
-
if (immutable !== initialImmutable)
|
|
2654
|
-
throw githubFailure(
|
|
2655
|
-
"github-preimage-changed",
|
|
2656
|
-
"immutable releases classification changed after confirmation",
|
|
2657
|
-
`unchanged immutable releases ${initialImmutable}`,
|
|
2658
|
-
);
|
|
2659
|
-
const afterTag = await githubTag(repository, tag, sha, annotation);
|
|
2660
|
-
release = await githubReleaseForTag(repository, tag);
|
|
2661
|
-
if (
|
|
2662
|
-
(state === "Fresh" && (afterTag !== "absent" || release !== undefined)) ||
|
|
2663
|
-
(state === "ExactTagOnly" &&
|
|
2664
|
-
(afterTag !== "exact" || release !== undefined)) ||
|
|
2665
|
-
(state === "ExactDraft" &&
|
|
2666
|
-
(afterTag !== "exact" || release === undefined || !release.draft))
|
|
2667
|
-
)
|
|
2668
|
-
throw githubFailure(
|
|
2669
|
-
"github-preimage-changed",
|
|
2670
|
-
"GitHub release classification changed after confirmation",
|
|
2671
|
-
`unchanged ${state} classification`,
|
|
2672
|
-
);
|
|
2673
|
-
if (state === "ExactDraft")
|
|
2674
|
-
await assertGithubRelease(
|
|
2675
|
-
repository,
|
|
2676
|
-
release!,
|
|
2677
|
-
exactArtifact,
|
|
2678
|
-
tag,
|
|
2679
|
-
true,
|
|
2680
|
-
downloads,
|
|
2681
|
-
);
|
|
2682
|
-
if (immutable === "disabled") {
|
|
2683
|
-
const enabled = await capturedGh([
|
|
2684
|
-
"api",
|
|
2685
|
-
"--include",
|
|
2686
|
-
"--method",
|
|
2687
|
-
"PUT",
|
|
2688
|
-
"-H",
|
|
2689
|
-
"Accept: application/vnd.github+json",
|
|
2690
|
-
"-H",
|
|
2691
|
-
"X-GitHub-Api-Version: 2026-03-10",
|
|
2692
|
-
`repos/${repository}/immutable-releases`,
|
|
2693
|
-
]);
|
|
2694
|
-
if (
|
|
2695
|
-
enabled.status !== 0 ||
|
|
2696
|
-
!/^HTTP\/\d(?:\.\d)? 204[^\r\n]*\r?\n(?:[^\r\n]*\r?\n)*\r?\n$/u.test(
|
|
2697
|
-
enabled.stdout,
|
|
2698
|
-
)
|
|
2699
|
-
)
|
|
2700
|
-
await githubWriteFailure(
|
|
2701
|
-
repository,
|
|
2702
|
-
tag,
|
|
2703
|
-
sha,
|
|
2704
|
-
annotation,
|
|
2705
|
-
exactArtifact,
|
|
2706
|
-
downloads,
|
|
2707
|
-
"immutable releases enable failed",
|
|
2708
|
-
"an exact bodyless HTTP 204 followed by an enabled readback",
|
|
2709
|
-
);
|
|
2710
|
-
if ((await githubImmutable(repository)) !== "enabled")
|
|
2711
|
-
await githubWriteFailure(
|
|
2712
|
-
repository,
|
|
2713
|
-
tag,
|
|
2714
|
-
sha,
|
|
2715
|
-
annotation,
|
|
2716
|
-
exactArtifact,
|
|
2717
|
-
downloads,
|
|
2718
|
-
"immutable releases did not read back enabled",
|
|
2719
|
-
"an enabled immutable-releases response",
|
|
2720
|
-
);
|
|
2721
|
-
}
|
|
2722
|
-
if (state === "Fresh") {
|
|
2723
|
-
const tagObjectResult = await capturedGh([
|
|
2724
|
-
"api",
|
|
2725
|
-
"--method",
|
|
2726
|
-
"POST",
|
|
2727
|
-
`repos/${repository}/git/tags`,
|
|
2728
|
-
"-f",
|
|
2729
|
-
`tag=${tag}`,
|
|
2730
|
-
"-f",
|
|
2731
|
-
`message=${annotation}`,
|
|
2732
|
-
"-f",
|
|
2733
|
-
`object=${sha}`,
|
|
2734
|
-
"-f",
|
|
2735
|
-
"type=commit",
|
|
2736
|
-
]);
|
|
2737
|
-
if (tagObjectResult.status !== 0 || tagObjectResult.stderr !== "")
|
|
2738
|
-
await githubWriteFailure(
|
|
2739
|
-
repository,
|
|
2740
|
-
tag,
|
|
2741
|
-
sha,
|
|
2742
|
-
annotation,
|
|
2743
|
-
exactArtifact,
|
|
2744
|
-
downloads,
|
|
2745
|
-
"tag object write failed",
|
|
2746
|
-
"one annotated tag object SHA",
|
|
2747
|
-
);
|
|
2748
|
-
let object: unknown;
|
|
2749
|
-
try {
|
|
2750
|
-
object = JSON.parse(tagObjectResult.stdout);
|
|
2751
|
-
} catch {
|
|
2752
|
-
object = undefined;
|
|
2753
|
-
}
|
|
2754
|
-
const objectSha =
|
|
2755
|
-
isObject(object) && isGithubObjectSha(object.sha) ? object.sha : null;
|
|
2756
|
-
if (objectSha === null)
|
|
2757
|
-
await githubWriteFailure(
|
|
2758
|
-
repository,
|
|
2759
|
-
tag,
|
|
2760
|
-
sha,
|
|
2761
|
-
annotation,
|
|
2762
|
-
exactArtifact,
|
|
2763
|
-
downloads,
|
|
2764
|
-
"tag object write returned no SHA",
|
|
2765
|
-
"one annotated tag object SHA",
|
|
2766
|
-
);
|
|
2767
|
-
if (
|
|
2768
|
-
(
|
|
2769
|
-
await capturedGh([
|
|
2770
|
-
"api",
|
|
2771
|
-
"--method",
|
|
2772
|
-
"POST",
|
|
2773
|
-
`repos/${repository}/git/refs`,
|
|
2774
|
-
"-f",
|
|
2775
|
-
`ref=refs/tags/${tag}`,
|
|
2776
|
-
"-f",
|
|
2777
|
-
`sha=${objectSha}`,
|
|
2778
|
-
])
|
|
2779
|
-
).status !== 0
|
|
2780
|
-
)
|
|
2781
|
-
await githubWriteFailure(
|
|
2782
|
-
repository,
|
|
2783
|
-
tag,
|
|
2784
|
-
sha,
|
|
2785
|
-
annotation,
|
|
2786
|
-
exactArtifact,
|
|
2787
|
-
downloads,
|
|
2788
|
-
"tag ref write failed",
|
|
2789
|
-
"one annotated tag reference",
|
|
2790
|
-
);
|
|
2791
|
-
if ((await githubTag(repository, tag, sha, annotation)) !== "exact")
|
|
2792
|
-
await githubWriteFailure(
|
|
2793
|
-
repository,
|
|
2794
|
-
tag,
|
|
2795
|
-
sha,
|
|
2796
|
-
annotation,
|
|
2797
|
-
exactArtifact,
|
|
2798
|
-
downloads,
|
|
2799
|
-
"annotated tag did not read back exactly",
|
|
2800
|
-
"one exact annotated tag reference",
|
|
2801
|
-
);
|
|
2802
|
-
}
|
|
2803
|
-
if (state === "Fresh" || state === "ExactTagOnly") {
|
|
2804
|
-
const notes = path.join(isolation.root, "github-release-notes.md");
|
|
2805
|
-
writeFileSync(notes, accepted.receipt.publication.releaseNotes);
|
|
2806
|
-
if (
|
|
2807
|
-
(
|
|
2808
|
-
await capturedGh([
|
|
2809
|
-
"release",
|
|
2810
|
-
"create",
|
|
2811
|
-
tag,
|
|
2812
|
-
exactArtifact.tgz,
|
|
2813
|
-
exactArtifact.checksum,
|
|
2814
|
-
"--draft",
|
|
2815
|
-
"--verify-tag",
|
|
2816
|
-
"--title",
|
|
2817
|
-
tag,
|
|
2818
|
-
`--notes-file=${notes}`,
|
|
2819
|
-
"--repo",
|
|
2820
|
-
repository,
|
|
2821
|
-
])
|
|
2822
|
-
).status !== 0
|
|
2823
|
-
)
|
|
2824
|
-
await githubWriteFailure(
|
|
2825
|
-
repository,
|
|
2826
|
-
tag,
|
|
2827
|
-
sha,
|
|
2828
|
-
annotation,
|
|
2829
|
-
exactArtifact,
|
|
2830
|
-
downloads,
|
|
2831
|
-
"draft release write failed",
|
|
2832
|
-
"one exact draft release with two assets",
|
|
2833
|
-
);
|
|
2834
|
-
}
|
|
2835
|
-
const draft = await githubReleaseForTag(repository, tag);
|
|
2836
|
-
if (draft === undefined || !draft.draft)
|
|
2837
|
-
await githubWriteFailure(
|
|
2838
|
-
repository,
|
|
2839
|
-
tag,
|
|
2840
|
-
sha,
|
|
2841
|
-
annotation,
|
|
2842
|
-
exactArtifact,
|
|
2843
|
-
downloads,
|
|
2844
|
-
"draft release did not read back",
|
|
2845
|
-
"one exact draft release",
|
|
2846
|
-
);
|
|
2847
|
-
await assertGithubRelease(
|
|
2848
|
-
repository,
|
|
2849
|
-
draft!,
|
|
2850
|
-
exactArtifact,
|
|
2851
|
-
tag,
|
|
2852
|
-
true,
|
|
2853
|
-
downloads,
|
|
2854
|
-
);
|
|
2855
|
-
if ((await githubImmutable(repository)) !== "enabled")
|
|
2856
|
-
throw githubFailure(
|
|
2857
|
-
"github-release-immutability-unproven",
|
|
2858
|
-
"immutable releases was not enabled immediately before publication",
|
|
2859
|
-
"an enabled immutable releases setting",
|
|
2860
|
-
);
|
|
2861
|
-
if ((await githubTag(repository, tag, sha, annotation)) !== "exact")
|
|
2862
|
-
throw githubFailure(
|
|
2863
|
-
"github-preimage-changed",
|
|
2864
|
-
"annotated tag changed immediately before publication",
|
|
2865
|
-
"the exact confirmation-bound annotated tag",
|
|
2866
|
-
);
|
|
2867
|
-
const finalDraft = await githubReleaseForTag(repository, tag);
|
|
2868
|
-
if (finalDraft === undefined || !finalDraft.draft)
|
|
2869
|
-
throw githubFailure(
|
|
2870
|
-
"github-preimage-changed",
|
|
2871
|
-
"draft release changed immediately before publication",
|
|
2872
|
-
"the exact confirmation-bound draft release",
|
|
2873
|
-
);
|
|
2874
|
-
await assertGithubRelease(
|
|
2875
|
-
repository,
|
|
2876
|
-
finalDraft,
|
|
2877
|
-
exactArtifact,
|
|
2878
|
-
tag,
|
|
2879
|
-
true,
|
|
2880
|
-
downloads,
|
|
2881
|
-
);
|
|
2882
|
-
// Asset bytes are the final mutable release fact. Re-prove the repository
|
|
2883
|
-
// setting after that readback so the publish write has no unchecked gap.
|
|
2884
|
-
if ((await githubImmutable(repository)) !== "enabled")
|
|
2885
|
-
throw githubFailure(
|
|
2886
|
-
"github-release-immutability-unproven",
|
|
2887
|
-
"immutable releases was not enabled after final draft asset verification",
|
|
2888
|
-
"an enabled immutable releases setting immediately before publication",
|
|
2889
|
-
);
|
|
2890
|
-
if (
|
|
2891
|
-
(
|
|
2892
|
-
await capturedGh([
|
|
2893
|
-
"release",
|
|
2894
|
-
"edit",
|
|
2895
|
-
tag,
|
|
2896
|
-
"--draft=false",
|
|
2897
|
-
"--repo",
|
|
2898
|
-
repository,
|
|
2899
|
-
])
|
|
2900
|
-
).status !== 0
|
|
2901
|
-
)
|
|
2902
|
-
await githubWriteFailure(
|
|
2903
|
-
repository,
|
|
2904
|
-
tag,
|
|
2905
|
-
sha,
|
|
2906
|
-
annotation,
|
|
2907
|
-
exactArtifact,
|
|
2908
|
-
downloads,
|
|
2909
|
-
"public release transition failed",
|
|
2910
|
-
"one successful draft-to-public transition",
|
|
2911
|
-
);
|
|
2912
|
-
const publicRelease = await githubReleaseForTag(repository, tag);
|
|
2913
|
-
if ((await githubImmutable(repository)) !== "enabled")
|
|
2914
|
-
throw githubFailure(
|
|
2915
|
-
"github-release-immutability-unproven",
|
|
2916
|
-
"immutable releases was not enabled after publication",
|
|
2917
|
-
"an enabled immutable releases setting",
|
|
2918
|
-
);
|
|
2919
|
-
if ((await githubTag(repository, tag, sha, annotation)) !== "exact")
|
|
2920
|
-
throw githubFailure(
|
|
2921
|
-
"github-release-immutability-unproven",
|
|
2922
|
-
"annotated tag changed after publication",
|
|
2923
|
-
"the exact annotated tag",
|
|
2924
|
-
);
|
|
2925
|
-
if (
|
|
2926
|
-
publicRelease === undefined ||
|
|
2927
|
-
publicRelease.draft ||
|
|
2928
|
-
!publicRelease.immutable ||
|
|
2929
|
-
!isGithubTimestamp(publicRelease.publishedAt)
|
|
2930
|
-
)
|
|
2931
|
-
throw githubFailure(
|
|
2932
|
-
"github-release-immutability-unproven",
|
|
2933
|
-
"public release did not read back immutable",
|
|
2934
|
-
"one immutable public release",
|
|
2935
|
-
);
|
|
2936
|
-
await assertGithubRelease(
|
|
2937
|
-
repository,
|
|
2938
|
-
publicRelease,
|
|
2939
|
-
exactArtifact,
|
|
2940
|
-
tag,
|
|
2941
|
-
false,
|
|
2942
|
-
downloads,
|
|
2943
|
-
);
|
|
2944
|
-
for (const arguments_ of [
|
|
2945
|
-
["release", "verify", tag, "--repo", repository],
|
|
2946
|
-
["release", "verify-asset", tag, exactArtifact.tgz, "--repo", repository],
|
|
2947
|
-
[
|
|
2948
|
-
"release",
|
|
2949
|
-
"verify-asset",
|
|
2950
|
-
tag,
|
|
2951
|
-
exactArtifact.checksum,
|
|
2952
|
-
"--repo",
|
|
2953
|
-
repository,
|
|
2954
|
-
],
|
|
2955
|
-
] as const)
|
|
2956
|
-
if ((await capturedGh(arguments_)).status !== 0)
|
|
2957
|
-
throw githubFailure(
|
|
2958
|
-
"github-release-attestation-invalid",
|
|
2959
|
-
"GitHub release attestation was not accepted",
|
|
2960
|
-
"three successful GitHub release verification commands",
|
|
2961
|
-
);
|
|
2962
|
-
}
|
|
2963
|
-
|
|
2964
|
-
async function external() {
|
|
2965
|
-
const artifactRoot = ownedArtifactRoot(process.env.ARTIFACT_ROOT);
|
|
2966
|
-
let isolationRoot: string | undefined;
|
|
2967
|
-
let isolation: Isolation | undefined;
|
|
2968
|
-
let client: NpmClient | undefined;
|
|
2969
|
-
let loginStarted = false;
|
|
2970
|
-
let githubReleaseVerified = false;
|
|
2971
|
-
let primary: unknown;
|
|
2972
|
-
const handlers: readonly NodeJS.Signals[] = ["SIGHUP", "SIGINT", "SIGTERM"];
|
|
2973
|
-
const onSignal = (signal: NodeJS.Signals): void => {
|
|
2974
|
-
if (receivedSignal !== undefined) return;
|
|
2975
|
-
receivedSignal = signal;
|
|
2976
|
-
activePrompt?.abort();
|
|
2977
|
-
activeChild?.kill(signal);
|
|
2978
|
-
};
|
|
2979
|
-
const signalHandlers = new Map(
|
|
2980
|
-
handlers.map((signal) => [signal, () => onSignal(signal)]),
|
|
2981
|
-
);
|
|
2982
|
-
for (const [signal, handler] of signalHandlers) process.on(signal, handler);
|
|
2983
|
-
try {
|
|
2984
|
-
requireExternalTty();
|
|
2985
|
-
rejectAmbientCredentials();
|
|
2986
|
-
const readiness = await inspectNpmPublicationReadiness({
|
|
2987
|
-
repositoryRoot: root,
|
|
2988
|
-
packagePath,
|
|
2989
|
-
});
|
|
2990
|
-
const git = gitFacts();
|
|
2991
|
-
if (
|
|
2992
|
-
readiness.kind !== "ready" ||
|
|
2993
|
-
git.unavailable ||
|
|
2994
|
-
git.detached ||
|
|
2995
|
-
git.facts.workingTree !== "clean" ||
|
|
2996
|
-
git.facts.currentBranch !== git.facts.defaultBranch ||
|
|
2997
|
-
!git.facts.headMatchesRemoteDefault ||
|
|
2998
|
-
!remoteMatchesPublicOwner(git.remote)
|
|
2999
|
-
)
|
|
3000
|
-
throw externalFailure(
|
|
3001
|
-
"external-preflight-required",
|
|
3002
|
-
"public package or Git handoff facts changed after Stage 4",
|
|
3003
|
-
"a ready package on the clean synchronized public default branch",
|
|
3004
|
-
"Restore the public handoff facts and rerun setup.",
|
|
3005
|
-
4,
|
|
3006
|
-
);
|
|
3007
|
-
const repository = repositoryNameFromReceipt(
|
|
3008
|
-
readiness.publication.repository,
|
|
3009
|
-
);
|
|
3010
|
-
if (repository === null)
|
|
3011
|
-
throw externalFailure(
|
|
3012
|
-
"identity-invalid",
|
|
3013
|
-
"public package repository is not GitHub",
|
|
3014
|
-
"a public GitHub repository",
|
|
3015
|
-
"Correct the reviewed package metadata and retry.",
|
|
3016
|
-
4,
|
|
3017
|
-
);
|
|
3018
|
-
const accepted = await acceptDownloadedPublicationArtifact({
|
|
3019
|
-
repositoryRoot: root,
|
|
3020
|
-
packagePath,
|
|
3021
|
-
artifactDirectory: artifactRoot,
|
|
3022
|
-
githubRepository: repository,
|
|
3023
|
-
});
|
|
3024
|
-
if (accepted.receipt.publication.version !== "1.0.0")
|
|
3025
|
-
throw externalFailure(
|
|
3026
|
-
"identity-invalid",
|
|
3027
|
-
"accepted artifact is not version 1.0.0",
|
|
3028
|
-
"the reviewed first-release artifact",
|
|
3029
|
-
"Correct the package publication facts and retry.",
|
|
3030
|
-
4,
|
|
3031
|
-
);
|
|
3032
|
-
const githubSha = execFileSync("git", ["rev-parse", "HEAD"], {
|
|
3033
|
-
cwd: root,
|
|
3034
|
-
encoding: "utf8",
|
|
3035
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
3036
|
-
}).trim();
|
|
3037
|
-
if (!/^[0-9a-f]{40}$/u.test(githubSha))
|
|
3038
|
-
throw externalFailure(
|
|
3039
|
-
"github-branch-conflict",
|
|
3040
|
-
"local HEAD is not an exact commit SHA",
|
|
3041
|
-
"one exact default-branch commit SHA",
|
|
3042
|
-
"Restore the public Git handoff and rerun setup.",
|
|
3043
|
-
4,
|
|
3044
|
-
);
|
|
3045
|
-
process.stdout.write("STAGE 5/9 Authenticate with npm\n");
|
|
3046
|
-
isolationRoot = createIsolationRoot((created) => {
|
|
3047
|
-
isolationRoot = created;
|
|
3048
|
-
});
|
|
3049
|
-
isolation = completeIsolation(isolationRoot);
|
|
3050
|
-
client = await bootstrapClient(isolation);
|
|
3051
|
-
await readExactPhrase("CONFIRM NPM 2FA AND RECOVERY CODES READY");
|
|
3052
|
-
throwIfSignalled();
|
|
3053
|
-
loginStarted = true;
|
|
3054
|
-
const login = await interactiveNpm(client, isolation, "npm-login", [
|
|
3055
|
-
"login",
|
|
3056
|
-
"--auth-type=web",
|
|
3057
|
-
]);
|
|
3058
|
-
if (receivedSignal || login.signal || login.status !== 0)
|
|
3059
|
-
throw externalFailure(
|
|
3060
|
-
"npm-login-failed",
|
|
3061
|
-
"npm web login did not complete",
|
|
3062
|
-
"a successful npm web login",
|
|
3063
|
-
"Complete npm authentication and rerun setup.",
|
|
3064
|
-
4,
|
|
3065
|
-
);
|
|
3066
|
-
const whoamiResult = await capturedNpm(client, isolation, ["whoami"]);
|
|
3067
|
-
if (
|
|
3068
|
-
whoamiResult.status !== 0 ||
|
|
3069
|
-
whoamiResult.stderr !== "" ||
|
|
3070
|
-
!/^[^\s]+\n?$/u.test(whoamiResult.stdout)
|
|
3071
|
-
)
|
|
3072
|
-
throw externalFailure(
|
|
3073
|
-
"npm-whoami-failed",
|
|
3074
|
-
"npm whoami did not return one username",
|
|
3075
|
-
"one logged-in npm username",
|
|
3076
|
-
"Complete npm web login and retry.",
|
|
3077
|
-
4,
|
|
3078
|
-
);
|
|
3079
|
-
const whoami = whoamiResult.stdout.trim();
|
|
3080
|
-
process.stdout.write(
|
|
3081
|
-
"OK npm-authenticated\nSTAGE 6/9 Publish version 1.0.0\n",
|
|
3082
|
-
);
|
|
3083
|
-
const firstView = await classifyVersion(
|
|
3084
|
-
client,
|
|
3085
|
-
isolation,
|
|
3086
|
-
accepted.receipt.publication.packageName,
|
|
3087
|
-
);
|
|
3088
|
-
if (firstView.kind === "unknown")
|
|
3089
|
-
throw externalFailure(
|
|
3090
|
-
"npm-version-state-unknown",
|
|
3091
|
-
"registry did not prove package absence or presence",
|
|
3092
|
-
"a structured npm registry fact",
|
|
3093
|
-
"Correct the registry failure and retry.",
|
|
3094
|
-
5,
|
|
3095
|
-
);
|
|
3096
|
-
if (firstView.kind === "package-present-version-absent")
|
|
3097
|
-
throw externalFailure(
|
|
3098
|
-
"npm-existing-version-conflict",
|
|
3099
|
-
"the package exists but does not contain version 1.0.0",
|
|
3100
|
-
"a nonexistent package or the exact accepted 1.0.0 version",
|
|
3101
|
-
"Investigate the existing npm package outside this wizard.",
|
|
3102
|
-
4,
|
|
3103
|
-
);
|
|
3104
|
-
if (firstView.kind === "present") {
|
|
3105
|
-
await assertCollaboratorWrite(
|
|
3106
|
-
client,
|
|
3107
|
-
isolation,
|
|
3108
|
-
accepted.receipt.publication.packageName,
|
|
3109
|
-
whoami,
|
|
3110
|
-
);
|
|
3111
|
-
await exactRemoteArtifact(
|
|
3112
|
-
client,
|
|
3113
|
-
isolation,
|
|
3114
|
-
accepted,
|
|
3115
|
-
accepted.receipt.publication.packageName,
|
|
3116
|
-
firstView.value,
|
|
3117
|
-
);
|
|
3118
|
-
process.stdout.write("OK npm-publish-resumed-exact\n");
|
|
3119
|
-
} else {
|
|
3120
|
-
process.stdout.write(
|
|
3121
|
-
`Publish artifact: ${accepted.tgz}\nIntegrity: ${accepted.receipt.artifact.integrity}\nNo OIDC provenance is expected for this manual first publish.\n`,
|
|
3122
|
-
);
|
|
3123
|
-
await readExactPhrase(
|
|
3124
|
-
`PUBLISH ${accepted.receipt.publication.packageName}@1.0.0 ${accepted.receipt.artifact.integrity}`,
|
|
3125
|
-
);
|
|
3126
|
-
throwIfSignalled();
|
|
3127
|
-
let refreshed: AcceptedPublicationArtifact;
|
|
3128
|
-
try {
|
|
3129
|
-
refreshed = await acceptDownloadedPublicationArtifact({
|
|
3130
|
-
repositoryRoot: root,
|
|
3131
|
-
packagePath,
|
|
3132
|
-
artifactDirectory: artifactRoot,
|
|
3133
|
-
githubRepository: repository,
|
|
3134
|
-
});
|
|
3135
|
-
} catch {
|
|
3136
|
-
throw externalFailure(
|
|
3137
|
-
"artifact-preimage-changed",
|
|
3138
|
-
"accepted artifact could not be reverified after confirmation",
|
|
3139
|
-
"the accepted receipt-bound artifact",
|
|
3140
|
-
"Rerun setup from Stage 1.",
|
|
3141
|
-
4,
|
|
3142
|
-
);
|
|
3143
|
-
}
|
|
3144
|
-
if (
|
|
3145
|
-
refreshed.tgz !== accepted.tgz ||
|
|
3146
|
-
refreshed.receipt.artifact.integrity !==
|
|
3147
|
-
accepted.receipt.artifact.integrity
|
|
3148
|
-
)
|
|
3149
|
-
throw externalFailure(
|
|
3150
|
-
"artifact-preimage-changed",
|
|
3151
|
-
"accepted artifact changed after confirmation",
|
|
3152
|
-
"the accepted receipt-bound artifact",
|
|
3153
|
-
"Rerun setup from Stage 1.",
|
|
3154
|
-
4,
|
|
3155
|
-
);
|
|
3156
|
-
const race = await classifyVersion(
|
|
3157
|
-
client,
|
|
3158
|
-
isolation,
|
|
3159
|
-
accepted.receipt.publication.packageName,
|
|
3160
|
-
);
|
|
3161
|
-
if (race.kind !== "absent")
|
|
3162
|
-
throw externalFailure(
|
|
3163
|
-
race.kind === "present" ||
|
|
3164
|
-
race.kind === "package-present-version-absent"
|
|
3165
|
-
? "npm-publish-race"
|
|
3166
|
-
: "npm-version-state-unknown",
|
|
3167
|
-
"registry version changed before publish",
|
|
3168
|
-
"target version absent immediately before publish",
|
|
3169
|
-
"Investigate the npm package and rerun setup.",
|
|
3170
|
-
race.kind === "present" ||
|
|
3171
|
-
race.kind === "package-present-version-absent"
|
|
3172
|
-
? 4
|
|
3173
|
-
: 5,
|
|
3174
|
-
);
|
|
3175
|
-
const published = await interactiveNpm(client, isolation, "npm-publish", [
|
|
3176
|
-
"publish",
|
|
3177
|
-
accepted.tgz,
|
|
3178
|
-
"--access=public",
|
|
3179
|
-
"--tag=latest",
|
|
3180
|
-
]);
|
|
3181
|
-
throwIfSignalled();
|
|
3182
|
-
const readback = await classifyVersion(
|
|
3183
|
-
client,
|
|
3184
|
-
isolation,
|
|
3185
|
-
accepted.receipt.publication.packageName,
|
|
3186
|
-
);
|
|
3187
|
-
if (published.signal || readback.kind !== "present")
|
|
3188
|
-
throw externalFailure(
|
|
3189
|
-
"npm-publish-readback-failed",
|
|
3190
|
-
"publish did not read back as an existing version",
|
|
3191
|
-
"the exact published 1.0.0 version",
|
|
3192
|
-
"Inspect npm before retrying.",
|
|
3193
|
-
4,
|
|
3194
|
-
);
|
|
3195
|
-
await assertCollaboratorWrite(
|
|
3196
|
-
client,
|
|
3197
|
-
isolation,
|
|
3198
|
-
accepted.receipt.publication.packageName,
|
|
3199
|
-
whoami,
|
|
3200
|
-
);
|
|
3201
|
-
await exactRemoteArtifact(
|
|
3202
|
-
client,
|
|
3203
|
-
isolation,
|
|
3204
|
-
accepted,
|
|
3205
|
-
accepted.receipt.publication.packageName,
|
|
3206
|
-
readback.value,
|
|
3207
|
-
);
|
|
3208
|
-
process.stdout.write("OK npm-published-exact\n");
|
|
3209
|
-
}
|
|
3210
|
-
process.stdout.write("STAGE 7/9 Configure trusted publishing\n");
|
|
3211
|
-
await configureTrust(client, isolation, {
|
|
3212
|
-
packageName: accepted.receipt.publication.packageName,
|
|
3213
|
-
repository,
|
|
3214
|
-
});
|
|
3215
|
-
process.stdout.write(
|
|
3216
|
-
"OK trusted-publishing-configured\nSTAGE 8/9 Create the first GitHub release\n",
|
|
3217
|
-
);
|
|
3218
|
-
await runGithubFirstRelease({
|
|
3219
|
-
isolation,
|
|
3220
|
-
client,
|
|
3221
|
-
accepted,
|
|
3222
|
-
repository,
|
|
3223
|
-
sha: githubSha,
|
|
3224
|
-
branch: git.facts.currentBranch!,
|
|
3225
|
-
});
|
|
3226
|
-
githubReleaseVerified = true;
|
|
3227
|
-
} catch (error) {
|
|
3228
|
-
primary = error;
|
|
3229
|
-
}
|
|
3230
|
-
let cleanupError;
|
|
3231
|
-
if (isolation !== undefined) {
|
|
3232
|
-
if (loginStarted && client !== undefined) {
|
|
3233
|
-
const logout = await capturedNpm(client, isolation, ["logout"], true);
|
|
3234
|
-
if (logout.status !== 0 && primary === undefined)
|
|
3235
|
-
cleanupError = externalFailure(
|
|
3236
|
-
"npm-session-cleanup-failed",
|
|
3237
|
-
"npm logout failed",
|
|
3238
|
-
"a completed npm logout",
|
|
3239
|
-
"Retry only after confirming the npm session is closed.",
|
|
3240
|
-
5,
|
|
3241
|
-
);
|
|
3242
|
-
}
|
|
3243
|
-
}
|
|
3244
|
-
if (isolationRoot !== undefined)
|
|
3245
|
-
try {
|
|
3246
|
-
removeOwnedDirectory(isolationRoot);
|
|
3247
|
-
} catch {
|
|
3248
|
-
if (primary === undefined)
|
|
3249
|
-
cleanupError = externalFailure(
|
|
3250
|
-
"npm-session-cleanup-failed",
|
|
3251
|
-
"isolated npm files could not be removed",
|
|
3252
|
-
"removed owned temporary files",
|
|
3253
|
-
"Remove the owned temporary files and retry.",
|
|
3254
|
-
5,
|
|
3255
|
-
);
|
|
3256
|
-
}
|
|
3257
|
-
try {
|
|
3258
|
-
removeOwnedDirectory(artifactRoot);
|
|
3259
|
-
} catch {
|
|
3260
|
-
if (primary === undefined)
|
|
3261
|
-
cleanupError = externalFailure(
|
|
3262
|
-
"npm-session-cleanup-failed",
|
|
3263
|
-
"accepted artifact files could not be removed",
|
|
3264
|
-
"removed owned temporary files",
|
|
3265
|
-
"Remove the owned temporary files and retry.",
|
|
3266
|
-
5,
|
|
3267
|
-
);
|
|
3268
|
-
}
|
|
3269
|
-
for (const [signal, handler] of signalHandlers)
|
|
3270
|
-
process.removeListener(signal, handler);
|
|
3271
|
-
if (receivedSignal !== undefined) process.kill(process.pid, receivedSignal);
|
|
3272
|
-
if (primary !== undefined) throw primary;
|
|
3273
|
-
if (cleanupError !== undefined) throw cleanupError;
|
|
3274
|
-
if (githubReleaseVerified)
|
|
3275
|
-
process.stdout.write(
|
|
3276
|
-
"STAGE 9/9 Finish setup\nOK setup-complete\nYou may now delete scripts/npm-publication-setup/ manually.\n",
|
|
3277
|
-
);
|
|
3278
|
-
}
|
|
3279
|
-
|
|
3280
|
-
if (
|
|
3281
|
-
!root ||
|
|
3282
|
-
![
|
|
3283
|
-
"status",
|
|
3284
|
-
"preflight",
|
|
3285
|
-
"configure",
|
|
3286
|
-
"remote-matches-owner",
|
|
3287
|
-
"artifact",
|
|
3288
|
-
"external",
|
|
3289
|
-
].includes(process.argv[2] ?? "")
|
|
3290
|
-
) {
|
|
3291
|
-
process.stderr.write(
|
|
3292
|
-
"private setup bridge requires REPOSITORY_ROOT and a supported action\n",
|
|
3293
|
-
);
|
|
3294
|
-
process.exitCode = 5;
|
|
3295
|
-
} else {
|
|
3296
|
-
if (process.argv[2] === "status") await status();
|
|
3297
|
-
else if (process.argv[2] === "preflight" || process.argv[2] === "configure") {
|
|
3298
|
-
try {
|
|
3299
|
-
if (process.argv[2] === "preflight") await preflight();
|
|
3300
|
-
else await configure();
|
|
3301
|
-
} catch (error) {
|
|
3302
|
-
if (error instanceof SetupFailure) reportFailure(error);
|
|
3303
|
-
else
|
|
3304
|
-
reportFailure(
|
|
3305
|
-
new SetupFailure(
|
|
3306
|
-
"configuration-platform-failure",
|
|
3307
|
-
"a local owner-file or temporary-directory operation failed",
|
|
3308
|
-
"a readable and writable local repository",
|
|
3309
|
-
"Correct the platform failure and retry.",
|
|
3310
|
-
5,
|
|
3311
|
-
),
|
|
3312
|
-
);
|
|
3313
|
-
}
|
|
3314
|
-
} else if (process.argv[2] === "artifact") await artifact();
|
|
3315
|
-
else if (process.argv[2] === "external") {
|
|
3316
|
-
try {
|
|
3317
|
-
await external();
|
|
3318
|
-
} catch (error) {
|
|
3319
|
-
if (error instanceof SetupFailure) reportFailure(error);
|
|
3320
|
-
else
|
|
3321
|
-
reportFailure(
|
|
3322
|
-
new SetupFailure(
|
|
3323
|
-
"npm-publication-platform-failure",
|
|
3324
|
-
oneLine(
|
|
3325
|
-
error instanceof Error
|
|
3326
|
-
? error.message
|
|
3327
|
-
: "the private npm publication bridge failed unexpectedly",
|
|
3328
|
-
),
|
|
3329
|
-
"a stable local npm publication environment",
|
|
3330
|
-
"Correct the local platform failure and retry.",
|
|
3331
|
-
5,
|
|
3332
|
-
),
|
|
3333
|
-
);
|
|
3334
|
-
}
|
|
3335
|
-
} else remoteMatchesOwner();
|
|
3336
|
-
}
|