create-packer 1.7.8 → 1.8.2
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/bin/clis/createTemp.d.ts +5 -0
- package/bin/clis/createTemp.js +57 -0
- package/bin/index.js +6 -11
- package/bin/utils/index.d.ts +3 -1
- package/bin/utils/index.js +24 -4
- package/package.json +16 -19
- package/template/{doc/docusaurus → docusaurus}/.gitignore +0 -0
- package/template/{doc/docusaurus → docusaurus}/.prettierignore +0 -0
- package/template/{desktop-app/electron/app → docusaurus}/.prettierrc.js +0 -0
- package/template/{doc/docusaurus → docusaurus}/README.md +0 -0
- package/template/{doc/docusaurus → docusaurus}/babel.config.js +0 -0
- package/template/{doc/docusaurus → docusaurus}/blog/2019-05-28-hola.md +0 -0
- package/template/{doc/docusaurus → docusaurus}/blog/2019-05-29-hello-world.md +0 -0
- package/template/{doc/docusaurus → docusaurus}/blog/2019-05-30-welcome.md +0 -0
- package/template/{doc/docusaurus → docusaurus}/docs/doc1/doc1.mdx +0 -0
- package/template/{doc/docusaurus → docusaurus}/docs/doc1/doc2.mdx +0 -0
- package/template/{doc/docusaurus → docusaurus}/docs/doc1/doc3.mdx +0 -0
- package/template/{doc/docusaurus → docusaurus}/docs/doc1/doc4.mdx +0 -0
- package/template/{doc/docusaurus → docusaurus}/docs/doc2/doc1.mdx +0 -0
- package/template/{doc/docusaurus → docusaurus}/docs/doc2/doc2.mdx +0 -0
- package/template/{doc/docusaurus → docusaurus}/docs/doc2/doc3.mdx +0 -0
- package/template/{doc/docusaurus → docusaurus}/docs/doc2/mdx4.mdx +0 -0
- package/template/{doc/docusaurus → docusaurus}/docusaurus.config.js +0 -0
- package/template/{doc/docusaurus → docusaurus}/package.json +19 -19
- package/template/{doc/docusaurus → docusaurus}/sidebars.js +0 -0
- package/template/{doc/docusaurus → docusaurus}/src/css/custom.css +0 -0
- package/template/{doc/docusaurus → docusaurus}/src/pages/index.tsx +0 -0
- package/template/{doc/docusaurus → docusaurus}/src/pages/styles.module.css +0 -0
- package/template/{doc/docusaurus → docusaurus}/static/.nojekyll +0 -0
- package/template/{doc/docusaurus → docusaurus}/static/img/docusaurus.png +0 -0
- package/template/{doc/docusaurus → docusaurus}/static/img/favicon.ico +0 -0
- package/template/{doc/docusaurus → docusaurus}/static/img/logo.svg +0 -0
- package/template/{doc/docusaurus → docusaurus}/static/img/tutorial/docsVersionDropdown.png +0 -0
- package/template/{doc/docusaurus → docusaurus}/static/img/tutorial/localeDropdown.png +0 -0
- package/template/{doc/docusaurus → docusaurus}/static/img/undraw_docusaurus_mountain.svg +0 -0
- package/template/{doc/docusaurus → docusaurus}/static/img/undraw_docusaurus_react.svg +0 -0
- package/template/{doc/docusaurus → docusaurus}/static/img/undraw_docusaurus_tree.svg +0 -0
- package/template/{doc/docusaurus → docusaurus}/tsconfig.json +0 -0
- package/template/nest/.eslintrc.js +25 -0
- package/template/nest/.gitignore +35 -0
- package/template/nest/.husky/pre-commit +4 -0
- package/template/nest/.prettierrc +6 -0
- package/template/{node/nest → nest}/README.md +1 -1
- package/template/{node/nest → nest}/nest-cli.json +1 -0
- package/template/nest/package.json +74 -0
- package/template/{node/nest → nest}/src/app.controller.spec.ts +1 -1
- package/template/{node/nest → nest}/src/app.controller.ts +0 -0
- package/template/{node/nest → nest}/src/app.module.ts +1 -1
- package/template/{node/nest → nest}/src/app.service.ts +0 -0
- package/template/{node/nest → nest}/src/main.ts +0 -0
- package/template/nest/src/utils/transform.interceptor.ts +26 -0
- package/template/{node/nest → nest}/test/app.e2e-spec.ts +6 -3
- package/template/{node/nest → nest}/test/jest-e2e.json +0 -0
- package/template/nest/tsconfig.build.json +5 -0
- package/template/{node/nest → nest}/tsconfig.json +7 -1
- package/template/{web-app/rc-recoil → react-cra}/.env +0 -0
- package/template/{web-app/rc-recoil → react-cra}/.gitignore +0 -0
- package/template/react-cra/.husky/pre-commit +4 -0
- package/template/{desktop-app/electron/app → react-cra}/.prettierignore +0 -0
- package/template/{doc/docusaurus → react-cra}/.prettierrc.js +0 -0
- package/template/{web-app/rc-recoil → react-cra}/.stylelintrc.js +0 -0
- package/template/{web-app/rc-recoil → react-cra}/README.md +0 -0
- package/template/{web-app/rc-recoil → react-cra}/craco.config.js +0 -0
- package/template/react-cra/package.json +61 -0
- package/template/{web-app/rc-recoil → react-cra}/public/favicon.ico +0 -0
- package/template/{web-app/rc-recoil → react-cra}/public/index.html +0 -0
- package/template/{web-app/rc-recoil → react-cra}/public/manifest.json +0 -0
- package/template/react-cra/src/Layout/index.tsx +8 -0
- package/template/{web-app/rc-recoil → react-cra}/src/Layout/typings.ts +0 -0
- package/template/{web-app/rc-recoil → react-cra}/src/index.scss +0 -0
- package/template/react-cra/src/index.tsx +24 -0
- package/template/{web-app/rc-recoil → react-cra}/src/logo.svg +0 -0
- package/template/{web-app/rc-recoil → react-cra}/src/pages/home/Home.scss +0 -0
- package/template/react-cra/src/pages/home/index.test.tsx +9 -0
- package/template/{web-app/rc-recoil → react-cra}/src/pages/home/index.tsx +0 -0
- package/template/{web-app/rc-recoil → react-cra}/src/react-app-env.d.ts +0 -0
- package/template/{web-app/rc-recoil → react-cra}/src/reportWebVitals.ts +0 -0
- package/template/react-cra/src/routes/index.ts +15 -0
- package/template/{web-app/rc-recoil → react-cra}/src/setupTests.ts +0 -0
- package/template/{web-app/rc-recoil → react-cra}/tsconfig.json +0 -0
- package/bin/clis/Create.d.ts +0 -4
- package/bin/clis/Create.js +0 -47
- package/bin/clis/Project.d.ts +0 -30
- package/bin/clis/Project.js +0 -65
- package/template/desktop-app/electron/.gitignore +0 -34
- package/template/desktop-app/electron/app/.eslintrc +0 -28
- package/template/desktop-app/electron/app/.gitignore +0 -19
- package/template/desktop-app/electron/app/babel.config.js +0 -19
- package/template/desktop-app/electron/app/package.json +0 -106
- package/template/desktop-app/electron/app/src/configs/appConfig.ts +0 -8
- package/template/desktop-app/electron/app/src/lib/AppWin.ts +0 -17
- package/template/desktop-app/electron/app/src/lib/DefaultWin.ts +0 -40
- package/template/desktop-app/electron/app/src/main.ts +0 -38
- package/template/desktop-app/electron/app/src/utils/updateAction.ts +0 -39
- package/template/desktop-app/electron/app/tsconfig.json +0 -20
- package/template/desktop-app/electron/app/webpack.config.js +0 -49
- package/template/desktop-app/electron/app/yarn.lock +0 -6479
- package/template/desktop-app/electron/package.json +0 -20
- package/template/desktop-app/electron/utils/package.js +0 -40
- package/template/desktop-app/electron/yarn.lock +0 -42
- package/template/doc/docusaurus/yarn.lock +0 -9466
- package/template/lib/gulp/.eslintrc +0 -40
- package/template/lib/gulp/.gitignore +0 -31
- package/template/lib/gulp/.prettierignore +0 -7
- package/template/lib/gulp/.prettierrc.js +0 -21
- package/template/lib/gulp/LICENSE +0 -21
- package/template/lib/gulp/README.md +0 -1
- package/template/lib/gulp/jest.config.js +0 -8
- package/template/lib/gulp/package.json +0 -35
- package/template/lib/gulp/scripts/build.js +0 -18
- package/template/lib/gulp/src/index.ts +0 -3
- package/template/lib/gulp/test/index.test.ts +0 -3
- package/template/lib/gulp/tsconfig.json +0 -19
- package/template/lib/gulp/yarn.lock +0 -9570
- package/template/lib/rollup/.eslintrc +0 -40
- package/template/lib/rollup/.gitignore +0 -27
- package/template/lib/rollup/.prettierignore +0 -7
- package/template/lib/rollup/.prettierrc.js +0 -21
- package/template/lib/rollup/LICENSE +0 -21
- package/template/lib/rollup/README.md +0 -1
- package/template/lib/rollup/jest.config.js +0 -8
- package/template/lib/rollup/package.json +0 -35
- package/template/lib/rollup/scripts/build.js +0 -8
- package/template/lib/rollup/src/index.ts +0 -3
- package/template/lib/rollup/test/index.test.ts +0 -3
- package/template/lib/rollup/tsconfig.json +0 -21
- package/template/lib/rollup/yarn.lock +0 -9570
- package/template/node/base/.eslintrc +0 -28
- package/template/node/base/.gitignore +0 -15
- package/template/node/base/.prettierignore +0 -4
- package/template/node/base/.prettierrc.js +0 -20
- package/template/node/base/LICENSE +0 -201
- package/template/node/base/README.md +0 -9
- package/template/node/base/jest.config.js +0 -8
- package/template/node/base/package.json +0 -37
- package/template/node/base/src/server.ts +0 -0
- package/template/node/base/test/server.test.ts +0 -3
- package/template/node/base/tsconfig.json +0 -19
- package/template/node/base/yarn.lock +0 -4038
- package/template/node/nest/.eslintrc.js +0 -24
- package/template/node/nest/.gitignore +0 -15
- package/template/node/nest/.prettierignore +0 -4
- package/template/node/nest/.prettierrc.js +0 -20
- package/template/node/nest/package.json +0 -76
- package/template/node/nest/src/utils/transform.interceptor.ts +0 -14
- package/template/node/nest/tsconfig.build.json +0 -4
- package/template/node/nest/yarn.lock +0 -5931
- package/template/web-app/rc-recoil/.prettierignore +0 -4
- package/template/web-app/rc-recoil/.prettierrc.js +0 -20
- package/template/web-app/rc-recoil/package.json +0 -71
- package/template/web-app/rc-recoil/src/Layout/index.tsx +0 -12
- package/template/web-app/rc-recoil/src/app.store.ts +0 -8
- package/template/web-app/rc-recoil/src/index.tsx +0 -23
- package/template/web-app/rc-recoil/src/pages/home/home.store.ts +0 -6
- package/template/web-app/rc-recoil/src/pages/home/index.test.tsx +0 -15
- package/template/web-app/rc-recoil/src/routes/index.ts +0 -11
- package/template/web-app/rc-recoil/yarn.lock +0 -12437
- package/template/web-app/rc-redux/.env +0 -1
- package/template/web-app/rc-redux/.gitignore +0 -30
- package/template/web-app/rc-redux/.prettierignore +0 -4
- package/template/web-app/rc-redux/.prettierrc.js +0 -20
- package/template/web-app/rc-redux/.stylelintrc.js +0 -21
- package/template/web-app/rc-redux/README.md +0 -10
- package/template/web-app/rc-redux/craco.config.js +0 -14
- package/template/web-app/rc-redux/package.json +0 -72
- package/template/web-app/rc-redux/public/favicon.ico +0 -0
- package/template/web-app/rc-redux/public/index.html +0 -41
- package/template/web-app/rc-redux/public/manifest.json +0 -15
- package/template/web-app/rc-redux/src/Layout/index.tsx +0 -9
- package/template/web-app/rc-redux/src/index.scss +0 -5
- package/template/web-app/rc-redux/src/index.tsx +0 -24
- package/template/web-app/rc-redux/src/logo.svg +0 -7
- package/template/web-app/rc-redux/src/pages/home/Home.scss +0 -0
- package/template/web-app/rc-redux/src/pages/home/home.store.ts +0 -7
- package/template/web-app/rc-redux/src/pages/home/index.test.tsx +0 -17
- package/template/web-app/rc-redux/src/pages/home/index.tsx +0 -10
- package/template/web-app/rc-redux/src/react-app-env.d.ts +0 -1
- package/template/web-app/rc-redux/src/reportWebVitals.ts +0 -15
- package/template/web-app/rc-redux/src/routes/index.ts +0 -11
- package/template/web-app/rc-redux/src/serviceWorker.ts +0 -139
- package/template/web-app/rc-redux/src/setupTests.ts +0 -5
- package/template/web-app/rc-redux/src/store/App.store.ts +0 -9
- package/template/web-app/rc-redux/src/store/index.ts +0 -11
- package/template/web-app/rc-redux/tsconfig.json +0 -21
- package/template/web-app/rc-redux/yarn.lock +0 -12480
- package/template/web-app/vue-2.x/.browserslistrc +0 -2
- package/template/web-app/vue-2.x/.gitignore +0 -30
- package/template/web-app/vue-2.x/.prettierignore +0 -5
- package/template/web-app/vue-2.x/.prettierrc.js +0 -20
- package/template/web-app/vue-2.x/README.md +0 -29
- package/template/web-app/vue-2.x/babel.config.js +0 -3
- package/template/web-app/vue-2.x/package.json +0 -31
- package/template/web-app/vue-2.x/public/favicon.ico +0 -0
- package/template/web-app/vue-2.x/public/index.html +0 -20
- package/template/web-app/vue-2.x/src/App.vue +0 -5
- package/template/web-app/vue-2.x/src/assets/logo.png +0 -0
- package/template/web-app/vue-2.x/src/main.ts +0 -12
- package/template/web-app/vue-2.x/src/router/index.ts +0 -21
- package/template/web-app/vue-2.x/src/shims-tsx.d.ts +0 -13
- package/template/web-app/vue-2.x/src/shims-vue.d.ts +0 -4
- package/template/web-app/vue-2.x/src/store/app.ts +0 -19
- package/template/web-app/vue-2.x/src/store/index.ts +0 -27
- package/template/web-app/vue-2.x/src/views/Home.vue +0 -5
- package/template/web-app/vue-2.x/tsconfig.json +0 -22
- package/template/web-app/vue-2.x/tslint.json +0 -21
- package/template/web-app/vue-2.x/vue.config.js +0 -10
- package/template/web-app/vue-2.x/yarn.lock +0 -8128
- package/template/web-app/webpack/.editorconfig +0 -14
- package/template/web-app/webpack/.gitignore +0 -30
- package/template/web-app/webpack/.prettierignore +0 -5
- package/template/web-app/webpack/.prettierrc.js +0 -20
- package/template/web-app/webpack/.stylelintrc.js +0 -21
- package/template/web-app/webpack/LICENSE +0 -191
- package/template/web-app/webpack/README.md +0 -4
- package/template/web-app/webpack/babel.config.js +0 -17
- package/template/web-app/webpack/jest.config.js +0 -27
- package/template/web-app/webpack/package.json +0 -85
- package/template/web-app/webpack/postcss.config.js +0 -11
- package/template/web-app/webpack/src/Layout/index.tsx +0 -9
- package/template/web-app/webpack/src/Layout/typings.ts +0 -4
- package/template/web-app/webpack/src/global.css +0 -3
- package/template/web-app/webpack/src/global.d.ts +0 -8
- package/template/web-app/webpack/src/index.html +0 -16
- package/template/web-app/webpack/src/index.tsx +0 -20
- package/template/web-app/webpack/src/pages/Home/Home.css.json +0 -1
- package/template/web-app/webpack/src/pages/Home/Home.module.css +0 -3
- package/template/web-app/webpack/src/pages/Home/Home.store.ts +0 -12
- package/template/web-app/webpack/src/pages/Home/index.test.tsx +0 -17
- package/template/web-app/webpack/src/pages/Home/index.tsx +0 -15
- package/template/web-app/webpack/src/pages/Home/typings.ts +0 -1
- package/template/web-app/webpack/src/routes/index.ts +0 -16
- package/template/web-app/webpack/src/store/App.store.ts +0 -14
- package/template/web-app/webpack/src/store/index.ts +0 -11
- package/template/web-app/webpack/tsconfig.json +0 -23
- package/template/web-app/webpack/tslint.json +0 -21
- package/template/web-app/webpack/webpack.config.js +0 -15
- package/template/web-app/webpack/webpack_config/config.js +0 -14
- package/template/web-app/webpack/webpack_config/genBaseConfig.js +0 -73
- package/template/web-app/webpack/webpack_config/genStyleConfig.js +0 -23
- package/template/web-app/webpack/webpack_config/jest/fileTransform.js +0 -40
- package/template/web-app/webpack/yarn.lock +0 -8474
|
@@ -0,0 +1,57 @@
|
|
|
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 fs = require("fs");
|
|
8
|
+
const chalk = require("chalk");
|
|
9
|
+
const ora = require("ora");
|
|
10
|
+
const child_process_1 = require("child_process");
|
|
11
|
+
const utils_1 = require("../utils");
|
|
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 tempInfo = utils_1.onGetDir(tempRoot).map(name => {
|
|
17
|
+
return {
|
|
18
|
+
name,
|
|
19
|
+
src: path.join(tempRoot, name)
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
function copyTempFile(tempPath, output) {
|
|
23
|
+
fsExtra.readdirSync(tempPath).map(name => {
|
|
24
|
+
if (!excludes.includes(name)) {
|
|
25
|
+
fsExtra.copySync(path.join(tempPath, name), path.join(output, name));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function createTempEnd(output) {
|
|
30
|
+
child_process_1.spawnSync(command, ['install'], {
|
|
31
|
+
cwd: output,
|
|
32
|
+
stdio: 'inherit'
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async function createTemp(dirname) {
|
|
36
|
+
const { temp } = await inquirer.prompt([
|
|
37
|
+
{
|
|
38
|
+
type: 'list',
|
|
39
|
+
name: 'temp',
|
|
40
|
+
message: 'Select temp.',
|
|
41
|
+
choices: tempInfo.map(o => o.name)
|
|
42
|
+
}
|
|
43
|
+
]);
|
|
44
|
+
const creating = ora(chalk.yellow('Creating...\n')).start();
|
|
45
|
+
const output = path.join(cwd, dirname);
|
|
46
|
+
if (dirname && fs.existsSync(output)) {
|
|
47
|
+
return console.log(chalk.red(`${dirname} already exists!`));
|
|
48
|
+
}
|
|
49
|
+
if (dirname) {
|
|
50
|
+
fsExtra.mkdirSync(output);
|
|
51
|
+
}
|
|
52
|
+
const tempPath = path.join(tempRoot, temp);
|
|
53
|
+
copyTempFile(tempPath, output);
|
|
54
|
+
createTempEnd(output);
|
|
55
|
+
creating.succeed();
|
|
56
|
+
}
|
|
57
|
+
exports.createTemp = createTemp;
|
package/bin/index.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const
|
|
4
|
+
const createTemp_1 = require("./clis/createTemp");
|
|
5
5
|
const commander_1 = require("commander");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (options.c !== true) {
|
|
12
|
-
dirname = options.c;
|
|
13
|
-
}
|
|
14
|
-
create.onCreate(dirname);
|
|
15
|
-
}
|
|
6
|
+
commander_1.program
|
|
7
|
+
.option('-c, --create <dirname>', 'Create project.', (dirname = '') => {
|
|
8
|
+
return createTemp_1.createTemp(dirname);
|
|
9
|
+
})
|
|
10
|
+
.parse(process.argv);
|
package/bin/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function hasPnpm(): boolean;
|
|
2
|
+
export declare function hasYarn(): boolean;
|
|
3
|
+
export declare function onGenCommand(): "pnpm" | "yarn" | "npm";
|
|
2
4
|
export declare function onGetDir(root: string): string[];
|
package/bin/utils/index.js
CHANGED
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.onGetDir = exports.onGenCommand = void 0;
|
|
3
|
+
exports.onGetDir = exports.onGenCommand = exports.hasYarn = exports.hasPnpm = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
-
function
|
|
6
|
+
function hasPnpm() {
|
|
7
|
+
try {
|
|
8
|
+
child_process_1.execSync('pnpm --version');
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.hasPnpm = hasPnpm;
|
|
16
|
+
function hasYarn() {
|
|
7
17
|
try {
|
|
8
18
|
child_process_1.execSync('yarnpkg --version');
|
|
9
|
-
return
|
|
19
|
+
return true;
|
|
10
20
|
}
|
|
11
21
|
catch {
|
|
12
|
-
return
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.hasYarn = hasYarn;
|
|
26
|
+
function onGenCommand() {
|
|
27
|
+
if (hasPnpm()) {
|
|
28
|
+
return 'pnpm';
|
|
29
|
+
}
|
|
30
|
+
if (hasYarn()) {
|
|
31
|
+
return 'yarn';
|
|
13
32
|
}
|
|
33
|
+
return 'npm';
|
|
14
34
|
}
|
|
15
35
|
exports.onGenCommand = onGenCommand;
|
|
16
36
|
function onGetDir(root) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-packer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": "https://github.com/kevily/create-packer",
|
|
6
6
|
"author": "1k <bug_zero@163.com>",
|
|
@@ -22,25 +22,22 @@
|
|
|
22
22
|
".gitignore"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"chalk": "
|
|
26
|
-
"commander": "
|
|
27
|
-
"fs-extra": "
|
|
28
|
-
"inquirer": "
|
|
29
|
-
"
|
|
25
|
+
"chalk": "4.1.2",
|
|
26
|
+
"commander": "8.1.0",
|
|
27
|
+
"fs-extra": "10.0.0",
|
|
28
|
+
"inquirer": "8.1.2",
|
|
29
|
+
"lodash": "4.17.21",
|
|
30
|
+
"ora": "5.4.1"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"1k-tasks": "
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@types/
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"rimraf": "^3.0.2",
|
|
42
|
-
"rollup-plugin-filesize": "^9.1.1",
|
|
43
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
44
|
-
"typescript": "^4.3.5"
|
|
33
|
+
"1k-tasks": "1.0.8",
|
|
34
|
+
"@types/fs-extra": "9.0.12",
|
|
35
|
+
"@types/inquirer": "7.3.3",
|
|
36
|
+
"@types/node": "16.4.7",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "4.29.2",
|
|
38
|
+
"@typescript-eslint/parser": "4.29.2",
|
|
39
|
+
"eslint": "7.32.0",
|
|
40
|
+
"rimraf": "3.0.2",
|
|
41
|
+
"typescript": "4.3.5"
|
|
45
42
|
}
|
|
46
43
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "docusaurus-
|
|
2
|
+
"name": "docusaurus-temp",
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@docusaurus/core": "2.0.0-beta.9",
|
|
20
20
|
"@docusaurus/preset-classic": "2.0.0-beta.9",
|
|
21
|
-
"@docusaurus/theme-live-codeblock": "
|
|
22
|
-
"@easyops-cn/docusaurus-search-local": "
|
|
23
|
-
"@mdx-js/react": "
|
|
24
|
-
"@svgr/webpack": "
|
|
25
|
-
"clsx": "
|
|
26
|
-
"file-loader": "
|
|
27
|
-
"nodejieba": "
|
|
28
|
-
"prism-react-renderer": "
|
|
29
|
-
"react": "
|
|
30
|
-
"react-dom": "
|
|
31
|
-
"url-loader": "
|
|
21
|
+
"@docusaurus/theme-live-codeblock": "2.0.0-beta.9",
|
|
22
|
+
"@easyops-cn/docusaurus-search-local": "0.19.1",
|
|
23
|
+
"@mdx-js/react": "1.6.21",
|
|
24
|
+
"@svgr/webpack": "5.5.0",
|
|
25
|
+
"clsx": "1.1.1",
|
|
26
|
+
"file-loader": "6.2.0",
|
|
27
|
+
"nodejieba": "2.5.2",
|
|
28
|
+
"prism-react-renderer": "1.2.1",
|
|
29
|
+
"react": "17.0.1",
|
|
30
|
+
"react-dom": "17.0.1",
|
|
31
|
+
"url-loader": "4.1.1"
|
|
32
32
|
},
|
|
33
33
|
"browserslist": {
|
|
34
34
|
"production": [
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@docusaurus/module-type-aliases": "
|
|
47
|
-
"@tsconfig/docusaurus": "
|
|
48
|
-
"@types/react": "
|
|
49
|
-
"@types/react-helmet": "
|
|
50
|
-
"@types/react-router-dom": "
|
|
51
|
-
"prettier": "
|
|
52
|
-
"typescript": "
|
|
46
|
+
"@docusaurus/module-type-aliases": "2.0.0-beta.9",
|
|
47
|
+
"@tsconfig/docusaurus": "1.0.4",
|
|
48
|
+
"@types/react": "17.0.19",
|
|
49
|
+
"@types/react-helmet": "6.1.2",
|
|
50
|
+
"@types/react-router-dom": "5.1.8",
|
|
51
|
+
"prettier": "2.3.2",
|
|
52
|
+
"typescript": "4.3.5"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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
|
|
35
|
+
!.vscode/extensions.json
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/
|
|
2
|
+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nest-temp",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "",
|
|
6
|
+
"private": true,
|
|
7
|
+
"license": "UNLICENSED",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"prepare": "husky install",
|
|
10
|
+
"prebuild": "rimraf dist",
|
|
11
|
+
"build": "nest build",
|
|
12
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
13
|
+
"start": "nest start",
|
|
14
|
+
"start:dev": "nest start --watch",
|
|
15
|
+
"start:debug": "nest start --debug --watch",
|
|
16
|
+
"start:prod": "node dist/main",
|
|
17
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
|
|
18
|
+
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
19
|
+
"test": "jest",
|
|
20
|
+
"test:watch": "jest --watch",
|
|
21
|
+
"test:cov": "jest --coverage",
|
|
22
|
+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
23
|
+
"test:e2e": "jest --config test/jest-e2e.json"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@nestjs/common": "9.0.0",
|
|
27
|
+
"@nestjs/core": "9.0.0",
|
|
28
|
+
"@nestjs/platform-express": "9.0.0",
|
|
29
|
+
"reflect-metadata": "0.1.13",
|
|
30
|
+
"rimraf": "3.0.2",
|
|
31
|
+
"rxjs": "7.2.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@nestjs/cli": "9.0.0",
|
|
35
|
+
"@nestjs/schematics": "9.0.0",
|
|
36
|
+
"@nestjs/testing": "9.0.0",
|
|
37
|
+
"@types/express": "4.17.13",
|
|
38
|
+
"@types/jest": "28.1.4",
|
|
39
|
+
"@types/node": "16.0.0",
|
|
40
|
+
"@types/supertest": "2.0.11",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "5.0.0",
|
|
42
|
+
"@typescript-eslint/parser": "5.0.0",
|
|
43
|
+
"eslint": "8.0.1",
|
|
44
|
+
"eslint-config-prettier": "8.3.0",
|
|
45
|
+
"eslint-plugin-prettier": "4.0.0",
|
|
46
|
+
"husky": "8.0.1",
|
|
47
|
+
"jest": "28.1.2",
|
|
48
|
+
"prettier": "2.3.2",
|
|
49
|
+
"source-map-support": "0.5.20",
|
|
50
|
+
"supertest": "6.1.3",
|
|
51
|
+
"ts-jest": "28.0.5",
|
|
52
|
+
"ts-loader": "9.2.3",
|
|
53
|
+
"ts-node": "10.0.0",
|
|
54
|
+
"tsconfig-paths": "4.0.0",
|
|
55
|
+
"typescript": "4.3.5"
|
|
56
|
+
},
|
|
57
|
+
"jest": {
|
|
58
|
+
"moduleFileExtensions": [
|
|
59
|
+
"js",
|
|
60
|
+
"json",
|
|
61
|
+
"ts"
|
|
62
|
+
],
|
|
63
|
+
"rootDir": "src",
|
|
64
|
+
"testRegex": ".*\\.spec\\.ts$",
|
|
65
|
+
"transform": {
|
|
66
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
|
67
|
+
},
|
|
68
|
+
"collectCoverageFrom": [
|
|
69
|
+
"**/*.(t|j)s"
|
|
70
|
+
],
|
|
71
|
+
"coverageDirectory": "../coverage",
|
|
72
|
+
"testEnvironment": "node"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -8,7 +8,7 @@ describe('AppController', () => {
|
|
|
8
8
|
beforeEach(async () => {
|
|
9
9
|
const app: TestingModule = await Test.createTestingModule({
|
|
10
10
|
controllers: [AppController],
|
|
11
|
-
providers: [AppService]
|
|
11
|
+
providers: [AppService],
|
|
12
12
|
}).compile()
|
|
13
13
|
|
|
14
14
|
appController = app.get<AppController>(AppController)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Injectable,
|
|
3
|
+
NestInterceptor,
|
|
4
|
+
ExecutionContext,
|
|
5
|
+
CallHandler,
|
|
6
|
+
} from '@nestjs/common'
|
|
7
|
+
import { Observable } from 'rxjs'
|
|
8
|
+
import { map } from 'rxjs/operators'
|
|
9
|
+
|
|
10
|
+
export interface Response<T> {
|
|
11
|
+
data: T
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@Injectable()
|
|
15
|
+
export class TransformInterceptor<T>
|
|
16
|
+
implements NestInterceptor<T, Response<T>>
|
|
17
|
+
{
|
|
18
|
+
intercept(
|
|
19
|
+
context: ExecutionContext,
|
|
20
|
+
next: CallHandler,
|
|
21
|
+
): Observable<Response<T>> {
|
|
22
|
+
return next
|
|
23
|
+
.handle()
|
|
24
|
+
.pipe(map((data) => ({ code: 200, message: '', data })))
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Test, TestingModule } from '@nestjs/testing'
|
|
2
2
|
import { INestApplication } from '@nestjs/common'
|
|
3
3
|
import * as request from 'supertest'
|
|
4
|
-
import { AppModule } from '
|
|
4
|
+
import { AppModule } from '../src/app.module'
|
|
5
5
|
|
|
6
6
|
describe('AppController (e2e)', () => {
|
|
7
7
|
let app: INestApplication
|
|
8
8
|
|
|
9
9
|
beforeEach(async () => {
|
|
10
10
|
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
11
|
-
imports: [AppModule]
|
|
11
|
+
imports: [AppModule],
|
|
12
12
|
}).compile()
|
|
13
13
|
|
|
14
14
|
app = moduleFixture.createNestApplication()
|
|
@@ -16,6 +16,9 @@ describe('AppController (e2e)', () => {
|
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
it('/ (GET)', () => {
|
|
19
|
-
return request(app.getHttpServer())
|
|
19
|
+
return request(app.getHttpServer())
|
|
20
|
+
.get('/')
|
|
21
|
+
.expect(200)
|
|
22
|
+
.expect('Hello World!')
|
|
20
23
|
})
|
|
21
24
|
})
|
|
File without changes
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
"sourceMap": true,
|
|
11
11
|
"outDir": "./dist",
|
|
12
12
|
"baseUrl": "./",
|
|
13
|
-
"incremental": true
|
|
13
|
+
"incremental": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"strictNullChecks": false,
|
|
16
|
+
"noImplicitAny": false,
|
|
17
|
+
"strictBindCallApply": false,
|
|
18
|
+
"forceConsistentCasingInFileNames": false,
|
|
19
|
+
"noFallthroughCasesInSwitch": false
|
|
14
20
|
}
|
|
15
21
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|