create-packer 1.8.0 → 1.8.3

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/index.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const createTemp_1 = require("./clis/createTemp");
5
5
  const commander_1 = require("commander");
6
6
  commander_1.program
7
- .option('-c, --create <dirname>', 'Create project.', dirname => {
7
+ .option('-c, --create [dirname]', 'Create project.', (dirname = '') => {
8
8
  return createTemp_1.createTemp(dirname);
9
9
  })
10
10
  .parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.8.0",
3
+ "version": "1.8.3",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -1,25 +1,25 @@
1
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
- };
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,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npm run lint
@@ -1,4 +1,6 @@
1
1
  {
2
- "singleQuote": true,
3
- "trailingComma": "all"
4
- }
2
+ "singleQuote": true,
3
+ "trailingComma": "all",
4
+ "tabWidth": 4,
5
+ "semi": false
6
+ }
@@ -1,71 +1,74 @@
1
1
  {
2
- "name": "nest-temp",
3
- "version": "0.0.1",
4
- "description": "",
5
- "author": "",
6
- "private": true,
7
- "license": "UNLICENSED",
8
- "scripts": {
9
- "prebuild": "rimraf dist",
10
- "build": "nest build",
11
- "format": "prettier --write \\\"src/**/*.ts\\\" \\\"test/**/*.ts\\\"",
12
- "start": "nest start",
13
- "start:dev": "nest start --watch",
14
- "start:debug": "nest start --debug --watch",
15
- "start:prod": "node dist/main",
16
- "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
17
- "test": "jest",
18
- "test:watch": "jest --watch",
19
- "test:cov": "jest --coverage",
20
- "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
21
- "test:e2e": "jest --config test/jest-e2e.json"
22
- },
23
- "dependencies": {
24
- "@nestjs/common": "9.0.0",
25
- "@nestjs/core": "9.0.0",
26
- "@nestjs/platform-express": "9.0.0",
27
- "reflect-metadata": "0.1.13",
28
- "rimraf": "3.0.2",
29
- "rxjs": "7.2.0"
30
- },
31
- "devDependencies": {
32
- "@nestjs/cli": "9.0.0",
33
- "@nestjs/schematics": "9.0.0",
34
- "@nestjs/testing": "9.0.0",
35
- "@types/express": "4.17.13",
36
- "@types/jest": "28.1.4",
37
- "@types/node": "16.0.0",
38
- "@types/supertest": "2.0.11",
39
- "@typescript-eslint/eslint-plugin": "5.0.0",
40
- "@typescript-eslint/parser": "5.0.0",
41
- "eslint": "8.0.1",
42
- "eslint-config-prettier": "8.3.0",
43
- "eslint-plugin-prettier": "4.0.0",
44
- "jest": "28.1.2",
45
- "prettier": "2.3.2",
46
- "source-map-support": "0.5.20",
47
- "supertest": "6.1.3",
48
- "ts-jest": "28.0.5",
49
- "ts-loader": "9.2.3",
50
- "ts-node": "10.0.0",
51
- "tsconfig-paths": "4.0.0",
52
- "typescript": "4.3.5"
53
- },
54
- "jest": {
55
- "moduleFileExtensions": [
56
- "js",
57
- "json",
58
- "ts"
59
- ],
60
- "rootDir": "src",
61
- "testRegex": ".*\\.spec\\.ts$",
62
- "transform": {
63
- "^.+\\.(t|j)s$": "ts-jest"
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"
64
24
  },
65
- "collectCoverageFrom": [
66
- "**/*.(t|j)s"
67
- ],
68
- "coverageDirectory": "../coverage",
69
- "testEnvironment": "node"
70
- }
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
+ }
71
74
  }
@@ -1,22 +1,22 @@
1
- import { Test, TestingModule } from '@nestjs/testing';
2
- import { AppController } from './app.controller';
3
- import { AppService } from './app.service';
1
+ import { Test, TestingModule } from '@nestjs/testing'
2
+ import { AppController } from './app.controller'
3
+ import { AppService } from './app.service'
4
4
 
5
5
  describe('AppController', () => {
6
- let appController: AppController;
6
+ let appController: AppController
7
7
 
8
- beforeEach(async () => {
9
- const app: TestingModule = await Test.createTestingModule({
10
- controllers: [AppController],
11
- providers: [AppService],
12
- }).compile();
8
+ beforeEach(async () => {
9
+ const app: TestingModule = await Test.createTestingModule({
10
+ controllers: [AppController],
11
+ providers: [AppService],
12
+ }).compile()
13
13
 
14
- appController = app.get<AppController>(AppController);
15
- });
14
+ appController = app.get<AppController>(AppController)
15
+ })
16
16
 
17
- describe('root', () => {
18
- it('should return "Hello World!"', () => {
19
- expect(appController.getHello()).toBe('Hello World!');
20
- });
21
- });
22
- });
17
+ describe('root', () => {
18
+ it('should return "Hello World!"', () => {
19
+ expect(appController.getHello()).toBe('Hello World!')
20
+ })
21
+ })
22
+ })
@@ -1,12 +1,12 @@
1
- import { Controller, Get } from '@nestjs/common';
2
- import { AppService } from './app.service';
1
+ import { Controller, Get } from '@nestjs/common'
2
+ import { AppService } from './app.service'
3
3
 
4
4
  @Controller()
5
5
  export class AppController {
6
- constructor(private readonly appService: AppService) {}
6
+ constructor(private readonly appService: AppService) {}
7
7
 
8
- @Get()
9
- getHello(): string {
10
- return this.appService.getHello();
11
- }
8
+ @Get()
9
+ getHello(): string {
10
+ return this.appService.getHello()
11
+ }
12
12
  }
@@ -1,10 +1,10 @@
1
- import { Module } from '@nestjs/common';
2
- import { AppController } from './app.controller';
3
- import { AppService } from './app.service';
1
+ import { Module } from '@nestjs/common'
2
+ import { AppController } from './app.controller'
3
+ import { AppService } from './app.service'
4
4
 
5
5
  @Module({
6
- imports: [],
7
- controllers: [AppController],
8
- providers: [AppService],
6
+ imports: [],
7
+ controllers: [AppController],
8
+ providers: [AppService],
9
9
  })
10
10
  export class AppModule {}
@@ -1,8 +1,8 @@
1
- import { Injectable } from '@nestjs/common';
1
+ import { Injectable } from '@nestjs/common'
2
2
 
3
3
  @Injectable()
4
4
  export class AppService {
5
- getHello(): string {
6
- return 'Hello World!';
7
- }
5
+ getHello(): string {
6
+ return 'Hello World!'
7
+ }
8
8
  }
@@ -1,10 +1,10 @@
1
- import { NestFactory } from '@nestjs/core';
2
- import { AppModule } from './app.module';
3
- import { TransformInterceptor } from 'src/utils/transform.interceptor';
1
+ import { NestFactory } from '@nestjs/core'
2
+ import { AppModule } from './app.module'
3
+ import { TransformInterceptor } from 'src/utils/transform.interceptor'
4
4
 
5
5
  async function bootstrap() {
6
- const app = await NestFactory.create(AppModule);
7
- app.useGlobalInterceptors(new TransformInterceptor());
8
- await app.listen(3000);
6
+ const app = await NestFactory.create(AppModule)
7
+ app.useGlobalInterceptors(new TransformInterceptor())
8
+ await app.listen(3000)
9
9
  }
10
- bootstrap();
10
+ bootstrap()
@@ -1,4 +1,9 @@
1
- import { Injectable, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common'
1
+ import {
2
+ Injectable,
3
+ NestInterceptor,
4
+ ExecutionContext,
5
+ CallHandler,
6
+ } from '@nestjs/common'
2
7
  import { Observable } from 'rxjs'
3
8
  import { map } from 'rxjs/operators'
4
9
 
@@ -7,8 +12,15 @@ export interface Response<T> {
7
12
  }
8
13
 
9
14
  @Injectable()
10
- export class TransformInterceptor<T> implements NestInterceptor<T, Response<T>> {
11
- intercept(context: ExecutionContext, next: CallHandler): Observable<Response<T>> {
12
- return next.handle().pipe(map(data => ({ code: 200, message: '', data })))
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 })))
13
25
  }
14
26
  }
@@ -1,24 +1,24 @@
1
- import { Test, TestingModule } from '@nestjs/testing';
2
- import { INestApplication } from '@nestjs/common';
3
- import * as request from 'supertest';
4
- import { AppModule } from '../src/app.module';
1
+ import { Test, TestingModule } from '@nestjs/testing'
2
+ import { INestApplication } from '@nestjs/common'
3
+ import * as request from 'supertest'
4
+ import { AppModule } from '../src/app.module'
5
5
 
6
6
  describe('AppController (e2e)', () => {
7
- let app: INestApplication;
7
+ let app: INestApplication
8
8
 
9
- beforeEach(async () => {
10
- const moduleFixture: TestingModule = await Test.createTestingModule({
11
- imports: [AppModule],
12
- }).compile();
9
+ beforeEach(async () => {
10
+ const moduleFixture: TestingModule = await Test.createTestingModule({
11
+ imports: [AppModule],
12
+ }).compile()
13
13
 
14
- app = moduleFixture.createNestApplication();
15
- await app.init();
16
- });
14
+ app = moduleFixture.createNestApplication()
15
+ await app.init()
16
+ })
17
17
 
18
- it('/ (GET)', () => {
19
- return request(app.getHttpServer())
20
- .get('/')
21
- .expect(200)
22
- .expect('Hello World!');
23
- });
24
- });
18
+ it('/ (GET)', () => {
19
+ return request(app.getHttpServer())
20
+ .get('/')
21
+ .expect(200)
22
+ .expect('Hello World!')
23
+ })
24
+ })
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npm run lint
@@ -21,22 +21,15 @@
21
21
  "web-vitals": "2.1.4"
22
22
  },
23
23
  "scripts": {
24
+ "prepare": "husky install",
24
25
  "start": "craco start",
25
26
  "build": "craco build",
26
27
  "analyze": "craco build --analyze",
27
28
  "test": "craco test",
28
29
  "eject": "react-scripts eject",
29
- "format": "prettier --write \"src/**/*.{ts,js,tsx,jsx,css,scss,less}\" \"./package.json\""
30
- },
31
- "husky": {
32
- "hooks": {
33
- "pre-commit": "npm run format && lint-staged && git add ."
34
- }
35
- },
36
- "lint-staged": {
37
- "./src/**/*.{css,scss,less}": [
38
- "stylelint"
39
- ]
30
+ "format": "prettier --write \"src/**/*.{ts,js,tsx,jsx,css,scss,less}\" \"./package.json\"",
31
+ "lint": "eslint ./src/**/*.{tsx,ts,js,jsx,vue} && stylelint ./src/**/*.{css,scss,less}",
32
+ "lint:fix": "eslint ./src/**/*.{tsx,ts,js,jsx,vue} --fix && stylelint ./src/**/*.{css,scss,less} --fix"
40
33
  },
41
34
  "eslintConfig": {
42
35
  "extends": [
@@ -60,7 +53,6 @@
60
53
  "@testing-library/dom": "8.14.0",
61
54
  "@types/recoil": "0.0.9",
62
55
  "husky": "8.0.1",
63
- "lint-staged": "13.0.3",
64
56
  "prettier": "2.7.1",
65
57
  "stylelint": "14.9.1",
66
58
  "stylelint-config-standard": "26.0.0",