@giteeteam/apps-cli 0.1.9 → 0.1.12

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.
Files changed (2) hide show
  1. package/dist/index.js +21 -12
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ var simpleGit__default = /*#__PURE__*/_interopDefaultLegacy(simpleGit);
26
26
  var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);
27
27
  var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa);
28
28
 
29
- var version = "0.1.9";
29
+ var version = "0.1.12";
30
30
 
31
31
  const packageApp = async (outputDir, manifest, _copyFiles = []) => {
32
32
  // add copy file manifest
@@ -134,8 +134,10 @@ const getManifestObject = async () => {
134
134
  };
135
135
 
136
136
  var run$1 = async (opts) => {
137
- const { outputDir, inputDir, prod, copyFiles } = opts;
137
+ const { outputDir, inputDir, prod, copyFiles, zip } = opts;
138
138
  const manifest = await getManifestObject();
139
+ // clear output dir
140
+ await fse__default["default"].emptyDir(outputDir);
139
141
  // bundle
140
142
  await execActionWithSpinner({
141
143
  start: 'start bundle',
@@ -148,20 +150,24 @@ var run$1 = async (opts) => {
148
150
  error: 'package failed',
149
151
  succeed: 'package success',
150
152
  }, () => packageApp(outputDir, manifest, copyFiles));
151
- // archive
152
- await execActionWithSpinner({
153
- start: 'start archive',
154
- error: 'archive failed',
155
- succeed: 'archive success',
156
- }, () => archiveApp(outputDir));
153
+ if (zip) {
154
+ // archive
155
+ await execActionWithSpinner({
156
+ start: 'start archive',
157
+ error: 'archive failed',
158
+ succeed: 'archive success',
159
+ }, () => archiveApp(outputDir));
160
+ }
157
161
  };
158
162
 
159
163
  var build = async (options) => {
164
+ const { input = 'src', output = 'dist', prod, copy, zip } = options;
160
165
  await run$1({
161
- outputDir: path__default["default"].resolve('dist'),
162
- inputDir: path__default["default"].resolve('src'),
163
- prod: !!options.prod,
164
- copyFiles: options.copy,
166
+ outputDir: path__default["default"].resolve(output),
167
+ inputDir: path__default["default"].resolve(input),
168
+ prod: !!prod,
169
+ copyFiles: copy,
170
+ zip: zip,
165
171
  });
166
172
  };
167
173
 
@@ -324,7 +330,10 @@ program.version(version).description('Giteeteam Apps Cli');
324
330
  program
325
331
  .command('build')
326
332
  .option('--prod', 'build in production')
333
+ .option('--no-zip', 'no archive')
327
334
  .option('-c --copy [letters...]', 'copy files')
335
+ .option('-i --input [dir]', 'input dir')
336
+ .option('-o --output [dir]', 'output dir')
328
337
  .action(build);
329
338
  program.command('create [name]').action(create);
330
339
  program.parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.12",
4
4
  "description": "Giteeteam Apps cli",
5
5
  "keywords": [
6
6
  "typescript",
@@ -38,7 +38,7 @@
38
38
  "registry": "https://registry.npmjs.org/"
39
39
  },
40
40
  "dependencies": {
41
- "@giteeteam/apps-bundler": "^0.1.6",
41
+ "@giteeteam/apps-bundler": "^0.1.7",
42
42
  "archiver": "^5.3.1",
43
43
  "chalk": "^4.1.2",
44
44
  "commander": "^9.3.0",
@@ -56,5 +56,5 @@
56
56
  "@types/inquirer": "^8.2.1",
57
57
  "@types/uuid": "^8.3.4"
58
58
  },
59
- "gitHead": "09a6b545da63b26d19524d653bf78a79c72de270"
59
+ "gitHead": "0030d0a92683b04230c31a1f27b747a5c73480cb"
60
60
  }