create-umi 4.0.0-rc.2 → 4.0.0-rc.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
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  const utils_1 = require("@umijs/utils");
13
4
  const path_1 = require("path");
@@ -21,13 +12,13 @@ const testData = {
21
12
  npmClient: 'pnpm',
22
13
  registry: 'https://registry.npmjs.org/',
23
14
  };
24
- exports.default = ({ cwd, args, }) => __awaiter(void 0, void 0, void 0, function* () {
25
- const [_, name] = args._;
15
+ exports.default = async ({ cwd, args, }) => {
16
+ const [name] = args._;
26
17
  let npmClient = 'pnpm';
27
18
  let registry = 'https://registry.npmjs.org/';
28
19
  // test ignore prompts
29
20
  if (!args.default) {
30
- const response = yield (0, utils_1.prompts)([
21
+ const response = await (0, utils_1.prompts)([
31
22
  {
32
23
  type: 'select',
33
24
  name: 'npmClient',
@@ -44,7 +35,7 @@ exports.default = ({ cwd, args, }) => __awaiter(void 0, void 0, void 0, function
44
35
  {
45
36
  type: 'select',
46
37
  name: 'registry',
47
- message: 'Pick Bpm Registry',
38
+ message: 'Pick Npm Registry',
48
39
  choices: [
49
40
  {
50
41
  title: 'npm',
@@ -86,9 +77,10 @@ exports.default = ({ cwd, args, }) => __awaiter(void 0, void 0, void 0, function
86
77
  message: `Which organization is your plugin stored under github?`,
87
78
  },
88
79
  ];
80
+ const target = name ? (0, path_1.join)(cwd, name) : cwd;
89
81
  const generator = new utils_1.BaseGenerator({
90
82
  path: (0, path_1.join)(__dirname, '..', 'templates', args.plugin ? 'plugin' : 'app'),
91
- target: name ? (0, path_1.join)(cwd, name) : cwd,
83
+ target,
92
84
  data: args.default
93
85
  ? testData
94
86
  : {
@@ -98,9 +90,9 @@ exports.default = ({ cwd, args, }) => __awaiter(void 0, void 0, void 0, function
98
90
  },
99
91
  questions: args.default ? [] : args.plugin ? pluginPrompts : [],
100
92
  });
101
- yield generator.run();
93
+ await generator.run();
102
94
  if (!args.default) {
103
95
  // install
104
- (0, utils_1.installWithNpmClient)({ npmClient });
96
+ (0, utils_1.installWithNpmClient)({ npmClient, cwd: target });
105
97
  }
106
- });
98
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-umi",
3
- "version": "4.0.0-rc.2",
3
+ "version": "4.0.0-rc.20",
4
4
  "description": "create-umi",
5
5
  "homepage": "https://github.com/umijs/umi-next/tree/master/packages/create-umi#readme",
6
6
  "bugs": "https://github.com/umijs/umi-next/issues",
@@ -20,11 +20,12 @@
20
20
  ],
21
21
  "scripts": {
22
22
  "build": "pnpm tsc",
23
- "build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
24
- "dev": "pnpm build -- --watch"
23
+ "build:deps": "umi-scripts bundleDeps",
24
+ "dev": "pnpm build -- --watch",
25
+ "test": "umi-scripts jest-turbo"
25
26
  },
26
27
  "dependencies": {
27
- "@umijs/utils": "4.0.0-rc.2"
28
+ "@umijs/utils": "4.0.0-rc.20"
28
29
  },
29
30
  "publishConfig": {
30
31
  "access": "public"
@@ -6,5 +6,6 @@
6
6
  /src/.umi-production
7
7
  /.umi
8
8
  /.umi-production
9
+ /.umi-test
9
10
  /dist
10
11
  /.mfsu
@@ -10,8 +10,8 @@
10
10
  "umi": "^{{{ version }}}"
11
11
  },
12
12
  "devDependencies": {
13
- "@types/react": "^17.0.0",
14
- "@types/react-dom": "^17.0.0",
13
+ "@types/react": "^18.0.0",
14
+ "@types/react-dom": "^18.0.0",
15
15
  "typescript": "^4.1.2"
16
16
  }
17
17
  }
File without changes
File without changes
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
+ import yayJpg from '../assets/yay.jpg';
2
3
 
3
4
  export default function HomePage() {
4
5
  return (
5
6
  <div>
6
7
  <h2>Yay! Welcome to umi!</h2>
7
8
  <p>
8
- <img src={require('../assets/yay.jpg')} width="388" />
9
+ <img src={yayJpg} width="388" />
9
10
  </p>
10
11
  <p>
11
12
  To get started, edit <code>pages/index.tsx</code> and save to reload.
@@ -10,8 +10,8 @@
10
10
  "baseUrl": ".",
11
11
  "strict": true,
12
12
  "paths": {
13
- "@/*": ["*"],
14
- "@@/*": [".umi/*"]
13
+ "@/*": ["src/*"],
14
+ "@@/*": ["src/.umi/*"]
15
15
  },
16
16
  "allowSyntheticDefaultImports": true
17
17
  }
@@ -1,3 +1,6 @@
1
1
  declare module '*.less';
2
2
  declare module '*.css';
3
+ declare module '*.sass';
4
+ declare module '*.scss';
3
5
  declare module '*.png';
6
+ declare module '*.jpg';