Skip to content

Commit eeaf9fa

Browse files
committed
Initial commit
0 parents  commit eeaf9fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+13980
-0
lines changed

.browserslistrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
last 2 versions
2+
not android < 100
3+
not and_qq < 100
4+
not and_uc < 100
5+
not baidu < 100
6+
not bb < 100
7+
not opera < 1000
8+
not op_mini all
9+
not op_mob < 100
10+
not samsung < 100

.circleci/config.yml

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# list with all available versions of node.js images
2+
# https://github.com/CircleCI-Public/circleci-dockerfiles/tree/master/node/images
3+
version: 2.1
4+
5+
orbs:
6+
node: circleci/node@3.0.1
7+
8+
defaults: &build-image
9+
docker:
10+
- image: cypress/base:12
11+
environment:
12+
## this enables colors in the output
13+
TERM: xterm
14+
commands:
15+
install_package_dependencies:
16+
description: "Install library dependencies"
17+
steps:
18+
- checkout
19+
- run:
20+
name: Installing dependencies
21+
command: yarn install --frozen-lockfile
22+
23+
unit_test:
24+
description: "Run unit tests"
25+
parameters:
26+
node_version:
27+
type: integer
28+
default: 10
29+
coverage:
30+
type: boolean
31+
default: false
32+
steps:
33+
- run:
34+
name: Running unit tests on Node.js v<< parameters.node_version >> <<# parameters.coverage >>with coverage<</ parameters.coverage >>
35+
command: yarn test<<# parameters.coverage >>:coverage<</ parameters.coverage >>
36+
37+
e2e_tests:
38+
description: "Run integration tests"
39+
steps:
40+
- run:
41+
name: Installing Cypress binaries
42+
command: npx cypress install
43+
44+
- run:
45+
name: Running E2E integration tests
46+
command: yarn cypress
47+
48+
jobs:
49+
install:
50+
<<: *build-image
51+
steps:
52+
- checkout
53+
- restore_cache:
54+
keys:
55+
- c00k-b00k-{{ .Branch }}-{{ checksum "yarn.lock" }}
56+
# fallback to using the latest cache if no exact match is found
57+
- c00k-b00k-
58+
- run:
59+
name: Installing dependencies
60+
command: yarn install --frozen-lockfile
61+
- save_cache:
62+
key: c00k-b00k-{{ .Branch }}-{{ checksum "yarn.lock" }}
63+
paths:
64+
- node_modules
65+
- ~/.cache
66+
- store_artifacts:
67+
path: yarn-error.log
68+
- persist_to_workspace:
69+
root: .
70+
paths:
71+
- node_modules
72+
73+
lint:
74+
<<: *build-image
75+
steps:
76+
- checkout
77+
- attach_workspace:
78+
at: .
79+
- run:
80+
name: Linting library
81+
command: yarn lint
82+
83+
audit:
84+
<<: *build-image
85+
steps:
86+
- checkout
87+
- attach_workspace:
88+
at: .
89+
- run:
90+
name: Auditing all dependencies
91+
command: yarn audit
92+
93+
test_node_10:
94+
docker:
95+
- image: cypress/base:10.18.0
96+
- image: node:10
97+
steps:
98+
- checkout
99+
- install_package_dependencies
100+
- unit_test:
101+
node_version: 10
102+
- e2e_tests
103+
104+
test_node_12:
105+
docker:
106+
- image: cypress/base:12
107+
- image: node:12
108+
steps:
109+
- checkout
110+
- install_package_dependencies
111+
- unit_test:
112+
node_version: 12
113+
coverage: true
114+
- e2e_tests
115+
116+
test_node_14:
117+
docker:
118+
- image: cypress/base:14.0.0
119+
- image: node:14
120+
steps:
121+
- checkout
122+
- install_package_dependencies
123+
- unit_test:
124+
node_version: 14
125+
- e2e_tests
126+
127+
end_to_end_tests:
128+
<<: *build-image
129+
steps:
130+
- checkout
131+
- attach_workspace:
132+
at: .
133+
- e2e_tests
134+
- store_artifacts:
135+
path: cypress/videos
136+
- store_artifacts:
137+
path: cypress/screenshots
138+
- store_test_results:
139+
path: results
140+
141+
build:
142+
<<: *build-image
143+
steps:
144+
- checkout
145+
- attach_workspace:
146+
at: .
147+
- run:
148+
name: Building the library
149+
command: yarn build
150+
- persist_to_workspace:
151+
root: .
152+
paths:
153+
- lib
154+
- store_artifacts:
155+
path: lib
156+
157+
release:
158+
<<: *build-image
159+
steps:
160+
- checkout
161+
- attach_workspace:
162+
at: .
163+
- run:
164+
name: Running semantic-release workflow
165+
command: npx semantic-release
166+
- store_artifacts:
167+
path: release
168+
169+
workflows:
170+
version: 2
171+
"Test, Build & Maybe Deploy":
172+
jobs:
173+
- install
174+
- lint:
175+
requires:
176+
- install
177+
# - audit:
178+
# requires:
179+
# - install
180+
- test_node_10
181+
- test_node_12
182+
- test_node_14
183+
- end_to_end_tests:
184+
requires:
185+
- install
186+
- build:
187+
requires:
188+
- end_to_end_tests
189+
- test_node_10
190+
- test_node_12
191+
- test_node_14
192+
# - release:
193+
# requires:
194+
# - build
195+
# filters:
196+
# branches:
197+
# only:
198+
# - master
199+
# - next
200+
# - pre/rc
201+
# - beta

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
indent_style = space
11+
indent_size = 2

.eslintignore

Whitespace-only changes.

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./configurations/eslint');

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
.idea/
3+
coverage/
4+
node_modules/
5+
cypress/screenshots/
6+
cypress/videos/
7+
build/
8+
public/
9+
lib/
10+
.stylelintcache
11+
.env
12+
.envrc
13+
report*.json

.huskyrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"hooks": {
3+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
4+
"pre-commit": "lint-staged",
5+
"post-commit": "git update-index --again",
6+
"pre-push": "yarn test",
7+
}
8+
}

.lintstagedrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"./src/**/*.{ts,tsx}": [
3+
"eslint",
4+
"jest --passWithNoTests",
5+
"prettier"
6+
]
7+
}

.npmignore

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.git
2+
.idea
3+
.circleci
4+
.github
5+
configurations/
6+
cypress/
7+
scripts/
8+
src/
9+
.browserslistrc
10+
.editorconfig
11+
.eslintignore
12+
.eslintrc.js
13+
.gitignore
14+
.huskyrc
15+
.lintstagedrc
16+
.nvmrc
17+
.prettierignore
18+
.prettierrc.js
19+
babel.config.js
20+
commitlint.config.js
21+
cypress.json
22+
jest.config.js
23+
release.config.js
24+
rollup.config.js
25+
tsconfig.*
26+
webpack.config.js
27+
yarn-error.log

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12

.prettierignore

Whitespace-only changes.

.prettierrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./configurations/prettier');

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# @template/typescript-library
2+
> Typescript Library kick-off.
3+
4+
[![NPM Version][npm-image]][npm-url]
5+
[![CI Status][circleci-image]][circleci-url]
6+
[![Downloads Stats][npm-downloads]][npm-url]
7+
[![GitHub stars][stars-image]][stars-url]
8+
[![Known Vulnerabilities][vulnerabilities-image]][vulnerabilities-url]
9+
[![GitHub issues][issues-image]][issues-url]
10+
[![Awesome][awesome-image]][awesome-url]
11+
[![install size][install-size-image]][install-size-url]
12+
[![gzip size][gzip-size-image]][gzip-size-url]
13+
14+
<!-- Markdown link & img dfn's -->
15+
[npm-image]: https://img.shields.io/npm/v/{PACKAGE_NAMESPACE}.svg?style=flat-square
16+
[npm-url]: https://npmjs.org/package/{PACKAGE_NAMESPACE}
17+
[npm-downloads]: https://img.shields.io/npm/dm/{PACKAGE_NAMESPACE}.svg?style=flat-square
18+
[circleci-image]: https://circleci.com/gh/{GITHUB_REPO_URL}.svg?style=svg
19+
[circleci-url]: https://circleci.com/gh/{GITHUB_REPO_URL}
20+
[stars-image]: https://img.shields.io/github/stars/{GITHUB_REPO_URL}.svg
21+
[stars-url]: https://github.com/{GITHUB_REPO_URL}/stargazers
22+
[vulnerabilities-image]: https://snyk.io/test/github/{GITHUB_REPO_URL}/badge.svg
23+
[vulnerabilities-url]: https://snyk.io/test/github/{GITHUB_REPO_URL}
24+
[issues-image]: https://img.shields.io/github/issues/{GITHUB_REPO_URL}.svg
25+
[issues-url]: https://github.com/cthe-ookbook/navigator/issues
26+
[awesome-image]: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
27+
[awesome-url]: https://github.com/{GITHUB_REPO_URL}
28+
[install-size-image]: https://packagephobia.now.sh/badge?p={PACKAGE_NAMESPACE}
29+
[install-size-url]: https://packagephobia.now.sh/result?p={PACKAGE_NAMESPACE}
30+
[gzip-size-image]: http://img.badgesize.io/https://unpkg.com/{PACKAGE_NAMESPACE}/lib/navigator.min.js?compression=gzip
31+
[gzip-size-url]: https://unpkg.com/{PACKAGE_NAMESPACE}/lib/navigator.min.js

babel.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./configurations/babel');

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./configurations/commitlint');

configurations/babel/config.js

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
module.exports = function (api) {
2+
api.cache(true);
3+
4+
return {
5+
presets: [
6+
[
7+
'@babel/preset-env',
8+
{
9+
debug: process.env.NODE_ENV === 'development',
10+
},
11+
],
12+
'@babel/preset-typescript',
13+
'@babel/preset-react',
14+
],
15+
plugins: [
16+
[
17+
'module-resolver',
18+
{
19+
root: ['./src'],
20+
},
21+
],
22+
'@babel/plugin-transform-react-jsx',
23+
['@babel/plugin-proposal-class-properties', { loose: false }],
24+
'@babel/plugin-proposal-export-default-from',
25+
],
26+
env: {
27+
test: {
28+
plugins: ['dynamic-import-node'],
29+
},
30+
production: {
31+
plugins: [
32+
[
33+
'transform-remove-console',
34+
{
35+
exclude: ['error', 'warn'],
36+
},
37+
],
38+
[
39+
'transform-react-remove-prop-types',
40+
{
41+
mode: 'remove',
42+
removeImport: true,
43+
additionalLibraries: [/\/prop-types$/u],
44+
},
45+
],
46+
],
47+
},
48+
},
49+
};
50+
};

configurations/babel/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./config');

0 commit comments

Comments
 (0)