@tarojs/create-app 3.4.14
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/README.md +39 -0
- package/dist/createApp.js +28 -0
- package/dist/index.js +7 -0
- package/dist/util/index.js +17 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @tarojs/create-app
|
|
2
|
+
|
|
3
|
+
The fast way start building a new Taro application.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pnpm create @tarojs/app
|
|
7
|
+
# or
|
|
8
|
+
yarn create @tarojs/app
|
|
9
|
+
# or
|
|
10
|
+
npm create @tarojs/app
|
|
11
|
+
# or
|
|
12
|
+
cnpm create @tarojs/app
|
|
13
|
+
```
|
|
14
|
+
Then follow the prompts!
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
You can also directly specify the project name and the TypeScript. For example,
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm create @tarojs/app my-app --typescript
|
|
21
|
+
# or
|
|
22
|
+
yarn create @tarojs/app my-app --typescript
|
|
23
|
+
# or
|
|
24
|
+
npm create @tarojs/app my-app --typescript
|
|
25
|
+
# or
|
|
26
|
+
cnpm create @tarojs/app my-app --typescript
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Support for TypeScript alias
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm create @tarojs/app my-app --ts
|
|
33
|
+
# or
|
|
34
|
+
yarn create @tarojs/app my-app --ts
|
|
35
|
+
# or
|
|
36
|
+
npm create @tarojs/app my-app --ts
|
|
37
|
+
# or
|
|
38
|
+
cnpm create @tarojs/app my-app --ts
|
|
39
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.init = void 0;
|
|
4
|
+
const minimist = require("minimist");
|
|
5
|
+
const cli_1 = require("@tarojs/cli");
|
|
6
|
+
function init() {
|
|
7
|
+
const argv = minimist(process.argv.slice(2), {
|
|
8
|
+
alias: {
|
|
9
|
+
typescript: ['ts']
|
|
10
|
+
},
|
|
11
|
+
boolean: ['typescript']
|
|
12
|
+
});
|
|
13
|
+
const projectName = argv._[0];
|
|
14
|
+
const typescript = argv.typescript || undefined;
|
|
15
|
+
const appPath = process.cwd();
|
|
16
|
+
const project = new cli_1.Project({
|
|
17
|
+
projectName,
|
|
18
|
+
projectDir: appPath,
|
|
19
|
+
description: undefined,
|
|
20
|
+
templateSource: undefined,
|
|
21
|
+
css: undefined,
|
|
22
|
+
clone: undefined,
|
|
23
|
+
template: undefined,
|
|
24
|
+
typescript
|
|
25
|
+
});
|
|
26
|
+
project.create();
|
|
27
|
+
}
|
|
28
|
+
exports.init = init;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.printPkgVersion = exports.getPkgVersion = exports.getRootPath = void 0;
|
|
4
|
+
const path = require("path");
|
|
5
|
+
function getRootPath() {
|
|
6
|
+
return path.resolve(__dirname, '../../');
|
|
7
|
+
}
|
|
8
|
+
exports.getRootPath = getRootPath;
|
|
9
|
+
function getPkgVersion() {
|
|
10
|
+
return require(path.join(getRootPath(), 'package.json')).version;
|
|
11
|
+
}
|
|
12
|
+
exports.getPkgVersion = getPkgVersion;
|
|
13
|
+
function printPkgVersion() {
|
|
14
|
+
console.log(`👽 Taro v${getPkgVersion()}`);
|
|
15
|
+
console.log();
|
|
16
|
+
}
|
|
17
|
+
exports.printPkgVersion = printPkgVersion;
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tarojs/create-app",
|
|
3
|
+
"version": "3.4.14",
|
|
4
|
+
"description": "create taro app with one command",
|
|
5
|
+
"author": "VincentW <Vincent.Mr.W@gmail.com>",
|
|
6
|
+
"homepage": "https://github.com/nervjs/taro/tree/master/packages/create-app#readme",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "tsc -w",
|
|
11
|
+
"prod": "tsc",
|
|
12
|
+
"build": "npm run clean && npm run prod",
|
|
13
|
+
"clean": "rimraf dist"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/NervJS/taro.git"
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"create-app": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"taro",
|
|
27
|
+
"cli"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=12"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@tarojs/cli": "3.4.14",
|
|
34
|
+
"minimist": "1.2.5"
|
|
35
|
+
}
|
|
36
|
+
}
|