@yyp92-cli/cli 0.1.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.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/package.json +28 -0
- package/src/index.ts +22 -0
- package/tsconfig.json +15 -0
package/CHANGELOG.md
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
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
|
+
import create from '@yyp92-cli/create';
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
import fse from 'fs-extra';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
const pkgJson = fse.readJSONSync(path.join(import.meta.dirname, '../package.json'));
|
|
16
|
+
const program = new Command();
|
|
17
|
+
program
|
|
18
|
+
.name('yyp92-cli')
|
|
19
|
+
.description('脚手架 cli')
|
|
20
|
+
.version(pkgJson.version);
|
|
21
|
+
program.command('create')
|
|
22
|
+
.description('创建项目')
|
|
23
|
+
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
create();
|
|
25
|
+
}));
|
|
26
|
+
program.parse();
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAEpF,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACF,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,SAAS,CAAC;KACtB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAE9B,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;KACpB,WAAW,CAAC,MAAM,CAAC;KACnB,MAAM,CAAC,GAAS,EAAE;IACf,MAAM,EAAE,CAAC;AACb,CAAC,CAAA,CAAC,CAAC;AAEP,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yyp92-cli/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"bin": {
|
|
11
|
+
"yyp92-ci": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"description": "",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"commander": "^14.0.0",
|
|
19
|
+
"fs-extra": "^11.3.1",
|
|
20
|
+
"@yyp92-cli/create": "0.1.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/fs-extra": "^11.0.4"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import create from '@yyp92-cli/create';
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
import fse from 'fs-extra';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
|
|
7
|
+
const pkgJson = fse.readJSONSync(path.join(import.meta.dirname, '../package.json'));
|
|
8
|
+
|
|
9
|
+
const program = new Command();
|
|
10
|
+
|
|
11
|
+
program
|
|
12
|
+
.name('yyp92-cli')
|
|
13
|
+
.description('脚手架 cli')
|
|
14
|
+
.version(pkgJson.version);
|
|
15
|
+
|
|
16
|
+
program.command('create')
|
|
17
|
+
.description('创建项目')
|
|
18
|
+
.action(async () => {
|
|
19
|
+
create();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
program.parse();
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "dist",
|
|
4
|
+
"types": ["node"],
|
|
5
|
+
"target": "es2016",
|
|
6
|
+
"module": "NodeNext",
|
|
7
|
+
"moduleResolution": "NodeNext",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"sourceMap": true
|
|
14
|
+
}
|
|
15
|
+
}
|