@mpxjs/cli 3.3.4 → 3.4.0

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.
@@ -228,3 +228,77 @@ test('test-e2e', async () => {
228
228
  const pkg = require(path.resolve(cwd, name, 'package.json'))
229
229
  expect(pkg.devDependencies).toHaveProperty('@mpxjs/vue-cli-plugin-mpx-e2e-test')
230
230
  })
231
+
232
+ test('test-unocss', async () => {
233
+ const cwd = path.resolve(__dirname, '../../test')
234
+ const name = 'test-unocss'
235
+ await create(
236
+ name,
237
+ {
238
+ force: true,
239
+ git: false,
240
+ cwd
241
+ },
242
+ {
243
+ srcMode: 'wx',
244
+ appid: 'test',
245
+ description: 'test',
246
+ cross: true,
247
+ needUtilityFirstCSS: true,
248
+ plugins: {},
249
+ useConfigFiles: true
250
+ }
251
+ )
252
+
253
+ const pkg = require(path.resolve(cwd, name, 'package.json'))
254
+ expect(pkg.devDependencies).toHaveProperty('@mpxjs/vue-cli-plugin-mpx-utility-first-css')
255
+ })
256
+
257
+ test('test-typescript', async () => {
258
+ const cwd = path.resolve(__dirname, '../../test')
259
+ const name = 'test-typescript'
260
+ await create(
261
+ name,
262
+ {
263
+ force: true,
264
+ git: false,
265
+ cwd
266
+ },
267
+ {
268
+ srcMode: 'wx',
269
+ appid: 'test',
270
+ description: 'test',
271
+ cross: true,
272
+ needTs: true,
273
+ plugins: {},
274
+ useConfigFiles: true
275
+ }
276
+ )
277
+
278
+ const pkg = require(path.resolve(cwd, name, 'package.json'))
279
+ expect(pkg.devDependencies).toHaveProperty('@mpxjs/vue-cli-plugin-mpx-typescript')
280
+ })
281
+ test('test-ssr', async () => {
282
+ const cwd = path.resolve(__dirname, '../../test')
283
+ const name = 'test-ssr'
284
+ await create(
285
+ name,
286
+ {
287
+ force: true,
288
+ git: false,
289
+ cwd
290
+ },
291
+ {
292
+ srcMode: 'wx',
293
+ appid: 'test',
294
+ description: 'test',
295
+ cross: true,
296
+ needSSR: true,
297
+ plugins: {},
298
+ useConfigFiles: true
299
+ }
300
+ )
301
+
302
+ const pkg = require(path.resolve(cwd, name, 'package.json'))
303
+ expect(pkg.devDependencies).toHaveProperty('@mpxjs/vue-cli-plugin-mpx-ssr')
304
+ })
package/lib/create.js CHANGED
@@ -171,6 +171,7 @@ async function create (projectName, options, preset = null) {
171
171
  isPlugin: preset.isPlugin,
172
172
  cloudFunc: preset.cloudFunc,
173
173
  cross: preset.cross,
174
+ needSSR: preset.needSSR,
174
175
  name
175
176
  })
176
177
  })
package/lib/prompts.js CHANGED
@@ -16,6 +16,20 @@ module.exports = [
16
16
  type: 'confirm',
17
17
  default: true
18
18
  },
19
+ {
20
+ name: 'needSSR',
21
+ when: ({ srcMode }) => srcMode === 'wx',
22
+ message: '是否需要 web ssr',
23
+ type: 'confirm',
24
+ default: false,
25
+ preset: {
26
+ plugins: {
27
+ [`${prefix}-ssr`]: {
28
+ version: '^2.0.0'
29
+ }
30
+ }
31
+ }
32
+ },
19
33
  {
20
34
  name: 'cloudFunc',
21
35
  when: ({ srcMode, cross }) => srcMode === 'wx' && cross === false,
@@ -58,6 +72,20 @@ module.exports = [
58
72
  }
59
73
  }
60
74
  },
75
+
76
+ {
77
+ name: 'needUtilityFirstCSS',
78
+ type: 'confirm',
79
+ message: '是否需要使用原子类',
80
+ default: false,
81
+ preset: {
82
+ plugins: {
83
+ [`${prefix}-utility-first-css`]: {
84
+ version: '^2.0.0'
85
+ }
86
+ }
87
+ }
88
+ },
61
89
  {
62
90
  name: 'needUnitTest',
63
91
  message: '是否需要单元测试',
package/package.json CHANGED
@@ -29,5 +29,5 @@
29
29
  "access": "public",
30
30
  "registry": "https://registry.npmjs.org"
31
31
  },
32
- "version": "3.3.4"
32
+ "version": "3.4.0"
33
33
  }