Skip to content

Commit 4b579c8

Browse files
committed
feat(all): first commit
1 parent aeceee7 commit 4b579c8

Some content is hidden

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

110 files changed

+401709
-0
lines changed

.circleci/config.yml

+194
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
version: 2.1
2+
3+
map-1: &filter_only_master
4+
filters:
5+
branches:
6+
only:
7+
- master
8+
9+
map-2: &filter_only_dev
10+
filters:
11+
branches:
12+
only:
13+
- dev
14+
15+
map-3: &filter_ignore_dev
16+
filters:
17+
branches:
18+
ignore:
19+
- dev
20+
21+
test: &test
22+
parameters:
23+
coverage:
24+
type: boolean
25+
default: true
26+
steps:
27+
- checkout
28+
- run: node --version
29+
- run: npm install
30+
- run: npm run test
31+
32+
executors:
33+
34+
docker-circleci:
35+
parameters:
36+
node:
37+
type: string
38+
default: "10.12"
39+
working_directory: ~/repo
40+
docker:
41+
- image: "circleci/node:<< parameters.node >>-stretch-browsers"
42+
43+
jobs:
44+
45+
build:
46+
executor: docker-circleci
47+
steps:
48+
- checkout
49+
- run: npm ci
50+
- run: npm run build
51+
52+
lint:
53+
executor: docker-circleci
54+
steps:
55+
- checkout
56+
- run: npm ci
57+
- run: npm run lint
58+
59+
bundle:
60+
executor: docker-circleci
61+
steps:
62+
- checkout
63+
- run: npm ci
64+
- run: npm run bundle
65+
66+
test-6:
67+
<<: *test
68+
executor:
69+
name: docker-circleci
70+
node: "6.17.1"
71+
72+
test-8:
73+
<<: *test
74+
executor:
75+
name: docker-circleci
76+
node: "8.16.1"
77+
78+
test-10:
79+
<<: *test
80+
executor:
81+
name: docker-circleci
82+
node: "10.12"
83+
84+
test-12:
85+
<<: *test
86+
executor:
87+
name: docker-circleci
88+
node: "12.9"
89+
90+
publish_dev:
91+
executor: docker-circleci
92+
steps:
93+
- checkout
94+
- run: npm ci
95+
- run:
96+
name: "Authenticate with registry"
97+
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
98+
- run:
99+
name: "Publish to @dev"
100+
command: |
101+
npm run prepare-nightly
102+
npm publish --tag dev
103+
104+
merge_and_dist:
105+
executor: docker-circleci
106+
parameters:
107+
from:
108+
type: string
109+
default: "master"
110+
to:
111+
type: string
112+
default: "dev"
113+
message:
114+
type: string
115+
default: "chore(all): add latest build artifacts"
116+
steps:
117+
- checkout
118+
- run: npm ci
119+
- run: npm run bundle
120+
- run:
121+
name: "Configure git"
122+
command: |
123+
git config --global user.email "<>"
124+
git config --global user.name "seafox"
125+
git config --global core.mergeoptions --no-edit
126+
- run:
127+
name: "Stash dist folder"
128+
command: |
129+
git add dist --force
130+
git stash
131+
- run:
132+
name: "Merge << parameters.from >> into << parameters.to >>"
133+
command: |
134+
git checkout << parameters.to >>
135+
git merge << parameters.from >> --no-ff --no-edit -Xtheirs
136+
- run:
137+
name: "Overwrite existing with stashed dist folders"
138+
command: |
139+
rm -rf dist
140+
git add .
141+
git stash pop
142+
git add dist --force
143+
- run:
144+
name: "Commit dist folders"
145+
command: git commit --allow-empty -m "<< parameters.message >>"
146+
- run:
147+
name: "Push << parameters.to >>"
148+
command: git push origin << parameters.to >>
149+
150+
workflows:
151+
build_test:
152+
jobs:
153+
- build:
154+
<<: *filter_ignore_dev
155+
- lint:
156+
<<: *filter_ignore_dev
157+
- bundle:
158+
<<: *filter_ignore_dev
159+
- test-6:
160+
<<: *filter_ignore_dev
161+
- test-8:
162+
<<: *filter_ignore_dev
163+
- test-10:
164+
<<: *filter_ignore_dev
165+
- test-12:
166+
<<: *filter_ignore_dev
167+
168+
publish_nightly:
169+
jobs:
170+
- publish_dev:
171+
<<: *filter_only_dev
172+
173+
run_nightly:
174+
triggers:
175+
- schedule:
176+
<<: *filter_only_master
177+
cron: "0 0 * * *"
178+
jobs:
179+
- build
180+
- lint
181+
- bundle
182+
- test-6
183+
- test-8
184+
- test-10
185+
- test-12
186+
- merge_and_dist:
187+
requires:
188+
- build
189+
- lint
190+
- bundle
191+
- test-6
192+
- test-8
193+
- test-10
194+
- test-12

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
indent_style = space
11+
indent_size = 2
12+
13+
[ts]
14+
indent_size = 2

.eslintrc.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
module.exports = {
4+
overrides: [
5+
{
6+
files: ['**/*.js'],
7+
extends: ['eslint:recommended', 'plugin:node/recommended'],
8+
parserOptions: { ecmaVersion: 10 }
9+
},
10+
{
11+
files: ['**/*.ts'],
12+
extends: [
13+
'plugin:@typescript-eslint/eslint-recommended',
14+
'plugin:@typescript-eslint/recommended',
15+
'plugin:import/errors',
16+
'plugin:import/warnings',
17+
'plugin:import/typescript'
18+
],
19+
rules: {
20+
'@typescript-eslint/no-use-before-define': [2, { functions: false }], // https://github.com/eslint/eslint/issues/11903
21+
'@typescript-eslint/indent': 0,
22+
'prefer-const': ['error', { destructuring: 'all' }],
23+
24+
// TODO: enable it when all problems addressed
25+
'@typescript-eslint/explicit-function-return-type': 0,
26+
'@typescript-eslint/no-explicit-any': 0,
27+
'@typescript-eslint/class-name-casing': 0,
28+
'@typescript-eslint/camelcase': 0
29+
}
30+
},
31+
{
32+
files: ['scripts/*.js'],
33+
rules:
34+
{
35+
"node/no-unsupported-features/es-syntax": ["error", {"version": "10.0", "ignores": []}]
36+
}
37+
}
38+
]
39+
};

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/dist
2+
node_modules
3+
/coverage
4+
/.nyc_output
5+
/.rpt2_cache
6+
/packages/*/node_modules
7+
/packages/*/npm-debug.log
8+
/packages/*/build
9+
/packages/*/lib
10+
/packages/*/coverage
11+
/packages/*/.nyc_output
12+
/packages/*/.rpt2_cache
13+
yarn.lock
14+
*.log
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
.rollupcache
19+
.fuzz-output
20+
.DS_Store

.mocharc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extension": ["ts"],
3+
"color": true,
4+
"reporter": "progress",
5+
"require": ["ts-node/register", "source-map-support/register"],
6+
"recursive": true
7+
}

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock = true

.prettierignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
bench/v1.6.2/
2+
bench/v2/
3+
bench/v8-native-calls.js
4+
node_modules/
5+
dist/
6+
src/token.ts
7+
src/common.ts
8+
src/chars.ts
9+
src/lexer/charClassifier.ts
10+
src/unicode.ts
11+
package-lock.json

.vscode/extensions.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"christian-kohler.path-intellisense",
4+
"EditorConfig.EditorConfig",
5+
"esbenp.prettier-vscode",
6+
"joelday.docthis",
7+
"steoates.autoimport"
8+
]
9+
}

.vscode/launch.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Program",
11+
"program": "${workspaceFolder}\\dist\\umd\\cherow.js",
12+
"preLaunchTask": "tsc: build - tsconfig.json",
13+
"outFiles": [
14+
"${workspaceFolder}/build/**/*.js"
15+
]
16+
},
17+
{
18+
"type": "node",
19+
"request": "launch",
20+
"name": "Launch mocha tests",
21+
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
22+
"args": [
23+
"${workspaceRoot}/test/**/*.ts"
24+
],
25+
"cwd": "${workspaceRoot}",
26+
"internalConsoleOptions": "openOnSessionStart"
27+
}
28+
]
29+
}

.vscode/settings.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"typescript.tsdk": "./node_modules/typescript/lib",
3+
"tslint.nodePath": "./node_modules/tslint/bin/tslint",
4+
"tslint.exclude": [
5+
"**/node_modules/**",
6+
"**/dist/**",
7+
"**/build/**",
8+
"packages/*/test/**"
9+
],
10+
"emmet.triggerExpansionOnTab": true,
11+
"search.exclude": {
12+
"**/node_modules": true,
13+
"**/dist": true,
14+
"**/build": true,
15+
"**/.vscode": true
16+
},
17+
"prettier.singleQuote": true,
18+
"deepscan.ignoreConfirmWarning": true
19+
}

LICENSE.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ISC License
2+
3+
Copyright (c) 2019 and later, KFlash and others.
4+
5+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-cayman

0 commit comments

Comments
 (0)