zova-cli-set-front 1.2.62 → 1.2.65

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/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
File without changes
package/dist/index.js CHANGED
@@ -15,9 +15,6 @@ import { createConfigUtils, saveJSONFile as saveJSONFile$1 } from 'zova-vite';
15
15
  import fs from 'node:fs';
16
16
  import 'node:url';
17
17
  import { getOnionScenesMeta, getOnionMetasMeta } from '@cabloy/module-info';
18
- import compressing from 'compressing';
19
- import os from 'node:os';
20
- import urllib from 'urllib';
21
18
  import { extend } from '@cabloy/extend';
22
19
  import { catchError, matchSelector, getPropertyObject, evaluateSimple, StringPrefixRegexp } from '@cabloy/utils';
23
20
  import ts from 'typescript';
@@ -806,105 +803,6 @@ class CliCreatePage extends CliCreatePageBase {
806
803
  }
807
804
  }
808
805
 
809
- // import { __ThisSetName__ } from '../this.ts';
810
-
811
- class CliCreateProject extends BeanCliBase {
812
- constructor(options) {
813
- super(options);
814
- this.httpClient = void 0;
815
- this.httpClient = urllib;
816
- }
817
- async execute() {
818
- const {
819
- argv
820
- } = this.context;
821
- // super
822
- await super.execute();
823
- // noformat
824
- // argv.noformat = true;
825
- // project name
826
- const projectName = argv.name;
827
- // target dir
828
- const targetDir = path.join(argv.projectPath, projectName);
829
- if (!argv.force && fs.existsSync(targetDir)) {
830
- throw new Error(`project exists: ${projectName}`);
831
- }
832
- // template
833
- const template = argv.template;
834
- const packageName = `zova-ui-${template}`;
835
- // download boilerplate
836
- const templateDir = await this.downloadBoilerplate(packageName);
837
- fse.copySync(templateDir, targetDir);
838
- // remove LICENSE
839
- fse.removeSync(path.join(targetDir, 'LICENSE'));
840
- // copy package.json
841
- fse.copyFileSync(path.join(targetDir, 'package.original.json'), path.join(targetDir, 'package.json'));
842
- // npm run init
843
- await this.helper.spawnCmd({
844
- cmd: 'npm',
845
- args: ['run', 'init'],
846
- options: {
847
- cwd: targetDir
848
- }
849
- });
850
- // done
851
- await this.printUsage(targetDir);
852
- }
853
- async printUsage(targetDir) {
854
- await this.console.log(`usage:
855
- - cd ${targetDir}
856
- - pnpm install
857
- - npm run dev
858
- - npm run build
859
- - npm run preview
860
- `);
861
- }
862
- async downloadBoilerplate(packageName) {
863
- const result = await this.getPackageInfo(packageName, false);
864
- const tgzUrl = result.dist.tarball;
865
- await this.console.log(`downloading ${tgzUrl}`);
866
- const saveDir = path.join(os.tmpdir(), 'zova-project-boilerplate');
867
- await rimraf(saveDir);
868
- const response = await this.curl(tgzUrl, {
869
- streaming: true,
870
- followRedirect: true
871
- });
872
- await compressing.tgz.uncompress(response.res, saveDir);
873
- await this.console.log(`extract to ${saveDir}`);
874
- return path.join(saveDir, '/package');
875
- }
876
- async getPackageInfo(packageName, withFallback) {
877
- await this.console.log(`fetching npm info of ${packageName}`);
878
- try {
879
- const registry = await this.helper.getRegistry();
880
- const result = await this.curl(`${registry}${packageName}/latest`, {
881
- dataType: 'json',
882
- followRedirect: true,
883
- maxRedirects: 5
884
- });
885
- if (result.status !== 200) {
886
- const message = `npm info ${packageName} got error: ${result.status}, ${result.data.reason}`;
887
- throw new Error(message);
888
- }
889
- return result.data;
890
- } catch (err) {
891
- if (withFallback) {
892
- await this.console.log(`use fallback from ${packageName}`);
893
- const require = createRequire(import.meta.url);
894
- return require(`${packageName}/package.json`);
895
- }
896
- throw err;
897
- }
898
- }
899
- async curl(url, options) {
900
- options = options || {};
901
- if (!options.timeout) {
902
- options.timeout = 30000;
903
- }
904
- return await this.httpClient.request(url, options);
905
- }
906
- }
907
-
908
806
  class CliCreateSuite extends BeanCliBase {
909
807
  async execute() {
910
808
  const {
@@ -3720,7 +3618,6 @@ const beans = {
3720
3618
  'default.list': CliDefaultList,
3721
3619
  'bin.buildModule': CliBinBuildModule,
3722
3620
  'bin.buildRest': CliBinBuildRest,
3723
- 'create.project': CliCreateProject,
3724
3621
  'create.suite': CliCreateSuite,
3725
3622
  'create.module': CliCreateModule,
3726
3623
  'create.page': CliCreatePage,
@@ -3983,57 +3880,6 @@ var createPage = {
3983
3880
  }
3984
3881
  };
3985
3882
 
3986
- var createProject = {
3987
- bean: 'create.project',
3988
- info: {
3989
- version: '5.0.0',
3990
- title: 'Cli: Create Project',
3991
- usage: 'zova :create:project projectName [--template=] [--force]'
3992
- },
3993
- options: {
3994
- template: {
3995
- description: 'template',
3996
- type: 'string'
3997
- },
3998
- force: {
3999
- description: 'force',
4000
- type: 'boolean'
4001
- }
4002
- },
4003
- groups: {
4004
- default: {
4005
- questions: {
4006
- template: {
4007
- type: 'select',
4008
- message: 'Specify the project template',
4009
- choices: [{
4010
- name: 'quasar',
4011
- message: 'zova + quasar'
4012
- }, {
4013
- name: 'vuetify',
4014
- message: 'zova + vuetify'
4015
- }, {
4016
- name: 'empty',
4017
- message: 'zova only'
4018
- }]
4019
- }
4020
- }
4021
- },
4022
- moduleInfo: {
4023
- questions: {
4024
- name: {
4025
- type: 'input',
4026
- message: 'project name',
4027
- initial: {
4028
- expression: 'arg0'
4029
- },
4030
- required: true
4031
- }
4032
- }
4033
- }
4034
- }
4035
- };
4036
-
4037
3883
  var createSuite = {
4038
3884
  bean: 'create.suite',
4039
3885
  info: {
@@ -4687,7 +4533,6 @@ const commands = {
4687
4533
  buildRest: binBuildRest
4688
4534
  },
4689
4535
  create: {
4690
- project: createProject,
4691
4536
  suite: createSuite,
4692
4537
  module: createModule,
4693
4538
  page: createPage,
@@ -5,7 +5,6 @@ import { CliCreateComponent } from './bean/cli.create.component.ts';
5
5
  import { CliCreateMock } from './bean/cli.create.mock.ts';
6
6
  import { CliCreateModule } from './bean/cli.create.module.ts';
7
7
  import { CliCreatePage } from './bean/cli.create.page.ts';
8
- import { CliCreateProject } from './bean/cli.create.project.ts';
9
8
  import { CliCreateSuite } from './bean/cli.create.suite.ts';
10
9
  import { CliDefaultList } from './bean/cli.default.list.ts';
11
10
  import { CliInitAppMonkey } from './bean/cli.init.appMonkey.ts';
@@ -42,7 +41,6 @@ export declare const beans: {
42
41
  'default.list': typeof CliDefaultList;
43
42
  'bin.buildModule': typeof CliBinBuildModule;
44
43
  'bin.buildRest': typeof CliBinBuildRest;
45
- 'create.project': typeof CliCreateProject;
46
44
  'create.suite': typeof CliCreateSuite;
47
45
  'create.module': typeof CliCreateModule;
48
46
  'create.page': typeof CliCreatePage;
@@ -58,50 +58,6 @@ export declare const commands: {
58
58
  };
59
59
  };
60
60
  create: {
61
- project: {
62
- bean: string;
63
- info: {
64
- version: string;
65
- title: string;
66
- usage: string;
67
- };
68
- options: {
69
- template: {
70
- description: string;
71
- type: string;
72
- };
73
- force: {
74
- description: string;
75
- type: string;
76
- };
77
- };
78
- groups: {
79
- default: {
80
- questions: {
81
- template: {
82
- type: string;
83
- message: string;
84
- choices: {
85
- name: string;
86
- message: string;
87
- }[];
88
- };
89
- };
90
- };
91
- moduleInfo: {
92
- questions: {
93
- name: {
94
- type: string;
95
- message: string;
96
- initial: {
97
- expression: string;
98
- };
99
- required: boolean;
100
- };
101
- };
102
- };
103
- };
104
- };
105
61
  suite: {
106
62
  bean: string;
107
63
  info: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-cli-set-front",
3
- "version": "1.2.62",
4
- "gitHead": "6f675a8cc46d596142c591c28a40cc4d82fcc6cc",
3
+ "version": "1.2.65",
4
+ "gitHead": "e1b92ae84fdacdb2a33410f3edb1bae8d7333028",
5
5
  "description": "zova cli-set-front",
6
6
  "keywords": [
7
7
  "framework",
@@ -25,6 +25,13 @@
25
25
  "publishConfig": {
26
26
  "access": "public"
27
27
  },
28
+ "scripts": {
29
+ "clean": "rimraf dist dist-cli tsconfig.build.tsbuildinfo tsconfig.cli.tsbuildinfo",
30
+ "tsc:publish": "npm run clean && vona :bin:buildGeneral && tsc -p tsconfig.build.json && tsc -p tsconfig.cli.json",
31
+ "prepublishOnly": "npm run tsc:publish",
32
+ "prepack": "clean-package",
33
+ "postpack": "clean-package restore && npm run clean"
34
+ },
28
35
  "dependencies": {
29
36
  "@babel/plugin-proposal-decorators": "^7.29.0",
30
37
  "@babel/plugin-transform-class-properties": "^7.28.6",
@@ -36,14 +43,14 @@
36
43
  "@cabloy/utils": "^2.1.19",
37
44
  "@cabloy/vite-plugin-babel": "^1.3.3",
38
45
  "@cabloy/vue-babel-plugin-jsx": "^2.0.1",
39
- "@cabloy/word-utils": "^2.1.12",
46
+ "@cabloy/word-utils": "^2.1.13",
40
47
  "@typescript/native-preview": "^7.0.0-dev.20260320.1",
41
48
  "@vitejs/plugin-vue-jsx": "^5.1.5",
42
49
  "babel-plugin-transform-typescript-metadata": "^0.4.0",
43
- "babel-plugin-zova-bean-module": "^1.2.12",
44
- "babel-plugin-zova-bean-use": "^1.1.12",
45
- "babel-plugin-zova-behavior": "^1.1.12",
46
- "babel-plugin-zova-component": "^1.1.12",
50
+ "babel-plugin-zova-bean-module": "^1.2.13",
51
+ "babel-plugin-zova-bean-use": "^1.1.13",
52
+ "babel-plugin-zova-behavior": "^1.1.13",
53
+ "babel-plugin-zova-component": "^1.1.13",
47
54
  "compressing": "^1.10.0",
48
55
  "fs-extra": "^11.3.5",
49
56
  "globby": "^14.1.0",
@@ -57,11 +64,7 @@
57
64
  "urllib": "^4.6.11",
58
65
  "vite": "^8.0.2",
59
66
  "yaml": "^2.8.3",
60
- "zova-openapi": "^1.1.12",
61
- "zova-vite": "^1.1.30"
62
- },
63
- "scripts": {
64
- "clean": "rimraf dist dist-cli tsconfig.build.tsbuildinfo tsconfig.cli.tsbuildinfo",
65
- "tsc:publish": "npm run clean && vona :bin:buildGeneral && tsc -p tsconfig.build.json && tsc -p tsconfig.cli.json"
67
+ "zova-openapi": "^1.1.13",
68
+ "zova-vite": "^1.1.31"
66
69
  }
67
- }
70
+ }
@@ -1,18 +0,0 @@
1
- import type { CmdOptions } from '@cabloy/cli';
2
- import { BeanCliBase } from '@cabloy/cli';
3
- import urllib from 'urllib';
4
- declare module '@cabloy/cli' {
5
- interface ICommandArgv {
6
- force: boolean;
7
- template: string;
8
- }
9
- }
10
- export declare class CliCreateProject extends BeanCliBase {
11
- httpClient: typeof urllib;
12
- constructor(options: CmdOptions);
13
- execute(): Promise<void>;
14
- printUsage(targetDir: string): Promise<void>;
15
- downloadBoilerplate(packageName: string): Promise<string>;
16
- getPackageInfo(packageName: string, withFallback: boolean): Promise<any>;
17
- curl(url: string, options: any): Promise<import("urllib").HttpClientResponse<any>>;
18
- }
@@ -1,45 +0,0 @@
1
- declare const _default: {
2
- bean: string;
3
- info: {
4
- version: string;
5
- title: string;
6
- usage: string;
7
- };
8
- options: {
9
- template: {
10
- description: string;
11
- type: string;
12
- };
13
- force: {
14
- description: string;
15
- type: string;
16
- };
17
- };
18
- groups: {
19
- default: {
20
- questions: {
21
- template: {
22
- type: string;
23
- message: string;
24
- choices: {
25
- name: string;
26
- message: string;
27
- }[];
28
- };
29
- };
30
- };
31
- moduleInfo: {
32
- questions: {
33
- name: {
34
- type: string;
35
- message: string;
36
- initial: {
37
- expression: string;
38
- };
39
- required: boolean;
40
- };
41
- };
42
- };
43
- };
44
- };
45
- export default _default;