Skip to content

Commit 82de956

Browse files
Merge pull request #771 from vinayakkulkarni/refactor/bundle-with-vite
2 parents 8ff975d + cdd2178 commit 82de956

26 files changed

+7259
-12325
lines changed

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ module.exports = {
44
browser: true,
55
es6: true,
66
},
7+
parser: '@typescript-eslint/parser', // add the TypeScript parser
78
parserOptions: {
8-
parser: '@typescript-eslint/parser',
99
ecmaVersion: 2020,
1010
sourceType: 'module',
1111
lib: ['es2020'],
1212
tsconfigRootDir: __dirname,
13-
project: ['./tsconfig.json'],
1413
extraFileExtensions: ['.svelte'],
1514
},
1615
overrides: [
@@ -19,13 +18,12 @@ module.exports = {
1918
processor: 'svelte3/svelte3',
2019
},
2120
],
22-
plugins: ['svelte3', 'jsdoc', '@typescript-eslint'],
21+
plugins: ['svelte3', 'security', 'jsdoc', '@typescript-eslint'],
2322
extends: [
24-
'eslint:recommended',
2523
'plugin:@typescript-eslint/recommended',
2624
'plugin:@typescript-eslint/eslint-recommended',
27-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
2825
'plugin:jsdoc/recommended',
26+
'plugin:security/recommended',
2927
'prettier',
3028
],
3129
// add your custom rules here
@@ -34,6 +32,6 @@ module.exports = {
3432
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
3533
},
3634
settings: {
37-
'svelte3/typescript': true,
35+
'svelte3/typescript': () => require('typescript'), // pass the TypeScript package to the Svelte plugin
3836
},
3937
};

.github/semantic.yml

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

.github/workflows/ci.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,42 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ubuntu-latest]
29-
node: [16]
3029

3130
steps:
32-
- name: Check out repository (push)
33-
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request_target' || github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
31+
- name: Check out repository
32+
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'pull_request_target' && github.actor != 'dependabot[bot]' }}
3433
uses: actions/checkout@v3
3534

36-
- name: Check out repository (pull_request_target)
35+
- name: Check out repository 🎉 (dependabot)
3736
if: ${{ github.event_name == 'pull_request_target' }}
3837
uses: actions/checkout@v3
3938
with:
4039
ref: ${{ github.event.pull_request.head.sha }}
4140

4241
- name: Setup node env 📦
43-
uses: actions/setup-node@v3
42+
uses: actions/setup-node@v3.4.1
4443
with:
45-
node-version: ${{ matrix.node }}
44+
node-version-file: '.nvmrc'
45+
registry-url: https://registry.npmjs.org
4646
check-latest: true
47-
registry-url: 'https://registry.npmjs.org'
4847
cache: 'npm'
4948

50-
- name: Upgrade npm ✨
51-
run: npm i -g npm@latest
52-
5349
- name: Install dependencies 🚀
54-
run: npm ci --prefer-offline --no-audit --no-optional
50+
run: npm ci --prefer-offline --no-audit
5551

5652
- name: Run linter(s) 👀
57-
run: npm run lint
53+
uses: wearerequired/lint-action@v2
54+
with:
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
continue_on_error: true
57+
git_name: github-actions[bot]
58+
git_email: github-actions[bot]@users.noreply.github.com
59+
auto_fix: false
60+
eslint: true
61+
eslint_extensions: js,ts,svelte
62+
prettier: true
63+
prettier_extensions: js,ts,svelte
64+
neutral_check_on_warning: true
5865

59-
- name: Check build 🎉
60-
run: npm run build
66+
- name: Run build 🏁
67+
run: npm run build
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: 'CodeQL'
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [main]
9+
schedule:
10+
- cron: '45 23 * * 2'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: ['javascript']
25+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
26+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v3
31+
32+
# Initializes the CodeQL tools for scanning.
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v2
35+
with:
36+
languages: ${{ matrix.language }}
37+
# If you wish to specify custom queries, you can do so here or in a config file.
38+
# By default, queries listed here will override any specified in a config file.
39+
# Prefix the list here with "+" to use these queries and those in the config file.
40+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
41+
42+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
43+
# If this step fails, then you should remove it and run the build manually (see below)
44+
- name: Autobuild
45+
uses: github/codeql-action/autobuild@v2
46+
47+
# ℹ️ Command-line programs to run using the OS shell.
48+
# 📚 https://git.io/JvXDl
49+
50+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
51+
# and modify them (or add more) to build your code if your project
52+
# uses a compiled language
53+
54+
#- run: |
55+
# make bootstrap
56+
# make release
57+
58+
- name: Perform CodeQL Analysis
59+
uses: github/codeql-action/analyze@v2

.github/workflows/lint-pr.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: 'Lint PR'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
check-sign-off:
12+
if: startsWith(github.head_ref, 'releases/v') == false
13+
name: Write comment if unsigned commits found
14+
env:
15+
FORCE_COLOR: 1
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: live627/check-pr-signoff-action@v1
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
semantic-pull-request:
23+
name: Validate PR title
24+
needs: [check-sign-off]
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: amannn/action-semantic-pull-request@v4
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/shipjs-trigger.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,24 @@ jobs:
99
runs-on: ubuntu-latest
1010
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')
1111
steps:
12-
- name: Checkout 🛎️
12+
- name: Checkout code 🛎
1313
uses: actions/checkout@v3
1414
with:
1515
fetch-depth: 0
1616
ref: main
1717

18-
- name: Setup node env 📦
19-
uses: actions/setup-node@v3
18+
- name: Setup node env 🏗
19+
uses: actions/setup-node@v3.4.1
2020
with:
21-
node-version: 16
21+
node-version-file: '.nvmrc'
22+
registry-url: https://registry.npmjs.org
2223
check-latest: true
23-
registry-url: 'https://npm.pkg.github.com'
2424
cache: 'npm'
25-
26-
- name: Upgrade npm 🎉
27-
run: npm install -g npm@latest
2825

2926
- name: Install dependencies 🚀
30-
run: npm ci --prefer-offline --no-audit --no-optional
27+
run: npm ci --prefer-offline --no-audit
3128

32-
- name: Perform a new release 🚨
29+
- name: Release new version to registry 🎉
3330
run: npx shipjs trigger
3431
env:
3532
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.husky/commit-msg

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx --no-install commitlint --edit $1
4+
NAME=$(git config user.name)
5+
EMAIL=$(git config user.email)
6+
7+
if [ -z "$NAME" ]; then
8+
echo "empty git config user.name"
9+
exit 1
10+
fi
11+
12+
if [ -z "$EMAIL" ]; then
13+
echo "empty git config user.email"
14+
exit 1
15+
fi
16+
17+
git interpret-trailers --if-exists doNothing --trailer \
18+
"Signed-off-by: $NAME <$EMAIL>" \
19+
--in-place "$1"
20+
21+
npm exec --no -- commitlint --edit $1

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run lint-staged
4+
npm exec --no -- lint-staged --no-stash

.husky/pre-push

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

.nvmrc

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

0 commit comments

Comments
 (0)