zova-cli-set-front 1.2.18 → 1.2.19
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/index.js
CHANGED
|
@@ -253,10 +253,32 @@ class CliBinBuildRest extends BeanCliBase {
|
|
|
253
253
|
}
|
|
254
254
|
return modules;
|
|
255
255
|
}
|
|
256
|
-
async
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
async _buildTs({
|
|
257
|
+
srcDir,
|
|
258
|
+
outDir
|
|
259
|
+
}) {
|
|
260
|
+
// entry
|
|
261
|
+
const entry = path.join(srcDir, 'index.ts');
|
|
262
|
+
// build
|
|
263
|
+
await build$1({
|
|
264
|
+
entry: [entry],
|
|
265
|
+
format: ['esm'],
|
|
266
|
+
outDir,
|
|
267
|
+
tsconfig: 'tsconfig.rest.json',
|
|
268
|
+
plugins: [svgResolverPlugin()],
|
|
269
|
+
deps: {
|
|
270
|
+
alwaysBundle: _id => {
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
minify: true
|
|
275
|
+
});
|
|
276
|
+
const fileIndex = path.join(outDir, 'index.mjs');
|
|
277
|
+
let fileContent = (await fse.readFile(fileIndex)).toString();
|
|
278
|
+
fileContent = fileContent.replace(/import[\s\S]*?"[^"]*";/g, '').replace(/export[\s\S]*?"[^"]*";/g, '');
|
|
279
|
+
await fse.writeFile(fileIndex, fileContent);
|
|
280
|
+
}
|
|
281
|
+
async _buildDts({
|
|
260
282
|
srcDir,
|
|
261
283
|
outDir
|
|
262
284
|
}) {
|
|
@@ -269,12 +291,14 @@ class CliBinBuildRest extends BeanCliBase {
|
|
|
269
291
|
format: ['esm'],
|
|
270
292
|
outDir,
|
|
271
293
|
tsconfig: 'tsconfig.rest.json',
|
|
294
|
+
clean: false,
|
|
272
295
|
dts: {
|
|
273
296
|
// resolve: true,
|
|
274
297
|
resolver: 'tsc',
|
|
275
298
|
tsgo: true,
|
|
276
299
|
eager: true,
|
|
277
|
-
tsconfig: 'tsconfig.rest.json'
|
|
300
|
+
tsconfig: 'tsconfig.rest.json',
|
|
301
|
+
emitDtsOnly: true
|
|
278
302
|
},
|
|
279
303
|
plugins: [svgResolverPlugin()],
|
|
280
304
|
deps: {
|
|
@@ -285,6 +309,18 @@ class CliBinBuildRest extends BeanCliBase {
|
|
|
285
309
|
},
|
|
286
310
|
minify: true
|
|
287
311
|
});
|
|
312
|
+
}
|
|
313
|
+
async _build(buildContext) {
|
|
314
|
+
const {
|
|
315
|
+
projectPath,
|
|
316
|
+
flavor,
|
|
317
|
+
bundleNameCopy,
|
|
318
|
+
srcDir,
|
|
319
|
+
outDir
|
|
320
|
+
} = buildContext;
|
|
321
|
+
// build
|
|
322
|
+
await this._buildTs(buildContext);
|
|
323
|
+
await this._buildDts(buildContext);
|
|
288
324
|
// deps
|
|
289
325
|
const deps = await _extractDeps(path.join(outDir, 'index.d.mts'));
|
|
290
326
|
const depsVersion = await _extractDepsVersion(projectPath, deps);
|
|
@@ -2986,7 +3022,7 @@ ${contentResourceIcons}
|
|
|
2986
3022
|
}
|
|
2987
3023
|
async function generateRestIcon(moduleName, modulePath, _resourceIcons) {
|
|
2988
3024
|
// icons
|
|
2989
|
-
const contentResourceIcons = `
|
|
3025
|
+
const contentResourceIcons = `export * from 'zova-module-${moduleName}';\n`;
|
|
2990
3026
|
const fileIcons = path.join(modulePath, 'rest/icons.ts');
|
|
2991
3027
|
await fse.outputFile(fileIcons, contentResourceIcons);
|
|
2992
3028
|
// index
|
|
@@ -17,7 +17,9 @@ export declare class CliBinBuildRest extends BeanCliBase {
|
|
|
17
17
|
execute(): Promise<void>;
|
|
18
18
|
_prepareResources(context: IBinBuildRestContext): Promise<void>;
|
|
19
19
|
_prepareBundleModules(): string[];
|
|
20
|
-
|
|
20
|
+
_buildTs({ srcDir, outDir }: IBinBuildRestContext): Promise<void>;
|
|
21
|
+
_buildDts({ srcDir, outDir }: IBinBuildRestContext): Promise<void>;
|
|
22
|
+
_build(buildContext: IBinBuildRestContext): Promise<void>;
|
|
21
23
|
_prepareResourcesPackage({ projectPath, flavor, bundleName, srcDir }: IBinBuildRestContext): Promise<void>;
|
|
22
24
|
_prepareResourcesIndex({ srcDir }: IBinBuildRestContext): Promise<void>;
|
|
23
25
|
_prepareResourcesIndex_rest(srcDir: string): Promise<string>;
|
package/package.json
CHANGED