Skip to content

Commit ec281a5

Browse files
committed
feat: initialize
0 parents  commit ec281a5

38 files changed

+10092
-0
lines changed

.dependency-cruiser.js

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
module.exports = {
2+
extends: "dependency-cruiser/configs/recommended-strict",
3+
forbidden: [
4+
{
5+
name: "not-to-test",
6+
comment:
7+
"This module depends on code within a folder that should only contain tests. As tests don't " +
8+
"implement functionality this is odd. Either you're writing a test outside the test folder " +
9+
"or there's something in the test folder that isn't a test.",
10+
severity: "error",
11+
from: {
12+
pathNot: "^(test|spec)",
13+
},
14+
to: {
15+
path: "^(test|spec)",
16+
},
17+
},
18+
{
19+
name: "not-to-spec",
20+
comment:
21+
"This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. " +
22+
"If there's something in a spec that's of use to other modules, it doesn't have that single " +
23+
"responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.",
24+
severity: "error",
25+
from: {},
26+
to: {
27+
path: "\\.spec\\.(js|ts|ls|coffee|litcoffee|coffee\\.md)$",
28+
},
29+
},
30+
{
31+
name: "not-to-dev-dep",
32+
severity: "error",
33+
comment:
34+
"This module depends on an npm package from the 'devDependencies' section of your " +
35+
"package.json. It looks like something that ships to production, though. To prevent problems " +
36+
"with npm packages that aren't there on production declare it (only!) in the 'dependencies'" +
37+
"section of your package.json. If this module is development only - add it to the " +
38+
"from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration",
39+
from: {
40+
path: "^(src|app|lib)",
41+
pathNot: "\\.spec\\.(js|ts|ls|coffee|litcoffee|coffee\\.md)$",
42+
},
43+
to: {
44+
pathNot: "type-fest",
45+
dependencyTypes: ["npm-dev"],
46+
},
47+
},
48+
{
49+
name: "optional-deps-used",
50+
severity: "info",
51+
comment:
52+
"This module depends on an npm package that is declared as an optional dependency " +
53+
"in your package.json. As this makes sense in limited situations only, it's flagged here. " +
54+
"If you're using an optional dependency here by design - add an exception to your" +
55+
"depdency-cruiser configuration.",
56+
from: {},
57+
to: {
58+
dependencyTypes: ["npm-optional"],
59+
},
60+
},
61+
{
62+
name: "peer-deps-used",
63+
comment:
64+
"This module depends on an npm package that is declared as a peer dependency " +
65+
"in your package.json. This makes sense if your package is e.g. a plugin, but in " +
66+
"other cases - maybe not so much. If the use of a peer dependency is intentional " +
67+
"add an exception to your dependency-cruiser configuration.",
68+
severity: "warn",
69+
from: {},
70+
to: {
71+
dependencyTypes: ["npm-peer"],
72+
},
73+
},
74+
],
75+
options: {
76+
/* conditions specifying which files not to follow further when encountered:
77+
- path: a regular expression to match
78+
- dependencyTypes: see https://github.com/sverweij/dependency-cruiser/blob/develop/doc/rules-reference.md#dependencytypes
79+
for a complete list
80+
*/
81+
doNotFollow: {
82+
// path: 'node_modules',
83+
dependencyTypes: ["npm", "npm-dev", "npm-optional", "npm-peer", "npm-bundled", "npm-no-pkg"],
84+
},
85+
86+
/* conditions specifying which dependencies to exclude
87+
- path: a regular expression to match
88+
- dynamic: a boolean indicating whether to ignore dynamic (true) or static (false) dependencies.
89+
leave out if you want to exclude neither (recommended!)
90+
*/
91+
// , exclude : {
92+
// path: ''
93+
// , dynamic: true
94+
// }
95+
96+
/* pattern specifying which files to include (regular expression)
97+
dependency-cruiser will skip everything not matching this pattern
98+
*/
99+
// , includeOnly : ''
100+
101+
/* list of module systems to cruise */
102+
// , moduleSystems: ['amd', 'cjs', 'es6', 'tsd']
103+
104+
/* prefix for links in html and svg output (e.g. https://github.com/you/yourrepo/blob/develop/) */
105+
// , prefix: ''
106+
107+
/* if true detect dependencies that only exist before typescript-to-javascript compilation */
108+
tsPreCompilationDeps: true,
109+
110+
/* if true combines the package.jsons found from the module up to the base
111+
folder the cruise is initiated from. Useful for how (some) mono-repos
112+
manage dependencies & dependency definitions.
113+
*/
114+
// , combinedDependencies: false
115+
116+
/* if true leave symlinks untouched, otherwise use the realpath */
117+
// , preserveSymlinks: false
118+
119+
/* Typescript project file ('tsconfig.json') to use for
120+
(1) compilation and
121+
(2) resolution (e.g. with the paths property)
122+
123+
The (optional) fileName attribute specifies which file to take (relative to
124+
dependency-cruiser's current working directory). When not provided
125+
defaults to './tsconfig.json'.
126+
*/
127+
tsConfig: {
128+
fileName: "./tsconfig.build.json",
129+
},
130+
131+
/* Webpack configuration to use to get resolve options from.
132+
133+
The (optional) fileName attribute specifies which file to take (relative to dependency-cruiser's
134+
current working directory. When not provided defaults to './webpack.conf.js'.
135+
136+
The (optional) `env` and `args` attributes contain the parameters to be passed if
137+
your webpack config is a function and takes them (see webpack documentation
138+
for details)
139+
*/
140+
// , webpackConfig: {
141+
// fileName: './webpack.conf.js'
142+
// , env: {}
143+
// , args: {}
144+
// }
145+
146+
/* How to resolve external modules - use "yarn-pnp" if you're using yarn's Plug'n'Play.
147+
otherwise leave it out (or set to the default, which is 'node_modules')
148+
*/
149+
// , externalModuleResolutionStrategy: 'node_modules'
150+
},
151+
};
152+
// generated: [email protected] on 2019-11-21T01:41:12.817Z

.eslintrc.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
parser: "@typescript-eslint/parser",
3+
parserOptions: {
4+
project: "tsconfig.json",
5+
sourceType: "module",
6+
},
7+
extends: ["plugin:@typescript-eslint/recommended", "plugin:import/typescript"],
8+
rules: {
9+
"@typescript-eslint/no-floating-promises": 2,
10+
"@typescript-eslint/triple-slash-reference": [2, { path: "never", types: "never", lib: "never" }],
11+
"@typescript-eslint/no-unnecessary-qualifier": 2,
12+
"@typescript-eslint/no-unnecessary-condition": [2, { ignoreRhs: true }],
13+
"@typescript-eslint/unified-signatures": 2,
14+
"no-undef": 0,
15+
"no-redeclare": 0,
16+
"import/export": 0,
17+
"import/named": 0,
18+
"import/no-unresolved": 0,
19+
"import/namespace": 0,
20+
"@typescript-eslint/no-unused-vars": 0,
21+
"@typescript-eslint/no-var-requires": 0,
22+
"@typescript-eslint/explicit-member-accessibility": 0,
23+
"@typescript-eslint/no-namespace": 0,
24+
"@typescript-eslint/explicit-function-return-type": 0,
25+
"@typescript-eslint/no-explicit-any": 0,
26+
"@typescript-eslint/no-empty-interface": 0,
27+
28+
"@typescript-eslint/camelcase": 0,
29+
"react/prop-types": 0,
30+
"@typescript-eslint/no-unnecessary-qualifier": 0,
31+
},
32+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Pull Request Workflow
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
node-version: [12.x]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
ref: ${{ github.event.pull_request.head.sha }}
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
22+
- name: yarn install, build, and test
23+
run: |
24+
yarn install --frozen-lockfile
25+
yarn build
26+
yarn test:ci
27+
env:
28+
CI: true
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Push master Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [12.x]
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
ref: master
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- name: yarn install, build, and test
26+
run: |
27+
yarn install --frozen-lockfile
28+
yarn build
29+
yarn test:ci
30+
env:
31+
CI: true
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release Workflow
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
ref: master
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: 12
17+
- run: |
18+
yarn install --frozen-lockfile
19+
yarn build
20+
yarn test:ci
21+
22+
release-npm-packages:
23+
needs: build
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
with:
28+
ref: master
29+
- uses: actions/setup-node@v1
30+
with:
31+
node-version: 12
32+
registry-url: https://registry.npmjs.org/
33+
- run: |
34+
yarn install --frozen-lockfile
35+
yarn build
36+
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
37+
38+
yarn lerna publish from-package --yes
39+
env:
40+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
41+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
lib
3+
coverage
4+
node_modules
5+
package-lock.json
6+
.env*
7+
*.log
8+
private_npm_cache
9+
data
10+
.private_npm_cache
11+
*tsbuildinfo
12+
.cache/

.huskyrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "lint-staged",
4+
"commit-msg": "commitlint --config commitlint.config.js -e $GIT_PARAMS"
5+
}
6+
}

.lintstagedrc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"*.{js,jsx,json,yml,yaml,html,md}": ["prettier --write", "git add"],
3+
"*.{ts,tsx}": ["yarn run format", "yarn run lint", "git add"],
4+
"package.json": ["sort-package-json", "git add"]
5+
}

.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
always-auth=true
2+
engine-strict=true
3+
package-lock=false

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package.json

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"tabWidth": 2,
3+
"semi": true,
4+
"trailingComma": "all",
5+
"bracketSpacing": true,
6+
"printWidth": 144
7+
}
8+

.yarnrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--install.ignore-engines true

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Contributing

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Himenon
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)