Skip to content

Commit b60b589

Browse files
authored
chore: migrate to esm (#334)
* chore: update unit tests * fix: follow latest action template * chore: add licenses and workflows * chore: remove bloat * chore: fix linter
1 parent 6c3c96b commit b60b589

Some content is hidden

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

48 files changed

+43181
-35607
lines changed

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
dist/** -diff linguist-generated=true
1+
* text=auto eol=lf
2+
3+
dist/** -diff linguist-generated=true

.github/codeql/codeql-config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: JavaScript CodeQL Configuration
2+
3+
paths-ignore:
4+
- node_modules
5+
- dist

.github/dependabot.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,29 @@ updates:
33
- package-ecosystem: github-actions
44
directory: /
55
schedule:
6-
interval: daily
6+
interval: weekly
7+
groups:
8+
actions-minor:
9+
update-types:
10+
- minor
11+
- patch
712

813
- package-ecosystem: npm
914
directory: /
1015
schedule:
1116
interval: daily
17+
groups:
18+
npm-development:
19+
dependency-type: development
20+
update-types:
21+
- minor
22+
- patch
23+
npm-production:
24+
dependency-type: production
25+
update-types:
26+
- patch
1227
ignore:
28+
# nodejs types is pinned to runtime version
1329
- dependency-name: '@types/node'
1430
update-types:
1531
- version-update:semver-major
16-
- dependency-name: 'jest'
17-
update-types:
18-
- version-update:semver-major

.github/workflows/check-dist.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 31 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,47 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
12-
name: 'CodeQL'
1+
name: CodeQL
132

143
on:
15-
push:
16-
branches: [ main ]
174
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [ main ]
5+
push:
6+
branches:
7+
- main
208
schedule:
219
- cron: '31 7 * * 3'
2210

11+
permissions:
12+
actions: read
13+
checks: write
14+
contents: read
15+
security-events: write
16+
2317
jobs:
2418
analyze:
2519
name: Analyze
2620
runs-on: ubuntu-latest
27-
permissions:
28-
actions: read
29-
contents: read
30-
security-events: write
3121

3222
strategy:
3323
fail-fast: false
3424
matrix:
35-
language: [ 'TypeScript' ]
36-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37-
# Learn more about CodeQL language support at https://git.io/codeql-language-support
25+
language:
26+
- typescript
3827

3928
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v4
42-
43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
46-
with:
47-
languages: ${{ matrix.language }}
48-
source-root: src
49-
# If you wish to specify custom queries, you can do so here or in a config file.
50-
# By default, queries listed here will override any specified in a config file.
51-
# Prefix the list here with "+" to use these queries and those in the config file.
52-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
53-
54-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55-
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v3
58-
59-
# ℹ️ Command-line programs to run using the OS shell.
60-
# 📚 https://git.io/JvXDl
61-
62-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63-
# and modify them (or add more) to build your code if your project
64-
# uses a compiled language
65-
66-
#- run: |
67-
# make bootstrap
68-
# make release
69-
70-
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v3
29+
- name: Checkout
30+
id: checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Initialize CodeQL
34+
id: initialize
35+
uses: github/codeql-action/init@v3
36+
with:
37+
config-file: .github/codeql/codeql-config.yml
38+
languages: ${{ matrix.language }}
39+
source-root: src
40+
41+
- name: Autobuild
42+
id: autobuild
43+
uses: github/codeql-action/autobuild@v3
44+
45+
- name: Perform CodeQL Analysis
46+
id: analyze
47+
uses: github/codeql-action/analyze@v3

.github/workflows/dependabot.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ jobs:
1616
steps:
1717
# This first step will fail if there's no metadata and so the approval
1818
# will not occur.
19-
- name: Dependabot metadata
20-
id: dependabot-metadata
19+
- id: meta
2120
uses: dependabot/fetch-metadata@v2
2221
with:
2322
github-token: '${{ secrets.GITHUB_TOKEN }}'
2423

2524
# Here the PR gets approved.
2625
- name: Approve a PR
27-
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
26+
if: ${{steps.meta.outputs.update-type != 'version-update:semver-major'}}
2827
run: gh pr review --approve "$PR_URL"
2928
env:
3029
PR_URL: ${{ github.event.pull_request.html_url }}
@@ -33,7 +32,7 @@ jobs:
3332
# Finally, this sets the PR to allow auto-merging for patch and minor
3433
# updates if all checks pass
3534
- name: Enable auto-merge for Dependabot PRs
36-
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
35+
if: ${{steps.meta.outputs.update-type != 'version-update:semver-major'}}
3736
run: gh pr merge --auto --squash "$PR_URL"
3837
env:
3938
PR_URL: ${{ github.event.pull_request.html_url }}

.github/workflows/licensed.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This workflow checks the statuses of cached dependencies used in this action
2+
# with the help of the Licensed tool. If any licenses are invalid or missing,
3+
# this workflow will fail. See: https://github.com/licensee/licensed
4+
5+
name: Licensed
6+
7+
on:
8+
pull_request:
9+
push:
10+
branches:
11+
- main
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
licensed:
19+
name: Check Licenses
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout
24+
id: checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
id: setup-node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version-file: .node-version
32+
cache: npm
33+
34+
- name: Install Dependencies
35+
id: npm-ci
36+
run: npm ci
37+
38+
- name: Setup Ruby
39+
id: setup-ruby
40+
uses: ruby/setup-ruby@v1
41+
with:
42+
ruby-version: ruby
43+
44+
- uses: licensee/[email protected]
45+
with:
46+
version: 4.x
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
49+
# If this is a workflow_dispatch event, update the cached licenses.
50+
- if: ${{ github.event_name == 'workflow_dispatch' }}
51+
name: Update Licenses
52+
id: update-licenses
53+
run: licensed cache
54+
55+
# Then, commit the updated licenses to the repository.
56+
- if: ${{ github.event_name == 'workflow_dispatch' }}
57+
name: Commit Licenses
58+
id: commit-licenses
59+
run: |
60+
git config --local user.email "[email protected]"
61+
git config --local user.name "licensed-ci"
62+
git add .
63+
git commit -m "Auto-update license files"
64+
git push
65+
66+
# Last, check the status of the cached licenses.
67+
- name: Check Licenses
68+
id: check-licenses
69+
run: licensed status

.github/workflows/linter.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This workflow will lint the entire codebase using the
2+
# `super-linter/super-linter` action.
3+
#
4+
# For more information, see the super-linter repository:
5+
# https://github.com/super-linter/super-linter
6+
name: Lint Codebase
7+
8+
on:
9+
pull_request:
10+
push:
11+
branches:
12+
- main
13+
14+
permissions:
15+
contents: read
16+
packages: read
17+
statuses: write
18+
19+
jobs:
20+
lint:
21+
name: Lint Codebase
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout
26+
id: checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Setup Node.js
32+
id: setup-node
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version-file: .node-version
36+
cache: npm
37+
38+
- name: Install Dependencies
39+
id: install
40+
run: npm ci
41+
42+
- name: Lint Codebase
43+
id: super-linter
44+
uses: super-linter/super-linter/slim@v8
45+
env:
46+
DEFAULT_BRANCH: main
47+
FILTER_REGEX_EXCLUDE: dist/**/*
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
LINTER_RULES_PATH: ${{ github.workspace }}
50+
VALIDATE_ALL_CODEBASE: true
51+
VALIDATE_JAVASCRIPT_ES: false
52+
VALIDATE_JAVASCRIPT_STANDARD: false
53+
VALIDATE_JSCPD: false
54+
VALIDATE_TYPESCRIPT_ES: false
55+
VALIDATE_JSON: false
56+
VALIDATE_TYPESCRIPT_STANDARD: false

.github/workflows/start.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,7 @@ jobs:
3939
with:
4040
version: ${{ matrix.version }}
4141
- run: supabase init
42-
- run: sed -i -E "s|^(major_version) .*|\1 = ${{ matrix.pg_major }}|" supabase/config.toml
42+
- run:
43+
sed -i -E "s|^(major_version) .*|\1 = ${{ matrix.pg_major }}|"
44+
supabase/config.toml
4345
- run: supabase start

0 commit comments

Comments
 (0)