@shell-shock/plugin-upgrade 0.1.5 → 0.1.7
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 +2 -0
- 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 +177 -65
- package/dist/components/upgrade-builtin.d.cts +9 -1
- package/dist/components/upgrade-builtin.d.cts.map +1 -1
- package/dist/components/upgrade-builtin.d.mts +9 -1
- package/dist/components/upgrade-builtin.d.mts.map +1 -1
- package/dist/components/upgrade-builtin.mjs +176 -66
- package/dist/components/upgrade-builtin.mjs.map +1 -1
- package/dist/index.cjs +10 -4
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/dist/types/env.cjs +0 -0
- package/dist/types/env.d.cts +14 -0
- package/dist/types/env.d.cts.map +1 -0
- package/dist/types/env.d.mts +14 -0
- package/dist/types/env.d.mts.map +1 -0
- package/dist/types/env.mjs +1 -0
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/plugin.d.cts +1 -15
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +1 -15
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +22 -8
|
@@ -245,7 +245,7 @@ function GetPackageManagerFunctionDeclaration() {
|
|
|
245
245
|
type: "GetPackageManagerOptions",
|
|
246
246
|
default: "{}"
|
|
247
247
|
}],
|
|
248
|
-
returnType: code`
|
|
248
|
+
returnType: code`"npm" | "yarn" | "deno" | "pnpm" | "bun"`,
|
|
249
249
|
get children() {
|
|
250
250
|
return [
|
|
251
251
|
createComponent(VarDeclaration, {
|
|
@@ -530,7 +530,7 @@ function FetchNpmPackageFunctionDeclaration() {
|
|
|
530
530
|
name: "packageName",
|
|
531
531
|
type: "string"
|
|
532
532
|
}],
|
|
533
|
-
returnType: code`
|
|
533
|
+
returnType: code`NpmPackage | undefined`,
|
|
534
534
|
get children() {
|
|
535
535
|
return [
|
|
536
536
|
createComponent(VarDeclaration, {
|
|
@@ -577,7 +577,7 @@ function GetLatestVersionFunctionDeclaration() {
|
|
|
577
577
|
default: `"${context.packageJson.name}"`
|
|
578
578
|
}];
|
|
579
579
|
},
|
|
580
|
-
returnType: code`
|
|
580
|
+
returnType: code`string | undefined`,
|
|
581
581
|
get children() {
|
|
582
582
|
return [
|
|
583
583
|
createComponent(VarDeclaration, {
|
|
@@ -625,7 +625,7 @@ function GetUpgradeCommandFunctionDeclaration() {
|
|
|
625
625
|
type: "string",
|
|
626
626
|
default: "process.cwd()"
|
|
627
627
|
}],
|
|
628
|
-
returnType: "
|
|
628
|
+
returnType: "string[]",
|
|
629
629
|
get children() {
|
|
630
630
|
return [
|
|
631
631
|
createComponent(VarDeclaration, {
|
|
@@ -768,6 +768,92 @@ function UpgradeFunctionDeclaration() {
|
|
|
768
768
|
];
|
|
769
769
|
}
|
|
770
770
|
/**
|
|
771
|
+
* The `updateVersionCheckFile` handler function declaration code for the Shell Shock project.
|
|
772
|
+
*/
|
|
773
|
+
function UpdateVersionCheckFileFunctionDeclaration() {
|
|
774
|
+
return [createComponent(TSDoc, {
|
|
775
|
+
heading: "A helper function that updates the version check file.",
|
|
776
|
+
get children() {
|
|
777
|
+
return [
|
|
778
|
+
createComponent(TSDocRemarks, { children: `This function is used to update the version check file with the current timestamp. It can be used in the CLI upgrade command to record the last time a check for updates was performed. The function writes a "version-check.json" file in the data directory, which contains a timestamp of the last check for updates.` }),
|
|
779
|
+
createComponent(Spacing, {}),
|
|
780
|
+
createComponent(TSDocReturns, { children: `A promise that resolves to a boolean indicating whether a check for updates is required.` })
|
|
781
|
+
];
|
|
782
|
+
}
|
|
783
|
+
}), createComponent(FunctionDeclaration, {
|
|
784
|
+
"export": true,
|
|
785
|
+
async: true,
|
|
786
|
+
name: "updateVersionCheckFile",
|
|
787
|
+
returnType: "void",
|
|
788
|
+
get children() {
|
|
789
|
+
return [createComponent(IfStatement, {
|
|
790
|
+
condition: code`!existsSync(paths.data)`,
|
|
791
|
+
children: code`await mkdir(paths.data, { recursive: true }); `
|
|
792
|
+
}), code`await writeFile(join(paths.data, "version-check.json"), JSON.stringify({ timestamp: new Date().getTime() }), "utf8"); `];
|
|
793
|
+
}
|
|
794
|
+
})];
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* The `isCheckForUpdatesRequired` handler function declaration code for the Shell Shock project.
|
|
798
|
+
*/
|
|
799
|
+
function IsCheckForUpdatesRequiredFunctionDeclaration() {
|
|
800
|
+
const context = usePowerlines();
|
|
801
|
+
return [createComponent(TSDoc, {
|
|
802
|
+
heading: "A helper function that verifies if a check for updates is required.",
|
|
803
|
+
get children() {
|
|
804
|
+
return [
|
|
805
|
+
createComponent(TSDocRemarks, { children: `This function is used to determine if a check for updates is required based on the last time a check was performed. It can be used in the CLI upgrade command to avoid unnecessary checks for updates if one was recently performed. The function checks for the existence of a "version-check.json" file in the data directory, which contains a timestamp of the last check for updates. If the file does not exist or if the timestamp is older than a specified stale time, the function will return true, indicating that a check for updates is required. Otherwise, it will return false.` }),
|
|
806
|
+
createComponent(Spacing, {}),
|
|
807
|
+
createComponent(TSDocReturns, { children: `A promise that resolves to a boolean indicating whether a check for updates is required.` })
|
|
808
|
+
];
|
|
809
|
+
}
|
|
810
|
+
}), createComponent(FunctionDeclaration, {
|
|
811
|
+
"export": true,
|
|
812
|
+
async: true,
|
|
813
|
+
name: "isCheckForUpdatesRequired",
|
|
814
|
+
get children() {
|
|
815
|
+
return [
|
|
816
|
+
createComponent(IfStatement, {
|
|
817
|
+
condition: code`!isInteractive || isCI || env.SKIP_VERSION_CHECK`,
|
|
818
|
+
children: code`return false; `
|
|
819
|
+
}),
|
|
820
|
+
createComponent(Spacing, {}),
|
|
821
|
+
createComponent(VarDeclaration, {
|
|
822
|
+
"const": true,
|
|
823
|
+
name: "filePath",
|
|
824
|
+
initializer: code`join(paths.data, "version-check.json"); `
|
|
825
|
+
}),
|
|
826
|
+
createComponent(IfStatement, {
|
|
827
|
+
condition: code`existsSync(filePath)`,
|
|
828
|
+
get children() {
|
|
829
|
+
return [
|
|
830
|
+
createComponent(VarDeclaration, {
|
|
831
|
+
"const": true,
|
|
832
|
+
name: "file",
|
|
833
|
+
type: "{ timestamp: number; }",
|
|
834
|
+
initializer: code` JSON.parse(await readFile(filePath, "utf8")); `
|
|
835
|
+
}),
|
|
836
|
+
createComponent(IfStatement, {
|
|
837
|
+
condition: code`!file.timestamp`,
|
|
838
|
+
children: code`await updateVersionCheckFile();
|
|
839
|
+
return true; `
|
|
840
|
+
}),
|
|
841
|
+
createComponent(ElseIfClause, {
|
|
842
|
+
get condition() {
|
|
843
|
+
return code`new Date().getTime() - file.timestamp < ${context.config.upgrade.staleTime}`;
|
|
844
|
+
},
|
|
845
|
+
children: code`return false; `
|
|
846
|
+
})
|
|
847
|
+
];
|
|
848
|
+
}
|
|
849
|
+
}),
|
|
850
|
+
createComponent(ElseClause, { children: code`await updateVersionCheckFile();
|
|
851
|
+
return true; ` })
|
|
852
|
+
];
|
|
853
|
+
}
|
|
854
|
+
})];
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
771
857
|
* The `checkForUpdates` handler function declaration code for the Shell Shock project.
|
|
772
858
|
*/
|
|
773
859
|
function CheckForUpdatesFunctionDeclaration() {
|
|
@@ -777,13 +863,32 @@ function CheckForUpdatesFunctionDeclaration() {
|
|
|
777
863
|
"export": true,
|
|
778
864
|
name: "CheckForUpdatesOptions",
|
|
779
865
|
"extends": "GetPackageManagerOptions",
|
|
780
|
-
doc: "Options for the `checkForUpdates` handler function."
|
|
866
|
+
doc: "Options for the `checkForUpdates` handler function.",
|
|
867
|
+
get children() {
|
|
868
|
+
return createComponent(InterfaceMember, {
|
|
869
|
+
name: "force",
|
|
870
|
+
optional: true,
|
|
871
|
+
type: "boolean",
|
|
872
|
+
doc: "Whether to force a check for updates regardless of the last check timestamp. If set to `true`, the function will bypass the timestamp check and perform a check for updates, updating the timestamp in the process. This can be useful if you want to ensure that a check for updates is performed even if one was recently done, such as when the user explicitly requests it or when certain conditions are met that warrant an immediate check."
|
|
873
|
+
});
|
|
874
|
+
}
|
|
781
875
|
}),
|
|
782
876
|
createComponent(Spacing, {}),
|
|
783
877
|
createComponent(InterfaceDeclaration, {
|
|
784
|
-
"
|
|
785
|
-
|
|
786
|
-
|
|
878
|
+
name: "CheckForUpdatesBaseResult",
|
|
879
|
+
get children() {
|
|
880
|
+
return createComponent(InterfaceMember, {
|
|
881
|
+
name: "isError",
|
|
882
|
+
type: "boolean",
|
|
883
|
+
optional: true,
|
|
884
|
+
doc: "Indicates whether an error occurred while checking for updates."
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
}),
|
|
888
|
+
createComponent(Spacing, {}),
|
|
889
|
+
createComponent(InterfaceDeclaration, {
|
|
890
|
+
name: "CheckForUpdatesSuccessResult",
|
|
891
|
+
"extends": "CheckForUpdatesBaseResult",
|
|
787
892
|
get children() {
|
|
788
893
|
return [
|
|
789
894
|
createComponent(InterfaceMember, {
|
|
@@ -807,18 +912,32 @@ function CheckForUpdatesFunctionDeclaration() {
|
|
|
807
912
|
createComponent(InterfaceMember, {
|
|
808
913
|
name: "package",
|
|
809
914
|
type: "NpmPackage",
|
|
915
|
+
optional: true,
|
|
810
916
|
doc: "The npm package that was checked for updates."
|
|
811
|
-
}),
|
|
812
|
-
createIntrinsic("hbr", {}),
|
|
813
|
-
createComponent(InterfaceMember, {
|
|
814
|
-
name: "packageManager",
|
|
815
|
-
type: "'npm' | 'yarn' | 'pnpm' | 'deno' | 'bun'",
|
|
816
|
-
doc: "The package manager used to check for updates."
|
|
817
917
|
})
|
|
818
918
|
];
|
|
819
919
|
}
|
|
820
920
|
}),
|
|
821
921
|
createComponent(Spacing, {}),
|
|
922
|
+
createComponent(InterfaceDeclaration, {
|
|
923
|
+
name: "CheckForUpdatesErrorResult",
|
|
924
|
+
"extends": "CheckForUpdatesBaseResult",
|
|
925
|
+
get children() {
|
|
926
|
+
return createComponent(InterfaceMember, {
|
|
927
|
+
name: "error",
|
|
928
|
+
type: "Error",
|
|
929
|
+
doc: "The error that occurred while checking for updates."
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
}),
|
|
933
|
+
createComponent(Spacing, {}),
|
|
934
|
+
createComponent(TypeDeclaration, {
|
|
935
|
+
"export": true,
|
|
936
|
+
name: "CheckForUpdatesResult",
|
|
937
|
+
doc: "The result for the `checkForUpdates` handler function.",
|
|
938
|
+
children: code`CheckForUpdatesSuccessResult | CheckForUpdatesErrorResult;`
|
|
939
|
+
}),
|
|
940
|
+
createComponent(Spacing, {}),
|
|
822
941
|
createComponent(TSDoc, {
|
|
823
942
|
heading: "Check for updates to the application dependencies.",
|
|
824
943
|
get children() {
|
|
@@ -842,67 +961,41 @@ function CheckForUpdatesFunctionDeclaration() {
|
|
|
842
961
|
type: "CheckForUpdatesOptions",
|
|
843
962
|
default: "{}"
|
|
844
963
|
}],
|
|
845
|
-
returnType: "
|
|
964
|
+
returnType: "CheckForUpdatesResult",
|
|
846
965
|
get children() {
|
|
847
966
|
return [
|
|
848
|
-
createComponent(VarDeclaration, {
|
|
849
|
-
"const": true,
|
|
850
|
-
name: "filePath",
|
|
851
|
-
initializer: code`join(paths.data, "version-check.json"); `
|
|
852
|
-
}),
|
|
853
967
|
createComponent(IfStatement, {
|
|
854
|
-
condition: code
|
|
968
|
+
condition: code`!options.force && !(await isCheckForUpdatesRequired())`,
|
|
855
969
|
get children() {
|
|
856
|
-
return
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
}),
|
|
863
|
-
createComponent(IfStatement, {
|
|
864
|
-
condition: code`!file.timestamp`,
|
|
865
|
-
children: code`await writeFile(filePath, JSON.stringify({ timestamp: new Date().getTime() }), "utf8");
|
|
866
|
-
return undefined; `
|
|
867
|
-
}),
|
|
868
|
-
createComponent(ElseIfClause, {
|
|
869
|
-
get condition() {
|
|
870
|
-
return code`new Date().getTime() - file.timestamp < ${context.config.upgrade.staleTime}`;
|
|
871
|
-
},
|
|
872
|
-
children: code`return undefined; `
|
|
873
|
-
})
|
|
874
|
-
];
|
|
970
|
+
return code`return {
|
|
971
|
+
latestVersion: "${context.packageJson.version}",
|
|
972
|
+
currentVersion: "${context.packageJson.version}",
|
|
973
|
+
isUpToDate: true,
|
|
974
|
+
isError: false,
|
|
975
|
+
}; `;
|
|
875
976
|
}
|
|
876
977
|
}),
|
|
877
|
-
createComponent(ElseClause, { children: code`await writeFile(filePath, JSON.stringify({ timestamp: new Date().getTime() }), "utf8");
|
|
878
|
-
return undefined; ` }),
|
|
879
|
-
createComponent(Spacing, {}),
|
|
880
|
-
createComponent(VarDeclaration, {
|
|
881
|
-
"const": true,
|
|
882
|
-
name: "packageManager",
|
|
883
|
-
initializer: code`await getPackageManager(options); `
|
|
884
|
-
}),
|
|
885
978
|
createComponent(Spacing, {}),
|
|
979
|
+
code`try { `,
|
|
886
980
|
createComponent(VarDeclaration, {
|
|
887
981
|
"const": true,
|
|
888
982
|
name: "pkg",
|
|
889
|
-
initializer
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
createComponent(IfStatement, {
|
|
893
|
-
condition: code`!pkg`,
|
|
894
|
-
children: code`return undefined; `
|
|
983
|
+
get initializer() {
|
|
984
|
+
return code`await fetchNpmPackage("${context.packageJson.name}"); `;
|
|
985
|
+
}
|
|
895
986
|
}),
|
|
896
987
|
createComponent(Spacing, {}),
|
|
897
|
-
memo(() => code`
|
|
898
|
-
|
|
988
|
+
memo(() => code`
|
|
899
989
|
return {
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
990
|
+
latestVersion: pkg?.version || "${context.packageJson.version}",
|
|
991
|
+
currentVersion: "${context.packageJson.version}",
|
|
992
|
+
isUpToDate: pkg ? "${context.packageJson.version}" === pkg.version : true,
|
|
993
|
+
package: pkg,
|
|
994
|
+
isError: false,
|
|
995
|
+
};
|
|
996
|
+
} catch (err) {
|
|
997
|
+
return { isError: true, error: err instanceof Error ? err : new Error(String(err)) };
|
|
998
|
+
} `)
|
|
906
999
|
];
|
|
907
1000
|
}
|
|
908
1001
|
})
|
|
@@ -922,7 +1015,11 @@ function UpgradeBuiltin(props) {
|
|
|
922
1015
|
"node:os": "os",
|
|
923
1016
|
"node:path": ["join", "resolve"],
|
|
924
1017
|
"node:fs": ["existsSync"],
|
|
925
|
-
"node:fs/promises": [
|
|
1018
|
+
"node:fs/promises": [
|
|
1019
|
+
"readFile",
|
|
1020
|
+
"writeFile",
|
|
1021
|
+
"mkdir"
|
|
1022
|
+
],
|
|
926
1023
|
"node:process": "process"
|
|
927
1024
|
});
|
|
928
1025
|
},
|
|
@@ -933,8 +1030,17 @@ function UpgradeBuiltin(props) {
|
|
|
933
1030
|
"verbose",
|
|
934
1031
|
"writeLine"
|
|
935
1032
|
],
|
|
936
|
-
env: [
|
|
937
|
-
|
|
1033
|
+
env: [
|
|
1034
|
+
"paths",
|
|
1035
|
+
"isWindows",
|
|
1036
|
+
"isCI",
|
|
1037
|
+
"env"
|
|
1038
|
+
],
|
|
1039
|
+
utils: [
|
|
1040
|
+
"isColorSupported",
|
|
1041
|
+
"isInteractive",
|
|
1042
|
+
"spawn"
|
|
1043
|
+
]
|
|
938
1044
|
});
|
|
939
1045
|
},
|
|
940
1046
|
get children() {
|
|
@@ -969,6 +1075,10 @@ function UpgradeBuiltin(props) {
|
|
|
969
1075
|
createComponent(Spacing, {}),
|
|
970
1076
|
createComponent(CheckForUpdatesFunctionDeclaration, {}),
|
|
971
1077
|
createComponent(Spacing, {}),
|
|
1078
|
+
createComponent(IsCheckForUpdatesRequiredFunctionDeclaration, {}),
|
|
1079
|
+
createComponent(Spacing, {}),
|
|
1080
|
+
createComponent(UpdateVersionCheckFileFunctionDeclaration, {}),
|
|
1081
|
+
createComponent(Spacing, {}),
|
|
972
1082
|
createComponent(Show, {
|
|
973
1083
|
get when() {
|
|
974
1084
|
return Boolean(children);
|
|
@@ -981,5 +1091,5 @@ function UpgradeBuiltin(props) {
|
|
|
981
1091
|
}
|
|
982
1092
|
|
|
983
1093
|
//#endregion
|
|
984
|
-
export { CheckForUpdatesFunctionDeclaration, FetchNpmPackageFunctionDeclaration, GetLatestVersionFunctionDeclaration, GetPackageManagerFunctionDeclaration, GetUpgradeCommandFunctionDeclaration, LocateLockfileFunctionDeclaration, LocatePackageJsonFunctionDeclaration, UpgradeBuiltin, UpgradeFunctionDeclaration };
|
|
1094
|
+
export { CheckForUpdatesFunctionDeclaration, FetchNpmPackageFunctionDeclaration, GetLatestVersionFunctionDeclaration, GetPackageManagerFunctionDeclaration, GetUpgradeCommandFunctionDeclaration, IsCheckForUpdatesRequiredFunctionDeclaration, LocateLockfileFunctionDeclaration, LocatePackageJsonFunctionDeclaration, UpdateVersionCheckFileFunctionDeclaration, UpgradeBuiltin, UpgradeFunctionDeclaration };
|
|
985
1095
|
//# sourceMappingURL=upgrade-builtin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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,C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C1CC,KAAK,CAAC,SAAS,YAAY;IAC3BC,OAAO,CAAC,oBAAoB,QAAO;IACpC,CAAC;;EAAA,IAAAlC,WAAA;AAAA,UAAA;IAAAH,gBACDb,gBAAc;KAAA,SAAA;KAEbc,MAAI;KACJI,MAAI;KACJM,aAAahC,IAAI;KAAgB,CAAA;IAAAqB,gBAElCZ,SAAO,EAAA,CAAA;IAAAY,gBACPb,gBAAc;KAAA,SAAA;KAEbc,MAAI;KACJI,MAAI;KACJM,aAAahC,IAAI;KAAe,CAAA;IAAAqB,gBAEjCZ,SAAO,EAAA,CAAA;IAAAY,gBACPF,sCAAoC,EAAA,CAAA;IAAAE,gBACpCZ,SAAO,EAAA,CAAA;IAAAY,gBACPe,mCAAiC,EAAA,CAAA;IAAAf,gBACjCZ,SAAO,EAAA,CAAA;IAAAY,gBACPgB,sCAAoC,EAAA,CAAA;IAAAhB,gBACpCZ,SAAO,EAAA,CAAA;IAAAY,gBACPiB,oCAAkC,EAAA,CAAA;IAAAjB,gBAClCZ,SAAO,EAAA,CAAA;IAAAY,gBACPkB,qCAAmC,EAAA,CAAA;IAAAlB,gBACnCZ,SAAO,EAAA,CAAA;IAAAY,gBACPmB,sCAAoC,EAAA,CAAA;IAAAnB,gBACpCZ,SAAO,EAAA,CAAA;IAAAY,gBACPoB,4BAA0B,EAAA,CAAA;IAAApB,gBAC1BZ,SAAO,EAAA,CAAA;IAAAY,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"}
|
|
1
|
+
{"version":3,"file":"upgrade-builtin.mjs","names":["code","Show","splitProps","ElseClause","ElseIfClause","FunctionDeclaration","IfStatement","InterfaceDeclaration","VarDeclaration","Spacing","usePowerlines","InterfaceMember","TSDoc","TSDocParam","TSDocRemarks","TSDocReturns","TypeDeclaration","BuiltinFile","defu","LocatePackageJsonFunctionDeclaration","context","_$createComponent","name","doc","children","optional","type","heading","async","parameters","default","returnType","initializer","_$createIntrinsic","condition","packageJson","LocateLockfileFunctionDeclaration","GetPackageManagerFunctionDeclaration","FetchNpmPackageFunctionDeclaration","GetLatestVersionFunctionDeclaration","GetUpgradeCommandFunctionDeclaration","UpgradeFunctionDeclaration","UpdateVersionCheckFileFunctionDeclaration","IsCheckForUpdatesRequiredFunctionDeclaration","config","upgrade","staleTime","CheckForUpdatesFunctionDeclaration","version","_$memo","UpgradeBuiltin","props","rest","_$mergeProps","id","description","imports","builtinImports","console","env","utils","when","Boolean"],"sources":["../../src/components/upgrade-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport {\n ElseClause,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n InterfaceMember,\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns,\n TypeDeclaration\n} from \"@powerlines/plugin-alloy/typescript\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport defu from \"defu\";\nimport type { UpgradePluginContext } from \"../types/plugin\";\n\n/**\n * The `locatePackageJson` handler function declaration code for the Shell Shock project.\n */\nexport function LocatePackageJsonFunctionDeclaration() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"LocatePackageJsonOptions\"\n doc=\"Options for the `locatePackageJson` handler function.\">\n <InterfaceMember\n name=\"cwd\"\n optional\n type=\"string\"\n doc=\"The current working directory to use. If not provided, the process's current working directory will be used.\"\n />\n <Spacing />\n <InterfaceMember\n name=\"isDependencyRequired\"\n optional\n type=\"boolean\"\n doc=\"Whether to only locate a package.json file if it contains the application as a dependency. If set to `true`, the function will check if the located package.json file has the application listed as a dependency in its dependencies, devDependencies, peerDependencies, or optionalDependencies before returning its path. This can be useful in monorepo setups where multiple package.json files may exist, but only the one that includes the application as a dependency is relevant for upgrade purposes.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Locate the package.json file currently being used by the command-line/workspace.\">\n <TSDocRemarks>\n {`This function is used to determine the package.json file currently being used by the command-line/workspace. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`locatePackageJson\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the package.json file currently being used by the command-line/workspace as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"locatePackageJson\"\n parameters={[\n {\n name: \"options\",\n type: \"LocatePackageJsonOptions\",\n default: \"{}\"\n }\n ]}\n returnType=\"string | undefined\">\n <VarDeclaration\n let\n name=\"currentPath\"\n type=\"string\"\n initializer={code`options.cwd ?? process.cwd(); `}\n />\n <hbr />\n <VarDeclaration\n let\n name=\"parentPath\"\n initializer={code`resolve(currentPath, \"..\"); `}\n />\n <Spacing />\n {code`while (parentPath !== currentPath && currentPath !== homePath && currentPath !== tempPath) { `}\n <VarDeclaration\n const\n name=\"packageJsonPath\"\n initializer={code`join(currentPath, \"package.json\"); `}\n />\n <IfStatement condition={code`existsSync(packageJsonPath)`}>\n <IfStatement condition={code`options.isDependencyRequired`}>\n <VarDeclaration\n const\n name=\"packageJson\"\n initializer={code`JSON.parse(await readFile(packageJsonPath, \"utf8\")); `}\n />\n <IfStatement\n condition={code`Object.keys(packageJson.dependencies || {}).concat(Object.keys(packageJson.devDependencies || {})).concat(Object.keys(packageJson.peerDependencies || {})).concat(Object.keys(packageJson.optionalDependencies || {})).some(dep => dep === \"${context.packageJson.name}\" || dep.startsWith(\"${context.packageJson.name}@\"))`}>\n {code`return packageJsonPath; `}\n </IfStatement>\n </IfStatement>\n <ElseClause>{code`return packageJsonPath; `}</ElseClause>\n </IfStatement>\n <ElseClause>\n {code`currentPath = parentPath;\n parentPath = resolve(currentPath, \"..\"); `}\n </ElseClause>\n {code` }\n\n return undefined; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `locateLockfile` handler function declaration code for the Shell Shock project.\n */\nexport function LocateLockfileFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"LocateLockfileOptions\"\n doc=\"Options for the `locateLockfile` handler function.\">\n <InterfaceMember\n name=\"cwd\"\n optional\n type=\"string\"\n doc=\"The current working directory to use. If not provided, the process's current working directory will be used.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Locate the lockfile currently being used by the command-line/workspace.\">\n <TSDocRemarks>\n {`This function is used to determine the lockfile currently being used by the command-line/workspace. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`locateLockfile\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the lockfile currently being used by the command-line/workspace as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"locateLockfile\"\n parameters={[\n {\n name: \"options\",\n type: \"LocateLockfileOptions\",\n default: \"{}\"\n }\n ]}\n returnType=\"string | undefined\">\n <VarDeclaration\n let\n name=\"currentPath\"\n type=\"string\"\n initializer={code`options.cwd ?? process.cwd(); `}\n />\n <hbr />\n <VarDeclaration\n let\n name=\"parentPath\"\n initializer={code`resolve(currentPath, \"..\"); `}\n />\n <Spacing />\n {code`while (parentPath !== currentPath && currentPath !== homePath && currentPath !== tempPath) { `}\n <VarDeclaration\n const\n name=\"lockfile\"\n initializer={code`[\n \"package-lock.json\",\n \"npm-shrinkwrap.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"pnpm-workspace.yaml\",\n \"deno.lock\",\n \"deno.json\",\n \"deno.jsonc\",\n \"bun.lock\",\n \"bun.lockb\"\n ].find(lf => existsSync(join(currentPath, lf))); `}\n />\n <hbr />\n <IfStatement condition={code`lockfile`}>\n {code`return lockfile; `}\n </IfStatement>\n <ElseClause>\n {code`currentPath = parentPath;\n parentPath = resolve(currentPath, \"..\"); `}\n </ElseClause>\n {code` }\n\n return undefined; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `getPackageManager` handler function declaration code for the Shell Shock project.\n */\nexport function GetPackageManagerFunctionDeclaration() {\n return (\n <>\n {code`declare global {\n var Bun: any;\n namespace NodeJS {\n interface ProcessVersions {\n bun?: string;\n }\n }\n } `}\n <Spacing />\n <TypeDeclaration\n export\n name=\"GetPackageManagerOptions\"\n doc=\"Options for the `getPackageManager` handler function.\">{code`LocateLockfileOptions;`}</TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Get the package manager currently being used by the command-line/workspace.\">\n <TSDocRemarks>\n {`This function is used to determine the package manager currently being used by the command-line/workspace. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`getPackageManager\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the package manager currently being used by the command-line/workspace as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"getPackageManager\"\n parameters={[\n {\n name: \"options\",\n type: \"GetPackageManagerOptions\",\n default: \"{}\"\n }\n ]}\n returnType={code`\"npm\" | \"yarn\" | \"deno\" | \"pnpm\" | \"bun\"`}>\n <VarDeclaration\n const\n name=\"userAgent\"\n type=\"string\"\n initializer={code`process.env.npm_config_user_agent ?? \"\"; `}\n />\n <hbr />\n <VarDeclaration\n const\n name=\"execPath\"\n type=\"string\"\n initializer={code`process.env.npm_execpath ?? \"\"; `}\n />\n <Spacing />\n <IfStatement\n condition={code`userAgent.startsWith(\"yarn\") || execPath.includes(\"yarn\")`}>\n {code`return \"yarn\"; `}\n </IfStatement>\n <ElseIfClause\n condition={code`userAgent.startsWith(\"pnpm\") || execPath.includes(\"pnpm\")`}>\n {code`return \"pnpm\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`userAgent.startsWith(\"bun\") || execPath.includes(\"bun\") || typeof Bun !== \"undefined\" || process.versions.bun`}>\n {code`return \"bun\"; `}\n </ElseIfClause>\n <ElseClause>\n <VarDeclaration\n const\n name=\"lockfilePath\"\n initializer={code`locateLockfile(options); `}\n />\n <Spacing />\n <IfStatement condition={code`lockfilePath === \"yarn.lock\"`}>\n {code`return \"yarn\"; `}\n </IfStatement>\n <ElseIfClause\n condition={code`lockfilePath === \"deno.lock\" || lockfilePath === \"deno.json\" || lockfilePath === \"deno.jsonc\"`}>\n {code`return \"deno\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`lockfilePath === \"pnpm-lock.yaml\" || lockfilePath === \"pnpm-workspace.yaml\"`}>\n {code`return \"pnpm\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`lockfilePath === \"bun.lock\" || lockfilePath === \"bun.lockb\"`}>\n {code`return \"bun\"; `}\n </ElseIfClause>\n <ElseClause>\n <VarDeclaration\n const\n name=\"packageJsonPath\"\n initializer={code`await locatePackageJson(options); `}\n />\n <IfStatement\n condition={code`packageJsonPath && existsSync(packageJsonPath)`}>\n <VarDeclaration\n const\n name=\"packageJson\"\n initializer={code`JSON.parse(await readFile(packageJsonPath, \"utf8\")); `}\n />\n <IfStatement\n condition={code`packageJson.devEngines?.packageManager?.name && typeof packageJson.devEngines.packageManager.name === \"string\" && [\"npm\", \"yarn\", \"pnpm\", \"deno\", \"bun\"].includes(packageJson.devEngines.packageManager.name)`}>\n {code`return packageJson.devEngines.packageManager.name; `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n const\n name=\"dependencies\"\n initializer={code`{\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n ...packageJson.peerDependencies,\n ...packageJson.optionalDependencies,\n }; `}\n />\n <IfStatement\n condition={code`Object.keys(dependencies).some(dep => dep === \"yarn\" || dep.startsWith(\"yarn@\") || dep === \"yarnpkg\" || dep.startsWith(\"yarnpkg@\"))`}>\n {code`return \"yarn\"; `}\n </IfStatement>\n <ElseIfClause\n condition={code`Object.keys(dependencies).some(dep => dep === \"bun\" || dep.startsWith(\"bun@\"))`}>\n {code`return \"bun\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`Object.keys(dependencies).some(dep => dep === \"pnpm\" || dep.startsWith(\"pnpm@\"))`}>\n {code`return \"pnpm\"; `}\n </ElseIfClause>\n <ElseIfClause\n condition={code`Object.keys(dependencies).some(dep => dep === \"deno\" || dep.startsWith(\"deno@\"))`}>\n {code`return \"deno\"; `}\n </ElseIfClause>\n </IfStatement>\n <Spacing />\n {code`return \"npm\"; `}\n </ElseClause>\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `fetchNpmPackage` handler function declaration code for the Shell Shock project.\n */\nexport function FetchNpmPackageFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"NpmPackageMaintainer\"\n doc=\"Represents a maintainer of an npm package.\">\n <InterfaceMember\n name=\"email\"\n type=\"string\"\n doc=\"The email of the npm package maintainer.\"\n />\n <hbr />\n <InterfaceMember\n name=\"username\"\n type=\"string\"\n doc=\"The username of the npm package maintainer.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackageLinks\"\n doc=\"Represents the links of an npm package.\">\n <InterfaceMember\n name=\"homepage\"\n type=\"string\"\n optional\n doc=\"The homepage of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"repository\"\n type=\"string\"\n optional\n doc=\"The repository of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"bugs\"\n type=\"string\"\n optional\n doc=\"The bugs page of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"npm\"\n type=\"string\"\n optional\n doc=\"The npm page of the npm package.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackage\"\n doc=\"Represents an npm package.\">\n <InterfaceMember\n name=\"name\"\n type=\"string\"\n doc=\"The name of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"date\"\n type=\"Date\"\n doc=\"The date when the npm package was last updated.\"\n />\n <hbr />\n <InterfaceMember\n name=\"version\"\n type=\"string\"\n doc=\"The version of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"description\"\n type=\"string\"\n optional\n doc=\"The description of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"keywords\"\n type=\"string[]\"\n doc=\"A list of keywords associated with the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"license\"\n type=\"string\"\n optional\n doc=\"The license of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"maintainers\"\n type=\"NpmPackageMaintainer[]\"\n doc=\"The maintainers of the npm package.\"\n />\n <hbr />\n <InterfaceMember\n name=\"links\"\n type=\"NpmPackageLinks\"\n doc=\"The links of the npm package.\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackageSearchResultItem\"\n doc=\"Represents an npm package search result item.\">\n <InterfaceMember\n name=\"package\"\n type=\"NpmPackage\"\n doc=\"The npm package details.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"NpmPackageSearchResult\"\n doc=\"Represents an npm package search result.\">\n <InterfaceMember\n name=\"objects\"\n type=\"NpmPackageSearchResultItem[]\"\n doc=\"The list of npm package search result items.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Fetch details of an npm package.\">\n <TSDocRemarks>\n {`This function is used to fetch an npm package. It can be used in the CLI upgrade command to check if the application is using npm, yarn, or another package manager.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"packageName\">\n {`The name of the npm package to fetch.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the npm package details or undefined if the package is not found.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"fetchNpmPackage\"\n parameters={[\n {\n name: \"packageName\",\n type: \"string\"\n }\n ]}\n returnType={code`NpmPackage | undefined`}>\n <VarDeclaration\n const\n name=\"result\"\n initializer={code` await fetch(\\`https://registry.npmjs.com/-/v1/search?text=\\${packageName}&size=1\\`).then(res => res.json()) as NpmPackageSearchResult; `}\n />\n <hbr />\n <IfStatement\n condition={code`result.objects && result.objects.length > 0 && result.objects[0].package && result.objects[0].package.name === packageName`}>\n {code`return result.objects[0].package; `}\n </IfStatement>\n <ElseClause>{code`return undefined; `}</ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `getLatestVersion` handler function declaration code for the Shell Shock project.\n */\nexport function GetLatestVersionFunctionDeclaration() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <>\n <TSDoc heading=\"Get the latest version of the application from the npm registry.\">\n <TSDocRemarks>\n {`This function is used to retrieve the latest version of the application from the npm registry. It can be used in the CLI upgrade command to check if there is a newer version of the application available.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"packageName\">\n {`The name of the npm package to fetch.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves to the latest version of the specified npm package as a string.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"getLatestVersion\"\n parameters={[\n {\n name: \"packageName\",\n default: `\"${context.packageJson.name}\"`\n }\n ]}\n returnType={code`string | undefined`}>\n <VarDeclaration\n const\n name=\"result\"\n initializer={code`await fetchNpmPackage(packageName); `}\n />\n <Spacing />\n {code`return result?.version; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `upgrade` handler function declaration code for the Shell Shock project.\n */\nexport function GetUpgradeCommandFunctionDeclaration() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <>\n <TSDoc heading=\"A function to get the upgrade command for a specific package manager.\">\n <TSDocRemarks>\n {`This function is used to get the appropriate upgrade command for a specific package manager. It can be used in the CLI upgrade command to determine which command to run based on the package manager being used by the application.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"packageManager\">\n {`The name of the package manager to get the upgrade command for. This should be one of \"npm\", \"yarn\", \"pnpm\", \"deno\", or \"bun\".`}\n </TSDocParam>\n <TSDocParam name=\"cwd\">\n {`The current working directory to use when determining the upgrade command. This can be used to locate the appropriate package.json and lockfile to determine how to run the upgrade command. If not provided, the process's current working directory will be used.`}\n </TSDocParam>\n <TSDocReturns>\n {`An array of strings representing the command and its arguments to run in order to upgrade the application dependencies using the specified package manager.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"getUpgradeCommand\"\n parameters={[\n {\n name: \"packageManager\",\n type: \"string\"\n },\n {\n name: \"cwd\",\n type: \"string\",\n default: \"process.cwd()\"\n }\n ]}\n returnType=\"string[]\">\n <VarDeclaration\n const\n name=\"version\"\n initializer={code`(await getLatestVersion(\"${context.packageJson.name}\")) || \"latest\"; `}\n />\n <Spacing />\n <IfStatement condition={code`packageManager === \"yarn\"`}>\n {code`return [\"upgrade\", \\`${\n context.packageJson.name\n }@\\${version}\\`]; `}\n </IfStatement>\n <ElseIfClause condition={code`packageManager === \"pnpm\"`}>\n {code`return [\"update\", \\`${\n context.packageJson.name\n }@\\${version}\\`]; `}\n </ElseIfClause>\n <ElseIfClause condition={code`packageManager === \"deno\"`}>\n {code`return [\"outdated\", \"--update\", \\`${\n context.packageJson.name\n }@\\${version}\\`]; `}\n </ElseIfClause>\n <ElseIfClause condition={code`packageManager === \"bun\"`}>\n {code`return [\"update\", \"--save\", \\`${\n context.packageJson.name\n }@\\${version}\\`]; `}\n </ElseIfClause>\n <ElseClause>{code`return [\"update\", \"--save\", \"--bin-links\", \\`${\n context.packageJson.name\n }@\\${version}\\`]; `}</ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `upgrade` handler function declaration code for the Shell Shock project.\n */\nexport function UpgradeFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n name=\"UpgradeBaseOptions\"\n doc=\"Options for the `upgrade` handler function.\">\n <InterfaceMember\n name=\"stdout\"\n optional\n type=\"(data: string) => void\"\n doc=\"A callback function that is called with the stdout output of the command.\"\n />\n <hbr />\n <InterfaceMember\n name=\"stderr\"\n optional\n type=\"(err: string) => void\"\n doc=\"A callback function that is called with the stderr output of the command.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TypeDeclaration\n export\n name=\"UpgradeOptions\"\n doc=\"Options for the `upgrade` handler function.\">{code`UpgradeBaseOptions & GetPackageManagerOptions & Parameters<typeof spawn>[2];`}</TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Upgrade the application dependencies.\">\n <TSDocRemarks>\n {`This function is used to upgrade the application dependencies. It can be used in the CLI upgrade command to ensure that all necessary dependencies are up-to-date.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`upgrade\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves when the upgrade of dependencies is complete.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"upgrade\"\n parameters={[\n {\n name: \"options\",\n type: \"UpgradeOptions\",\n default: \"{}\"\n }\n ]}>\n <VarDeclaration\n const\n name=\"packageManager\"\n initializer={code`await getPackageManager(options); `}\n />\n <Spacing />\n <VarDeclaration\n const\n name=\"args\"\n initializer={code`await getUpgradeCommand(packageManager, options.cwd); `}\n />\n <hbr />\n <VarDeclaration let name=\"output\" initializer={code`\"\"; `} />\n <hbr />\n {code`await spawn(\n \\`\\${packageManager}\\${isWindows && packageManager !== \"bun\" ? \".cmd\" : \"\"}\\`,\n [args.join(\" \")],\n {\n ...options,\n env: {\n ...options.env,\n ...(packageManager === \"pnpm\" ? { npm_config_strict_peer_dependencies: false } : null),\n },\n stdout: (data: string) => {\n options.stdout?.(data);\n output += data;\n },\n stderr: (data: string) => {\n options.stderr?.(data);\n },\n },\n ); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `updateVersionCheckFile` handler function declaration code for the Shell Shock project.\n */\nexport function UpdateVersionCheckFileFunctionDeclaration() {\n return (\n <>\n <TSDoc heading=\"A helper function that updates the version check file.\">\n <TSDocRemarks>\n {`This function is used to update the version check file with the current timestamp. It can be used in the CLI upgrade command to record the last time a check for updates was performed. The function writes a \"version-check.json\" file in the data directory, which contains a timestamp of the last check for updates.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocReturns>\n {`A promise that resolves to a boolean indicating whether a check for updates is required.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"updateVersionCheckFile\"\n returnType=\"void\">\n <IfStatement condition={code`!existsSync(paths.data)`}>\n {code`await mkdir(paths.data, { recursive: true }); `}\n </IfStatement>\n {code`await writeFile(join(paths.data, \"version-check.json\"), JSON.stringify({ timestamp: new Date().getTime() }), \"utf8\"); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `isCheckForUpdatesRequired` handler function declaration code for the Shell Shock project.\n */\nexport function IsCheckForUpdatesRequiredFunctionDeclaration() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <>\n <TSDoc heading=\"A helper function that verifies if a check for updates is required.\">\n <TSDocRemarks>\n {`This function is used to determine if a check for updates is required based on the last time a check was performed. It can be used in the CLI upgrade command to avoid unnecessary checks for updates if one was recently performed. The function checks for the existence of a \"version-check.json\" file in the data directory, which contains a timestamp of the last check for updates. If the file does not exist or if the timestamp is older than a specified stale time, the function will return true, indicating that a check for updates is required. Otherwise, it will return false.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocReturns>\n {`A promise that resolves to a boolean indicating whether a check for updates is required.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration export async name=\"isCheckForUpdatesRequired\">\n <IfStatement\n condition={code`!isInteractive || isCI || env.SKIP_VERSION_CHECK`}>\n {code`return false; `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n const\n name=\"filePath\"\n initializer={code`join(paths.data, \"version-check.json\"); `}\n />\n <IfStatement condition={code`existsSync(filePath)`}>\n <VarDeclaration\n const\n name=\"file\"\n type=\"{ timestamp: number; }\"\n initializer={code` JSON.parse(await readFile(filePath, \"utf8\")); `}\n />\n <IfStatement condition={code`!file.timestamp`}>\n {code`await updateVersionCheckFile();\n return true; `}\n </IfStatement>\n <ElseIfClause\n condition={code`new Date().getTime() - file.timestamp < ${\n context.config.upgrade.staleTime\n }`}>\n {code`return false; `}\n </ElseIfClause>\n </IfStatement>\n <ElseClause>\n {code`await updateVersionCheckFile();\n return true; `}\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * The `checkForUpdates` handler function declaration code for the Shell Shock project.\n */\nexport function CheckForUpdatesFunctionDeclaration() {\n const context = usePowerlines<UpgradePluginContext>();\n\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"CheckForUpdatesOptions\"\n extends=\"GetPackageManagerOptions\"\n doc=\"Options for the `checkForUpdates` handler function.\">\n <InterfaceMember\n name=\"force\"\n optional\n type=\"boolean\"\n doc=\"Whether to force a check for updates regardless of the last check timestamp. If set to `true`, the function will bypass the timestamp check and perform a check for updates, updating the timestamp in the process. This can be useful if you want to ensure that a check for updates is performed even if one was recently done, such as when the user explicitly requests it or when certain conditions are met that warrant an immediate check.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration name=\"CheckForUpdatesBaseResult\">\n <InterfaceMember\n name=\"isError\"\n type=\"boolean\"\n optional\n doc=\"Indicates whether an error occurred while checking for updates.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"CheckForUpdatesSuccessResult\"\n extends=\"CheckForUpdatesBaseResult\">\n <InterfaceMember\n name=\"latestVersion\"\n type=\"string\"\n doc=\"The latest version of the application dependencies.\"\n />\n <hbr />\n <InterfaceMember\n name=\"currentVersion\"\n type=\"string\"\n doc=\"The current version of the application dependencies.\"\n />\n <hbr />\n <InterfaceMember\n name=\"isUpToDate\"\n type=\"boolean\"\n doc=\"Indicates whether the application dependencies are up-to-date.\"\n />\n <hbr />\n <InterfaceMember\n name=\"package\"\n type=\"NpmPackage\"\n optional\n doc=\"The npm package that was checked for updates.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"CheckForUpdatesErrorResult\"\n extends=\"CheckForUpdatesBaseResult\">\n <InterfaceMember\n name=\"error\"\n type=\"Error\"\n doc=\"The error that occurred while checking for updates.\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TypeDeclaration\n export\n name=\"CheckForUpdatesResult\"\n doc=\"The result for the `checkForUpdates` handler function.\">\n {code`CheckForUpdatesSuccessResult | CheckForUpdatesErrorResult;`}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Check for updates to the application dependencies.\">\n <TSDocRemarks>\n {`This function is used to check for updates to the application dependencies. It can be used in the CLI upgrade command to ensure that all necessary dependencies are up-to-date.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"options\">\n {`The options for the \\`checkForUpdates\\` function. Currently, there are no options available, but this parameter is included for future extensibility.`}\n </TSDocParam>\n <TSDocReturns>\n {`A promise that resolves when the check for updates is complete or undefined if the check was not performed.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"checkForUpdates\"\n parameters={[\n {\n name: \"options\",\n type: \"CheckForUpdatesOptions\",\n default: \"{}\"\n }\n ]}\n returnType=\"CheckForUpdatesResult\">\n <IfStatement\n condition={code`!options.force && !(await isCheckForUpdatesRequired())`}>\n {code`return {\n latestVersion: \"${context.packageJson.version}\",\n currentVersion: \"${context.packageJson.version}\",\n isUpToDate: true,\n isError: false,\n }; `}\n </IfStatement>\n <Spacing />\n {code`try { `}\n <VarDeclaration\n const\n name=\"pkg\"\n initializer={code`await fetchNpmPackage(\"${\n context.packageJson.name\n }\"); `}\n />\n <Spacing />\n {code`\n return {\n latestVersion: pkg?.version || \"${context.packageJson.version}\",\n currentVersion: \"${context.packageJson.version}\",\n isUpToDate: pkg ? \"${context.packageJson.version}\" === pkg.version : true,\n package: pkg,\n isError: false,\n };\n } catch (err) {\n return { isError: true, error: err instanceof Error ? err : new Error(String(err)) };\n } `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface UpgradeBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> {}\n\n/**\n * A built-in upgrade module for Shell Shock.\n */\nexport function UpgradeBuiltin(props: UpgradeBuiltinProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <BuiltinFile\n id=\"upgrade\"\n description=\"A collection of application upgrade utility functions for Shell Shock.\"\n {...rest}\n imports={defu(rest.imports ?? {}, {\n \"node:os\": \"os\",\n \"node:path\": [\"join\", \"resolve\"],\n \"node:fs\": [\"existsSync\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\", \"mkdir\"],\n \"node:process\": \"process\"\n })}\n builtinImports={defu(rest.builtinImports ?? {}, {\n console: [\"error\", \"verbose\", \"writeLine\"],\n env: [\"paths\", \"isWindows\", \"isCI\", \"env\"],\n utils: [\"isColorSupported\", \"isInteractive\", \"spawn\"]\n })}>\n <VarDeclaration\n const\n name=\"homePath\"\n type=\"string\"\n initializer={code`os.homedir(); `}\n />\n <Spacing />\n <VarDeclaration\n const\n name=\"tempPath\"\n type=\"string\"\n initializer={code`os.tmpdir(); `}\n />\n <Spacing />\n <LocatePackageJsonFunctionDeclaration />\n <Spacing />\n <LocateLockfileFunctionDeclaration />\n <Spacing />\n <GetPackageManagerFunctionDeclaration />\n <Spacing />\n <FetchNpmPackageFunctionDeclaration />\n <Spacing />\n <GetLatestVersionFunctionDeclaration />\n <Spacing />\n <GetUpgradeCommandFunctionDeclaration />\n <Spacing />\n <UpgradeFunctionDeclaration />\n <Spacing />\n <CheckForUpdatesFunctionDeclaration />\n <Spacing />\n <IsCheckForUpdatesRequiredFunctionDeclaration />\n <Spacing />\n <UpdateVersionCheckFileFunctionDeclaration />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA6CA,SAAgBmB,uCAAuC;CACrD,MAAMC,UAAUV,eAAqC;AAErD,QAAA;EAAAW,gBAEKd,sBAAoB;GAAA,UAAA;GAEnBe,MAAI;GACJC,KAAG;GAAA,IAAAC,WAAA;AAAA,WAAA;KAAAH,gBACFV,iBAAe;MACdW,MAAI;MACJG,UAAQ;MACRC,MAAI;MACJH,KAAG;MAAA,CAAA;KAAAF,gBAEJZ,SAAO,EAAA,CAAA;KAAAY,gBACPV,iBAAe;MACdW,MAAI;MACJG,UAAQ;MACRC,MAAI;MACJH,KAAG;MAAA,CAAA;KAAA;;GAAA,CAAA;EAAAF,gBAGNZ,SAAO,EAAA,CAAA;EAAAY,gBACPT,OAAK;GAACe,SAAO;GAAA,IAAAH,WAAA;AAAA,WAAA;KAAAH,gBACXP,cAAY,EAAAU,UACV,sOAAoO,CAAA;KAAAH,gBAEtOZ,SAAO,EAAA,CAAA;KAAAY,gBACPR,YAAU;MAACS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KAAA,IAAC4D,OAAI;AAAA,aAAEC,QAAQtC,SAAS;;KAAGA;KAAQ,CAAA;IAAA;;EAAA,CAAA,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -19,10 +19,16 @@ const plugin = (options = {}) => {
|
|
|
19
19
|
name: "shell-shock:upgrade",
|
|
20
20
|
config() {
|
|
21
21
|
this.debug("Providing default configuration for the Shell Shock `upgrade` plugin.");
|
|
22
|
-
return {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
return {
|
|
23
|
+
upgrade: (0, defu.default)(options, {
|
|
24
|
+
type: "confirm",
|
|
25
|
+
staleTime: 2160 * 60 * 1e3
|
|
26
|
+
}),
|
|
27
|
+
env: {
|
|
28
|
+
types: "@shell-shock/plugin-upgrade/types/env#ShellShockUpgradePluginEnv",
|
|
29
|
+
validate: false
|
|
30
|
+
}
|
|
31
|
+
};
|
|
26
32
|
},
|
|
27
33
|
configResolved() {
|
|
28
34
|
this.debug("Adding the CLI upgrade commands to the application context.");
|