Skip to content

Commit f949ed1

Browse files
authored
Merge pull request #27 from sourcetoad/update-to-typescript
MD-23 Build esm, common, and umd bundles
2 parents 6972f72 + 8ccc09e commit f949ed1

24 files changed

+13042
-4957
lines changed

.babelrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

.eslintrc

Lines changed: 0 additions & 13 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
/* eslint-disable @stylistic/quote-props, @stylistic/array-bracket-spacing, @stylistic/object-curly-spacing */
2+
3+
/** @type {import('eslint').Linter.Config} */
4+
module.exports = {
5+
root: true,
6+
env: {
7+
browser: true,
8+
es2021: true,
9+
node: true,
10+
jest: true,
11+
},
12+
globals: {
13+
NodeJS: true,
14+
},
15+
extends: [
16+
'eslint:recommended',
17+
],
18+
plugins: [
19+
'@stylistic',
20+
'@stylistic/ts',
21+
'jsdoc',
22+
],
23+
overrides: [
24+
{
25+
files: ['*.js', '*.jsx', '*.cjs', '*.mjs'],
26+
parserOptions: {
27+
sourceType: 'module',
28+
},
29+
rules: {
30+
'@typescript-eslint/indent': 'off',
31+
'@typescript-eslint/object-curly-spacing': 'off',
32+
'@typescript-eslint/no-var-requires': 'off',
33+
'@typescript-eslint/semi': 'off',
34+
'@typescript-eslint/explicit-function-return-type': 'off',
35+
'@typescript-eslint/space-before-function-paren': 'off',
36+
},
37+
},
38+
{
39+
files: ['*.ts', '*.tsx', '*.cts', '*.mts'],
40+
parser: '@typescript-eslint/parser',
41+
parserOptions: {
42+
sourceType: 'module',
43+
project: [
44+
'tsconfig.json',
45+
],
46+
},
47+
rules: {
48+
'no-unused-vars': 'off',
49+
'@typescript-eslint/triple-slash-reference': 'off',
50+
},
51+
},
52+
],
53+
rules: {
54+
'prettier/prettier': 0,
55+
'curly': ['error', 'all'],
56+
'arrow-body-style': ['error', 'as-needed'],
57+
'eqeqeq': 'error',
58+
'no-console': ['error', { 'allow': [ 'warn', 'error' ] }],
59+
'no-unreachable-loop': 'warn',
60+
'no-var': 'error',
61+
'jsdoc/check-access': 2,
62+
'jsdoc/check-alignment': 2,
63+
'jsdoc/check-param-names': 2,
64+
'jsdoc/check-property-names': 2,
65+
'jsdoc/check-tag-names': 2,
66+
'jsdoc/check-values': 2,
67+
'jsdoc/empty-tags': 2,
68+
'jsdoc/implements-on-classes': 2,
69+
'jsdoc/multiline-blocks': 2,
70+
'jsdoc/no-multi-asterisks': 0,
71+
'jsdoc/no-undefined-types': 0,
72+
'jsdoc/require-jsdoc': 2,
73+
'jsdoc/require-param': 2,
74+
'jsdoc/require-param-description': 0,
75+
'jsdoc/require-param-name': 2,
76+
'jsdoc/require-property': 2,
77+
'jsdoc/require-property-description': 0,
78+
'jsdoc/require-property-name': 2,
79+
'jsdoc/require-returns': 2,
80+
'jsdoc/require-returns-check': 2,
81+
'jsdoc/require-returns-description': 0,
82+
'jsdoc/tag-lines': ['error', 'any', {
83+
'count': 0,
84+
'startLines': 1,
85+
}],
86+
'@stylistic/array-bracket-newline': ['error', 'consistent'],
87+
'@stylistic/array-bracket-spacing': ['error', 'always', {
88+
'arraysInArrays': false,
89+
'objectsInArrays': false,
90+
}],
91+
'@stylistic/array-element-newline': ['error', {
92+
ArrayExpression: 'consistent',
93+
ArrayPattern: {minItems: 4},
94+
}],
95+
'@stylistic/arrow-parens': ['error', 'as-needed', {
96+
requireForBlockBody: true,
97+
}],
98+
'@stylistic/arrow-spacing': ['error', {
99+
before: true,
100+
after: true,
101+
}],
102+
'@stylistic/block-spacing': ['error', 'always'],
103+
'@stylistic/brace-style': ['error', '1tbs', {allowSingleLine: false}],
104+
'@stylistic/comma-dangle': ['error', {
105+
arrays: 'always-multiline',
106+
objects: 'always-multiline',
107+
imports: 'always-multiline',
108+
exports: 'always-multiline',
109+
functions: 'only-multiline',
110+
}],
111+
'@stylistic/comma-spacing': ['error', {before: false, after: true}],
112+
'@stylistic/comma-style': ['error', 'last'],
113+
'@stylistic/computed-property-spacing': ['error', 'never'],
114+
'@stylistic/dot-location': ['error', 'property'],
115+
'@stylistic/eol-last': ['error', 'always'],
116+
'@stylistic/function-call-spacing': ['error', 'never'],
117+
'@stylistic/function-paren-newline': ['error', 'multiline-arguments'],
118+
'@stylistic/generator-star-spacing': ['error', {before: true, after: false}],
119+
'@stylistic/indent': ['warn', 4, {
120+
SwitchCase: 1,
121+
}],
122+
'@stylistic/key-spacing': ['error', {
123+
'beforeColon': false,
124+
'afterColon': true,
125+
'mode': 'strict',
126+
}],
127+
'@stylistic/keyword-spacing': ['error', {before: true, after: true}],
128+
'@stylistic/linebreak-style': ['error', 'unix'],
129+
'@stylistic/lines-between-class-members': ['error', {
130+
enforce: [
131+
{blankLine: 'always', prev: 'field', next: 'method'},
132+
{blankLine: 'always', prev: 'method', next: 'method'},
133+
],
134+
}],
135+
'@stylistic/max-len': ['error', 120, {
136+
ignorePattern: '^import',
137+
ignoreUrls: true,
138+
}],
139+
'@stylistic/max-statements-per-line': ['error', {max: 1}],
140+
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
141+
'@stylistic/new-parens': ['error', 'always'],
142+
'@stylistic/no-extra-semi': 'error',
143+
'@stylistic/no-floating-decimal': 'error',
144+
'@stylistic/no-mixed-spaces-and-tabs': 'error',
145+
'@stylistic/no-multi-spaces': 'error',
146+
'@stylistic/no-multiple-empty-lines': ['error', {
147+
max: 2,
148+
maxEOF: 1,
149+
maxBOF: 0,
150+
}],
151+
'@stylistic/no-trailing-spaces': 'error',
152+
'@stylistic/no-whitespace-before-property': 'error',
153+
'@stylistic/object-curly-newline': ['error', {consistent: true}],
154+
'@stylistic/object-curly-spacing': ['error', 'always', {
155+
'arraysInObjects': false,
156+
'objectsInObjects': false,
157+
}],
158+
'@stylistic/one-var-declaration-per-line': ['error', 'always'],
159+
'@stylistic/operator-linebreak': ['error', 'after', {
160+
overrides: {
161+
'?': 'before',
162+
':': 'before',
163+
},
164+
}],
165+
'@stylistic/padded-blocks': ['error', 'never'],
166+
'@stylistic/quote-props': ['error', 'as-needed'],
167+
'@stylistic/quotes': ['error', 'single', {
168+
avoidEscape: true,
169+
allowTemplateLiterals: false,
170+
}],
171+
'@stylistic/rest-spread-spacing': ['error', 'never'],
172+
'@stylistic/semi': ['error', 'always'],
173+
'@stylistic/semi-spacing': ['error', {before: false, after: true}],
174+
'@stylistic/space-before-blocks': ['error', 'always'],
175+
'@stylistic/space-before-function-paren': ['error', {
176+
anonymous: 'never',
177+
named: 'never',
178+
asyncArrow: 'always',
179+
}],
180+
'@stylistic/space-in-parens': ['error', 'never'],
181+
'@stylistic/space-infix-ops': ['error', {int32Hint: true}],
182+
'@stylistic/space-unary-ops': ['error', {
183+
words: true,
184+
nonwords: false,
185+
}],
186+
'@stylistic/switch-colon-spacing': ['error', {after: true, before: false}],
187+
'@stylistic/template-curly-spacing': ['error', 'never'],
188+
'@stylistic/template-tag-spacing': ['error', 'never'],
189+
'@stylistic/wrap-iife': ['error', 'inside'],
190+
'@stylistic/yield-star-spacing': ['error', {before: true, after: false}],
191+
'@stylistic/object-property-newline': ['error', {
192+
allowAllPropertiesOnSameLine: true,
193+
}],
194+
'@stylistic/ts/member-delimiter-style': ['error', {
195+
multiline: {
196+
delimiter: 'comma',
197+
requireLast: true,
198+
},
199+
singleline: {
200+
delimiter: 'comma',
201+
requireLast: true,
202+
},
203+
}],
204+
'@stylistic/ts/type-annotation-spacing': ['error', {
205+
before: false,
206+
after: true,
207+
overrides: {
208+
arrow: {
209+
before: true,
210+
after: true,
211+
},
212+
},
213+
}],
214+
},
215+
};

.github/auto-assign.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# https://github.com/kentaro-m/auto-assign-action
2+
3+
# Set to true to add reviewers to pull requests
4+
addReviewers: true
5+
6+
# Set to true to add assignees to pull requests
7+
addAssignees: false
8+
9+
# Set to true to add assignees from different groups to pull requests
10+
useAssigneeGroups: false
11+
12+
# A number of reviewers added to the pull request
13+
# Set 0 to add all the reviewers (default: 0)
14+
numberOfReviewers: 2
15+
16+
# Set to true to add reviewers from different groups to pull requests
17+
useReviewGroups: true
18+
19+
# A list of reviewers to be added to pull requests (GitHub username)
20+
reviewGroups:
21+
groupA:
22+
- stobob
23+
- joeladam518
24+
- xhaferrama
25+
groupB:
26+
- ryantoad
27+
- angietoad
28+
- edertoad

.github/workflows/auto-assign.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: 'Auto Assign Reviewers'
2+
on:
3+
pull_request_target:
4+
types: [opened, ready_for_review]
5+
6+
jobs:
7+
add-reviews:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: kentaro-m/auto-assign-action@v2.0.0
11+
with:
12+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/build.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@ on: [push]
44
jobs:
55
build:
66
runs-on: ubuntu-latest
7-
strategy:
8-
matrix:
9-
node: ['12', '14']
107

11-
name: Node ${{ matrix.node }}
8+
name: Node 20
129
steps:
1310
- uses: actions/checkout@v4
1411

15-
- name: Setup node
12+
- name: Setup Node
1613
uses: actions/setup-node@v4
1714
with:
18-
node-version: ${{ matrix.node }}
19-
cache: 'yarn'
15+
node-version: 20
16+
cache: 'npm'
2017

21-
- name: Yarn Install
22-
run: yarn install --network-concurrency 1
18+
- name: NPM Install
19+
run: npm install
2320

2421
- name: Lint
25-
run: yarn lint
22+
run: npm run lint
23+
24+
- name: Check Types
25+
run: npm run check-types
2626

2727
- name: Test
28-
run: yarn test
28+
run: npm run test
2929

3030
- name: Build
31-
run: yarn prod
31+
run: npm run build
3232

3333
- name: ES Check
34-
run: yarn es-check
34+
run: npm run es-check

.github/workflows/publish.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
- name: Setup node
1616
uses: actions/setup-node@v4
1717
with:
18-
node-version: 14
19-
cache: 'yarn'
18+
node-version: 20
19+
cache: 'npm'
2020
registry-url: 'https://registry.npmjs.org'
2121

22-
- name: Yarn Install
23-
run: yarn install --network-concurrency 1
22+
- name: NPM Install
23+
run: npm install
2424

2525
- name: Build
26-
run: yarn prod
26+
run: npm run build
2727

2828
- name: Publish (NPM)
2929
run: npm publish --access public
@@ -32,6 +32,7 @@ jobs:
3232

3333
- uses: actions/setup-node@v4
3434
with:
35+
node-version: 20
3536
registry-url: 'https://npm.pkg.github.com'
3637

3738
- name: Publish (GPR)

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
.github
22
.idea
3+
node_modules
4+
src
5+
tests
6+
.eslintignore
7+
.eslintrc.cjs
8+
.nvmrc
9+
jest.config.cjs
10+
rollup.config.js
11+
tsconfig.json

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20

0 commit comments

Comments
 (0)