@shell-shock/plugin-upgrade 0.1.4 → 0.1.5
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/components/index.cjs +5 -3
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/components/upgrade-builtin.cjs +320 -45
- package/dist/components/upgrade-builtin.d.cts +13 -5
- package/dist/components/upgrade-builtin.d.cts.map +1 -1
- package/dist/components/upgrade-builtin.d.mts +13 -5
- package/dist/components/upgrade-builtin.d.mts.map +1 -1
- package/dist/components/upgrade-builtin.mjs +316 -43
- package/dist/components/upgrade-builtin.mjs.map +1 -1
- package/dist/components/upgrade-command.cjs +1 -1
- package/dist/components/upgrade-command.d.cts +2 -2
- package/dist/components/upgrade-command.mjs +1 -1
- package/dist/index.cjs +6 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/package-manager.d.cts.map +1 -1
- package/dist/types/plugin.d.cts +21 -5
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +21 -5
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +3 -3
|
@@ -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,S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A;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","CheckForUpdatesFunctionDeclaration","config","upgrade","staleTime","_$memo","version","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`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`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`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 `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`Promise<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=\"Promise<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 `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.\"></InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CheckForUpdatesResult\"\n doc=\"The result for the `checkForUpdates` handler function.\">\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 doc=\"The npm package that was checked for updates.\"\n />\n <hbr />\n <InterfaceMember\n name=\"packageManager\"\n type=\"'npm' | 'yarn' | 'pnpm' | 'deno' | 'bun'\"\n doc=\"The package manager used to check for updates.\"\n />\n </InterfaceDeclaration>\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=\"Promise<CheckForUpdatesResult | undefined>\">\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 writeFile(filePath, JSON.stringify({ timestamp: new Date().getTime() }), \"utf8\");\n return undefined; `}\n </IfStatement>\n <ElseIfClause\n condition={code`new Date().getTime() - file.timestamp < ${\n context.config.upgrade.staleTime\n }`}>\n {code`return undefined; `}\n </ElseIfClause>\n </IfStatement>\n <ElseClause>\n {code`await writeFile(filePath, JSON.stringify({ timestamp: new Date().getTime() }), \"utf8\");\n return undefined; `}\n </ElseClause>\n <Spacing />\n <VarDeclaration\n const\n name=\"packageManager\"\n initializer={code`await getPackageManager(options); `}\n />\n <Spacing />\n <VarDeclaration\n const\n name=\"pkg\"\n initializer={code`await fetchNpmPackage(); `}\n />\n <Spacing />\n <IfStatement condition={code`!pkg`}>\n {code`return undefined; `}\n </IfStatement>\n <Spacing />\n {code`await writeFile(filePath, JSON.stringify({ timestamp: new Date().getTime() }), \"utf8\");\n\n return {\n latestVersion: pkg?.version ?? \"0.0.0\",\n currentVersion: \"${context.packageJson.version}\",\n isUpToDate: pkg ? \"${context.packageJson.version}\" === pkg.version : true,\n package: pkg,\n packageManager,\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 <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 <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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AAiC,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,gBACPqB,oCAAkC,EAAA,CAAA;IAAArB,gBAClCZ,SAAO,EAAA,CAAA;IAAAY,gBACPpB,MAAI;KAAA,IAAC0D,OAAI;AAAA,aAAEC,QAAQpC,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
|
|
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():
|
|
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,10 @@ 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 { upgrade: (0, defu.default)(options, {
|
|
23
|
+
type: "confirm",
|
|
24
|
+
staleTime: 2160 * 60 * 1e3
|
|
25
|
+
}) };
|
|
21
26
|
},
|
|
22
27
|
configResolved() {
|
|
23
28
|
this.debug("Adding the CLI upgrade commands to the application context.");
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;
|
|
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"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;
|
|
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,10 @@ 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 { upgrade: defu(options, {
|
|
20
|
+
type: "confirm",
|
|
21
|
+
staleTime: 2160 * 60 * 1e3
|
|
22
|
+
}) };
|
|
19
23
|
},
|
|
20
24
|
configResolved() {
|
|
21
25
|
this.debug("Adding the CLI upgrade commands to the application context.");
|
package/dist/index.mjs.map
CHANGED
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["render","getAppTitle","joinPaths","defu","UpgradeBuiltin","UpgradeCommand","plugin","options","name","config","debug","upgrade","type","staleTime","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 };\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,EACLC,SAASR,KAAKI,SAAS;IACrBK,MAAM;IACNC,WAAW,OAAU,KAAK;IAC3B,CAAA,EACF;;EAEHC,iBAAiB;AACf,QAAKJ,MAAM,8DAA8D;AAEzE,QAAKK,WAAW,EAAE;AAClB,OAAI,KAAKA,OAAOC,MAAKC,UAASA,MAAMC,OAAO,UAAU,CACnD,MAAKC,KACH,oMACD;OAED,MAAKJ,OAAOK,KAAK;IACfF,IAAI;IACJV,MAAM;IACNa,OAAO,CAAC,MAAM,SAAS;IACvBC,MAAM;IACNC,UAAU,CAAC,UAAU;IACrBC,OAAO;IACPC,aAAa,2DAA2DxB,YACtE,KACD,CAAA;IACDyB,OAAO;KACLC,MAAMzB,UAAU,KAAK0B,WAAW,WAAW,aAAa;KACxDX,OAAO,EACLU,MAAMzB,UAAU,KAAK0B,WAAW,WAAW,aAAY,EACzD;KACD;IACDC,WAAW;IACZ,CAAC;;EAGN,MAAMC,UAAU;AACd,QAAKpB,MACH,uFACD;AAED,UAAOV,OACL,MAAI,CAAA+B,gBAED3B,gBAAc,EAAA,CAAA,EAAA2B,gBACd1B,gBAAc,EAAA,CAAA,CAEnB,CAAC;;EAEJ;;AAGH,kBAAeC"}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig } from "./plugin.cjs";
|
|
1
|
+
import { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig, UpgradeType } from "./plugin.cjs";
|
|
2
2
|
import { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager } from "./package-manager.cjs";
|
|
3
|
-
export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager, UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig };
|
|
3
|
+
export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager, UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig, UpgradeType };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig } from "./plugin.mjs";
|
|
1
|
+
import { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig, UpgradeType } from "./plugin.mjs";
|
|
2
2
|
import { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager } from "./package-manager.mjs";
|
|
3
|
-
export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager, UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig };
|
|
3
|
+
export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager, UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig, UpgradeType };
|
|
@@ -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,
|
|
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"}
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -2,14 +2,30 @@ import { ResolvedConfig, UserConfig } from "@shell-shock/core/types/config";
|
|
|
2
2
|
import { Context } from "@shell-shock/core/types/context";
|
|
3
3
|
|
|
4
4
|
//#region src/types/plugin.d.ts
|
|
5
|
+
type UpgradeType = "confirm" | "auto" | "display" | "command";
|
|
5
6
|
interface UpgradePluginOptions {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* The type of upgrade to perform. This option determines how the upgrade process will be handled.
|
|
8
9
|
*
|
|
9
10
|
* @remarks
|
|
10
|
-
*
|
|
11
|
+
* The upgrade logic will behave differently based on the value of this field:
|
|
12
|
+
* - `"confirm"` - the user will be prompted to confirm the upgrade before it is performed. This is the default behavior and is recommended for most users, as it provides an extra layer of safety against unintended upgrades.
|
|
13
|
+
* - `"auto"` - the upgrade will be performed automatically without any user confirmation. This option is suitable for advanced users who want a seamless upgrade experience and are confident in the stability of new versions.
|
|
14
|
+
* - `"display"` - the command will only display the latest available version without performing any upgrade. This option is useful for users who want to check for updates without making any changes to their system.
|
|
15
|
+
* - `"command"` - the upgrade will be triggered by a specific command. This option allows users to manually initiate the upgrade process through a dedicated command.
|
|
16
|
+
*
|
|
17
|
+
* @defaultValue "confirm"
|
|
11
18
|
*/
|
|
12
|
-
|
|
19
|
+
type?: UpgradeType;
|
|
20
|
+
/**
|
|
21
|
+
* The time in milliseconds after which previously retrieved version data is considered stale.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* 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.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue 2 * 60 * 60 * 1000 (2 hours)
|
|
27
|
+
*/
|
|
28
|
+
staleTime?: number;
|
|
13
29
|
}
|
|
14
30
|
type UpgradePluginUserConfig = UserConfig & {
|
|
15
31
|
/**
|
|
@@ -21,9 +37,9 @@ type UpgradePluginResolvedConfig = ResolvedConfig & {
|
|
|
21
37
|
/**
|
|
22
38
|
* Resolved upgrade configuration for the plugin.
|
|
23
39
|
*/
|
|
24
|
-
upgrade: UpgradePluginOptions
|
|
40
|
+
upgrade: Required<UpgradePluginOptions>;
|
|
25
41
|
};
|
|
26
42
|
type UpgradePluginContext<TResolvedConfig extends UpgradePluginResolvedConfig = UpgradePluginResolvedConfig> = Context<TResolvedConfig>;
|
|
27
43
|
//#endregion
|
|
28
|
-
export { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig };
|
|
44
|
+
export { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig, UpgradeType };
|
|
29
45
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAwBY,WAAA;UAEK,oBAAA;EAFL;AAEZ;AA0BA;AAOA;;;;;AAOA;;;;EAGI,IAAA,CAAA,EA9BK,WA8BL;EAAO;;;;;;;;;;KAjBC,uBAAA,GAA0B;;;;WAI3B;;KAGC,2BAAA,GAA8B;;;;WAI/B,SAAS;;KAGR,6CACc,8BACtB,+BACA,QAAQ"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -2,14 +2,30 @@ import { ResolvedConfig, UserConfig } from "@shell-shock/core/types/config";
|
|
|
2
2
|
import { Context } from "@shell-shock/core/types/context";
|
|
3
3
|
|
|
4
4
|
//#region src/types/plugin.d.ts
|
|
5
|
+
type UpgradeType = "confirm" | "auto" | "display" | "command";
|
|
5
6
|
interface UpgradePluginOptions {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* The type of upgrade to perform. This option determines how the upgrade process will be handled.
|
|
8
9
|
*
|
|
9
10
|
* @remarks
|
|
10
|
-
*
|
|
11
|
+
* The upgrade logic will behave differently based on the value of this field:
|
|
12
|
+
* - `"confirm"` - the user will be prompted to confirm the upgrade before it is performed. This is the default behavior and is recommended for most users, as it provides an extra layer of safety against unintended upgrades.
|
|
13
|
+
* - `"auto"` - the upgrade will be performed automatically without any user confirmation. This option is suitable for advanced users who want a seamless upgrade experience and are confident in the stability of new versions.
|
|
14
|
+
* - `"display"` - the command will only display the latest available version without performing any upgrade. This option is useful for users who want to check for updates without making any changes to their system.
|
|
15
|
+
* - `"command"` - the upgrade will be triggered by a specific command. This option allows users to manually initiate the upgrade process through a dedicated command.
|
|
16
|
+
*
|
|
17
|
+
* @defaultValue "confirm"
|
|
11
18
|
*/
|
|
12
|
-
|
|
19
|
+
type?: UpgradeType;
|
|
20
|
+
/**
|
|
21
|
+
* The time in milliseconds after which previously retrieved version data is considered stale.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* 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.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue 2 * 60 * 60 * 1000 (2 hours)
|
|
27
|
+
*/
|
|
28
|
+
staleTime?: number;
|
|
13
29
|
}
|
|
14
30
|
type UpgradePluginUserConfig = UserConfig & {
|
|
15
31
|
/**
|
|
@@ -21,9 +37,9 @@ type UpgradePluginResolvedConfig = ResolvedConfig & {
|
|
|
21
37
|
/**
|
|
22
38
|
* Resolved upgrade configuration for the plugin.
|
|
23
39
|
*/
|
|
24
|
-
upgrade: UpgradePluginOptions
|
|
40
|
+
upgrade: Required<UpgradePluginOptions>;
|
|
25
41
|
};
|
|
26
42
|
type UpgradePluginContext<TResolvedConfig extends UpgradePluginResolvedConfig = UpgradePluginResolvedConfig> = Context<TResolvedConfig>;
|
|
27
43
|
//#endregion
|
|
28
|
-
export { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig };
|
|
44
|
+
export { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig, UpgradeType };
|
|
29
45
|
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAwBY,WAAA;UAEK,oBAAA;EAFL;AAEZ;AA0BA;AAOA;;;;;AAOA;;;;EAGI,IAAA,CAAA,EA9BK,WA8BL;EAAO;;;;;;;;;;KAjBC,uBAAA,GAA0B;;;;WAI3B;;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.
|
|
3
|
+
"version": "0.1.5",
|
|
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": {
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
"@powerlines/deepkit": "^0.6.67",
|
|
158
158
|
"@powerlines/plugin-alloy": "^0.23.17",
|
|
159
159
|
"@powerlines/plugin-plugin": "^0.12.238",
|
|
160
|
-
"@shell-shock/core": "^0.9.
|
|
160
|
+
"@shell-shock/core": "^0.9.1",
|
|
161
161
|
"@stryke/path": "0.26.6",
|
|
162
162
|
"powerlines": "^0.38.54",
|
|
163
163
|
"defu": "6.1.4"
|
|
@@ -181,5 +181,5 @@
|
|
|
181
181
|
"./package.json": "./package.json"
|
|
182
182
|
}
|
|
183
183
|
},
|
|
184
|
-
"gitHead": "
|
|
184
|
+
"gitHead": "b94dfbfbfd27471351cac0596afe1f550d8dca57"
|
|
185
185
|
}
|