@hot-updater/plugin-core 0.6.0 → 0.6.1-rc.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/copyDirToTmp.d.ts +4 -0
- package/dist/index.cjs +29 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +31 -7
- package/dist/types.d.ts +3 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -100,9 +100,10 @@ var __webpack_exports__ = {};
|
|
|
100
100
|
"use strict";
|
|
101
101
|
__webpack_require__.r(__webpack_exports__);
|
|
102
102
|
__webpack_require__.d(__webpack_exports__, {
|
|
103
|
+
log: ()=>log,
|
|
104
|
+
copyDirToTmp: ()=>copyDirToTmp,
|
|
103
105
|
getCwd: ()=>getCwd,
|
|
104
|
-
loadConfig: ()=>loadConfig
|
|
105
|
-
log: ()=>log
|
|
106
|
+
loadConfig: ()=>loadConfig
|
|
106
107
|
});
|
|
107
108
|
var picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js");
|
|
108
109
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
@@ -139,6 +140,32 @@ var __webpack_exports__ = {};
|
|
|
139
140
|
if (!result?.config) return null;
|
|
140
141
|
return result.config;
|
|
141
142
|
};
|
|
143
|
+
const external_path_namespaceObject = require("path");
|
|
144
|
+
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
145
|
+
const promises_namespaceObject = require("fs/promises");
|
|
146
|
+
var promises_default = /*#__PURE__*/ __webpack_require__.n(promises_namespaceObject);
|
|
147
|
+
const copyDirToTmp = async (dir)=>{
|
|
148
|
+
const cwd = getCwd();
|
|
149
|
+
const tmpDir = external_path_default().join(cwd, ".hot-updater");
|
|
150
|
+
try {
|
|
151
|
+
await promises_default().rm(tmpDir, {
|
|
152
|
+
recursive: true,
|
|
153
|
+
force: true
|
|
154
|
+
});
|
|
155
|
+
} catch (err) {}
|
|
156
|
+
await promises_default().mkdir(tmpDir, {
|
|
157
|
+
recursive: true
|
|
158
|
+
});
|
|
159
|
+
await promises_default().cp(dir, tmpDir, {
|
|
160
|
+
recursive: true
|
|
161
|
+
});
|
|
162
|
+
return {
|
|
163
|
+
tmpDir,
|
|
164
|
+
removeTmpDir: ()=>promises_default().rm(tmpDir, {
|
|
165
|
+
recursive: true
|
|
166
|
+
})
|
|
167
|
+
};
|
|
168
|
+
};
|
|
142
169
|
})();
|
|
143
170
|
var __webpack_export_target__ = exports;
|
|
144
171
|
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_tty__ from "tty";
|
|
2
|
-
import * as
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_workspace_tools_2c254f81__ from "workspace-tools";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_cosmiconfig__ from "cosmiconfig";
|
|
4
|
-
import * as
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_cosmiconfig_typescript_loader_05c5f2fe__ from "cosmiconfig-typescript-loader";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__ from "fs/promises";
|
|
5
7
|
var __webpack_modules__ = {
|
|
6
8
|
"../../node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
7
9
|
let tty = __webpack_require__("tty");
|
|
@@ -98,7 +100,7 @@ const log = {
|
|
|
98
100
|
warn: (message)=>console.log(picocolors_default().yellow(message)),
|
|
99
101
|
debug: (message)=>console.log(picocolors_default().gray(message))
|
|
100
102
|
};
|
|
101
|
-
const getCwd = ()=>(0,
|
|
103
|
+
const getCwd = ()=>(0, __WEBPACK_EXTERNAL_MODULE_workspace_tools_2c254f81__.findPackageRoot)(process.cwd());
|
|
102
104
|
const loadConfig = async ()=>{
|
|
103
105
|
const result = await (0, __WEBPACK_EXTERNAL_MODULE_cosmiconfig__.cosmiconfig)("hot-updater", {
|
|
104
106
|
stopDir: getCwd(),
|
|
@@ -112,12 +114,34 @@ const loadConfig = async ()=>{
|
|
|
112
114
|
],
|
|
113
115
|
ignoreEmptySearchPlaces: false,
|
|
114
116
|
loaders: {
|
|
115
|
-
".ts": (0,
|
|
116
|
-
".mts": (0,
|
|
117
|
-
".cts": (0,
|
|
117
|
+
".ts": (0, __WEBPACK_EXTERNAL_MODULE_cosmiconfig_typescript_loader_05c5f2fe__.TypeScriptLoader)(),
|
|
118
|
+
".mts": (0, __WEBPACK_EXTERNAL_MODULE_cosmiconfig_typescript_loader_05c5f2fe__.TypeScriptLoader)(),
|
|
119
|
+
".cts": (0, __WEBPACK_EXTERNAL_MODULE_cosmiconfig_typescript_loader_05c5f2fe__.TypeScriptLoader)()
|
|
118
120
|
}
|
|
119
121
|
}).search();
|
|
120
122
|
if (!result?.config) return null;
|
|
121
123
|
return result.config;
|
|
122
124
|
};
|
|
123
|
-
|
|
125
|
+
const copyDirToTmp = async (dir)=>{
|
|
126
|
+
const cwd = getCwd();
|
|
127
|
+
const tmpDir = __WEBPACK_EXTERNAL_MODULE_path__["default"].join(cwd, ".hot-updater");
|
|
128
|
+
try {
|
|
129
|
+
await __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__["default"].rm(tmpDir, {
|
|
130
|
+
recursive: true,
|
|
131
|
+
force: true
|
|
132
|
+
});
|
|
133
|
+
} catch (err) {}
|
|
134
|
+
await __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__["default"].mkdir(tmpDir, {
|
|
135
|
+
recursive: true
|
|
136
|
+
});
|
|
137
|
+
await __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__["default"].cp(dir, tmpDir, {
|
|
138
|
+
recursive: true
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
tmpDir,
|
|
142
|
+
removeTmpDir: ()=>__WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__["default"].rm(tmpDir, {
|
|
143
|
+
recursive: true
|
|
144
|
+
})
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
export { copyDirToTmp, getCwd, loadConfig, log };
|
package/dist/types.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export type Config = {
|
|
|
52
52
|
*/
|
|
53
53
|
port?: number;
|
|
54
54
|
};
|
|
55
|
-
build: (args: BasePluginArgs) => BuildPlugin;
|
|
56
|
-
storage: (args: BasePluginArgs) => StoragePlugin;
|
|
57
|
-
database: (args: BasePluginArgs) => DatabasePlugin;
|
|
55
|
+
build: (args: BasePluginArgs) => Promise<BuildPlugin> | BuildPlugin;
|
|
56
|
+
storage: (args: BasePluginArgs) => Promise<StoragePlugin> | StoragePlugin;
|
|
57
|
+
database: (args: BasePluginArgs) => Promise<DatabasePlugin> | DatabasePlugin;
|
|
58
58
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/plugin-core",
|
|
3
|
-
"version": "0.6.0",
|
|
3
|
+
"version": "0.6.1-rc.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@hot-updater/core": "0.6.0",
|
|
41
|
+
"@hot-updater/core": "0.6.1-rc.0",
|
|
42
42
|
"cosmiconfig": "^9.0.0",
|
|
43
43
|
"cosmiconfig-typescript-loader": "^5.0.0",
|
|
44
44
|
"workspace-tools": "^0.36.4"
|