hot-updater 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/init/supabase.d.ts +1 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/index.cjs +6987 -94
- package/dist/index.js +6993 -109
- package/dist/plugins/babel.cjs +14 -1
- package/dist/plugins/babel.js +14 -1
- package/dist/utils/ensureInstallPackages.d.ts +4 -0
- package/dist/utils/getPackageManager.d.ts +1 -0
- package/dist/utils/makeEnv.d.ts +1 -0
- package/dist/utils/makeEnv.spec.d.ts +1 -0
- package/dist/utils/transformTemplate.d.ts +15 -0
- package/package.json +24 -15
package/dist/plugins/babel.cjs
CHANGED
|
@@ -17019,7 +17019,20 @@ let defaultGenerator;
|
|
|
17019
17019
|
const uuidv7 = ()=>uuidv7obj().toString();
|
|
17020
17020
|
const uuidv7obj = ()=>(defaultGenerator || (defaultGenerator = new V7Generator())).generate();
|
|
17021
17021
|
function replaceHotUpdaterBundleId() {
|
|
17022
|
-
const
|
|
17022
|
+
const buildOutDir = process.env["BUILD_OUT_DIR"];
|
|
17023
|
+
if (!buildOutDir) return {
|
|
17024
|
+
name: "replace-hot-updater-bundle-id",
|
|
17025
|
+
visitor: {
|
|
17026
|
+
MemberExpression (path) {
|
|
17027
|
+
if (lib.isIdentifier(path.node.object, {
|
|
17028
|
+
name: "HotUpdater"
|
|
17029
|
+
}) && lib.isIdentifier(path.node.property, {
|
|
17030
|
+
name: "HOT_UPDATER_BUNDLE_ID"
|
|
17031
|
+
})) path.replaceWith(lib.stringLiteral("00000000-0000-0000-0000-000000000000"));
|
|
17032
|
+
}
|
|
17033
|
+
}
|
|
17034
|
+
};
|
|
17035
|
+
const bundleIdPath = external_path_default().join(buildOutDir, "BUNDLE_ID");
|
|
17023
17036
|
let bundleId = uuidv7();
|
|
17024
17037
|
if (external_fs_default().existsSync(bundleIdPath)) bundleId = external_fs_default().readFileSync(bundleIdPath, "utf-8");
|
|
17025
17038
|
else external_fs_default().writeFileSync(bundleIdPath, bundleId);
|
package/dist/plugins/babel.js
CHANGED
|
@@ -16977,7 +16977,20 @@ let defaultGenerator;
|
|
|
16977
16977
|
const uuidv7 = ()=>uuidv7obj().toString();
|
|
16978
16978
|
const uuidv7obj = ()=>(defaultGenerator || (defaultGenerator = new V7Generator())).generate();
|
|
16979
16979
|
function replaceHotUpdaterBundleId() {
|
|
16980
|
-
const
|
|
16980
|
+
const buildOutDir = process.env["BUILD_OUT_DIR"];
|
|
16981
|
+
if (!buildOutDir) return {
|
|
16982
|
+
name: "replace-hot-updater-bundle-id",
|
|
16983
|
+
visitor: {
|
|
16984
|
+
MemberExpression (path) {
|
|
16985
|
+
if (lib.isIdentifier(path.node.object, {
|
|
16986
|
+
name: "HotUpdater"
|
|
16987
|
+
}) && lib.isIdentifier(path.node.property, {
|
|
16988
|
+
name: "HOT_UPDATER_BUNDLE_ID"
|
|
16989
|
+
})) path.replaceWith(lib.stringLiteral("00000000-0000-0000-0000-000000000000"));
|
|
16990
|
+
}
|
|
16991
|
+
}
|
|
16992
|
+
};
|
|
16993
|
+
const bundleIdPath = __WEBPACK_EXTERNAL_MODULE_path__["default"].join(buildOutDir, "BUNDLE_ID");
|
|
16981
16994
|
let bundleId = uuidv7();
|
|
16982
16995
|
if (__WEBPACK_EXTERNAL_MODULE_fs__["default"].existsSync(bundleIdPath)) bundleId = __WEBPACK_EXTERNAL_MODULE_fs__["default"].readFileSync(bundleIdPath, "utf-8");
|
|
16983
16996
|
else __WEBPACK_EXTERNAL_MODULE_fs__["default"].writeFileSync(bundleIdPath, bundleId);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getPackageManager: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const makeEnv: (newEnvVars: Record<string, string>, filePath?: string) => Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type ExtractPlaceholders<T extends string> = T extends `${infer _Start}%%${infer Key}%%${infer Rest}` ? Key | ExtractPlaceholders<Rest> : never;
|
|
2
|
+
type TransformTemplateArgs<T extends string> = {
|
|
3
|
+
[Key in ExtractPlaceholders<T>]: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Replaces placeholders in the format %%key%% in a template string with values from the values object.
|
|
7
|
+
* Uses generic type T to automatically infer placeholder keys from the template string to ensure type safety.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const str = "Hello %%name%%, you are %%age%% years old."
|
|
11
|
+
* const result = transformTemplate(str, { name: "John", age: "20" })
|
|
12
|
+
* // Result: "Hello John, you are 20 years old."
|
|
13
|
+
*/
|
|
14
|
+
export declare function transformTemplate<T extends string>(templateString: T, values: TransformTemplateArgs<T>): string;
|
|
15
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hot-updater",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"hot-updater": "./dist/index.js"
|
|
7
7
|
},
|
|
@@ -38,35 +38,44 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@hot-updater/
|
|
43
|
-
"@hot-updater/
|
|
41
|
+
"@clack/prompts": "^0.9.0",
|
|
42
|
+
"@hot-updater/console": "0.3.0",
|
|
43
|
+
"@hot-updater/core": "0.3.0",
|
|
44
|
+
"@hot-updater/plugin-core": "0.3.0",
|
|
44
45
|
"commander": "^11.1.0",
|
|
45
46
|
"cosmiconfig": "^9.0.0",
|
|
46
|
-
"cosmiconfig-typescript-loader": "^5.0.0"
|
|
47
|
-
"@clack/prompts": "^0.9.0"
|
|
47
|
+
"cosmiconfig-typescript-loader": "^5.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"jszip": "^3.10.1",
|
|
51
|
-
"plist": "^3.1.0",
|
|
52
|
-
"read-package-up": "^11.0.0",
|
|
53
|
-
"@hono/node-server": "^1.13.4",
|
|
54
|
-
"@types/semver": "^7.5.8",
|
|
55
|
-
"uuidv7": "^1.0.2",
|
|
56
|
-
"boxen": "^8.0.1",
|
|
57
|
-
"picocolors": "^1.0.0",
|
|
58
50
|
"@babel/core": "^7.26.0",
|
|
59
51
|
"@babel/traverse": "^7.25.9",
|
|
60
52
|
"@babel/types": "^7.26.0",
|
|
53
|
+
"@hono/node-server": "^1.13.4",
|
|
61
54
|
"@types/babel__core": "^7.20.5",
|
|
62
55
|
"@types/babel__traverse": "^7.20.6",
|
|
63
56
|
"@types/connect": "^3.4.38",
|
|
64
57
|
"@types/cosmiconfig": "^6.0.0",
|
|
65
58
|
"@types/node": "^22.9.0",
|
|
66
59
|
"@types/plist": "^3.0.5",
|
|
60
|
+
"@types/semver": "^7.5.8",
|
|
61
|
+
"boxen": "^8.0.1",
|
|
62
|
+
"execa": "^9.5.2",
|
|
67
63
|
"is-port-reachable": "^4.0.0",
|
|
64
|
+
"jszip": "^3.10.1",
|
|
68
65
|
"open": "^10.1.0",
|
|
69
|
-
"
|
|
66
|
+
"picocolors": "^1.0.0",
|
|
67
|
+
"plist": "^3.1.0",
|
|
68
|
+
"read-package-up": "^11.0.0",
|
|
69
|
+
"semver": "^7.6.3",
|
|
70
|
+
"uuidv7": "^1.0.2"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"@hot-updater/supabase": "*"
|
|
74
|
+
},
|
|
75
|
+
"peerDependenciesMeta": {
|
|
76
|
+
"@hot-updater/supabase": {
|
|
77
|
+
"optional": true
|
|
78
|
+
}
|
|
70
79
|
},
|
|
71
80
|
"scripts": {
|
|
72
81
|
"build": "rslib build",
|