Skip to content

Commit

Permalink
fix: fix .gitignore not copied
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuhao-C committed Jul 1, 2021
1 parent c637462 commit 4b0d635
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 13 deletions.
10 changes: 8 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module",
"project": "./tsconfig.json"
"project": "./tsconfig.eslint.json"
},
"extends": [
"plugin:@typescript-eslint/recommended",
Expand All @@ -14,5 +14,11 @@
"node": true
},
"plugins": ["prettier", "@typescript-eslint"],
"ignorePatterns": ["template", "lib"]
"ignorePatterns": ["template", "lib"],
"overrides": [
{
"files": ["*.js"],
"rules": { "@typescript-eslint/no-var-requires": "off" }
}
]
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
"description": "Production-ready all-in-one react typescript boilerplate, with babel, webpack, prettier, eslint, stylelint, commitlint, lint-staged, and husky.",
"main": "./lib/index.js",
"bin": {
"create-hotdog-app": "./bin/create-hotdog-app.js"
"create-hotdog-app": "./lib/cli.js"
},
"files": [
"bin",
"lib"
],
"scripts": {
"start": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts project-name",
"build": "rm -rf ./lib && tsc -p . && yarn post-build",
"post-build": "cpy './template/**/*' './lib' --parents --dot",
"post-build": "node ./scripts/post-build.js",
"release": "semantic-release",
"commit": "cz"
},
Expand Down
10 changes: 10 additions & 0 deletions scripts/post-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env node

'use strict';

const fs = require('fs-extra');
const path = require('path');

const src = path.resolve(__dirname, '../template');
const dest = path.resolve(__dirname, '../lib/template');
fs.copySync(src, dest);
6 changes: 2 additions & 4 deletions bin/create-hotdog-app.js → src/cli.ts
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env node

'use strict';

// to use V8's code cache to speed up instantiation time
require('v8-compile-cache');
import 'v8-compile-cache';

require('../lib/index');
import './index';
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env node

import path from 'path';
import { cyan, green, red } from 'chalk';
import fs from 'fs-extra';
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["**/*.js", "**/*.ts"]
}
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"esModuleInterop": true,
"resolveJsonModule": true,
"rootDir": "src",
"outDir": "lib"
"outDir": "lib",
"allowJs": true
},
"include": ["./src/*.ts", "./bin/**/*"]
"include": ["./src/*.ts"]
}

0 comments on commit 4b0d635

Please sign in to comment.