create-packer 1.22.2 → 1.23.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/.gitignore +1 -1
- package/LICENSE +21 -21
- package/bin/createTemp.d.ts +1 -1
- package/bin/createTemp.js +64 -64
- package/bin/index.d.ts +2 -2
- package/bin/index.js +6 -6
- package/bin/utils/index.d.ts +10 -10
- package/bin/utils/index.js +70 -70
- package/package.json +1 -1
- package/template/nest/.eslintrc.js +25 -25
- package/template/nest/.gitignore +34 -34
- package/template/nest/.husky/pre-commit +4 -4
- package/template/nest/.prettierrc +6 -6
- package/template/nest/README.md +73 -73
- package/template/nest/nest-cli.json +5 -5
- package/template/nest/src/app.controller.spec.ts +22 -22
- package/template/nest/src/app.controller.ts +12 -12
- package/template/nest/src/app.module.ts +10 -10
- package/template/nest/src/app.service.ts +8 -8
- package/template/nest/src/main.ts +10 -10
- package/template/nest/src/utils/transform.interceptor.ts +26 -26
- package/template/nest/test/app.e2e-spec.ts +24 -24
- package/template/nest/test/jest-e2e.json +9 -9
- package/template/nest/tsconfig.build.json +5 -5
- package/template/nest/tsconfig.json +21 -21
- package/template/web-app/next/.editorconfig +14 -0
- package/template/web-app/next/.eslintrc.json +8 -0
- package/template/web-app/next/.gitignore +34 -0
- package/template/web-app/next/.husky/_/.gitignore +1 -0
- package/template/web-app/next/.husky/commit-msg +4 -0
- package/template/web-app/next/.husky/pre-commit +4 -0
- package/template/web-app/next/.prettierrc +12 -0
- package/template/web-app/next/.stylelintrc +23 -0
- package/template/web-app/next/.vscode/extensions.json +7 -0
- package/template/web-app/next/README.md +34 -0
- package/template/web-app/next/app/favicon.ico +0 -0
- package/template/web-app/next/app/globals.css +22 -0
- package/template/web-app/next/app/layout.tsx +18 -0
- package/template/web-app/next/app/page.tsx +113 -0
- package/template/web-app/next/commitlint.config.cjs +1 -0
- package/template/web-app/next/next-env.d.ts +5 -0
- package/template/web-app/next/next.config.js +5 -0
- package/template/web-app/next/package.json +45 -0
- package/template/web-app/next/pnpm-lock.yaml +4187 -0
- package/template/web-app/next/postcss.config.js +6 -0
- package/template/web-app/next/public/next.svg +1 -0
- package/template/web-app/next/public/vercel.svg +1 -0
- package/template/web-app/next/tailwind.config.js +20 -0
- package/template/web-app/next/tsconfig.json +28 -0
- package/template/web-app/react/src/domain/app/{models/app.ts → app.model.ts} +1 -3
- package/template/web-app/react/src/domain/app/index.ts +1 -1
- package/template/web-app/react/src/router/router.tsx +1 -1
- package/template/web-app/vue/src/router/index.ts +1 -2
- package/template/web-app/react/src/domain/app/models/index.ts +0 -1
- package/template/workspace/nx/node_modules/.pnpm/minipass-fetch@3.0.3/node_modules/minipass-sized/.gitignore +0 -22
- package/template/workspace/nx/node_modules/.pnpm/minipass-sized@1.0.3/node_modules/minipass-sized/.gitignore +0 -22
- package/template/workspace/nx/node_modules/.pnpm/node_modules/minipass-sized/.gitignore +0 -22
- package/template/workspace/nx/node_modules/.pnpm/node_modules/npm-normalize-package-bin/.gitignore +0 -24
- package/template/workspace/nx/node_modules/.pnpm/npm-bundled@1.1.2/node_modules/npm-normalize-package-bin/.gitignore +0 -24
- package/template/workspace/nx/node_modules/.pnpm/npm-normalize-package-bin@1.0.1/node_modules/npm-normalize-package-bin/.gitignore +0 -24
- package/template/workspace/nx/node_modules/.pnpm/npm-packlist@5.1.1/node_modules/npm-normalize-package-bin/.gitignore +0 -24
- /package/template/web-app/react/src/{layout → pages/layout}/components/index.ts +0 -0
- /package/template/web-app/react/src/{layout → pages/layout}/components/loading.tsx +0 -0
- /package/template/web-app/react/src/{layout → pages/layout}/index.ts +0 -0
- /package/template/web-app/react/src/{layout → pages/layout}/layout.tsx +0 -0
- /package/template/web-app/vue/src/{layout → pages/layout}/index.ts +0 -0
- /package/template/web-app/vue/src/{layout → pages/layout}/layout.vue +0 -0
package/.gitignore
CHANGED
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 1k
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 1k
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/bin/createTemp.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function createTemp(dirname: string): Promise<void>;
|
|
1
|
+
export declare function createTemp(dirname: string): Promise<void>;
|
package/bin/createTemp.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTemp = void 0;
|
|
4
|
-
const inquirer = require("inquirer");
|
|
5
|
-
const fsExtra = require("fs-extra");
|
|
6
|
-
const path = require("path");
|
|
7
|
-
const chalk = require("chalk");
|
|
8
|
-
const ora = require("ora");
|
|
9
|
-
const child_process_1 = require("child_process");
|
|
10
|
-
const utils_1 = require("./utils");
|
|
11
|
-
const fs_1 = require("fs");
|
|
12
|
-
const cwd = process.cwd();
|
|
13
|
-
const command = utils_1.onGenCommand();
|
|
14
|
-
const excludes = ['node_modules', 'yarn-error.log', 'dist'];
|
|
15
|
-
const tempRoot = path.join(__dirname, '../template');
|
|
16
|
-
const tempInfoList = utils_1.genTemplateInfoList(tempRoot);
|
|
17
|
-
function copyTempFile(tempPath, output) {
|
|
18
|
-
fsExtra.readdirSync(tempPath).map(name => {
|
|
19
|
-
if (!excludes.includes(name)) {
|
|
20
|
-
fsExtra.copySync(path.join(tempPath, name), path.join(output, name));
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function createTempEnd(output) {
|
|
25
|
-
child_process_1.spawnSync(command, ['install'], {
|
|
26
|
-
cwd: output,
|
|
27
|
-
stdio: 'inherit'
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
async function createTemp(dirname) {
|
|
31
|
-
const isCurrent = dirname === '.';
|
|
32
|
-
let answer = await inquirer.prompt([
|
|
33
|
-
{
|
|
34
|
-
type: 'list',
|
|
35
|
-
name: 'temp',
|
|
36
|
-
message: 'Select temp.',
|
|
37
|
-
choices: tempInfoList.map(o => o.name)
|
|
38
|
-
}
|
|
39
|
-
]);
|
|
40
|
-
let tempInfo = tempInfoList.find(o => o.name === answer.temp);
|
|
41
|
-
if (tempInfo.children.length > 0) {
|
|
42
|
-
answer = await inquirer.prompt([
|
|
43
|
-
{
|
|
44
|
-
type: 'list',
|
|
45
|
-
name: 'temp',
|
|
46
|
-
message: 'Select temp type.',
|
|
47
|
-
choices: tempInfo.children.map(o => o.name)
|
|
48
|
-
}
|
|
49
|
-
]);
|
|
50
|
-
tempInfo = tempInfo.children.find(o => o.name === answer.temp);
|
|
51
|
-
}
|
|
52
|
-
const creating = ora(chalk.yellow('Creating...\n')).start();
|
|
53
|
-
const output = path.join(cwd, isCurrent ? '' : dirname);
|
|
54
|
-
if (!isCurrent && fs_1.existsSync(output)) {
|
|
55
|
-
return console.log(chalk.red(`${dirname} already exists!`));
|
|
56
|
-
}
|
|
57
|
-
if (!isCurrent) {
|
|
58
|
-
fsExtra.mkdirSync(output);
|
|
59
|
-
}
|
|
60
|
-
copyTempFile(tempInfo.src, output);
|
|
61
|
-
createTempEnd(output);
|
|
62
|
-
creating.succeed();
|
|
63
|
-
}
|
|
64
|
-
exports.createTemp = createTemp;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTemp = void 0;
|
|
4
|
+
const inquirer = require("inquirer");
|
|
5
|
+
const fsExtra = require("fs-extra");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const chalk = require("chalk");
|
|
8
|
+
const ora = require("ora");
|
|
9
|
+
const child_process_1 = require("child_process");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
const fs_1 = require("fs");
|
|
12
|
+
const cwd = process.cwd();
|
|
13
|
+
const command = utils_1.onGenCommand();
|
|
14
|
+
const excludes = ['node_modules', 'yarn-error.log', 'dist'];
|
|
15
|
+
const tempRoot = path.join(__dirname, '../template');
|
|
16
|
+
const tempInfoList = utils_1.genTemplateInfoList(tempRoot);
|
|
17
|
+
function copyTempFile(tempPath, output) {
|
|
18
|
+
fsExtra.readdirSync(tempPath).map(name => {
|
|
19
|
+
if (!excludes.includes(name)) {
|
|
20
|
+
fsExtra.copySync(path.join(tempPath, name), path.join(output, name));
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function createTempEnd(output) {
|
|
25
|
+
child_process_1.spawnSync(command, ['install'], {
|
|
26
|
+
cwd: output,
|
|
27
|
+
stdio: 'inherit'
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async function createTemp(dirname) {
|
|
31
|
+
const isCurrent = dirname === '.';
|
|
32
|
+
let answer = await inquirer.prompt([
|
|
33
|
+
{
|
|
34
|
+
type: 'list',
|
|
35
|
+
name: 'temp',
|
|
36
|
+
message: 'Select temp.',
|
|
37
|
+
choices: tempInfoList.map(o => o.name)
|
|
38
|
+
}
|
|
39
|
+
]);
|
|
40
|
+
let tempInfo = tempInfoList.find(o => o.name === answer.temp);
|
|
41
|
+
if (tempInfo.children.length > 0) {
|
|
42
|
+
answer = await inquirer.prompt([
|
|
43
|
+
{
|
|
44
|
+
type: 'list',
|
|
45
|
+
name: 'temp',
|
|
46
|
+
message: 'Select temp type.',
|
|
47
|
+
choices: tempInfo.children.map(o => o.name)
|
|
48
|
+
}
|
|
49
|
+
]);
|
|
50
|
+
tempInfo = tempInfo.children.find(o => o.name === answer.temp);
|
|
51
|
+
}
|
|
52
|
+
const creating = ora(chalk.yellow('Creating...\n')).start();
|
|
53
|
+
const output = path.join(cwd, isCurrent ? '' : dirname);
|
|
54
|
+
if (!isCurrent && fs_1.existsSync(output)) {
|
|
55
|
+
return console.log(chalk.red(`${dirname} already exists!`));
|
|
56
|
+
}
|
|
57
|
+
if (!isCurrent) {
|
|
58
|
+
fsExtra.mkdirSync(output);
|
|
59
|
+
}
|
|
60
|
+
copyTempFile(tempInfo.src, output);
|
|
61
|
+
createTempEnd(output);
|
|
62
|
+
creating.succeed();
|
|
63
|
+
}
|
|
64
|
+
exports.createTemp = createTemp;
|
package/bin/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export {};
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export {};
|
package/bin/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const createTemp_1 = require("./createTemp");
|
|
5
|
-
const commander_1 = require("commander");
|
|
6
|
-
commander_1.program.argument('<dirname>', 'Create project.', dirname => createTemp_1.createTemp(dirname)).parse(process.argv);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const createTemp_1 = require("./createTemp");
|
|
5
|
+
const commander_1 = require("commander");
|
|
6
|
+
commander_1.program.argument('<dirname>', 'Create project.', dirname => createTemp_1.createTemp(dirname)).parse(process.argv);
|
package/bin/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare function hasPnpm(): boolean;
|
|
2
|
-
export declare function hasYarn(): boolean;
|
|
3
|
-
export declare function onGenCommand(): "pnpm" | "yarn" | "npm";
|
|
4
|
-
interface tempInfoType {
|
|
5
|
-
name: string;
|
|
6
|
-
src: string;
|
|
7
|
-
children?: tempInfoType[];
|
|
8
|
-
}
|
|
9
|
-
export declare function genTemplateInfoList(root: string): tempInfoType[];
|
|
10
|
-
export {};
|
|
1
|
+
export declare function hasPnpm(): boolean;
|
|
2
|
+
export declare function hasYarn(): boolean;
|
|
3
|
+
export declare function onGenCommand(): "pnpm" | "yarn" | "npm";
|
|
4
|
+
interface tempInfoType {
|
|
5
|
+
name: string;
|
|
6
|
+
src: string;
|
|
7
|
+
children?: tempInfoType[];
|
|
8
|
+
}
|
|
9
|
+
export declare function genTemplateInfoList(root: string): tempInfoType[];
|
|
10
|
+
export {};
|
package/bin/utils/index.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.genTemplateInfoList = exports.onGenCommand = exports.hasYarn = exports.hasPnpm = void 0;
|
|
23
|
-
const path = __importStar(require("path"));
|
|
24
|
-
const child_process_1 = require("child_process");
|
|
25
|
-
const fs_1 = require("fs");
|
|
26
|
-
function hasPnpm() {
|
|
27
|
-
try {
|
|
28
|
-
child_process_1.execSync('pnpm --version');
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.hasPnpm = hasPnpm;
|
|
36
|
-
function hasYarn() {
|
|
37
|
-
try {
|
|
38
|
-
child_process_1.execSync('yarnpkg --version');
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.hasYarn = hasYarn;
|
|
46
|
-
function onGenCommand() {
|
|
47
|
-
if (hasPnpm()) {
|
|
48
|
-
return 'pnpm';
|
|
49
|
-
}
|
|
50
|
-
if (hasYarn()) {
|
|
51
|
-
return 'yarn';
|
|
52
|
-
}
|
|
53
|
-
return 'npm';
|
|
54
|
-
}
|
|
55
|
-
exports.onGenCommand = onGenCommand;
|
|
56
|
-
function genTemplateInfoList(root) {
|
|
57
|
-
const temps = [];
|
|
58
|
-
fs_1.readdirSync(root, { withFileTypes: true }).forEach(o => {
|
|
59
|
-
const src = path.join(root, o.name);
|
|
60
|
-
if (o.isDirectory()) {
|
|
61
|
-
temps.push({
|
|
62
|
-
name: o.name,
|
|
63
|
-
src,
|
|
64
|
-
children: fs_1.existsSync(path.join(src, 'package.json')) ? [] : genTemplateInfoList(src)
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
return temps;
|
|
69
|
-
}
|
|
70
|
-
exports.genTemplateInfoList = genTemplateInfoList;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.genTemplateInfoList = exports.onGenCommand = exports.hasYarn = exports.hasPnpm = void 0;
|
|
23
|
+
const path = __importStar(require("path"));
|
|
24
|
+
const child_process_1 = require("child_process");
|
|
25
|
+
const fs_1 = require("fs");
|
|
26
|
+
function hasPnpm() {
|
|
27
|
+
try {
|
|
28
|
+
child_process_1.execSync('pnpm --version');
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.hasPnpm = hasPnpm;
|
|
36
|
+
function hasYarn() {
|
|
37
|
+
try {
|
|
38
|
+
child_process_1.execSync('yarnpkg --version');
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.hasYarn = hasYarn;
|
|
46
|
+
function onGenCommand() {
|
|
47
|
+
if (hasPnpm()) {
|
|
48
|
+
return 'pnpm';
|
|
49
|
+
}
|
|
50
|
+
if (hasYarn()) {
|
|
51
|
+
return 'yarn';
|
|
52
|
+
}
|
|
53
|
+
return 'npm';
|
|
54
|
+
}
|
|
55
|
+
exports.onGenCommand = onGenCommand;
|
|
56
|
+
function genTemplateInfoList(root) {
|
|
57
|
+
const temps = [];
|
|
58
|
+
fs_1.readdirSync(root, { withFileTypes: true }).forEach(o => {
|
|
59
|
+
const src = path.join(root, o.name);
|
|
60
|
+
if (o.isDirectory()) {
|
|
61
|
+
temps.push({
|
|
62
|
+
name: o.name,
|
|
63
|
+
src,
|
|
64
|
+
children: fs_1.existsSync(path.join(src, 'package.json')) ? [] : genTemplateInfoList(src)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return temps;
|
|
69
|
+
}
|
|
70
|
+
exports.genTemplateInfoList = genTemplateInfoList;
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
parserOptions: {
|
|
4
|
-
project: 'tsconfig.json',
|
|
5
|
-
tsconfigRootDir: __dirname,
|
|
6
|
-
sourceType: 'module',
|
|
7
|
-
},
|
|
8
|
-
plugins: ['@typescript-eslint/eslint-plugin'],
|
|
9
|
-
extends: [
|
|
10
|
-
'plugin:@typescript-eslint/recommended',
|
|
11
|
-
'plugin:prettier/recommended',
|
|
12
|
-
],
|
|
13
|
-
root: true,
|
|
14
|
-
env: {
|
|
15
|
-
node: true,
|
|
16
|
-
jest: true,
|
|
17
|
-
},
|
|
18
|
-
ignorePatterns: ['.eslintrc.js'],
|
|
19
|
-
rules: {
|
|
20
|
-
'@typescript-eslint/interface-name-prefix': 'off',
|
|
21
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
22
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
23
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
24
|
-
},
|
|
25
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
parser: '@typescript-eslint/parser',
|
|
3
|
+
parserOptions: {
|
|
4
|
+
project: 'tsconfig.json',
|
|
5
|
+
tsconfigRootDir: __dirname,
|
|
6
|
+
sourceType: 'module',
|
|
7
|
+
},
|
|
8
|
+
plugins: ['@typescript-eslint/eslint-plugin'],
|
|
9
|
+
extends: [
|
|
10
|
+
'plugin:@typescript-eslint/recommended',
|
|
11
|
+
'plugin:prettier/recommended',
|
|
12
|
+
],
|
|
13
|
+
root: true,
|
|
14
|
+
env: {
|
|
15
|
+
node: true,
|
|
16
|
+
jest: true,
|
|
17
|
+
},
|
|
18
|
+
ignorePatterns: ['.eslintrc.js'],
|
|
19
|
+
rules: {
|
|
20
|
+
'@typescript-eslint/interface-name-prefix': 'off',
|
|
21
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
22
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
23
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
24
|
+
},
|
|
25
|
+
}
|
package/template/nest/.gitignore
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
# compiled output
|
|
2
|
-
/dist
|
|
3
|
-
/node_modules
|
|
4
|
-
|
|
5
|
-
# Logs
|
|
6
|
-
logs
|
|
7
|
-
*.log
|
|
8
|
-
npm-debug.log*
|
|
9
|
-
pnpm-debug.log*
|
|
10
|
-
yarn-debug.log*
|
|
11
|
-
yarn-error.log*
|
|
12
|
-
lerna-debug.log*
|
|
13
|
-
|
|
14
|
-
# OS
|
|
15
|
-
.DS_Store
|
|
16
|
-
|
|
17
|
-
# Tests
|
|
18
|
-
/coverage
|
|
19
|
-
/.nyc_output
|
|
20
|
-
|
|
21
|
-
# IDEs and editors
|
|
22
|
-
/.idea
|
|
23
|
-
.project
|
|
24
|
-
.classpath
|
|
25
|
-
.c9/
|
|
26
|
-
*.launch
|
|
27
|
-
.settings/
|
|
28
|
-
*.sublime-workspace
|
|
29
|
-
|
|
30
|
-
# IDE - VSCode
|
|
31
|
-
.vscode/*
|
|
32
|
-
!.vscode/settings.json
|
|
33
|
-
!.vscode/tasks.json
|
|
34
|
-
!.vscode/launch.json
|
|
1
|
+
# compiled output
|
|
2
|
+
/dist
|
|
3
|
+
/node_modules
|
|
4
|
+
|
|
5
|
+
# Logs
|
|
6
|
+
logs
|
|
7
|
+
*.log
|
|
8
|
+
npm-debug.log*
|
|
9
|
+
pnpm-debug.log*
|
|
10
|
+
yarn-debug.log*
|
|
11
|
+
yarn-error.log*
|
|
12
|
+
lerna-debug.log*
|
|
13
|
+
|
|
14
|
+
# OS
|
|
15
|
+
.DS_Store
|
|
16
|
+
|
|
17
|
+
# Tests
|
|
18
|
+
/coverage
|
|
19
|
+
/.nyc_output
|
|
20
|
+
|
|
21
|
+
# IDEs and editors
|
|
22
|
+
/.idea
|
|
23
|
+
.project
|
|
24
|
+
.classpath
|
|
25
|
+
.c9/
|
|
26
|
+
*.launch
|
|
27
|
+
.settings/
|
|
28
|
+
*.sublime-workspace
|
|
29
|
+
|
|
30
|
+
# IDE - VSCode
|
|
31
|
+
.vscode/*
|
|
32
|
+
!.vscode/settings.json
|
|
33
|
+
!.vscode/tasks.json
|
|
34
|
+
!.vscode/launch.json
|
|
35
35
|
!.vscode/extensions.json
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
. "$(dirname -- "$0")/_/husky.sh"
|
|
3
|
-
|
|
4
|
-
npm run lint
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
. "$(dirname -- "$0")/_/husky.sh"
|
|
3
|
+
|
|
4
|
+
npm run lint
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"singleQuote": true,
|
|
3
|
-
"trailingComma": "all",
|
|
4
|
-
"tabWidth": 4,
|
|
5
|
-
"semi": false
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"singleQuote": true,
|
|
3
|
+
"trailingComma": "all",
|
|
4
|
+
"tabWidth": 4,
|
|
5
|
+
"semi": false
|
|
6
|
+
}
|