@shell-shock/plugin-upgrade 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +264 -0
  3. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  4. package/dist/components/index.cjs +11 -0
  5. package/dist/components/index.d.cts +3 -0
  6. package/dist/components/index.d.mts +3 -0
  7. package/dist/components/index.mjs +4 -0
  8. package/dist/components/upgrade-builtin.cjs +735 -0
  9. package/dist/components/upgrade-builtin.d.cts +36 -0
  10. package/dist/components/upgrade-builtin.d.cts.map +1 -0
  11. package/dist/components/upgrade-builtin.d.mts +36 -0
  12. package/dist/components/upgrade-builtin.d.mts.map +1 -0
  13. package/dist/components/upgrade-builtin.mjs +728 -0
  14. package/dist/components/upgrade-builtin.mjs.map +1 -0
  15. package/dist/components/upgrade-command.cjs +96 -0
  16. package/dist/components/upgrade-command.d.cts +10 -0
  17. package/dist/components/upgrade-command.d.cts.map +1 -0
  18. package/dist/components/upgrade-command.d.mts +10 -0
  19. package/dist/components/upgrade-command.d.mts.map +1 -0
  20. package/dist/components/upgrade-command.mjs +96 -0
  21. package/dist/components/upgrade-command.mjs.map +1 -0
  22. package/dist/index.cjs +51 -0
  23. package/dist/index.d.cts +12 -0
  24. package/dist/index.d.cts.map +1 -0
  25. package/dist/index.d.mts +12 -0
  26. package/dist/index.d.mts.map +1 -0
  27. package/dist/index.mjs +49 -0
  28. package/dist/index.mjs.map +1 -0
  29. package/dist/types/index.cjs +4 -0
  30. package/dist/types/index.d.cts +3 -0
  31. package/dist/types/index.d.mts +3 -0
  32. package/dist/types/index.mjs +3 -0
  33. package/dist/types/package-manager.cjs +20 -0
  34. package/dist/types/package-manager.d.cts +7 -0
  35. package/dist/types/package-manager.d.cts.map +1 -0
  36. package/dist/types/package-manager.d.mts +7 -0
  37. package/dist/types/package-manager.d.mts.map +1 -0
  38. package/dist/types/package-manager.mjs +19 -0
  39. package/dist/types/package-manager.mjs.map +1 -0
  40. package/dist/types/plugin.cjs +0 -0
  41. package/dist/types/plugin.d.cts +29 -0
  42. package/dist/types/plugin.d.cts.map +1 -0
  43. package/dist/types/plugin.d.mts +29 -0
  44. package/dist/types/plugin.d.mts.map +1 -0
  45. package/dist/types/plugin.mjs +1 -0
  46. package/package.json +185 -0
@@ -0,0 +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","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 export\n name=\"InstallOptions\"\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 <hbr />\n <InterfaceMember\n name=\"color\"\n optional\n type=\"boolean\"\n doc=\"Whether to enable color output in the command. If not provided, color output will be enabled by default.\"\n />\n </InterfaceDeclaration>\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 returnType=\"Promise<string>\">\n <VarDeclaration\n const\n name=\"packageManager\"\n initializer={code`getPackageManager(); `}\n />\n <hbr />\n <VarDeclaration let name=\"output\" initializer={code`\"\"; `} />\n <hbr />\n {code`try {\n // await spawn(\n // \\`\\${packageManager}\\${isWindows && packageManager !== \"bun\" ? \".cmd\" : \"\"}\\`,\n // [\"install\"],\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 // cwd: options.cwd ?? process.cwd(),\n // env: {\n // ...process.env,\n // ...(options.color !== false ? { FORCE_COLOR: true } : null),\n // // With spawn, pnpm install will fail with ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies.\n // // When pnpm install is run directly from the terminal, this error does not occur.\n // // When pnpm install is run from a simple spawn script, this error does not occur.\n // // The issue only seems to be when pnpm install is executed from npm-check-updates, but it's not clear what configuration or environmental factors are causing this.\n // // For now, turn off strict-peer-dependencies on pnpm auto-install.\n // // See: https://github.com/raineorshine/npm-check-updates/issues/1191\n // ...(packageManager === 'pnpm' ? { npm_config_strict_peer_dependencies: false } : null),\n // },\n // },\n // );\n } catch (err) {\n console.error(\"Error executing install command:\", err);\n throw err;\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 })}>\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,OA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require('../_virtual/rolldown_runtime.cjs');
2
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
+ let __alloy_js_core = require("@alloy-js/core");
4
+ let __alloy_js_typescript = require("@alloy-js/typescript");
5
+ let __powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
6
+ let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
7
+ 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
+ let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
10
+ let __stryke_path = require("@stryke/path");
11
+
12
+ //#region src/components/upgrade-command.tsx
13
+ /**
14
+ * The Upgrade command's handler wrapper for the Shell Shock project.
15
+ */
16
+ function UpgradeCommand() {
17
+ const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
18
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript.TypescriptFile, {
19
+ get path() {
20
+ return (0, __stryke_path.joinPaths)(context.entryPath, "upgrade", "command.ts");
21
+ },
22
+ imports: {
23
+ "node:os": ["os"],
24
+ "node:fs/promises": ["readFile", "writeFile"]
25
+ },
26
+ builtinImports: { console: [
27
+ "colors",
28
+ "writeLine",
29
+ "success",
30
+ "warn",
31
+ "stripAnsi"
32
+ ] },
33
+ get children() {
34
+ return [
35
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Upgrade command." }),
36
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceDeclaration, {
37
+ "export": true,
38
+ name: "UpgradeOptions",
39
+ get children() {
40
+ return [
41
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
42
+ heading: "Whether to upgrade to the latest version.",
43
+ get children() {
44
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `If set to \`true\`, the command will attempt to upgrade to the latest version. This option takes precedence over the \`version\` option.` }), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
45
+ get type() {
46
+ return __powerlines_deepkit_vendor_type.ReflectionKind.boolean;
47
+ },
48
+ defaultValue: false
49
+ })];
50
+ }
51
+ }),
52
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript.InterfaceMember, {
53
+ name: "latest",
54
+ optional: true,
55
+ type: "boolean"
56
+ }),
57
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core.Spacing, {}),
58
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
59
+ heading: "A specific application version to upgrade to.",
60
+ get children() {
61
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The command will attempt to upgrade to the specified version. The version should be a valid semantic version string, or \`latest\` to upgrade to the latest version.` }), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
62
+ get type() {
63
+ return __powerlines_deepkit_vendor_type.ReflectionKind.string;
64
+ },
65
+ defaultValue: "latest"
66
+ })];
67
+ }
68
+ }),
69
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript.InterfaceMember, {
70
+ name: "version",
71
+ optional: true,
72
+ type: "string"
73
+ })
74
+ ];
75
+ }
76
+ }),
77
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core.Spacing, {}),
78
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Handler logic for the \\`upgrade\\` command." }),
79
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
80
+ "export": true,
81
+ "default": true,
82
+ async: true,
83
+ name: "handler",
84
+ parameters: [{
85
+ name: "options",
86
+ type: "UpgradeOptions"
87
+ }],
88
+ children: __alloy_js_core.code` return;`
89
+ })
90
+ ];
91
+ }
92
+ });
93
+ }
94
+
95
+ //#endregion
96
+ exports.UpgradeCommand = UpgradeCommand;
@@ -0,0 +1,10 @@
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
+
3
+ //#region src/components/upgrade-command.d.ts
4
+ /**
5
+ * The Upgrade command's handler wrapper for the Shell Shock project.
6
+ */
7
+ declare function UpgradeCommand(): _alloy_js_core0.Children;
8
+ //#endregion
9
+ export { UpgradeCommand };
10
+ //# sourceMappingURL=upgrade-command.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade-command.d.cts","names":[],"sources":["../../src/components/upgrade-command.tsx"],"sourcesContent":[],"mappings":";;;;;;AAyCgB,iBAAA,cAAA,CAAA,CAAc,EAAA,eAAA,CAAA,QAAA"}
@@ -0,0 +1,10 @@
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
+
3
+ //#region src/components/upgrade-command.d.ts
4
+ /**
5
+ * The Upgrade command's handler wrapper for the Shell Shock project.
6
+ */
7
+ declare function UpgradeCommand(): _alloy_js_core0.Children;
8
+ //#endregion
9
+ export { UpgradeCommand };
10
+ //# sourceMappingURL=upgrade-command.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade-command.d.mts","names":[],"sources":["../../src/components/upgrade-command.tsx"],"sourcesContent":[],"mappings":";;;;;;AAyCgB,iBAAA,cAAA,CAAA,CAAc,EAAA,eAAA,CAAA,QAAA"}
@@ -0,0 +1,96 @@
1
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
2
+ import { code } from "@alloy-js/core";
3
+ import { FunctionDeclaration, InterfaceDeclaration } from "@alloy-js/typescript";
4
+ import { InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
5
+ import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
6
+ import { Spacing } from "@powerlines/plugin-alloy/core";
7
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
+ import { TSDoc as TSDoc$1, TSDocDefaultValue, TSDocRemarks as TSDocRemarks$1 } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
9
+ import { joinPaths } from "@stryke/path";
10
+
11
+ //#region src/components/upgrade-command.tsx
12
+ /**
13
+ * The Upgrade command's handler wrapper for the Shell Shock project.
14
+ */
15
+ function UpgradeCommand() {
16
+ const context = usePowerlines();
17
+ return createComponent(TypescriptFile, {
18
+ get path() {
19
+ return joinPaths(context.entryPath, "upgrade", "command.ts");
20
+ },
21
+ imports: {
22
+ "node:os": ["os"],
23
+ "node:fs/promises": ["readFile", "writeFile"]
24
+ },
25
+ builtinImports: { console: [
26
+ "colors",
27
+ "writeLine",
28
+ "success",
29
+ "warn",
30
+ "stripAnsi"
31
+ ] },
32
+ get children() {
33
+ return [
34
+ createComponent(TSDoc$1, { heading: "Options for the Upgrade command." }),
35
+ createComponent(InterfaceDeclaration, {
36
+ "export": true,
37
+ name: "UpgradeOptions",
38
+ get children() {
39
+ return [
40
+ createComponent(TSDoc$1, {
41
+ heading: "Whether to upgrade to the latest version.",
42
+ get children() {
43
+ return [createComponent(TSDocRemarks$1, { children: `If set to \`true\`, the command will attempt to upgrade to the latest version. This option takes precedence over the \`version\` option.` }), createComponent(TSDocDefaultValue, {
44
+ get type() {
45
+ return ReflectionKind.boolean;
46
+ },
47
+ defaultValue: false
48
+ })];
49
+ }
50
+ }),
51
+ createComponent(InterfaceMember, {
52
+ name: "latest",
53
+ optional: true,
54
+ type: "boolean"
55
+ }),
56
+ createComponent(Spacing, {}),
57
+ createComponent(TSDoc$1, {
58
+ heading: "A specific application version to upgrade to.",
59
+ get children() {
60
+ return [createComponent(TSDocRemarks$1, { children: `The command will attempt to upgrade to the specified version. The version should be a valid semantic version string, or \`latest\` to upgrade to the latest version.` }), createComponent(TSDocDefaultValue, {
61
+ get type() {
62
+ return ReflectionKind.string;
63
+ },
64
+ defaultValue: "latest"
65
+ })];
66
+ }
67
+ }),
68
+ createComponent(InterfaceMember, {
69
+ name: "version",
70
+ optional: true,
71
+ type: "string"
72
+ })
73
+ ];
74
+ }
75
+ }),
76
+ createComponent(Spacing, {}),
77
+ createComponent(TSDoc$1, { heading: "Handler logic for the \\`upgrade\\` command." }),
78
+ createComponent(FunctionDeclaration, {
79
+ "export": true,
80
+ "default": true,
81
+ async: true,
82
+ name: "handler",
83
+ parameters: [{
84
+ name: "options",
85
+ type: "UpgradeOptions"
86
+ }],
87
+ children: code` return;`
88
+ })
89
+ ];
90
+ }
91
+ });
92
+ }
93
+
94
+ //#endregion
95
+ export { UpgradeCommand };
96
+ //# sourceMappingURL=upgrade-command.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade-command.mjs","names":["code","FunctionDeclaration","InterfaceDeclaration","ReflectionKind","Spacing","usePowerlines","InterfaceMember","TypescriptFile","TSDoc","TSDocDefaultValue","TSDocRemarks","joinPaths","UpgradeCommand","context","_$createComponent","path","entryPath","imports","builtinImports","console","children","heading","name","type","boolean","defaultValue","optional","string","async","parameters"],"sources":["../../src/components/upgrade-command.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 } from \"@alloy-js/core\";\nimport {\n FunctionDeclaration,\n InterfaceDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n InterfaceMember,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocRemarks\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { UpgradePluginContext } from \"../types/plugin\";\n\n/**\n * The Upgrade command's handler wrapper for the Shell Shock project.\n */\nexport function UpgradeCommand() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"upgrade\", \"command.ts\")}\n imports={{\n \"node:os\": [\"os\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"]\n }}\n builtinImports={{\n console: [\"colors\", \"writeLine\", \"success\", \"warn\", \"stripAnsi\"]\n }}>\n <TSDoc heading=\"Options for the Upgrade command.\" />\n <InterfaceDeclaration export name=\"UpgradeOptions\">\n <TSDoc heading=\"Whether to upgrade to the latest version.\">\n <TSDocRemarks>{`If set to \\`true\\`, the command will attempt to upgrade to the latest version. This option takes precedence over the \\`version\\` option.`}</TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.boolean}\n defaultValue={false}\n />\n </TSDoc>\n <InterfaceMember name=\"latest\" optional type=\"boolean\" />\n <Spacing />\n <TSDoc heading=\"A specific application version to upgrade to.\">\n <TSDocRemarks>{`The command will attempt to upgrade to the specified version. The version should be a valid semantic version string, or \\`latest\\` to upgrade to the latest version.`}</TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"latest\"\n />\n </TSDoc>\n <InterfaceMember name=\"version\" optional type=\"string\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`upgrade\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[{ name: \"options\", type: \"UpgradeOptions\" }]}>\n {code` return;`}\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAyCA,SAAgBY,iBAAiB;CAC/B,MAAMC,UAAUR,eAAqC;AAErD,QAAAS,gBACGP,gBAAc;EAAA,IACbQ,OAAI;AAAA,UAAEJ,UAAUE,QAAQG,WAAW,WAAW,aAAa;;EAC3DC,SAAS;GACP,WAAW,CAAC,KAAK;GACjB,oBAAoB,CAAC,YAAY,YAAW;GAC7C;EACDC,gBAAgB,EACdC,SAAS;GAAC;GAAU;GAAa;GAAW;GAAQ;GAAW,EAChE;EAAA,IAAAC,WAAA;AAAA,UAAA;IAAAN,gBACAN,SAAK,EAACa,SAAO,oCAAA,CAAA;IAAAP,gBACbZ,sBAAoB;KAAA,UAAA;KAAQoB,MAAI;KAAA,IAAAF,WAAA;AAAA,aAAA;OAAAN,gBAC9BN,SAAK;QAACa,SAAO;QAAA,IAAAD,WAAA;AAAA,gBAAA,CAAAN,gBACXJ,gBAAY,EAAAU,UAAE,4IAA0I,CAAA,EAAAN,gBACxJL,mBAAiB;UAAA,IAChBc,OAAI;AAAA,kBAAEpB,eAAeqB;;UACrBC,cAAc;UAAK,CAAA,CAAA;;QAAA,CAAA;OAAAX,gBAGtBR,iBAAe;QAACgB,MAAI;QAAUI,UAAQ;QAACH,MAAI;QAAA,CAAA;OAAAT,gBAC3CV,SAAO,EAAA,CAAA;OAAAU,gBACPN,SAAK;QAACa,SAAO;QAAA,IAAAD,WAAA;AAAA,gBAAA,CAAAN,gBACXJ,gBAAY,EAAAU,UAAE,wKAAsK,CAAA,EAAAN,gBACpLL,mBAAiB;UAAA,IAChBc,OAAI;AAAA,kBAAEpB,eAAewB;;UACrBF,cAAY;UAAA,CAAA,CAAA;;QAAA,CAAA;OAAAX,gBAGfR,iBAAe;QAACgB,MAAI;QAAWI,UAAQ;QAACH,MAAI;QAAA,CAAA;OAAA;;KAAA,CAAA;IAAAT,gBAE9CV,SAAO,EAAA,CAAA;IAAAU,gBACPN,SAAK,EAACa,SAAO,gDAAA,CAAA;IAAAP,gBACbb,qBAAmB;KAAA,UAAA;KAAA,WAAA;KAGlB2B,OAAK;KACLN,MAAI;KACJO,YAAY,CAAC;MAAEP,MAAM;MAAWC,MAAM;MAAkB,CAAC;KAAAH,UACxDpB,IAAI;KAAU,CAAA;IAAA;;EAAA,CAAA"}
package/dist/index.cjs ADDED
@@ -0,0 +1,51 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
+ const require_components_upgrade_builtin = require('./components/upgrade-builtin.cjs');
4
+ const require_components_upgrade_command = require('./components/upgrade-command.cjs');
5
+ require('./components/index.cjs');
6
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
+ let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
8
+ let __shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
9
+ let __stryke_path_join = require("@stryke/path/join");
10
+
11
+ //#region src/index.tsx
12
+ /**
13
+ * The Upgrade - Shell Shock plugin to add version check functionality and upgrade commands to a Shell Shock application.
14
+ */
15
+ const plugin = (options = {}) => {
16
+ return {
17
+ name: "shell-shock:upgrade",
18
+ config() {
19
+ this.debug("Providing default configuration for the Shell Shock `upgrade` plugin.");
20
+ return { upgrade: options };
21
+ },
22
+ configResolved() {
23
+ this.debug("Adding the CLI upgrade commands to the application context.");
24
+ this.inputs ??= [];
25
+ if (this.inputs.some((input) => input.id === "upgrade")) this.info("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.");
26
+ else this.inputs.push({
27
+ id: "upgrade",
28
+ name: "upgrade",
29
+ alias: ["up", "update"],
30
+ path: "upgrade",
31
+ segments: ["upgrade"],
32
+ title: "Upgrade",
33
+ description: `A command for checking and upgrading the version of the ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this)}.`,
34
+ entry: {
35
+ file: (0, __stryke_path_join.joinPaths)(this.entryPath, "upgrade", "command.ts"),
36
+ input: { file: (0, __stryke_path_join.joinPaths)(this.entryPath, "upgrade", "command.ts") }
37
+ },
38
+ isVirtual: false
39
+ });
40
+ },
41
+ async prepare() {
42
+ this.debug("Rendering upgrade built-in and command modules for the Shell Shock `upgrade` plugin.");
43
+ return (0, __powerlines_plugin_alloy_render.render)(this, [(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_upgrade_builtin.UpgradeBuiltin, {}), (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_upgrade_command.UpgradeCommand, {})]);
44
+ }
45
+ };
46
+ };
47
+ var src_default = plugin;
48
+
49
+ //#endregion
50
+ exports.default = src_default;
51
+ exports.plugin = plugin;
@@ -0,0 +1,12 @@
1
+ import { UpgradePluginContext, UpgradePluginOptions } from "./types/plugin.cjs";
2
+ import { Plugin } from "powerlines";
3
+
4
+ //#region src/index.d.ts
5
+
6
+ /**
7
+ * The Upgrade - Shell Shock plugin to add version check functionality and upgrade commands to a Shell Shock application.
8
+ */
9
+ declare const plugin: <TContext extends UpgradePluginContext = UpgradePluginContext>(options?: UpgradePluginOptions) => Plugin<TContext>;
10
+ //#endregion
11
+ export { plugin as default, plugin };
12
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +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"}
@@ -0,0 +1,12 @@
1
+ import { UpgradePluginContext, UpgradePluginOptions } from "./types/plugin.mjs";
2
+ import { Plugin } from "powerlines";
3
+
4
+ //#region src/index.d.ts
5
+
6
+ /**
7
+ * The Upgrade - Shell Shock plugin to add version check functionality and upgrade commands to a Shell Shock application.
8
+ */
9
+ declare const plugin: <TContext extends UpgradePluginContext = UpgradePluginContext>(options?: UpgradePluginOptions) => Plugin<TContext>;
10
+ //#endregion
11
+ export { plugin as default, plugin };
12
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +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"}
package/dist/index.mjs ADDED
@@ -0,0 +1,49 @@
1
+ import { UpgradeBuiltin } from "./components/upgrade-builtin.mjs";
2
+ import { UpgradeCommand } from "./components/upgrade-command.mjs";
3
+ import "./components/index.mjs";
4
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
5
+ import { render } from "@powerlines/plugin-alloy/render";
6
+ import { getAppTitle } from "@shell-shock/core/plugin-utils";
7
+ import { joinPaths } from "@stryke/path/join";
8
+
9
+ //#region src/index.tsx
10
+ /**
11
+ * The Upgrade - Shell Shock plugin to add version check functionality and upgrade commands to a Shell Shock application.
12
+ */
13
+ const plugin = (options = {}) => {
14
+ return {
15
+ name: "shell-shock:upgrade",
16
+ config() {
17
+ this.debug("Providing default configuration for the Shell Shock `upgrade` plugin.");
18
+ return { upgrade: options };
19
+ },
20
+ configResolved() {
21
+ this.debug("Adding the CLI upgrade commands to the application context.");
22
+ this.inputs ??= [];
23
+ if (this.inputs.some((input) => input.id === "upgrade")) this.info("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.");
24
+ else this.inputs.push({
25
+ id: "upgrade",
26
+ name: "upgrade",
27
+ alias: ["up", "update"],
28
+ path: "upgrade",
29
+ segments: ["upgrade"],
30
+ title: "Upgrade",
31
+ description: `A command for checking and upgrading the version of the ${getAppTitle(this)}.`,
32
+ entry: {
33
+ file: joinPaths(this.entryPath, "upgrade", "command.ts"),
34
+ input: { file: joinPaths(this.entryPath, "upgrade", "command.ts") }
35
+ },
36
+ isVirtual: false
37
+ });
38
+ },
39
+ async prepare() {
40
+ this.debug("Rendering upgrade built-in and command modules for the Shell Shock `upgrade` plugin.");
41
+ return render(this, [createComponent(UpgradeBuiltin, {}), createComponent(UpgradeCommand, {})]);
42
+ }
43
+ };
44
+ };
45
+ var src_default = plugin;
46
+
47
+ //#endregion
48
+ export { src_default as default, plugin };
49
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +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"}
@@ -0,0 +1,4 @@
1
+ const require_types_package_manager = require('./package-manager.cjs');
2
+
3
+ exports.PACKAGE_MANAGERS = require_types_package_manager.PACKAGE_MANAGERS;
4
+ exports.PACKAGE_MANAGER_LOCKFILE_MAP = require_types_package_manager.PACKAGE_MANAGER_LOCKFILE_MAP;
@@ -0,0 +1,3 @@
1
+ import { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig } from "./plugin.cjs";
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 };
@@ -0,0 +1,3 @@
1
+ import { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig } from "./plugin.mjs";
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 };
@@ -0,0 +1,3 @@
1
+ import { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP } from "./package-manager.mjs";
2
+
3
+ export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP };
@@ -0,0 +1,20 @@
1
+
2
+ //#region src/types/package-manager.ts
3
+ const PACKAGE_MANAGERS = [
4
+ "npm",
5
+ "yarn",
6
+ "pnpm",
7
+ "deno",
8
+ "bun"
9
+ ];
10
+ const PACKAGE_MANAGER_LOCKFILE_MAP = {
11
+ "package-lock": "npm",
12
+ yarn: "yarn",
13
+ "pnpm-lock": "pnpm",
14
+ deno: "deno",
15
+ bun: "bun"
16
+ };
17
+
18
+ //#endregion
19
+ exports.PACKAGE_MANAGERS = PACKAGE_MANAGERS;
20
+ exports.PACKAGE_MANAGER_LOCKFILE_MAP = PACKAGE_MANAGER_LOCKFILE_MAP;
@@ -0,0 +1,7 @@
1
+ //#region src/types/package-manager.d.ts
2
+ type PackageManager = "npm" | "yarn" | "pnpm" | "deno" | "bun";
3
+ declare const PACKAGE_MANAGERS: readonly PackageManager[];
4
+ declare const PACKAGE_MANAGER_LOCKFILE_MAP: Record<string, PackageManager>;
5
+ //#endregion
6
+ export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager };
7
+ //# sourceMappingURL=package-manager.d.cts.map
@@ -0,0 +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,4BARyC,EAQX,MARW,CAAA,MAAA,EAQI,cARJ,CAAA"}
@@ -0,0 +1,7 @@
1
+ //#region src/types/package-manager.d.ts
2
+ type PackageManager = "npm" | "yarn" | "pnpm" | "deno" | "bun";
3
+ declare const PACKAGE_MANAGERS: readonly PackageManager[];
4
+ declare const PACKAGE_MANAGER_LOCKFILE_MAP: Record<string, PackageManager>;
5
+ //#endregion
6
+ export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager };
7
+ //# sourceMappingURL=package-manager.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-manager.d.mts","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"}
@@ -0,0 +1,19 @@
1
+ //#region src/types/package-manager.ts
2
+ const PACKAGE_MANAGERS = [
3
+ "npm",
4
+ "yarn",
5
+ "pnpm",
6
+ "deno",
7
+ "bun"
8
+ ];
9
+ const PACKAGE_MANAGER_LOCKFILE_MAP = {
10
+ "package-lock": "npm",
11
+ yarn: "yarn",
12
+ "pnpm-lock": "pnpm",
13
+ deno: "deno",
14
+ bun: "bun"
15
+ };
16
+
17
+ //#endregion
18
+ export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP };
19
+ //# sourceMappingURL=package-manager.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-manager.mjs","names":["PACKAGE_MANAGERS","PACKAGE_MANAGER_LOCKFILE_MAP","yarn","deno","bun"],"sources":["../../src/types/package-manager.ts"],"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\nexport type PackageManager = \"npm\" | \"yarn\" | \"pnpm\" | \"deno\" | \"bun\";\n\nexport const PACKAGE_MANAGERS: readonly PackageManager[] = [\n \"npm\",\n \"yarn\",\n \"pnpm\",\n \"deno\",\n \"bun\"\n] as const;\n\nexport const PACKAGE_MANAGER_LOCKFILE_MAP: Record<string, PackageManager> = {\n \"package-lock\": \"npm\",\n yarn: \"yarn\",\n \"pnpm-lock\": \"pnpm\",\n deno: \"deno\",\n bun: \"bun\"\n} as const;\n"],"mappings":";AAoBA,MAAaA,mBAA8C;CACzD;CACA;CACA;CACA;CACA;CACQ;AAEV,MAAaC,+BAA+D;CAC1E,gBAAgB;CAChBC,MAAM;CACN,aAAa;CACbC,MAAM;CACNC,KAAK;CACG"}
File without changes
@@ -0,0 +1,29 @@
1
+ import { ResolvedConfig, UserConfig } from "@shell-shock/core/types/config";
2
+ import { Context } from "@shell-shock/core/types/context";
3
+
4
+ //#region src/types/plugin.d.ts
5
+ interface UpgradePluginOptions {
6
+ /**
7
+ * Optionally specify the name of the package in npm to check for upgrades.
8
+ *
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.
11
+ */
12
+ packageName?: string;
13
+ }
14
+ type UpgradePluginUserConfig = UserConfig & {
15
+ /**
16
+ * Resolved upgrade configuration for the plugin.
17
+ */
18
+ upgrade: UpgradePluginOptions;
19
+ };
20
+ type UpgradePluginResolvedConfig = ResolvedConfig & {
21
+ /**
22
+ * Resolved upgrade configuration for the plugin.
23
+ */
24
+ upgrade: UpgradePluginOptions;
25
+ };
26
+ type UpgradePluginContext<TResolvedConfig extends UpgradePluginResolvedConfig = UpgradePluginResolvedConfig> = Context<TResolvedConfig>;
27
+ //#endregion
28
+ export { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig };
29
+ //# sourceMappingURL=plugin.d.cts.map
@@ -0,0 +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"}