zova-cli-set-front 1.2.18 → 1.2.20
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
|
@@ -247,16 +247,39 @@ class CliBinBuildRest extends BeanCliBase {
|
|
|
247
247
|
_prepareBundleModules() {
|
|
248
248
|
const modules = [];
|
|
249
249
|
for (const module of this.modulesMeta.modulesArray) {
|
|
250
|
-
|
|
250
|
+
const moduleRoot = module.root.replaceAll('\\', '/');
|
|
251
|
+
if (moduleRoot.includes('/src/module/') || moduleRoot.includes('/src/suite/')) {
|
|
251
252
|
modules.push(module.info.fullName);
|
|
252
253
|
}
|
|
253
254
|
}
|
|
254
255
|
return modules;
|
|
255
256
|
}
|
|
256
|
-
async
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
async _buildTs({
|
|
258
|
+
srcDir,
|
|
259
|
+
outDir
|
|
260
|
+
}) {
|
|
261
|
+
// entry
|
|
262
|
+
const entry = path.join(srcDir, 'index.ts');
|
|
263
|
+
// build
|
|
264
|
+
await build$1({
|
|
265
|
+
entry: [entry],
|
|
266
|
+
format: ['esm'],
|
|
267
|
+
outDir,
|
|
268
|
+
tsconfig: 'tsconfig.rest.json',
|
|
269
|
+
plugins: [svgResolverPlugin()],
|
|
270
|
+
deps: {
|
|
271
|
+
alwaysBundle: _id => {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
minify: true
|
|
276
|
+
});
|
|
277
|
+
const fileIndex = path.join(outDir, 'index.mjs');
|
|
278
|
+
let fileContent = (await fse.readFile(fileIndex)).toString();
|
|
279
|
+
fileContent = fileContent.replace(/import[\s\S]*?"[^"]*";/g, '').replace(/export[\s\S]*?"[^"]*";/g, '');
|
|
280
|
+
await fse.writeFile(fileIndex, fileContent);
|
|
281
|
+
}
|
|
282
|
+
async _buildDts({
|
|
260
283
|
srcDir,
|
|
261
284
|
outDir
|
|
262
285
|
}) {
|
|
@@ -269,12 +292,14 @@ class CliBinBuildRest extends BeanCliBase {
|
|
|
269
292
|
format: ['esm'],
|
|
270
293
|
outDir,
|
|
271
294
|
tsconfig: 'tsconfig.rest.json',
|
|
295
|
+
clean: false,
|
|
272
296
|
dts: {
|
|
273
297
|
// resolve: true,
|
|
274
298
|
resolver: 'tsc',
|
|
275
299
|
tsgo: true,
|
|
276
300
|
eager: true,
|
|
277
|
-
tsconfig: 'tsconfig.rest.json'
|
|
301
|
+
tsconfig: 'tsconfig.rest.json',
|
|
302
|
+
emitDtsOnly: true
|
|
278
303
|
},
|
|
279
304
|
plugins: [svgResolverPlugin()],
|
|
280
305
|
deps: {
|
|
@@ -285,6 +310,18 @@ class CliBinBuildRest extends BeanCliBase {
|
|
|
285
310
|
},
|
|
286
311
|
minify: true
|
|
287
312
|
});
|
|
313
|
+
}
|
|
314
|
+
async _build(buildContext) {
|
|
315
|
+
const {
|
|
316
|
+
projectPath,
|
|
317
|
+
flavor,
|
|
318
|
+
bundleNameCopy,
|
|
319
|
+
srcDir,
|
|
320
|
+
outDir
|
|
321
|
+
} = buildContext;
|
|
322
|
+
// build
|
|
323
|
+
await this._buildTs(buildContext);
|
|
324
|
+
await this._buildDts(buildContext);
|
|
288
325
|
// deps
|
|
289
326
|
const deps = await _extractDeps(path.join(outDir, 'index.d.mts'));
|
|
290
327
|
const depsVersion = await _extractDepsVersion(projectPath, deps);
|
|
@@ -2986,7 +3023,7 @@ ${contentResourceIcons}
|
|
|
2986
3023
|
}
|
|
2987
3024
|
async function generateRestIcon(moduleName, modulePath, _resourceIcons) {
|
|
2988
3025
|
// icons
|
|
2989
|
-
const contentResourceIcons = `
|
|
3026
|
+
const contentResourceIcons = `export * from 'zova-module-${moduleName}';\n`;
|
|
2990
3027
|
const fileIcons = path.join(modulePath, 'rest/icons.ts');
|
|
2991
3028
|
await fse.outputFile(fileIcons, contentResourceIcons);
|
|
2992
3029
|
// 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