Skip to content

Commit e700581

Browse files
committed
chore: Update dependencies, update template
ci: Migrate to Github Actions chore: Update LICENSE to use start date doc: Update doc
1 parent 82ac03d commit e700581

File tree

8 files changed

+2567
-1030
lines changed

8 files changed

+2567
-1030
lines changed

.github/workflows/ci.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags-ignore:
8+
- '*'
9+
pull_request:
10+
branches:
11+
- '*'
12+
tags-ignore:
13+
- '*'
14+
15+
env:
16+
CI_SKIP: false
17+
18+
jobs:
19+
test:
20+
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, 'doc:')"
21+
name: ${{ matrix.os }} ${{ matrix.target }}
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
matrix:
25+
os: [macos-latest, ubuntu-18.04, windows-2019]
26+
target: [13.x]
27+
timeout-minutes: 120
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
33+
- name: Git log
34+
shell: bash
35+
run: |
36+
if [ -n "$(git log --format=%B -n 1 | grep -iE '^[0-9]+[.]{1,}[0-9]+[.]{1,}[0-9]+')" ]; then
37+
echo '::set-env name=CI_SKIP::true'
38+
fi
39+
40+
- name: Setup node@${{ matrix.target }}
41+
if: "env.CI_SKIP == 'false'"
42+
uses: actions/setup-node@v1
43+
with:
44+
node-version: ${{ matrix.target }}
45+
46+
- name: List versions
47+
if: "env.CI_SKIP == 'false'"
48+
continue-on-error: true
49+
shell: bash
50+
run: |
51+
node -v && npm version && which npm && pwd && npx envinfo
52+
53+
- name: Install dependencies
54+
if: "env.CI_SKIP == 'false'"
55+
run: |
56+
npm ci --quiet
57+
58+
- name: Lint
59+
if: "env.CI_SKIP == 'false'"
60+
run: |
61+
npm run lint
62+
63+
- name: Build
64+
if: "env.CI_SKIP == 'false'"
65+
run: |
66+
npm run build
67+
68+
- name: Check build
69+
if: "env.CI_SKIP == 'false'"
70+
shell: bash
71+
run: |
72+
pwd && ls -la
73+
74+
- name: Run Test
75+
if: "env.CI_SKIP == 'false'"
76+
run: |
77+
npm run jest
78+
79+
- name: Upload coverage to codecov
80+
uses: codecov/codecov-action@v1
81+
if: success()
82+
with:
83+
token: ${{ secrets.CODECOV_TOKEN }}
84+
file: ./coverage/lcov.info
85+
flags: unit_tests

.github/workflows/publish.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- '*'
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
build:
12+
name: ${{ matrix.os }} ${{ matrix.target }}
13+
runs-on: ${{ matrix.os }}
14+
timeout-minutes: 120
15+
strategy:
16+
matrix:
17+
os: [ubuntu-18.04]
18+
target: [13.x]
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Setup node@${{ matrix.target }}
25+
uses: actions/setup-node@v1
26+
with:
27+
node-version: ${{ matrix.target }}
28+
registry-url: 'https://registry.npmjs.org'
29+
30+
- name: List versions
31+
continue-on-error: true
32+
shell: bash
33+
run: |
34+
node -v && npm version && which npm && pwd && npx envinfo
35+
36+
- name: Install dependencies
37+
run: |
38+
npm ci --quiet
39+
40+
- name: Publish to npm (RC)
41+
if: contains(github.ref, '-rc') == true
42+
run: |
43+
npm config list
44+
npm publish . --tag=next
45+
env:
46+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
48+
- name: Publish to npm
49+
if: contains(github.ref, '-rc') == false
50+
run: |
51+
npm config list
52+
npm publish .
53+
env:
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55+
56+
# See https://github.com/actions/setup-node/issues/73.
57+
# - name: Setup node@${{ matrix.target }}
58+
# uses: actions/setup-node@v1
59+
# with:
60+
# node-version: ${{ matrix.target }}
61+
# registry-url: 'https://npm.pkg.github.com/'
62+
# scope: '@motss'
63+
64+
# - name: Publish to GPR (RC)
65+
# if: success() && contains(github.ref, '-rc') == true
66+
# run: |
67+
# npm config list
68+
# npm publish . --tag=next
69+
# env:
70+
# NODE_AUTH_TOKEN: ${{github.token}}
71+
72+
# - name: Publish to GPR
73+
# if: success() && contains(github.ref, '-rc') == false
74+
# run: |
75+
# npm config list
76+
# npm publish .
77+
# env:
78+
# NODE_AUTH_TOKEN: ${{github.token}}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2019 Rong Sen Ng <[email protected]>
3+
Copyright (c) 2018 Rong Sen Ng <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
<hr />
88

9+
<a href="https://www.buymeacoffee.com/RLmMhgXFb" target="_blank" rel="noopener noreferrer"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 20px !important;width: auto !important;" ></a>
10+
[![tippin.me][tippin-me-badge]][tippin-me-url]
911
[![Follow me][follow-me-badge]][follow-me-url]
1012

1113
[![Version][version-badge]][version-url]
@@ -33,6 +35,7 @@
3335
- [Installation](#installation)
3436
- [NPM](#npm)
3537
- [NPX](#npx)
38+
- [Testing](#testing)
3639
- [Getting To Know Yeoman](#getting-to-know-yeoman)
3740
- [Contributing](#contributing)
3841
- [Code of Conduct](#code-of-conduct)
@@ -43,10 +46,10 @@
4346

4447
Please make sure that you have the following dependencies installed and setup correctly:-
4548

46-
- [Node.js][nodejs-url] >= `8.16.0`
47-
- [NPM][npm-url] >= `6.4.1`
48-
- [TypeScript][typescript-url] >= `3.0.1` ___(No guarantee it will work below the version specified here)___
49-
- [TSLint][tslint-url] >= `5.11.0` ___(No guarantee it will work below the version specified here)___
49+
- [Node.js][nodejs-url] >= `10.18.1`
50+
- [NPM][npm-url] >= `6.13.4`
51+
- [TypeScript][typescript-url] >= `3.8.3`
52+
- [TSLint][tslint-url] >= `6.1.0`
5053
- [TSLint extension for your favorite text editor][tslint-extension-url]
5154

5255
## Installation
@@ -84,6 +87,13 @@ $ mkdir my-app && cd my-app
8487
$ npx -p yo -p generator-node-tsnext -- yo node-tsnext
8588
```
8689

90+
## Testing
91+
92+
Bring your own testing library/ framework based on your use case. But, here are a few to recommend if you haven't already had one:
93+
94+
1. [Jest]
95+
2. [AVA]
96+
8797
## Getting To Know Yeoman
8898

8999
- Yeoman has a heart of gold.
@@ -110,8 +120,11 @@ Please note that this project is released with a [Contributor Code of Conduct][c
110120
[tslint-url]: https://palantir.github.io/tslint
111121
[typescript-url]: https://www.typescriptlang.org
112122
[yeoman-url]: https://yeoman.io
123+
[Jest]: https://github.com/facebook/jest
124+
[AVA]: https://github.com/avajs/ava
113125

114126
<!-- Badges -->
127+
[tippin-me-badge]: https://badgen.net/badge/%E2%9A%A1%EF%B8%8Ftippin.me/@igarshmyb/F0918E
115128
[follow-me-badge]: https://flat.badgen.net/twitter/follow/igarshmyb?icon=twitter
116129

117130
[version-badge]: https://flat.badgen.net/npm/v/generator-node-tsnext?icon=npm
@@ -132,7 +145,8 @@ Please note that this project is released with a [Contributor Code of Conduct][c
132145
[coc-badge]: https://flat.badgen.net/badge/code%20of/conduct/pink
133146

134147
<!-- Links -->
135-
[follow-me-url]: https://twitter.com/igarshmyb?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=motss/generator-node-tsnext
148+
[tippin-me-url]: https://tippin.me/@igarshmyb
149+
[follow-me-url]: https://twitter.com/igarshmyb?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=motss/generator-lit-element-next
136150

137151
[version-url]: https://www.npmjs.com/package/generator-node-tsnext
138152
[node-version-url]: https://nodejs.org/en/download

app/templates/_README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
[![Packagephobia][packagephobia-badge]][packagephobia-url]
1818
[![Bundlephobia][bundlephobia-badge]][bundlephobia-url]
1919

20-
[![CircleCI][circleci-badge]][circleci-url]
2120
[![Dependency Status][daviddm-badge]][daviddm-url]
2221
[![codecov][codecov-badge]][codecov-url]
2322
[![Coverage Status][coveralls-badge]][coveralls-url]
@@ -114,7 +113,6 @@ This methods works the same as `greeting(name)` except that this is the synchron
114113
[packagephobia-badge]: https://flat.badgen.net/packagephobia/install/<%= packageName %>
115114
[bundlephobia-badge]: https://flat.badgen.net/bundlephobia/minzip/<%= packageName %>
116115

117-
[circleci-badge]: https://flat.badgen.net/circleci/github/<%= gitName %>/<%= packageName %>?icon=circleci
118116
[daviddm-badge]: https://flat.badgen.net/david/dep/<%= gitName %>/<%= packageName %>
119117
[codecov-badge]: https://flat.badgen.net/codecov/c/github/<%= gitName %>/<%= packageName %>?label=codecov&icon=codecov
120118
[coveralls-badge]: https://flat.badgen.net/coveralls/c/github/<%= gitName %>/<%= packageName %>?label=coveralls
@@ -134,7 +132,6 @@ This methods works the same as `greeting(name)` except that this is the synchron
134132
[packagephobia-url]: https://packagephobia.now.sh/result?p=<%= packageName %>
135133
[bundlephobia-url]: https://bundlephobia.com/result?p=<%= packageName %>
136134

137-
[circleci-url]: https://circleci.com/gh/<%= gitName %>/<%= packageName %>/tree/master
138135
[daviddm-url]: https://david-dm.org/<%= gitName %>/<%= packageName %>
139136
[codecov-url]: https://codecov.io/gh/<%= gitName %>/<%= packageName %>
140137
[coveralls-url]: https://coveralls.io/github/<%= gitName %>/<%= packageName %>?branch=master

app/templates/_package.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,33 @@
2929
"module": "dist/index.mjs",
3030
"typings": "dist/index.d.ts",
3131
"scripts": {
32-
"build": "npm run ts -- -p tsconfig.prod.json",
33-
"clean": "shx rm -rf dist/",
32+
"build": "tsc -p tsconfig.prod.json",
33+
"clean": "shx rm -rf dist/ .*cache *.log",
3434
"lint": "npm run lint:debug -- --config tslint.prod.json",
3535
"lint:debug": "tslint --project tsconfig.json --format stylish",
3636
"prepublishOnly": "npm run lint && npm run build",
3737
"test": "shx echo 'Write your own tests'",
38-
"ts": "npm run clean && tsc",
39-
"watch": "npm run ts -- --watch"
38+
"ts": "tsc",
39+
"watch": "tsc --watch"
40+
},
41+
"husky": {
42+
"hooks": {
43+
"pre-commit": "npm run lint && tsc --noEmit"
44+
}
4045
},
4146
"dependencies": {},
4247
"devDependencies": {
43-
"@reallyland/tsconfig": "^1.0.0",
48+
"@reallyland/tsconfig": "^2.0.0",
4449
"@reallyland/tslint-config": "^1.1.1",
45-
"@types/node": "^12.7.4",
50+
"@types/node": "^13.9.8",
51+
"husky": "^4.2.3",
4652
"shx": "^0.3.2",
47-
"tslint": "^5.19.0",
48-
"typescript": "^3.6.2"
53+
"tslint": "^6.1.0",
54+
"typescript": "^3.8.3"
4955
},
5056
"engines": {
51-
"node": ">= 8.16.0",
52-
"npm": ">= 6.4.1"
57+
"node": ">= 10.18.1",
58+
"npm": ">= 6.13.4"
5359
},
5460
"publishConfig": {
5561
"access": "public"

0 commit comments

Comments
 (0)