Skip to content

Commit 4074fcb

Browse files
committed
🔥 Remove Rollup for bundling
Other changes: * Remove Rollup and use your own bundler * Remove unnecessary NPM scripts * Add Contributing section with CoC in doc * Use `shx` for cross platform commands support, e.g. `rm -rf` * Use `@reallyland/tsconfig` and `@reallyland/tslint-config`
1 parent 40860fd commit 4074fcb

File tree

11 files changed

+41
-87
lines changed

11 files changed

+41
-87
lines changed

‎.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ version: 2.1
66

77
aliases:
88
- &restore-cache-deps
9-
key: dependency-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ checksum "package.json" }}-2
9+
key: dependency-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ checksum "package.json" }}-2.1
1010
- &save-cache-deps
11-
key: dependency-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ checksum "package.json" }}-2
11+
key: dependency-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ checksum "package.json" }}-2.1
1212
paths:
1313
- node_modules
1414

1515
defaults: &defaults
16-
working_directory: ~/async-poll
16+
working_directory: ~/generator-node-tsnext
1717
steps:
1818
- checkout
1919
- restore_cache: *restore-cache-deps

‎README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
- [NPM](#npm)
3535
- [NPX](#npx)
3636
- [Getting To Know Yeoman](#getting-to-know-yeoman)
37+
- [Contributing](#contributing)
38+
- [Code of Conduct](#code-of-conduct)
3739
- [License](#license)
3840

3941

@@ -89,6 +91,12 @@ $ npx -p yo -p generator-node-tsnext -- yo node-tsnext
8991
- Yeoman can be too opinionated at times but is easily convinced not to be.
9092
- Feel free to [learn more about Yeoman][yeoman-url].
9193

94+
## Contributing
95+
96+
### Code of Conduct
97+
98+
Please note that this project is released with a [Contributor Code of Conduct][coc-url]. By participating in this project you agree to abide by its terms.
99+
92100
## License
93101

94102
[MIT License](https://motss.mit-license.org/) © Rong Sen Ng
@@ -128,7 +136,7 @@ $ npx -p yo -p generator-node-tsnext -- yo node-tsnext
128136

129137
[version-url]: https://www.npmjs.com/package/generator-node-tsnext
130138
[node-version-url]: https://nodejs.org/en/download
131-
[mit-license-url]: https://github.com/motss/generator-node-tsnext/blob/master/LICENSE
139+
[mit-license-url]: /LICENSE
132140

133141
[downloads-url]: https://www.npmtrends.com/generator-node-tsnext
134142
[packagephobia-url]: https://packagephobia.now.sh/result?p=generator-node-tsnext
@@ -140,4 +148,4 @@ $ npx -p yo -p generator-node-tsnext -- yo node-tsnext
140148

141149
[codebeat-url]: https://codebeat.co/projects/github-com-motss-generator-node-tsnext-master
142150
[codacy-url]: https://www.codacy.com/app/motss/generator-node-tsnext?utm_source=github.com&utm_medium=referral&utm_content=motss/generator-node-tsnext&utm_campaign=Badge_Grade
143-
[coc-url]: https://github.com/motss/generator-node-tsnext/blob/master/code-of-conduct.md
151+
[coc-url]: /CODE-OF-CONDUCT.md

‎__tests__/mock-github-info.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ describe(`mock Github info`, () => {
5353
'README.md',
5454

5555
'package.json',
56-
'rollup.config.js',
5756
'tsconfig.json',
5857
'tsconfig.prod.json',
5958
'tslint.json',

‎__tests__/no-github-info-and-desc.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ describe(`Github info and 'docDescription' are missing`, () => {
3333
'README.md',
3434

3535
'package.json',
36-
'rollup.config.js',
3736
'tsconfig.json',
3837
'tsconfig.prod.json',
3938
'tslint.json',

‎__tests__/normal.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ describe('normal', () => {
3030
'README.md',
3131

3232
'package.json',
33-
'rollup.config.js',
3433
'tsconfig.json',
3534
'tsconfig.prod.json',
3635
'tslint.json',

‎app/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ module.exports = class extends Generator {
8989

9090
writing() {
9191
const NON_TPLS = [
92-
'rollup.config.js',
9392
'src/index.ts',
9493
'tsconfig.json',
9594
'tsconfig.prod.json',

‎app/templates/_package.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,21 @@
2929
"module": "dist/index.mjs",
3030
"typings": "dist/index.d.ts",
3131
"scripts": {
32-
"build": "npm run clean && npm run rollup",
33-
"clean": "rm -rf dist/",
34-
"lint": "tslint --project tsconfig.json --config tslint.prod.json --format stylish",
35-
"lint:debug": "tslint --project tsconfig.json --config tslint.json --format stylish",
32+
"build": "npm run clean && npm run npm run ts -- -p tsconfig.prod.json",
33+
"clean": "shx rm -rf dist/",
34+
"lint": "npm run lint -- --config tslint.prod.json",
35+
"lint:debug": "tslint --project tsconfig.json --format stylish",
3636
"prepublishOnly": "npm run lint && npm run build",
37-
"rollup": "rollup -c ./rollup.config.js",
37+
"test": "shx echo 'Write your own tests'",
3838
"ts": "npm run clean && tsc",
3939
"watch": "npm run ts -- --watch"
4040
},
4141
"dependencies": {},
4242
"devDependencies": {
4343
"@reallyland/tslint-config": "^1.0.0",
44-
"@types/node": "^12.0.0",
45-
"rollup": "^1.10.1",
46-
"rollup-plugin-filesize": "^6.0.1",
47-
"rollup-plugin-terser": "^4.0.4",
48-
"rollup-plugin-tslint": "^0.2.2",
49-
"rollup-plugin-typescript2": "^0.21.0",
44+
"@reallyland/tsconfig": "^1.0.0",
45+
"@types/node": "^12.0.2",
46+
"shx": "^0.3.2",
5047
"tslint": "^5.16.0",
5148
"typescript": "^3.4.5"
5249
},

‎app/templates/rollup.config.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

‎app/templates/tsconfig.json

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,8 @@
11
{
2+
"extends": "@reallyland/tsconfig",
23
"compilerOptions": {
3-
"allowSyntheticDefaultImports": true,
4-
"esModuleInterop": true,
5-
"experimentalDecorators": true,
6-
"forceConsistentCasingInFileNames": true,
7-
"inlineSources": true,
8-
"listEmittedFiles": true,
9-
"newLine": "LF",
10-
"noFallthroughCasesInSwitch": true,
11-
"noImplicitReturns": true,
12-
"noUnusedLocals": true,
13-
"noUnusedParameters": true,
14-
"removeComments": true,
15-
"resolveJsonModule": true,
16-
"sourceMap": true,
17-
"strict": true,
18-
19-
"lib": [
20-
"esnext",
21-
"esnext.array",
22-
"esnext.asynciterable",
23-
"esnext.intl",
24-
"esnext.symbol"
25-
],
26-
"moduleResolution": "node",
27-
"module": "esnext",
28-
"target": "esnext",
294
"rootDir": "src",
305
"outDir": "dist",
31-
"declaration": true,
32-
"declarationMap": true,
336
"declarationDir": "dist"
347
},
358
"include": ["src/**/*.ts"],

‎package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
"main": "app/index.js",
2525
"scripts": {
26-
"clean": "rm -rf ./*.*js ./*.d.ts dist/",
26+
"clean": "shx rm -rf dist/ coverage/",
2727
"test": "jest --config ./.jestrc.json"
2828
},
2929
"dependencies": {
@@ -34,6 +34,7 @@
3434
},
3535
"devDependencies": {
3636
"jest": "^24.8.0",
37+
"shx": "^0.3.2",
3738
"yeoman-assert": "^3.1.0",
3839
"yeoman-test": "^2.0.0"
3940
},

0 commit comments

Comments
 (0)