@giteeteam/apps-cli 0.1.13 → 0.1.16

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 +22 -20
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -26,11 +26,9 @@ 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.13";
29
+ var version = "0.1.16";
30
30
 
31
- const packageApp = async (outputDir, manifest, _copyFiles = []) => {
32
- // add copy file manifest
33
- const copyFiles = ['manifest.yml', ..._copyFiles];
31
+ const packageApp = async ({ outputDir, manifest, copyFiles }) => {
34
32
  const { resources } = manifest;
35
33
  if (resources) {
36
34
  for (const { key, path: resourcePath } of resources) {
@@ -126,8 +124,7 @@ const getManifestObject = async () => {
126
124
  return obj;
127
125
  };
128
126
 
129
- var run$1 = async (opts) => {
130
- const { outputDir, inputDir, prod, copyFiles, zip } = opts;
127
+ var run$1 = async ({ outputDir, inputDir, prod, copyFiles, zip }) => {
131
128
  const manifest = await getManifestObject();
132
129
  const { app: { version, key }, } = manifest;
133
130
  if (!key) {
@@ -151,7 +148,7 @@ var run$1 = async (opts) => {
151
148
  start: 'start package',
152
149
  error: 'package failed',
153
150
  succeed: 'package success',
154
- }, () => packageApp(outputDir, manifest, copyFiles));
151
+ }, () => packageApp({ outputDir, manifest, copyFiles }));
155
152
  if (zip) {
156
153
  const pkgName = `${key}_${version}.zip`;
157
154
  // archive
@@ -163,13 +160,14 @@ var run$1 = async (opts) => {
163
160
  }
164
161
  };
165
162
 
163
+ const defaultCopyFiles = ['manifest.yml'];
166
164
  var build = async (options) => {
167
- const { input = 'src', output = 'dist', prod, copy, zip } = options;
165
+ const { input = 'src', output = 'dist', prod, copy = [], zip } = options;
168
166
  await run$1({
169
167
  outputDir: path__default["default"].resolve(output),
170
168
  inputDir: path__default["default"].resolve(input),
171
169
  prod: !!prod,
172
- copyFiles: copy,
170
+ copyFiles: [...defaultCopyFiles, ...copy],
173
171
  zip: zip,
174
172
  });
175
173
  };
@@ -259,30 +257,30 @@ const selectTemplate = async () => {
259
257
  const prompt = inquirer__default["default"].createPromptModule();
260
258
  const result = await prompt({
261
259
  type: 'list',
262
- name: '请选择插件类型',
263
- choices: Object.keys(TemplateType),
260
+ name: 'Please select template type',
261
+ choices: [TemplateType.micro],
264
262
  });
265
263
  return Object.values(result)[0];
266
264
  };
267
265
  const cloneRepo = async (repoUrl, projectPath) => {
268
266
  await execActionWithSpinner({
269
- start: '开始克隆仓库',
270
- error: '仓库克隆失败',
271
- succeed: '仓库克隆完毕',
267
+ start: 'Start clone repository',
268
+ error: 'Clone repository failed!',
269
+ succeed: 'Clone repository success!',
272
270
  }, () => clone(repoUrl, projectPath));
273
271
  };
274
272
  const dependenciesInstall = async (projectPath) => {
275
273
  await execActionWithSpinner({
276
- start: '开始安装依赖',
277
- error: '依赖安装失败',
278
- succeed: '依赖安装成功',
274
+ start: 'Start install dependencies',
275
+ error: 'Install dependencies failed!',
276
+ succeed: 'Install dependencies success!',
279
277
  }, () => command.executeCommand('yarn', ['install'], projectPath));
280
278
  };
281
279
  var run = async (options) => {
282
280
  const { cwd, packageName } = options;
283
281
  const projectPath = path__default["default"].join(cwd, packageName);
284
282
  if (await fse__default["default"].pathExists(projectPath)) {
285
- console.error('项目文件夹已存在!请删除或者换个项目名');
283
+ console.error('Project path already exists!');
286
284
  return;
287
285
  }
288
286
  // 选择模板类型 micro or uikit
@@ -299,6 +297,10 @@ var run = async (options) => {
299
297
  const files = [
300
298
  './manifest.yml',
301
299
  './package.json',
300
+ './webpack.config.js',
301
+ './public/index.html',
302
+ './src/App.tsx',
303
+ './src/index.tsx',
302
304
  './static/micro/package.json',
303
305
  './static/micro/webpack.config.js',
304
306
  './static/micro/public/index.html',
@@ -312,8 +314,8 @@ var run = async (options) => {
312
314
  })));
313
315
  await dependenciesInstall(projectPath);
314
316
  await init(projectPath);
315
- console.log('项目初始化成功!');
316
- console.log('项目路径:' + projectPath);
317
+ console.log('Project init success!');
318
+ console.log('Project path:' + projectPath);
317
319
  };
318
320
 
319
321
  var create = async (packageName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-cli",
3
- "version": "0.1.13",
3
+ "version": "0.1.16",
4
4
  "description": "Giteeteam Apps cli",
5
5
  "keywords": [
6
6
  "typescript",
@@ -8,7 +8,7 @@
8
8
  "cli"
9
9
  ],
10
10
  "bin": {
11
- "giteeteam-apps-cli": "./dist/index.js"
11
+ "giteeteam-apps": "./dist/index.js"
12
12
  },
13
13
  "license": "ISC",
14
14
  "main": "./dist/index.js",
@@ -56,5 +56,5 @@
56
56
  "@types/inquirer": "^8.2.1",
57
57
  "@types/uuid": "^8.3.4"
58
58
  },
59
- "gitHead": "0edc60ca211858b1b25cf79ccf7595d6ee5f392e"
59
+ "gitHead": "ed0a34bda70ee112ec04caf0ee75247c912b0d5b"
60
60
  }