Skip to content

Commit 883bf99

Browse files
committed
Initial commit
0 parents  commit 883bf99

23 files changed

+7073
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
max_line_length = 120
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.eslintrc.js

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
/* eslint-disable max-lines */
2+
module.exports = {
3+
plugins: ['prettier', 'fp', 'markdown', 'html'],
4+
extends: [
5+
'eslint:recommended',
6+
'standard',
7+
'prettier',
8+
'prettier/standard',
9+
'plugin:unicorn/recommended',
10+
'plugin:eslint-comments/recommended',
11+
'plugin:node/recommended',
12+
'plugin:fp/recommended',
13+
'plugin:ava/recommended',
14+
'plugin:you-dont-need-lodash-underscore/all',
15+
],
16+
reportUnusedDisableDirectives: true,
17+
rules: {
18+
'no-console': 0,
19+
'no-unused-vars': [2, {}],
20+
'no-empty': [2, { allowEmptyCatch: true }],
21+
'import/order': [
22+
2,
23+
{
24+
'newlines-between': 'always',
25+
alphabetize: {
26+
order: 'asc',
27+
caseInsensitive: true,
28+
},
29+
},
30+
],
31+
'no-process-exit': 0,
32+
'require-atomic-updates': 0,
33+
'no-undef': [2, { typeof: true }],
34+
35+
'max-lines': [
36+
2,
37+
{
38+
max: 150,
39+
skipBlankLines: true,
40+
skipComments: true,
41+
},
42+
],
43+
'max-lines-per-function': [
44+
2,
45+
{
46+
max: 100,
47+
skipBlankLines: true,
48+
skipComments: true,
49+
IIFEs: true,
50+
},
51+
],
52+
'max-statements': [2, 15],
53+
'max-statements-per-line': [2, { max: 2 }],
54+
'import/max-dependencies': [2, { max: 20 }],
55+
complexity: [2, 5],
56+
'max-depth': [2, 2],
57+
'max-nested-callbacks': [2, 2],
58+
'require-await': 2,
59+
60+
'node/no-sync': 2,
61+
'node/handle-callback-err': 2,
62+
'node/no-new-require': 2,
63+
'node/callback-return': 2,
64+
'node/exports-style': 2,
65+
'node/file-extension-in-import': 2,
66+
'node/global-require': 2,
67+
'node/no-mixed-requires': 2,
68+
// Browser globals should not use `require()`. Non-browser globals should
69+
'node/prefer-global/console': 2,
70+
'node/prefer-global/url-search-params': 2,
71+
'node/prefer-global/text-decoder': 2,
72+
'node/prefer-global/text-encoder': 2,
73+
'node/prefer-global/url': 2,
74+
'node/prefer-global/buffer': [2, 'never'],
75+
'node/prefer-global/process': [2, 'never'],
76+
// TODO: enable after dropping support for Node <11.4.0
77+
'node/prefer-promises/fs': 2,
78+
'node/prefer-promises/dns': 2,
79+
// This does not work well in a monorepo
80+
'node/shebang': 0,
81+
82+
'eslint-comments/no-unused-disable': 0,
83+
'eslint-comments/no-use': [
84+
2,
85+
{ allow: ['eslint-disable-next-line', 'eslint-disable', 'eslint-enable', 'eslint-env'] },
86+
],
87+
88+
// Not enabled by default in unicorn/recommended, but still pretty useful
89+
'unicorn/custom-error-definition': 2,
90+
'unicorn/no-unused-properties': 2,
91+
// The additional `non-zero` option is useful for code consistency
92+
'unicorn/explicit-length-check': [2, { 'non-zero': 'not-equal' }],
93+
// TODO: harmonize with filename snake_case in other Netlify Dev projects
94+
'unicorn/filename-case': [2, { case: 'snakeCase', ignore: ['.*.md'] }],
95+
// The `sortCharacterClasses` option is not very useful
96+
'unicorn/better-regex': [2, { sortCharacterClasses: false }],
97+
// Too strict
98+
'unicorn/no-null': 0,
99+
'unicorn/no-reduce': 0,
100+
// This rule gives too many false positives
101+
'unicorn/prevent-abbreviations': 0,
102+
// Conflicts with Prettier sometimes
103+
'unicorn/number-literal-case': 0,
104+
// Conflicts with the core ESLint `prefer-destructuring` rule
105+
'unicorn/no-unreadable-array-destructuring': 0,
106+
// Not useful for us
107+
'unicorn/expiring-todo-comments': 0,
108+
'unicorn/no-fn-reference-in-iterator': 0,
109+
// TODO: enable those rules
110+
'unicorn/no-process-exit': 0,
111+
'unicorn/import-style': 0,
112+
// TODO: enable after dropping Node 8 support
113+
'unicorn/prefer-optional-catch-binding': 0,
114+
'unicorn/prefer-trim-start-end': 0,
115+
116+
'fp/no-rest-parameters': 0,
117+
'fp/no-unused-expression': 0,
118+
'fp/no-nil': 0,
119+
'fp/no-throw': 0,
120+
'fp/no-mutating-methods': [
121+
2,
122+
{ allowedObjects: ['error', 'errorA', 'res', 'state', 'runState', 'logs', 'logsArray', 'currentEnv'] },
123+
],
124+
'fp/no-mutation': [
125+
2,
126+
{
127+
commonjs: true,
128+
exceptions: [
129+
{ object: 'error' },
130+
{ object: 'errorA' },
131+
{ object: 'res' },
132+
{ object: 'state' },
133+
{ object: 'runState' },
134+
{ object: 'logs' },
135+
{ object: 'logsArray' },
136+
{ object: 'currentEnv' },
137+
{ object: 'process', property: 'exitCode' },
138+
],
139+
},
140+
],
141+
142+
'ava/no-skip-test': 0,
143+
},
144+
overrides: [
145+
{
146+
files: ['**/tests.js', '**/tests/**/*.js'],
147+
rules: {
148+
'max-lines': 0,
149+
'node/no-unpublished-require': 0,
150+
'node/no-missing-require': 0,
151+
'unicorn/no-process-exit': 0,
152+
'fp/no-mutating-methods': 0,
153+
'fp/no-mutation': 0,
154+
'fp/no-delete': 0,
155+
},
156+
},
157+
{
158+
files: ['scripts/**/*.js'],
159+
rules: {
160+
'node/no-unpublished-require': 0,
161+
},
162+
},
163+
{
164+
files: ['**/*.md'],
165+
rules: {
166+
'no-undef': 0,
167+
'no-unused-vars': 0,
168+
'node/no-missing-require': 0,
169+
},
170+
},
171+
],
172+
}
173+
/* eslint-enable max-lines */

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @netlify/netlify-dev

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: 'Please replace with a clear and descriptive title'
5+
labels: 'type: bug'
6+
assignees: ''
7+
---
8+
9+
Thanks for reporting this bug!
10+
11+
Please search other issues to make sure this bug has not already been reported.
12+
13+
Then fill in the sections below.
14+
15+
**Describe the bug**
16+
17+
A clear and concise description of what the bug is.
18+
19+
**Configuration**
20+
21+
- If possible, please copy/paste below your `netlify.toml`.
22+
- Did you run your build through the UI or the CLI?
23+
- If using the CLI, which flags did you use?
24+
- If using the CLI, please enter the following command in a terminal and copy/paste its output:
25+
26+
```bash
27+
npx envinfo --system --binaries
28+
```
29+
30+
**Deploy logs**
31+
32+
If possible, please share a link to the Deploy that failed. If this is not possible or if the build was run in the CLI,
33+
please copy/paste the deploy logs below instead.
34+
35+
**Pull requests**
36+
37+
Pull requests are welcome! If you would like to help us fix this bug, please check our
38+
[contributions guidelines](../blob/master/CONTRIBUTING.md).
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: 'Please replace with a clear and descriptive title'
5+
labels: 'type: feature'
6+
assignees: ''
7+
---
8+
9+
<!--
10+
Thanks for suggesting a new feature!
11+
12+
Please fill in the sections below.
13+
-->
14+
15+
**Which problem is this feature request solving?**
16+
17+
<!--
18+
Example: I'm always frustrated when [...]
19+
-->
20+
21+
**Describe the solution you'd like**
22+
23+
<!--
24+
Example: This could be fixed by [...]
25+
-->
26+
27+
**Describe alternatives you've considered**
28+
29+
<!--
30+
Example: Another solution would be [...]
31+
-->
32+
33+
**Can you submit a pull request?**
34+
35+
Yes/No.
36+
37+
<!--
38+
Pull requests are welcome! If you would like to help us add this feature, please check our
39+
[contributions guidelines](../blob/master/CONTRIBUTING.md).
40+
-->

.github/pull_request_template.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
🎉 Thanks for sending this pull request! 🎉
2+
3+
Please make sure the title is clear and descriptive.
4+
5+
If you are fixing a typo or documentation, please skip these instructions.
6+
7+
Otherwise please fill in the sections below.
8+
9+
**Which problem is this pull request solving?**
10+
11+
Example: I'm always frustrated when [...]
12+
13+
**List other issues or pull requests related to this problem**
14+
15+
Example: This fixes #5012
16+
17+
**Describe the solution you've chosen**
18+
19+
Example: I've fixed this by [...]
20+
21+
**Describe alternatives you've considered**
22+
23+
Example: Another solution would be [...]
24+
25+
**Checklist**
26+
27+
Please add a `x` inside each checkbox:
28+
29+
- [ ] I have read the [contribution guidelines](../blob/master/CONTRIBUTING.md).
30+
- [ ] The status checks are successful (continuous integration). Those can be seen below.

.github/workflows/fossa.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Dependency License Scanning
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
jobs:
13+
fossa:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Fossa init
19+
run: |-
20+
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash
21+
fossa init
22+
- name: Set env
23+
run: echo ::set-env name=line_number::$(grep -n "project" .fossa.yml | cut -f1 -d:)
24+
- name: Configuration
25+
run: |-
26+
sed -i "${line_number}s|.*| project: [email protected]:${GITHUB_REPOSITORY}.git|" .fossa.yml
27+
cat .fossa.yml
28+
- name: Upload dependencies
29+
run: fossa analyze --debug
30+
env:
31+
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}

.github/workflows/workflow.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build
2+
on:
3+
# Ensure GitHub actions are not run twice for same commits
4+
push:
5+
branches: [master]
6+
tags: ['*']
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
timeout-minutes: 30
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macOS-latest, windows-latest]
16+
node-version: [14.x]
17+
fail-fast: false
18+
steps:
19+
- name: Git checkout
20+
uses: actions/checkout@v2
21+
- name: Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
- name: Install dependencies
26+
run: npm ci
27+
- name: Linting
28+
run: npm run format:ci
29+
if: "${{ matrix.node-version == '14.x' }}"
30+
- name: Tests
31+
run: npm run test:ci

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*~
2+
*.swp
3+
npm-debug.log
4+
node_modules
5+
/core
6+
.eslintcache
7+
.npmrc
8+
.yarn-error.log
9+
.nyc_output
10+
!.github/
11+
/coverage
12+
/build

0 commit comments

Comments
 (0)