@shell-shock/plugin-upgrade 0.1.4 → 0.1.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-builtin.mjs","names":["code","Show","splitProps","ElseClause","ElseIfClause","FunctionDeclaration","IfStatement","InterfaceDeclaration","VarDeclaration","Spacing","InterfaceMember","TSDoc","TSDocParam","TSDocRemarks","TSDocReturns","TypeDeclaration","BuiltinFile","defu","LocatePackageJsonFunctionDeclaration","_$createComponent","name","doc","children","optional","type","heading","async","parameters","default","returnType","initializer","_$createIntrinsic","condition","LocateLockfileFunctionDeclaration","GetPackageManagerFunctionDeclaration","FetchNpmPackageFunctionDeclaration","GetLatestFunctionDeclaration","InstallFunctionDeclaration","UpgradeBuiltin","props","rest","_$mergeProps","id","description","imports","builtinImports","console","env","utils","when","Boolean"],"sources":["../../src/components/upgrade-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport {\n ElseClause,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport {\n InterfaceMember,\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns,\n TypeDeclaration\n} from \"@powerlines/plugin-alloy/typescript\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport defu from \"defu\";\n\n/**\n * The `locatePackageJson` handler function declaration code for the Shell Shock project.\n */\nexport function LocatePackageJsonFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"LocatePackageJsonOptions\"\n doc=\"Options for the `locatePackageJson` handler function.\">\n <InterfaceMember\n name=\"cwd\"\n optional\n type=\"string\"\n doc=\"The current working directory to use. If not provided, the process's current working directory will be used.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Locate the package.json file currently being used by the command-line/workspace.\">\n <TSDocRemarks>\n {`This function is used to determine the package.json file currently being used by the command-line/workspace. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`locatePackageJson\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the package.json file currently being used by the command-line/workspace as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"locatePackageJson\"\n parameters={[\n {\n name: \"options\",\n type: \"LocatePackageJsonOptions\",\n default: \"{}\"\n }\n ]}\n returnType=\"string | undefined\">\n <VarDeclaration\n let\n name=\"currentPath\"\n type=\"string\"\n initializer={code`options.cwd ?? process.cwd(); `}\n />\n <hbr />\n <VarDeclaration\n let\n name=\"parentPath\"\n initializer={code`resolve(currentPath, \"..\"); `}\n />\n <Spacing />\n {code`while (parentPath !== currentPath && currentPath !== homePath && currentPath !== tempPath) { `}\n <IfStatement\n condition={code`existsSync(join(currentPath, \"package.json\"))`}>\n {code`return join(currentPath, \"package.json\"); `}\n </IfStatement>\n <ElseClause>\n {code`currentPath = pathParent;\n parentPath = resolve(currentPath, \"..\"); `}\n </ElseClause>\n {code` }\n\n return undefined; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `locateLockfile` handler function declaration code for the Shell Shock project.\n */\nexport function LocateLockfileFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"LocateLockfileOptions\"\n doc=\"Options for the `locateLockfile` handler function.\">\n <InterfaceMember\n name=\"cwd\"\n optional\n type=\"string\"\n doc=\"The current working directory to use. If not provided, the process's current working directory will be used.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Locate the lockfile currently being used by the command-line/workspace.\">\n <TSDocRemarks>\n {`This function is used to determine the lockfile currently being used by the command-line/workspace. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`locateLockfile\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the lockfile currently being used by the command-line/workspace as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"locateLockfile\"\n parameters={[\n {\n name: \"options\",\n type: \"LocateLockfileOptions\",\n default: \"{}\"\n }\n ]}\n returnType=\"string | undefined\">\n <VarDeclaration\n let\n name=\"currentPath\"\n type=\"string\"\n initializer={code`options.cwd ?? process.cwd(); `}\n />\n <hbr />\n <VarDeclaration\n let\n name=\"parentPath\"\n initializer={code`resolve(currentPath, \"..\"); `}\n />\n <Spacing />\n {code`while (parentPath !== currentPath && currentPath !== homePath && currentPath !== tempPath) { `}\n <VarDeclaration\n const\n name=\"lockfile\"\n initializer={code`[\n \"package-lock.json\",\n \"npm-shrinkwrap.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"pnpm-workspace.yaml\",\n \"deno.lock\",\n \"deno.json\",\n \"deno.jsonc\",\n \"bun.lock\",\n \"bun.lockb\"\n ].find(lf => existsSync(join(currentPath, lf))); `}\n />\n <hbr />\n <IfStatement condition={code`lockfile`}>\n {code`return lockfile; `}\n </IfStatement>\n <ElseClause>\n {code`currentPath = pathParent;\n parentPath = resolve(currentPath, \"..\"); `}\n </ElseClause>\n {code` }\n\n return undefined; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `getPackageManager` handler function declaration code for the Shell Shock project.\n */\nexport function GetPackageManagerFunctionDeclaration() {\n return (\n <>\n <TypeDeclaration\n export\n name=\"GetPackageManagerOptions\"\n doc=\"Options for the `getPackageManager` handler function.\">{code`LocateLockfileOptions;`}</TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Get the package manager currently being used by the command-line/workspace.\">\n <TSDocRemarks>\n {`This function is used to determine the package manager currently being used by the command-line/workspace. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`getPackageManager\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the package manager currently being used by the command-line/workspace as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"getPackageManager\"\n parameters={[\n {\n name: \"options\",\n type: \"GetPackageManagerOptions\",\n default: \"{}\"\n }\n ]}\n returnType={code`Promise<\"npm\" | \"yarn\" | \"deno\" | \"pnpm\" | \"bun\">`}>\n <VarDeclaration\n const\n name=\"userAgent\"\n type=\"string\"\n initializer={code`process.env.npm_config_user_agent ?? \"\"; `}\n />\n <hbr />\n <VarDeclaration\n const\n name=\"execPath\"\n type=\"string\"\n initializer={code`process.env.npm_execpath ?? \"\"; `}\n />\n <Spacing />\n <IfStatement\n condition={code`userAgent.startsWith(\"yarn\") || execPath.includes(\"yarn\")`}>\n {code`return \"yarn\"; `}\n </IfStatement>\n <ElseIfClause\n condition={code`userAgent.startsWith(\"pnpm\") || execPath.includes(\"pnpm\")`}>\n {code`return \"pnpm\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`userAgent.startsWith(\"bun\") || execPath.includes(\"bun\") || typeof Bun !== \"undefined\" || process.versions.bun`}>\n {code`return \"bun\"; `}\n </ElseIfClause>\n <ElseClause>\n <VarDeclaration\n const\n name=\"lockfilePath\"\n initializer={code`locateLockfile(options); `}\n />\n <Spacing />\n <IfStatement condition={code`lockfilePath === \"yarn.lock\"`}>\n {code`return \"yarn\"; `}\n </IfStatement>\n <ElseIfClause\n condition={code`lockfilePath === \"deno.lock\" || lockfilePath === \"deno.json\" || lockfilePath === \"deno.jsonc\"`}>\n {code`return \"deno\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`lockfilePath === \"pnpm-lock.yaml\" || lockfilePath === \"pnpm-workspace.yaml\"`}>\n {code`return \"pnpm\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`lockfilePath === \"bun.lock\" || lockfilePath === \"bun.lockb\"`}>\n {code`return \"bun\"; `}\n </ElseIfClause>\n <ElseClause>\n <VarDeclaration\n const\n name=\"packageJsonPath\"\n initializer={code`locatePackageJson(options); `}\n />\n <IfStatement\n condition={code`packageJsonPath && existsSync(packageJsonPath)`}>\n <VarDeclaration\n const\n name=\"packageJson\"\n initializer={code`JSON.parse(await readFile(packageJsonPath, \"utf8\")); `}\n />\n <IfStatement\n condition={code`packageJson.devEngines?.packageManager?.name && typeof packageJson.devEngines.packageManager.name === \"string\" && [\"npm\", \"yarn\", \"pnpm\", \"deno\", \"bun\"].includes(packageJson.devEngines.packageManager.name)`}>\n {code`return packageJson.devEngines.packageManager.name; `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n const\n name=\"dependencies\"\n initializer={code`{\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n ...packageJson.peerDependencies,\n ...packageJson.optionalDependencies,\n }; `}\n />\n <IfStatement\n condition={code`Object.keys(dependencies).some(dep => dep === \"yarn\" || dep.startsWith(\"yarn@\") || dep === \"yarnpkg\" || dep.startsWith(\"yarnpkg@\"))`}>\n {code`return \"yarn\"; `}\n </IfStatement>\n <ElseIfClause\n condition={code`Object.keys(dependencies).some(dep => dep === \"bun\" || dep.startsWith(\"bun@\"))`}>\n {code`return \"bun\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`Object.keys(dependencies).some(dep => dep === \"pnpm\" || dep.startsWith(\"pnpm@\"))`}>\n {code`return \"pnpm\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`Object.keys(dependencies).some(dep => dep === \"deno\" || dep.startsWith(\"deno@\"))`}>\n {code`return \"deno\"; `}\n </ElseIfClause>\n </IfStatement>\n <Spacing />\n {code`return \"npm\"; `}\n </ElseClause>\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `fetchNpmPackage` handler function declaration code for the Shell Shock project.\n */\nexport function FetchNpmPackageFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"NpmPackageMaintainer\"\n doc=\"Represents a maintainer of an npm package.\">\n <InterfaceMember\n name=\"email\"\n type=\"string\"\n doc=\"The email of the npm package maintainer.\"\n />\n <hbr />\n <InterfaceMember\n name=\"username\"\n type=\"string\"\n doc=\"The username of the npm package maintainer.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackageLinks\"\n doc=\"Represents the links of an npm package.\">\n <InterfaceMember\n name=\"homepage\"\n type=\"string\"\n optional\n doc=\"The homepage of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"repository\"\n type=\"string\"\n optional\n doc=\"The repository of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"bugs\"\n type=\"string\"\n optional\n doc=\"The bugs page of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"npm\"\n type=\"string\"\n optional\n doc=\"The npm page of the npm package.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackage\"\n doc=\"Represents an npm package.\">\n <InterfaceMember\n name=\"name\"\n type=\"string\"\n doc=\"The name of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"date\"\n type=\"Date\"\n doc=\"The date when the npm package was last updated.\"\n />\n <hbr />\n <InterfaceMember\n name=\"version\"\n type=\"string\"\n doc=\"The version of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"description\"\n type=\"string\"\n optional\n doc=\"The description of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"keywords\"\n type=\"string[]\"\n doc=\"A list of keywords associated with the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"license\"\n type=\"string\"\n optional\n doc=\"The license of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"maintainers\"\n type=\"NpmPackageMaintainer[]\"\n doc=\"The maintainers of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"links\"\n type=\"NpmPackageLinks\"\n doc=\"The links of the npm package.\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackageSearchResultItem\"\n doc=\"Represents an npm package search result item.\">\n <InterfaceMember\n name=\"package\"\n type=\"NpmPackage\"\n doc=\"The npm package details.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackageSearchResult\"\n doc=\"Represents an npm package search result.\">\n <InterfaceMember\n name=\"objects\"\n type=\"NpmPackageSearchResultItem[]\"\n doc=\"The list of npm package search result items.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Fetch details of an npm package.\">\n <TSDocRemarks>\n {`This function is used to fetch an npm package. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"packageName\">\n {`The name of the npm package to fetch.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the npm package details or undefined if the package is not found.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"fetchNpmPackage\"\n parameters={[\n {\n name: \"packageName\",\n type: \"string\"\n }\n ]}\n returnType={code`Promise<NpmPackage | undefined>`}>\n <VarDeclaration\n const\n name=\"result\"\n initializer={code` await fetch(\\`https://registry.npmjs.com/-/v1/search?text=\\${packageName}&size=1\\`).then(res => res.json()) as NpmPackageSearchResult; `}\n />\n <hbr />\n <IfStatement\n condition={code`result.objects && result.objects.length > 0 && result.objects[0].package && result.objects[0].package.name === packageName`}>\n {code`return result.objects[0].package; `}\n </IfStatement>\n <ElseClause>{code`return undefined; `}</ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `getLatest` handler function declaration code for the Shell Shock project.\n */\nexport function GetLatestFunctionDeclaration() {\n return (\n <>\n <TSDoc heading=\"Get the latest version of the application from the npm registry.\">\n <TSDocRemarks>\n {`This function is used to retrieve the latest version of the application from the npm registry. It can be used in the CLI upgrade command to check if there is a newer version of the application available.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"packageName\">\n {`The name of the npm package to fetch.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the latest version of the specified npm package as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"getLatest\"\n parameters={[\n {\n name: \"packageName\",\n type: \"string\"\n }\n ]}>\n <VarDeclaration\n const\n name=\"package\"\n initializer={code`await fetchNpmPackage(packageName); `}\n />\n <Spacing />\n {code`return package?.version; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `install` handler function declaration code for the Shell Shock project.\n */\nexport function InstallFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n name=\"InstallBaseOptions\"\n doc=\"Options for the `install` handler function.\">\n <InterfaceMember\n name=\"stdout\"\n optional\n type=\"(string) => void\"\n doc=\"A callback function that is called with the stdout output of the command.\"\n />\n <hbr />\n <InterfaceMember\n name=\"stderr\"\n optional\n type=\"(string) => void\"\n doc=\"A callback function that is called with the stderr output of the command.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TypeDeclaration\n export\n name=\"InstallOptions\"\n doc=\"Options for the `install` handler function.\">{code`InstallBaseOptions & Parameters<typeof spawn>[2];`}</TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Install the application dependencies.\">\n <TSDocRemarks>\n {`This function is used to install the application dependencies. It can be used in the CLI upgrade command to ensure that all necessary dependencies are installed.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`install\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves when the installation of dependencies is complete.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"install\"\n parameters={[\n {\n name: \"options\",\n type: \"InstallOptions\",\n default: \"{}\"\n }\n ]}>\n <VarDeclaration\n const\n name=\"packageManager\"\n initializer={code`getPackageManager(); `}\n />\n <Spacing />\n <VarDeclaration let name=\"output\" initializer={code`\"\"; `} />\n <hbr />\n {code`await spawn(\n \\`\\${packageManager}\\${isWindows && packageManager !== \"bun\" ? \".cmd\" : \"\"}\\`,\n [\"install\"],\n {\n ...options\n env: {\n ...options.env,\n ...(packageManager === \"pnpm\" ? { npm_config_strict_peer_dependencies: false } : null),\n },\n stdout: (data: string) => {\n options.stdout?.(data);\n output += data;\n },\n stderr: (data: string) => {\n options.stderr?.(data);\n },\n },\n ); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface UpgradeBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> {}\n\n/**\n * A built-in upgrade module for Shell Shock.\n */\nexport function UpgradeBuiltin(props: UpgradeBuiltinProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <BuiltinFile\n id=\"upgrade\"\n description=\"A collection of application upgrade utility functions for Shell Shock.\"\n {...rest}\n imports={defu(rest.imports ?? {}, {\n \"node:os\": \"os\",\n \"node:path\": [\"join\", \"resolve\"],\n \"node:fs\": [\"existsSync\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"],\n \"node:process\": \"process\"\n })}\n builtinImports={defu(rest.builtinImports ?? {}, {\n console: [\"error\", \"verbose\", \"writeLine\"],\n env: [\"paths\", \"isWindows\"],\n utils: [\"isColorSupported\", \"spawn\"]\n })}>\n <VarDeclaration\n const\n name=\"homePath\"\n type=\"string\"\n initializer={code`os.homedir(); `}\n />\n <Spacing />\n <VarDeclaration\n const\n name=\"tempPath\"\n type=\"string\"\n initializer={code`os.tmpdir(); `}\n />\n <Spacing />\n <LocateLockfileFunctionDeclaration />\n <Spacing />\n <GetPackageManagerFunctionDeclaration />\n <Spacing />\n <FetchNpmPackageFunctionDeclaration />\n <Spacing />\n <GetLatestFunctionDeclaration />\n <Spacing />\n <InstallFunctionDeclaration />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA2CA,SAAgBkB,uCAAuC;AACrD,QAAA;EAAAC,gBAEKZ,sBAAoB;GAAA,UAAA;GAEnBa,MAAI;GACJC,KAAG;GAAA,IAAAC,WAAA;AAAA,WAAAH,gBACFT,iBAAe;KACdU,MAAI;KACJG,UAAQ;KACRC,MAAI;KACJH,KAAG;KAAA,CAAA;;GAAA,CAAA;EAAAF,gBAGNV,SAAO,EAAA,CAAA;EAAAU,gBACPR,OAAK;GAACc,SAAO;GAAA,IAAAH,WAAA;AAAA,WAAA;KAAAH,gBACXN,cAAY,EAAAS,UACV,sOAAoO,CAAA;KAAAH,gBAEtOV,SAAO,EAAA,CAAA;KAAAU,gBACPP,YAAU;MAACQ,MAAI;MAAAE,UACb;MAAyJ,CAAA;KAAAH,gBAE3JL,cAAY,EAAAQ,UACV,oHAAkH,CAAA;KAAA;;GAAA,CAAA;EAAAH,gBAGtHd,qBAAmB;GAAA,UAAA;GAElBqB,OAAK;GACLN,MAAI;GACJO,YAAY,CACV;IACEP,MAAM;IACNI,MAAM;IACNI,SAAS;IACV,CACF;GACDC,YAAU;GAAA,IAAAP,WAAA;AAAA,WAAA;KAAAH,gBACTX,gBAAc;MAAA,OAAA;MAEbY,MAAI;M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,gBACDX,gBAAc;KAAA,SAAA;KAEbY,MAAI;KACJI,MAAI;KACJM,aAAa9B,IAAI;KAAgB,CAAA;IAAAmB,gBAElCV,SAAO,EAAA,CAAA;IAAAU,gBACPX,gBAAc;KAAA,SAAA;KAEbY,MAAI;KACJI,MAAI;KACJM,aAAa9B,IAAI;KAAe,CAAA;IAAAmB,gBAEjCV,SAAO,EAAA,CAAA;IAAAU,gBACPc,mCAAiC,EAAA,CAAA;IAAAd,gBACjCV,SAAO,EAAA,CAAA;IAAAU,gBACPe,sCAAoC,EAAA,CAAA;IAAAf,gBACpCV,SAAO,EAAA,CAAA;IAAAU,gBACPgB,oCAAkC,EAAA,CAAA;IAAAhB,gBAClCV,SAAO,EAAA,CAAA;IAAAU,gBACPiB,8BAA4B,EAAA,CAAA;IAAAjB,gBAC5BV,SAAO,EAAA,CAAA;IAAAU,gBACPkB,4BAA0B,EAAA,CAAA;IAAAlB,gBAC1BV,SAAO,EAAA,CAAA;IAAAU,gBACPlB,MAAI;KAAA,IAACgD,OAAI;AAAA,aAAEC,QAAQ5B,SAAS;;KAAGA;KAAQ,CAAA;IAAA;;EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"upgrade-builtin.mjs","names":["code","Show","splitProps","ElseClause","ElseIfClause","FunctionDeclaration","IfStatement","InterfaceDeclaration","VarDeclaration","Spacing","usePowerlines","InterfaceMember","TSDoc","TSDocParam","TSDocRemarks","TSDocReturns","TypeDeclaration","BuiltinFile","defu","LocatePackageJsonFunctionDeclaration","context","_$createComponent","name","doc","children","optional","type","heading","async","parameters","default","returnType","initializer","_$createIntrinsic","condition","packageJson","LocateLockfileFunctionDeclaration","GetPackageManagerFunctionDeclaration","FetchNpmPackageFunctionDeclaration","GetLatestVersionFunctionDeclaration","GetUpgradeCommandFunctionDeclaration","UpgradeFunctionDeclaration","UpdateVersionCheckFileFunctionDeclaration","IsCheckForUpdatesRequiredFunctionDeclaration","config","upgrade","staleTime","CheckForUpdatesFunctionDeclaration","version","_$memo","UpgradeBuiltin","props","rest","_$mergeProps","id","description","imports","builtinImports","console","env","utils","when","Boolean"],"sources":["../../src/components/upgrade-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport {\n ElseClause,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n InterfaceMember,\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns,\n TypeDeclaration\n} from \"@powerlines/plugin-alloy/typescript\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport defu from \"defu\";\nimport type { UpgradePluginContext } from \"../types/plugin\";\n\n/**\n * The `locatePackageJson` handler function declaration code for the Shell Shock project.\n */\nexport function LocatePackageJsonFunctionDeclaration() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"LocatePackageJsonOptions\"\n doc=\"Options for the `locatePackageJson` handler function.\">\n <InterfaceMember\n name=\"cwd\"\n optional\n type=\"string\"\n doc=\"The current working directory to use. If not provided, the process's current working directory will be used.\"\n />\n <Spacing />\n <InterfaceMember\n name=\"isDependencyRequired\"\n optional\n type=\"boolean\"\n doc=\"Whether to only locate a package.json file if it contains the application as a dependency. If set to `true`, the function will check if the located package.json file has the application listed as a dependency in its dependencies, devDependencies, peerDependencies, or optionalDependencies before returning its path. This can be useful in monorepo setups where multiple package.json files may exist, but only the one that includes the application as a dependency is relevant for upgrade purposes.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Locate the package.json file currently being used by the command-line/workspace.\">\n <TSDocRemarks>\n {`This function is used to determine the package.json file currently being used by the command-line/workspace. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`locatePackageJson\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the package.json file currently being used by the command-line/workspace as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"locatePackageJson\"\n parameters={[\n {\n name: \"options\",\n type: \"LocatePackageJsonOptions\",\n default: \"{}\"\n }\n ]}\n returnType=\"string | undefined\">\n <VarDeclaration\n let\n name=\"currentPath\"\n type=\"string\"\n initializer={code`options.cwd ?? process.cwd(); `}\n />\n <hbr />\n <VarDeclaration\n let\n name=\"parentPath\"\n initializer={code`resolve(currentPath, \"..\"); `}\n />\n <Spacing />\n {code`while (parentPath !== currentPath && currentPath !== homePath && currentPath !== tempPath) { `}\n <VarDeclaration\n const\n name=\"packageJsonPath\"\n initializer={code`join(currentPath, \"package.json\"); `}\n />\n <IfStatement condition={code`existsSync(packageJsonPath)`}>\n <IfStatement condition={code`options.isDependencyRequired`}>\n <VarDeclaration\n const\n name=\"packageJson\"\n initializer={code`JSON.parse(await readFile(packageJsonPath, \"utf8\")); `}\n />\n <IfStatement\n condition={code`Object.keys(packageJson.dependencies || {}).concat(Object.keys(packageJson.devDependencies || {})).concat(Object.keys(packageJson.peerDependencies || {})).concat(Object.keys(packageJson.optionalDependencies || {})).some(dep => dep === \"${context.packageJson.name}\" || dep.startsWith(\"${context.packageJson.name}@\"))`}>\n {code`return packageJsonPath; `}\n </IfStatement>\n </IfStatement>\n <ElseClause>{code`return packageJsonPath; `}</ElseClause>\n </IfStatement>\n <ElseClause>\n {code`currentPath = parentPath;\n parentPath = resolve(currentPath, \"..\"); `}\n </ElseClause>\n {code` }\n\n return undefined; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `locateLockfile` handler function declaration code for the Shell Shock project.\n */\nexport function LocateLockfileFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"LocateLockfileOptions\"\n doc=\"Options for the `locateLockfile` handler function.\">\n <InterfaceMember\n name=\"cwd\"\n optional\n type=\"string\"\n doc=\"The current working directory to use. If not provided, the process's current working directory will be used.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Locate the lockfile currently being used by the command-line/workspace.\">\n <TSDocRemarks>\n {`This function is used to determine the lockfile currently being used by the command-line/workspace. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`locateLockfile\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the lockfile currently being used by the command-line/workspace as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"locateLockfile\"\n parameters={[\n {\n name: \"options\",\n type: \"LocateLockfileOptions\",\n default: \"{}\"\n }\n ]}\n returnType=\"string | undefined\">\n <VarDeclaration\n let\n name=\"currentPath\"\n type=\"string\"\n initializer={code`options.cwd ?? process.cwd(); `}\n />\n <hbr />\n <VarDeclaration\n let\n name=\"parentPath\"\n initializer={code`resolve(currentPath, \"..\"); `}\n />\n <Spacing />\n {code`while (parentPath !== currentPath && currentPath !== homePath && currentPath !== tempPath) { `}\n <VarDeclaration\n const\n name=\"lockfile\"\n initializer={code`[\n \"package-lock.json\",\n \"npm-shrinkwrap.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"pnpm-workspace.yaml\",\n \"deno.lock\",\n \"deno.json\",\n \"deno.jsonc\",\n \"bun.lock\",\n \"bun.lockb\"\n ].find(lf => existsSync(join(currentPath, lf))); `}\n />\n <hbr />\n <IfStatement condition={code`lockfile`}>\n {code`return lockfile; `}\n </IfStatement>\n <ElseClause>\n {code`currentPath = parentPath;\n parentPath = resolve(currentPath, \"..\"); `}\n </ElseClause>\n {code` }\n\n return undefined; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `getPackageManager` handler function declaration code for the Shell Shock project.\n */\nexport function GetPackageManagerFunctionDeclaration() {\n return (\n <>\n {code`declare global {\n var Bun: any;\n namespace NodeJS {\n interface ProcessVersions {\n bun?: string;\n }\n }\n } `}\n <Spacing />\n <TypeDeclaration\n export\n name=\"GetPackageManagerOptions\"\n doc=\"Options for the `getPackageManager` handler function.\">{code`LocateLockfileOptions;`}</TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Get the package manager currently being used by the command-line/workspace.\">\n <TSDocRemarks>\n {`This function is used to determine the package manager currently being used by the command-line/workspace. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`getPackageManager\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the package manager currently being used by the command-line/workspace as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"getPackageManager\"\n parameters={[\n {\n name: \"options\",\n type: \"GetPackageManagerOptions\",\n default: \"{}\"\n }\n ]}\n returnType={code`\"npm\" | \"yarn\" | \"deno\" | \"pnpm\" | \"bun\"`}>\n <VarDeclaration\n const\n name=\"userAgent\"\n type=\"string\"\n initializer={code`process.env.npm_config_user_agent ?? \"\"; `}\n />\n <hbr />\n <VarDeclaration\n const\n name=\"execPath\"\n type=\"string\"\n initializer={code`process.env.npm_execpath ?? \"\"; `}\n />\n <Spacing />\n <IfStatement\n condition={code`userAgent.startsWith(\"yarn\") || execPath.includes(\"yarn\")`}>\n {code`return \"yarn\"; `}\n </IfStatement>\n <ElseIfClause\n condition={code`userAgent.startsWith(\"pnpm\") || execPath.includes(\"pnpm\")`}>\n {code`return \"pnpm\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`userAgent.startsWith(\"bun\") || execPath.includes(\"bun\") || typeof Bun !== \"undefined\" || process.versions.bun`}>\n {code`return \"bun\"; `}\n </ElseIfClause>\n <ElseClause>\n <VarDeclaration\n const\n name=\"lockfilePath\"\n initializer={code`locateLockfile(options); `}\n />\n <Spacing />\n <IfStatement condition={code`lockfilePath === \"yarn.lock\"`}>\n {code`return \"yarn\"; `}\n </IfStatement>\n <ElseIfClause\n condition={code`lockfilePath === \"deno.lock\" || lockfilePath === \"deno.json\" || lockfilePath === \"deno.jsonc\"`}>\n {code`return \"deno\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`lockfilePath === \"pnpm-lock.yaml\" || lockfilePath === \"pnpm-workspace.yaml\"`}>\n {code`return \"pnpm\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`lockfilePath === \"bun.lock\" || lockfilePath === \"bun.lockb\"`}>\n {code`return \"bun\"; `}\n </ElseIfClause>\n <ElseClause>\n <VarDeclaration\n const\n name=\"packageJsonPath\"\n initializer={code`await locatePackageJson(options); `}\n />\n <IfStatement\n condition={code`packageJsonPath && existsSync(packageJsonPath)`}>\n <VarDeclaration\n const\n name=\"packageJson\"\n initializer={code`JSON.parse(await readFile(packageJsonPath, \"utf8\")); `}\n />\n <IfStatement\n condition={code`packageJson.devEngines?.packageManager?.name && typeof packageJson.devEngines.packageManager.name === \"string\" && [\"npm\", \"yarn\", \"pnpm\", \"deno\", \"bun\"].includes(packageJson.devEngines.packageManager.name)`}>\n {code`return packageJson.devEngines.packageManager.name; `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n const\n name=\"dependencies\"\n initializer={code`{\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n ...packageJson.peerDependencies,\n ...packageJson.optionalDependencies,\n }; `}\n />\n <IfStatement\n condition={code`Object.keys(dependencies).some(dep => dep === \"yarn\" || dep.startsWith(\"yarn@\") || dep === \"yarnpkg\" || dep.startsWith(\"yarnpkg@\"))`}>\n {code`return \"yarn\"; `}\n </IfStatement>\n <ElseIfClause\n condition={code`Object.keys(dependencies).some(dep => dep === \"bun\" || dep.startsWith(\"bun@\"))`}>\n {code`return \"bun\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`Object.keys(dependencies).some(dep => dep === \"pnpm\" || dep.startsWith(\"pnpm@\"))`}>\n {code`return \"pnpm\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`Object.keys(dependencies).some(dep => dep === \"deno\" || dep.startsWith(\"deno@\"))`}>\n {code`return \"deno\"; `}\n </ElseIfClause>\n </IfStatement>\n <Spacing />\n {code`return \"npm\"; `}\n </ElseClause>\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `fetchNpmPackage` handler function declaration code for the Shell Shock project.\n */\nexport function FetchNpmPackageFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"NpmPackageMaintainer\"\n doc=\"Represents a maintainer of an npm package.\">\n <InterfaceMember\n name=\"email\"\n type=\"string\"\n doc=\"The email of the npm package maintainer.\"\n />\n <hbr />\n <InterfaceMember\n name=\"username\"\n type=\"string\"\n doc=\"The username of the npm package maintainer.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackageLinks\"\n doc=\"Represents the links of an npm package.\">\n <InterfaceMember\n name=\"homepage\"\n type=\"string\"\n optional\n doc=\"The homepage of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"repository\"\n type=\"string\"\n optional\n doc=\"The repository of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"bugs\"\n type=\"string\"\n optional\n doc=\"The bugs page of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"npm\"\n type=\"string\"\n optional\n doc=\"The npm page of the npm package.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackage\"\n doc=\"Represents an npm package.\">\n <InterfaceMember\n name=\"name\"\n type=\"string\"\n doc=\"The name of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"date\"\n type=\"Date\"\n doc=\"The date when the npm package was last updated.\"\n />\n <hbr />\n <InterfaceMember\n name=\"version\"\n type=\"string\"\n doc=\"The version of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"description\"\n type=\"string\"\n optional\n doc=\"The description of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"keywords\"\n type=\"string[]\"\n doc=\"A list of keywords associated with the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"license\"\n type=\"string\"\n optional\n doc=\"The license of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"maintainers\"\n type=\"NpmPackageMaintainer[]\"\n doc=\"The maintainers of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"links\"\n type=\"NpmPackageLinks\"\n doc=\"The links of the npm package.\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackageSearchResultItem\"\n doc=\"Represents an npm package search result item.\">\n <InterfaceMember\n name=\"package\"\n type=\"NpmPackage\"\n doc=\"The npm package details.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackageSearchResult\"\n doc=\"Represents an npm package search result.\">\n <InterfaceMember\n name=\"objects\"\n type=\"NpmPackageSearchResultItem[]\"\n doc=\"The list of npm package search result items.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Fetch details of an npm package.\">\n <TSDocRemarks>\n {`This function is used to fetch an npm package. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"packageName\">\n {`The name of the npm package to fetch.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the npm package details or undefined if the package is not found.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"fetchNpmPackage\"\n parameters={[\n {\n name: \"packageName\",\n type: \"string\"\n }\n ]}\n returnType={code`NpmPackage | undefined`}>\n <VarDeclaration\n const\n name=\"result\"\n initializer={code` await fetch(\\`https://registry.npmjs.com/-/v1/search?text=\\${packageName}&size=1\\`).then(res => res.json()) as NpmPackageSearchResult; `}\n />\n <hbr />\n <IfStatement\n condition={code`result.objects && result.objects.length > 0 && result.objects[0].package && result.objects[0].package.name === packageName`}>\n {code`return result.objects[0].package; `}\n </IfStatement>\n <ElseClause>{code`return undefined; `}</ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `getLatestVersion` handler function declaration code for the Shell Shock project.\n */\nexport function GetLatestVersionFunctionDeclaration() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <>\n <TSDoc heading=\"Get the latest version of the application from the npm registry.\">\n <TSDocRemarks>\n {`This function is used to retrieve the latest version of the application from the npm registry. It can be used in the CLI upgrade command to check if there is a newer version of the application available.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"packageName\">\n {`The name of the npm package to fetch.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the latest version of the specified npm package as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"getLatestVersion\"\n parameters={[\n {\n name: \"packageName\",\n default: `\"${context.packageJson.name}\"`\n }\n ]}\n returnType={code`string | undefined`}>\n <VarDeclaration\n const\n name=\"result\"\n initializer={code`await fetchNpmPackage(packageName); `}\n />\n <Spacing />\n {code`return result?.version; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `upgrade` handler function declaration code for the Shell Shock project.\n */\nexport function GetUpgradeCommandFunctionDeclaration() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <>\n <TSDoc heading=\"A function to get the upgrade command for a specific package manager.\">\n <TSDocRemarks>\n {`This function is used to get the appropriate upgrade command for a specific package manager. It can be used in the CLI upgrade command to determine which command to run based on the package manager being used by the application.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"packageManager\">\n {`The name of the package manager to get the upgrade command for. This should be one of \"npm\", \"yarn\", \"pnpm\", \"deno\", or \"bun\".`}\n </TSDocParam>\n <TSDocParam name=\"cwd\">\n {`The current working directory to use when determining the upgrade command. This can be used to locate the appropriate package.json and lockfile to determine how to run the upgrade command. If not provided, the process's current working directory will be used.`}\n </TSDocParam>\n <TSDocReturns>\n {`An array of strings representing the command and its arguments to run in order to upgrade the application dependencies using the specified package manager.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"getUpgradeCommand\"\n parameters={[\n {\n name: \"packageManager\",\n type: \"string\"\n },\n {\n name: \"cwd\",\n type: \"string\",\n default: \"process.cwd()\"\n }\n ]}\n returnType=\"string[]\">\n <VarDeclaration\n const\n name=\"version\"\n initializer={code`(await getLatestVersion(\"${context.packageJson.name}\")) || \"latest\"; `}\n />\n <Spacing />\n <IfStatement condition={code`packageManager === \"yarn\"`}>\n {code`return [\"upgrade\", \\`${\n context.packageJson.name\n }@\\${version}\\`]; `}\n </IfStatement>\n <ElseIfClause condition={code`packageManager === \"pnpm\"`}>\n {code`return [\"update\", \\`${\n context.packageJson.name\n }@\\${version}\\`]; `}\n </ElseIfClause>\n <ElseIfClause condition={code`packageManager === \"deno\"`}>\n {code`return [\"outdated\", \"--update\", \\`${\n context.packageJson.name\n }@\\${version}\\`]; `}\n </ElseIfClause>\n <ElseIfClause condition={code`packageManager === \"bun\"`}>\n {code`return [\"update\", \"--save\", \\`${\n context.packageJson.name\n }@\\${version}\\`]; `}\n </ElseIfClause>\n <ElseClause>{code`return [\"update\", \"--save\", \"--bin-links\", \\`${\n context.packageJson.name\n }@\\${version}\\`]; `}</ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `upgrade` handler function declaration code for the Shell Shock project.\n */\nexport function UpgradeFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n name=\"UpgradeBaseOptions\"\n doc=\"Options for the `upgrade` handler function.\">\n <InterfaceMember\n name=\"stdout\"\n optional\n type=\"(data: string) => void\"\n doc=\"A callback function that is called with the stdout output of the command.\"\n />\n <hbr />\n <InterfaceMember\n name=\"stderr\"\n optional\n type=\"(err: string) => void\"\n doc=\"A callback function that is called with the stderr output of the command.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TypeDeclaration\n export\n name=\"UpgradeOptions\"\n doc=\"Options for the `upgrade` handler function.\">{code`UpgradeBaseOptions & GetPackageManagerOptions & Parameters<typeof spawn>[2];`}</TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Upgrade the application dependencies.\">\n <TSDocRemarks>\n {`This function is used to upgrade the application dependencies. It can be used in the CLI upgrade command to ensure that all necessary dependencies are up-to-date.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`upgrade\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves when the upgrade of dependencies is complete.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"upgrade\"\n parameters={[\n {\n name: \"options\",\n type: \"UpgradeOptions\",\n default: \"{}\"\n }\n ]}>\n <VarDeclaration\n const\n name=\"packageManager\"\n initializer={code`await getPackageManager(options); `}\n />\n <Spacing />\n <VarDeclaration\n const\n name=\"args\"\n initializer={code`await getUpgradeCommand(packageManager, options.cwd); `}\n />\n <hbr />\n <VarDeclaration let name=\"output\" initializer={code`\"\"; `} />\n <hbr />\n {code`await spawn(\n \\`\\${packageManager}\\${isWindows && packageManager !== \"bun\" ? \".cmd\" : \"\"}\\`,\n [args.join(\" \")],\n {\n ...options,\n env: {\n ...options.env,\n ...(packageManager === \"pnpm\" ? { npm_config_strict_peer_dependencies: false } : null),\n },\n stdout: (data: string) => {\n options.stdout?.(data);\n output += data;\n },\n stderr: (data: string) => {\n options.stderr?.(data);\n },\n },\n ); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `updateVersionCheckFile` handler function declaration code for the Shell Shock project.\n */\nexport function UpdateVersionCheckFileFunctionDeclaration() {\n return (\n <>\n <TSDoc heading=\"A helper function that updates the version check file.\">\n <TSDocRemarks>\n {`This function is used to update the version check file with the current timestamp. It can be used in the CLI upgrade command to record the last time a check for updates was performed. The function writes a \"version-check.json\" file in the data directory, which contains a timestamp of the last check for updates.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocReturns>\n {`A promise that resolves to a boolean indicating whether a check for updates is required.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"updateVersionCheckFile\"\n returnType=\"void\">\n <IfStatement condition={code`!existsSync(paths.data)`}>\n {code`await mkdir(paths.data, { recursive: true }); `}\n </IfStatement>\n {code`await writeFile(join(paths.data, \"version-check.json\"), JSON.stringify({ timestamp: new Date().getTime() }), \"utf8\"); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `isCheckForUpdatesRequired` handler function declaration code for the Shell Shock project.\n */\nexport function IsCheckForUpdatesRequiredFunctionDeclaration() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <>\n <TSDoc heading=\"A helper function that verifies if a check for updates is required.\">\n <TSDocRemarks>\n {`This function is used to determine if a check for updates is required based on the last time a check was performed. It can be used in the CLI upgrade command to avoid unnecessary checks for updates if one was recently performed. The function checks for the existence of a \"version-check.json\" file in the data directory, which contains a timestamp of the last check for updates. If the file does not exist or if the timestamp is older than a specified stale time, the function will return true, indicating that a check for updates is required. Otherwise, it will return false.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocReturns>\n {`A promise that resolves to a boolean indicating whether a check for updates is required.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration export async name=\"isCheckForUpdatesRequired\">\n <IfStatement\n condition={code`!isInteractive || isCI || env.SKIP_VERSION_CHECK`}>\n {code`return false; `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n const\n name=\"filePath\"\n initializer={code`join(paths.data, \"version-check.json\"); `}\n />\n <IfStatement condition={code`existsSync(filePath)`}>\n <VarDeclaration\n const\n name=\"file\"\n type=\"{ timestamp: number; }\"\n initializer={code` JSON.parse(await readFile(filePath, \"utf8\")); `}\n />\n <IfStatement condition={code`!file.timestamp`}>\n {code`await updateVersionCheckFile();\n return true; `}\n </IfStatement>\n <ElseIfClause\n condition={code`new Date().getTime() - file.timestamp < ${\n context.config.upgrade.staleTime\n }`}>\n {code`return false; `}\n </ElseIfClause>\n </IfStatement>\n <ElseClause>\n {code`await updateVersionCheckFile();\n return true; `}\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `checkForUpdates` handler function declaration code for the Shell Shock project.\n */\nexport function CheckForUpdatesFunctionDeclaration() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"CheckForUpdatesOptions\"\n extends=\"GetPackageManagerOptions\"\n doc=\"Options for the `checkForUpdates` handler function.\">\n <InterfaceMember\n name=\"force\"\n optional\n type=\"boolean\"\n doc=\"Whether to force a check for updates regardless of the last check timestamp. If set to `true`, the function will bypass the timestamp check and perform a check for updates, updating the timestamp in the process. This can be useful if you want to ensure that a check for updates is performed even if one was recently done, such as when the user explicitly requests it or when certain conditions are met that warrant an immediate check.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration name=\"CheckForUpdatesBaseResult\">\n <InterfaceMember\n name=\"isError\"\n type=\"boolean\"\n optional\n doc=\"Indicates whether an error occurred while checking for updates.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"CheckForUpdatesSuccessResult\"\n extends=\"CheckForUpdatesBaseResult\">\n <InterfaceMember\n name=\"latestVersion\"\n type=\"string\"\n doc=\"The latest version of the application dependencies.\"\n />\n <hbr />\n <InterfaceMember\n name=\"currentVersion\"\n type=\"string\"\n doc=\"The current version of the application dependencies.\"\n />\n <hbr />\n <InterfaceMember\n name=\"isUpToDate\"\n type=\"boolean\"\n doc=\"Indicates whether the application dependencies are up-to-date.\"\n />\n <hbr />\n <InterfaceMember\n name=\"package\"\n type=\"NpmPackage\"\n optional\n doc=\"The npm package that was checked for updates.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"CheckForUpdatesErrorResult\"\n extends=\"CheckForUpdatesBaseResult\">\n <InterfaceMember\n name=\"error\"\n type=\"Error\"\n doc=\"The error that occurred while checking for updates.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TypeDeclaration\n export\n name=\"CheckForUpdatesResult\"\n doc=\"The result for the `checkForUpdates` handler function.\">\n {code`CheckForUpdatesSuccessResult | CheckForUpdatesErrorResult;`}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Check for updates to the application dependencies.\">\n <TSDocRemarks>\n {`This function is used to check for updates to the application dependencies. It can be used in the CLI upgrade command to ensure that all necessary dependencies are up-to-date.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`checkForUpdates\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves when the check for updates is complete or undefined if the check was not performed.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"checkForUpdates\"\n parameters={[\n {\n name: \"options\",\n type: \"CheckForUpdatesOptions\",\n default: \"{}\"\n }\n ]}\n returnType=\"CheckForUpdatesResult\">\n <IfStatement\n condition={code`!options.force && !(await isCheckForUpdatesRequired())`}>\n {code`return {\n latestVersion: \"${context.packageJson.version}\",\n currentVersion: \"${context.packageJson.version}\",\n isUpToDate: true,\n isError: false,\n }; `}\n </IfStatement>\n <Spacing />\n {code`try { `}\n <VarDeclaration\n const\n name=\"pkg\"\n initializer={code`await fetchNpmPackage(\"${\n context.packageJson.name\n }\"); `}\n />\n <Spacing />\n {code`\n return {\n latestVersion: pkg?.version || \"${context.packageJson.version}\",\n currentVersion: \"${context.packageJson.version}\",\n isUpToDate: pkg ? \"${context.packageJson.version}\" === pkg.version : true,\n package: pkg,\n isError: false,\n };\n } catch (err) {\n return { isError: true, error: err instanceof Error ? err : new Error(String(err)) };\n } `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface UpgradeBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> {}\n\n/**\n * A built-in upgrade module for Shell Shock.\n */\nexport function UpgradeBuiltin(props: UpgradeBuiltinProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <BuiltinFile\n id=\"upgrade\"\n description=\"A collection of application upgrade utility functions for Shell Shock.\"\n {...rest}\n imports={defu(rest.imports ?? {}, {\n \"node:os\": \"os\",\n \"node:path\": [\"join\", \"resolve\"],\n \"node:fs\": [\"existsSync\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\", \"mkdir\"],\n \"node:process\": \"process\"\n })}\n builtinImports={defu(rest.builtinImports ?? {}, {\n console: [\"error\", \"verbose\", \"writeLine\"],\n env: [\"paths\", \"isWindows\", \"isCI\", \"env\"],\n utils: [\"isColorSupported\", \"isInteractive\", \"spawn\"]\n })}>\n <VarDeclaration\n const\n name=\"homePath\"\n type=\"string\"\n initializer={code`os.homedir(); `}\n />\n <Spacing />\n <VarDeclaration\n const\n name=\"tempPath\"\n type=\"string\"\n initializer={code`os.tmpdir(); `}\n />\n <Spacing />\n <LocatePackageJsonFunctionDeclaration />\n <Spacing />\n <LocateLockfileFunctionDeclaration />\n <Spacing />\n <GetPackageManagerFunctionDeclaration />\n <Spacing />\n <FetchNpmPackageFunctionDeclaration />\n <Spacing />\n <GetLatestVersionFunctionDeclaration />\n <Spacing />\n <GetUpgradeCommandFunctionDeclaration />\n <Spacing />\n <UpgradeFunctionDeclaration />\n <Spacing />\n <CheckForUpdatesFunctionDeclaration />\n <Spacing />\n <IsCheckForUpdatesRequiredFunctionDeclaration />\n <Spacing />\n <UpdateVersionCheckFileFunctionDeclaration />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA6CA,SAAgBmB,uCAAuC;CACrD,MAAMC,UAAUV,eAAqC;AAErD,QAAA;EAAAW,gBAEKd,sBAAoB;GAAA,UAAA;GAEnBe,MAAI;GACJC,KAAG;GAAA,IAAAC,WAAA;AAAA,WAAA;KAAAH,gBACFV,iBAAe;MACdW,MAAI;MACJG,UAAQ;MACRC,MAAI;MACJH,KAAG;MAAA,CAAA;KAAAF,gBAEJZ,SAAO,EAAA,CAAA;KAAAY,gBACPV,iBAAe;MACdW,MAAI;MACJG,UAAQ;MACRC,MAAI;MACJH,KAAG;MAAA,CAAA;KAAA;;GAAA,CAAA;EAAAF,gBAGNZ,SAAO,EAAA,CAAA;EAAAY,gBACPT,OAAK;GAACe,SAAO;GAAA,IAAAH,WAAA;AAAA,WAAA;KAAAH,gBACXP,cAAY,EAAAU,UACV,sOAAoO,CAAA;KAAAH,gBAEtOZ,SAAO,EAAA,CAAA;KAAAY,gBACPR,YAAU;MAACS,MAAI;MAAAE,UACb;MAAyJ,CAAA;KAAAH,gBAE3JN,cAAY,EAAAS,UACV,oHAAkH,CAAA;KAAA;;GAAA,CAAA;EAAAH,gBAGtHhB,qBAAmB;GAAA,UAAA;GAElBuB,OAAK;GACLN,MAAI;GACJO,YAAY,CACV;IACEP,MAAM;IACNI,MAAM;IACNI,SAAS;IACV,CACF;GACDC,YAAU;GAAA,IAAAP,WAAA;AAAA,WAAA;KAAAH,gBACTb,gBAAc;MAAA,OAAA;MAEbc,MAAI;MACJI,MAAI;MACJM,aAAah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CZ,SAAO,EAAA,CAAA;IAAAY,gBACPb,gBAAc;KAAA,SAAA;KAEbc,MAAI;KACJI,MAAI;KACJM,aAAahC,IAAI;KAAe,CAAA;IAAAqB,gBAEjCZ,SAAO,EAAA,CAAA;IAAAY,gBACPF,sCAAoC,EAAA,CAAA;IAAAE,gBACpCZ,SAAO,EAAA,CAAA;IAAAY,gBACPe,mCAAiC,EAAA,CAAA;IAAAf,gBACjCZ,SAAO,EAAA,CAAA;IAAAY,gBACPgB,sCAAoC,EAAA,CAAA;IAAAhB,gBACpCZ,SAAO,EAAA,CAAA;IAAAY,gBACPiB,oCAAkC,EAAA,CAAA;IAAAjB,gBAClCZ,SAAO,EAAA,CAAA;IAAAY,gBACPkB,qCAAmC,EAAA,CAAA;IAAAlB,gBACnCZ,SAAO,EAAA,CAAA;IAAAY,gBACPmB,sCAAoC,EAAA,CAAA;IAAAnB,gBACpCZ,SAAO,EAAA,CAAA;IAAAY,gBACPoB,4BAA0B,EAAA,CAAA;IAAApB,gBAC1BZ,SAAO,EAAA,CAAA;IAAAY,gBACP0B,oCAAkC,EAAA,CAAA;IAAA1B,gBAClCZ,SAAO,EAAA,CAAA;IAAAY,gBACPsB,8CAA4C,EAAA,CAAA;IAAAtB,gBAC5CZ,SAAO,EAAA,CAAA;IAAAY,gBACPqB,2CAAyC,EAAA,CAAA;IAAArB,gBACzCZ,SAAO,EAAA,CAAA;IAAAY,gBACPpB,MAAI;KAAA,IAAC4D,OAAI;AAAA,aAAEC,QAAQtC,SAAS;;KAAGA;KAAQ,CAAA;IAAA;;EAAA,CAAA,CAAA"}
@@ -2,10 +2,10 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
3
  let __alloy_js_core = require("@alloy-js/core");
4
4
  let __alloy_js_typescript = require("@alloy-js/typescript");
5
+ let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
5
6
  let __powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
6
7
  let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
7
8
  let __powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
8
- let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
9
  let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
10
10
  let __stryke_path = require("@stryke/path");
11
11
 
@@ -1,10 +1,10 @@
1
- import * as _alloy_js_core6 from "@alloy-js/core";
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
2
 
3
3
  //#region src/components/upgrade-command.d.ts
4
4
  /**
5
5
  * The Upgrade command's handler wrapper for the Shell Shock project.
6
6
  */
7
- declare function UpgradeCommand(): _alloy_js_core6.Children;
7
+ declare function UpgradeCommand(): _alloy_js_core0.Children;
8
8
  //#endregion
9
9
  export { UpgradeCommand };
10
10
  //# sourceMappingURL=upgrade-command.d.cts.map
@@ -1,10 +1,10 @@
1
1
  import { createComponent } from "@alloy-js/core/jsx-runtime";
2
2
  import { code } from "@alloy-js/core";
3
3
  import { FunctionDeclaration, InterfaceDeclaration } from "@alloy-js/typescript";
4
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
4
5
  import { InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
5
6
  import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
6
7
  import { Spacing } from "@powerlines/plugin-alloy/core";
7
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
8
  import { TSDoc as TSDoc$1, TSDocDefaultValue, TSDocRemarks as TSDocRemarks$1 } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
9
9
  import { joinPaths } from "@stryke/path";
10
10
 
package/dist/index.cjs CHANGED
@@ -7,6 +7,8 @@ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
7
  let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
8
8
  let __shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
9
9
  let __stryke_path_join = require("@stryke/path/join");
10
+ let defu = require("defu");
11
+ defu = require_rolldown_runtime.__toESM(defu);
10
12
 
11
13
  //#region src/index.tsx
12
14
  /**
@@ -17,7 +19,16 @@ const plugin = (options = {}) => {
17
19
  name: "shell-shock:upgrade",
18
20
  config() {
19
21
  this.debug("Providing default configuration for the Shell Shock `upgrade` plugin.");
20
- return { upgrade: options };
22
+ return {
23
+ upgrade: (0, defu.default)(options, {
24
+ type: "confirm",
25
+ staleTime: 2160 * 60 * 1e3
26
+ }),
27
+ env: {
28
+ types: "@shell-shock/plugin-upgrade/types/env#ShellShockUpgradePluginEnv",
29
+ validate: false
30
+ }
31
+ };
21
32
  },
22
33
  configResolved() {
23
34
  this.debug("Adding the CLI upgrade commands to the application context.");
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AA+BA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,oBAAA,GAAuB,oBAAvB,CAAA,CAAA,OAAA,CAAA,EAER,oBAFQ,EAAA,GAGhB,MAHgB,CAGT,QAHS,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAgCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,oBAAA,GAAuB,oBAAvB,CAAA,CAAA,OAAA,CAAA,EAER,oBAFQ,EAAA,GAGhB,MAHgB,CAGT,QAHS,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AA+BA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,oBAAA,GAAuB,oBAAvB,CAAA,CAAA,OAAA,CAAA,EAER,oBAFQ,EAAA,GAGhB,MAHgB,CAGT,QAHS,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAgCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,oBAAA,GAAuB,oBAAvB,CAAA,CAAA,OAAA,CAAA,EAER,oBAFQ,EAAA,GAGhB,MAHgB,CAGT,QAHS,CAAA"}
package/dist/index.mjs CHANGED
@@ -5,6 +5,7 @@ import { createComponent } from "@alloy-js/core/jsx-runtime";
5
5
  import { render } from "@powerlines/plugin-alloy/render";
6
6
  import { getAppTitle } from "@shell-shock/core/plugin-utils";
7
7
  import { joinPaths } from "@stryke/path/join";
8
+ import defu from "defu";
8
9
 
9
10
  //#region src/index.tsx
10
11
  /**
@@ -15,7 +16,16 @@ const plugin = (options = {}) => {
15
16
  name: "shell-shock:upgrade",
16
17
  config() {
17
18
  this.debug("Providing default configuration for the Shell Shock `upgrade` plugin.");
18
- return { upgrade: options };
19
+ return {
20
+ upgrade: defu(options, {
21
+ type: "confirm",
22
+ staleTime: 2160 * 60 * 1e3
23
+ }),
24
+ env: {
25
+ types: "@shell-shock/plugin-upgrade/types/env#ShellShockUpgradePluginEnv",
26
+ validate: false
27
+ }
28
+ };
19
29
  },
20
30
  configResolved() {
21
31
  this.debug("Adding the CLI upgrade commands to the application context.");
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["render","getAppTitle","joinPaths","UpgradeBuiltin","UpgradeCommand","plugin","options","name","config","debug","upgrade","configResolved","inputs","some","input","id","info","push","alias","path","segments","title","description","entry","file","entryPath","isVirtual","prepare","_$createComponent"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Plugin } from \"powerlines\";\nimport { UpgradeBuiltin, UpgradeCommand } from \"./components\";\nimport type {\n UpgradePluginContext,\n UpgradePluginOptions\n} from \"./types/plugin\";\n\n/**\n * The Upgrade - Shell Shock plugin to add version check functionality and upgrade commands to a Shell Shock application.\n */\nexport const plugin = <\n TContext extends UpgradePluginContext = UpgradePluginContext\n>(\n options: UpgradePluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"shell-shock:upgrade\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `upgrade` plugin.\"\n );\n\n return {\n upgrade: options\n };\n },\n configResolved() {\n this.debug(\"Adding the CLI upgrade commands to the application context.\");\n\n this.inputs ??= [];\n if (this.inputs.some(input => input.id === \"upgrade\")) {\n this.info(\n \"The `upgrade` command already exists in the commands list. If you would like the upgrade command to be managed by the `@shell-shock/plugin-upgrade` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"upgrade\",\n name: \"upgrade\",\n alias: [\"up\", \"update\"],\n path: \"upgrade\",\n segments: [\"upgrade\"],\n title: \"Upgrade\",\n description: `A command for checking and upgrading the version of the ${getAppTitle(\n this\n )}.`,\n entry: {\n file: joinPaths(this.entryPath, \"upgrade\", \"command.ts\"),\n input: {\n file: joinPaths(this.entryPath, \"upgrade\", \"command.ts\")\n }\n },\n isVirtual: false\n });\n }\n },\n async prepare() {\n this.debug(\n \"Rendering upgrade built-in and command modules for the Shell Shock `upgrade` plugin.\"\n );\n\n return render(\n this,\n <>\n <UpgradeBuiltin />\n <UpgradeCommand />\n </>\n );\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AA+BA,MAAaK,UAGXC,UAAgC,EAAE,KACb;AACrB,QAAO;EACLC,MAAM;EACNC,SAAS;AACP,QAAKC,MACH,wEACD;AAED,UAAO,EACLC,SAASJ,SACV;;EAEHK,iBAAiB;AACf,QAAKF,MAAM,8DAA8D;AAEzE,QAAKG,WAAW,EAAE;AAClB,OAAI,KAAKA,OAAOC,MAAKC,UAASA,MAAMC,OAAO,UAAU,CACnD,MAAKC,KACH,oMACD;OAED,MAAKJ,OAAOK,KAAK;IACfF,IAAI;IACJR,MAAM;IACNW,OAAO,CAAC,MAAM,SAAS;IACvBC,MAAM;IACNC,UAAU,CAAC,UAAU;IACrBC,OAAO;IACPC,aAAa,2DAA2DrB,YACtE,KACD,CAAA;IACDsB,OAAO;KACLC,MAAMtB,UAAU,KAAKuB,WAAW,WAAW,aAAa;KACxDX,OAAO,EACLU,MAAMtB,UAAU,KAAKuB,WAAW,WAAW,aAAY,EACzD;KACD;IACDC,WAAW;IACZ,CAAC;;EAGN,MAAMC,UAAU;AACd,QAAKlB,MACH,uFACD;AAED,UAAOT,OACL,MAAI,CAAA4B,gBAEDzB,gBAAc,EAAA,CAAA,EAAAyB,gBACdxB,gBAAc,EAAA,CAAA,CAEnB,CAAC;;EAEJ;;AAGH,kBAAeC"}
1
+ {"version":3,"file":"index.mjs","names":["render","getAppTitle","joinPaths","defu","UpgradeBuiltin","UpgradeCommand","plugin","options","name","config","debug","upgrade","type","staleTime","env","types","validate","configResolved","inputs","some","input","id","info","push","alias","path","segments","title","description","entry","file","entryPath","isVirtual","prepare","_$createComponent"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport defu from \"defu\";\nimport type { Plugin } from \"powerlines\";\nimport { UpgradeBuiltin, UpgradeCommand } from \"./components\";\nimport type {\n UpgradePluginContext,\n UpgradePluginOptions\n} from \"./types/plugin\";\n\n/**\n * The Upgrade - Shell Shock plugin to add version check functionality and upgrade commands to a Shell Shock application.\n */\nexport const plugin = <\n TContext extends UpgradePluginContext = UpgradePluginContext\n>(\n options: UpgradePluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"shell-shock:upgrade\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `upgrade` plugin.\"\n );\n\n return {\n upgrade: defu(options, {\n type: \"confirm\",\n staleTime: 36 * 60 * 60 * 1000 // 36 hours\n }),\n env: {\n types:\n \"@shell-shock/plugin-upgrade/types/env#ShellShockUpgradePluginEnv\",\n validate: false\n }\n };\n },\n configResolved() {\n this.debug(\"Adding the CLI upgrade commands to the application context.\");\n\n this.inputs ??= [];\n if (this.inputs.some(input => input.id === \"upgrade\")) {\n this.info(\n \"The `upgrade` command already exists in the commands list. If you would like the upgrade command to be managed by the `@shell-shock/plugin-upgrade` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"upgrade\",\n name: \"upgrade\",\n alias: [\"up\", \"update\"],\n path: \"upgrade\",\n segments: [\"upgrade\"],\n title: \"Upgrade\",\n description: `A command for checking and upgrading the version of the ${getAppTitle(\n this\n )}.`,\n entry: {\n file: joinPaths(this.entryPath, \"upgrade\", \"command.ts\"),\n input: {\n file: joinPaths(this.entryPath, \"upgrade\", \"command.ts\")\n }\n },\n isVirtual: false\n });\n }\n },\n async prepare() {\n this.debug(\n \"Rendering upgrade built-in and command modules for the Shell Shock `upgrade` plugin.\"\n );\n\n return render(\n this,\n <>\n <UpgradeBuiltin />\n <UpgradeCommand />\n </>\n );\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;AAgCA,MAAaM,UAGXC,UAAgC,EAAE,KACb;AACrB,QAAO;EACLC,MAAM;EACNC,SAAS;AACP,QAAKC,MACH,wEACD;AAED,UAAO;IACLC,SAASR,KAAKI,SAAS;KACrBK,MAAM;KACNC,WAAW,OAAU,KAAK;KAC3B,CAAC;IACFC,KAAK;KACHC,OACE;KACFC,UAAU;KACZ;IACD;;EAEHC,iBAAiB;AACf,QAAKP,MAAM,8DAA8D;AAEzE,QAAKQ,WAAW,EAAE;AAClB,OAAI,KAAKA,OAAOC,MAAKC,UAASA,MAAMC,OAAO,UAAU,CACnD,MAAKC,KACH,oMACD;OAED,MAAKJ,OAAOK,KAAK;IACfF,IAAI;IACJb,MAAM;IACNgB,OAAO,CAAC,MAAM,SAAS;IACvBC,MAAM;IACNC,UAAU,CAAC,UAAU;IACrBC,OAAO;IACPC,aAAa,2DAA2D3B,YACtE,KACD,CAAA;IACD4B,OAAO;KACLC,MAAM5B,UAAU,KAAK6B,WAAW,WAAW,aAAa;KACxDX,OAAO,EACLU,MAAM5B,UAAU,KAAK6B,WAAW,WAAW,aAAY,EACzD;KACD;IACDC,WAAW;IACZ,CAAC;;EAGN,MAAMC,UAAU;AACd,QAAKvB,MACH,uFACD;AAED,UAAOV,OACL,MAAI,CAAAkC,gBAED9B,gBAAc,EAAA,CAAA,EAAA8B,gBACd7B,gBAAc,EAAA,CAAA,CAEnB,CAAC;;EAEJ;;AAGH,kBAAeC"}
File without changes
@@ -0,0 +1,14 @@
1
+ import { ShellShockEnv } from "@shell-shock/core/types/env";
2
+
3
+ //#region src/types/env.d.ts
4
+ interface ShellShockUpgradePluginEnv extends ShellShockEnv {
5
+ /**
6
+ * An environment variable that can be set to skip the version check when determining if a check for updates is required. If this variable is set to any value, the `isCheckForUpdatesRequired` function will return `false`, indicating that a check for updates is not required. This can be useful in CI environments or other non-interactive contexts where you want to avoid performing a version check, which may involve file system operations or network requests. By setting this environment variable, you can ensure that the upgrade process proceeds without checking for updates, which can help speed up the process in certain scenarios.
7
+ *
8
+ * @defaultValue false
9
+ */
10
+ SKIP_VERSION_CHECK?: boolean;
11
+ }
12
+ //#endregion
13
+ export { ShellShockUpgradePluginEnv };
14
+ //# sourceMappingURL=env.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.cts","names":[],"sources":["../../src/types/env.ts"],"sourcesContent":[],"mappings":";;;UAoBiB,0BAAA,SAAmC;;AAApD"}
@@ -0,0 +1,14 @@
1
+ import { ShellShockEnv } from "@shell-shock/core/types/env";
2
+
3
+ //#region src/types/env.d.ts
4
+ interface ShellShockUpgradePluginEnv extends ShellShockEnv {
5
+ /**
6
+ * An environment variable that can be set to skip the version check when determining if a check for updates is required. If this variable is set to any value, the `isCheckForUpdatesRequired` function will return `false`, indicating that a check for updates is not required. This can be useful in CI environments or other non-interactive contexts where you want to avoid performing a version check, which may involve file system operations or network requests. By setting this environment variable, you can ensure that the upgrade process proceeds without checking for updates, which can help speed up the process in certain scenarios.
7
+ *
8
+ * @defaultValue false
9
+ */
10
+ SKIP_VERSION_CHECK?: boolean;
11
+ }
12
+ //#endregion
13
+ export { ShellShockUpgradePluginEnv };
14
+ //# sourceMappingURL=env.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.mts","names":[],"sources":["../../src/types/env.ts"],"sourcesContent":[],"mappings":";;;UAoBiB,0BAAA,SAAmC;;AAApD"}
@@ -0,0 +1 @@
1
+ export { };
@@ -1 +1 @@
1
- {"version":3,"file":"package-manager.d.cts","names":[],"sources":["../../src/types/package-manager.ts"],"sourcesContent":[],"mappings":";KAkBY,cAAA;AAAA,cAEC,gBAFa,EAAA,SAEc,cAFd,EAAA;AAEb,cAQA,4BAR2B,EAQG,MARW,CAAA,MAAA,EAQI,cARJ,CAAA"}
1
+ {"version":3,"file":"package-manager.d.cts","names":[],"sources":["../../src/types/package-manager.ts"],"sourcesContent":[],"mappings":";KAkBY,cAAA;AAAA,cAEC,gBAFa,EAAA,SAEc,cAFd,EAAA;AAEb,cAQA,4BARyC,EAQX,MARW,CAAA,MAAA,EAQI,cARJ,CAAA"}
@@ -4,12 +4,14 @@ import { Context } from "@shell-shock/core/types/context";
4
4
  //#region src/types/plugin.d.ts
5
5
  interface UpgradePluginOptions {
6
6
  /**
7
- * Optionally specify the name of the package in npm to check for upgrades.
7
+ * The time in milliseconds after which previously retrieved version data is considered stale.
8
8
  *
9
9
  * @remarks
10
- * This option is used to determine which package's version to check for upgrades. If not specified, it will default to the value detected in the `package.json` file of the project, or the name of the package that the plugin is a part of if it is being used within a package context. This option is primarily intended for use when the plugin is being used in a non-package context, such as a global installation, where there may not be a `package.json` file to reference.
10
+ * This field will control how often the application will check for new versions. If set, the application will check for new versions at the specified interval and notify the user if an update is available. If set to `-1`, the application will only check for updates when the command is executed.
11
+ *
12
+ * @defaultValue 2 * 60 * 60 * 1000 (2 hours)
11
13
  */
12
- packageName?: string;
14
+ staleTime?: number;
13
15
  }
14
16
  type UpgradePluginUserConfig = UserConfig & {
15
17
  /**
@@ -21,7 +23,7 @@ type UpgradePluginResolvedConfig = ResolvedConfig & {
21
23
  /**
22
24
  * Resolved upgrade configuration for the plugin.
23
25
  */
24
- upgrade: UpgradePluginOptions;
26
+ upgrade: Required<UpgradePluginOptions>;
25
27
  };
26
28
  type UpgradePluginContext<TResolvedConfig extends UpgradePluginResolvedConfig = UpgradePluginResolvedConfig> = Context<TResolvedConfig>;
27
29
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;UAwBiB,oBAAA;;AAAjB;AAUA;AAOA;AAOA;;EAEI,WAAA,CAAA,EAAA,MAAA;;AACA,KAjBQ,uBAAA,GAA0B,UAiBlC,GAAA;EAAO;;;WAbA;;KAGC,2BAAA,GAA8B;;;;WAI/B;;KAGC,6CACc,8BACtB,+BACA,QAAQ"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;UAwBiB,oBAAA;;AAAjB;AAYA;AAOA;;;;;EAOY,SAAA,CAAA,EAAA,MAAA;;AAER,KAhBQ,uBAAA,GAA0B,UAgBlC,GAAA;EACQ;;;WAbD;;KAGC,2BAAA,GAA8B;;;;WAI/B,SAAS;;KAGR,6CACc,8BACtB,+BACA,QAAQ"}
@@ -4,12 +4,14 @@ import { Context } from "@shell-shock/core/types/context";
4
4
  //#region src/types/plugin.d.ts
5
5
  interface UpgradePluginOptions {
6
6
  /**
7
- * Optionally specify the name of the package in npm to check for upgrades.
7
+ * The time in milliseconds after which previously retrieved version data is considered stale.
8
8
  *
9
9
  * @remarks
10
- * This option is used to determine which package's version to check for upgrades. If not specified, it will default to the value detected in the `package.json` file of the project, or the name of the package that the plugin is a part of if it is being used within a package context. This option is primarily intended for use when the plugin is being used in a non-package context, such as a global installation, where there may not be a `package.json` file to reference.
10
+ * This field will control how often the application will check for new versions. If set, the application will check for new versions at the specified interval and notify the user if an update is available. If set to `-1`, the application will only check for updates when the command is executed.
11
+ *
12
+ * @defaultValue 2 * 60 * 60 * 1000 (2 hours)
11
13
  */
12
- packageName?: string;
14
+ staleTime?: number;
13
15
  }
14
16
  type UpgradePluginUserConfig = UserConfig & {
15
17
  /**
@@ -21,7 +23,7 @@ type UpgradePluginResolvedConfig = ResolvedConfig & {
21
23
  /**
22
24
  * Resolved upgrade configuration for the plugin.
23
25
  */
24
- upgrade: UpgradePluginOptions;
26
+ upgrade: Required<UpgradePluginOptions>;
25
27
  };
26
28
  type UpgradePluginContext<TResolvedConfig extends UpgradePluginResolvedConfig = UpgradePluginResolvedConfig> = Context<TResolvedConfig>;
27
29
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;UAwBiB,oBAAA;;AAAjB;AAUA;AAOA;AAOA;;EAEI,WAAA,CAAA,EAAA,MAAA;;AACA,KAjBQ,uBAAA,GAA0B,UAiBlC,GAAA;EAAO;;;WAbA;;KAGC,2BAAA,GAA8B;;;;WAI/B;;KAGC,6CACc,8BACtB,+BACA,QAAQ"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;UAwBiB,oBAAA;;AAAjB;AAYA;AAOA;;;;;EAOY,SAAA,CAAA,EAAA,MAAA;;AAER,KAhBQ,uBAAA,GAA0B,UAgBlC,GAAA;EACQ;;;WAbD;;KAGC,2BAAA,GAA8B;;;;WAI/B,SAAS;;KAGR,6CACc,8BACtB,+BACA,QAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-upgrade",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "description": "A package containing a Shell Shock plugin to manage upgrading the local application's version.",
6
6
  "repository": {
@@ -112,6 +112,20 @@
112
112
  "default": "./dist/types/index.mjs"
113
113
  }
114
114
  },
115
+ "./types/env": {
116
+ "require": {
117
+ "types": "./dist/types/env.d.cts",
118
+ "default": "./dist/types/env.cjs"
119
+ },
120
+ "import": {
121
+ "types": "./dist/types/env.d.mts",
122
+ "default": "./dist/types/env.mjs"
123
+ },
124
+ "default": {
125
+ "types": "./dist/types/env.d.mts",
126
+ "default": "./dist/types/env.mjs"
127
+ }
128
+ },
115
129
  "./types/package-manager": {
116
130
  "require": {
117
131
  "types": "./dist/types/package-manager.d.cts",
@@ -154,16 +168,16 @@
154
168
  "dependencies": {
155
169
  "@alloy-js/core": "0.23.0-dev.8",
156
170
  "@alloy-js/typescript": "0.23.0-dev.4",
157
- "@powerlines/deepkit": "^0.6.67",
158
- "@powerlines/plugin-alloy": "^0.23.17",
159
- "@powerlines/plugin-plugin": "^0.12.238",
160
- "@shell-shock/core": "^0.9.0",
171
+ "@powerlines/deepkit": "^0.6.68",
172
+ "@powerlines/plugin-alloy": "^0.23.18",
173
+ "@powerlines/plugin-plugin": "^0.12.239",
174
+ "@shell-shock/core": "^0.9.2",
161
175
  "@stryke/path": "0.26.6",
162
- "powerlines": "^0.38.54",
176
+ "powerlines": "^0.38.55",
163
177
  "defu": "6.1.4"
164
178
  },
165
179
  "devDependencies": {
166
- "@powerlines/plugin-deepkit": "^0.11.166",
180
+ "@powerlines/plugin-deepkit": "^0.11.167",
167
181
  "@types/node": "^25.3.0"
168
182
  },
169
183
  "publishConfig": {
@@ -181,5 +195,5 @@
181
195
  "./package.json": "./package.json"
182
196
  }
183
197
  },
184
- "gitHead": "cfda8730b7dac0e89647907af8bdf83635eee335"
198
+ "gitHead": "a31a7a7e812f31a59f19cf31f8175d9c15a50e82"
185
199
  }