Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ module.exports = {
env: {
browser: true,
},
overrides: [
{
files: ['jest.config.mjs', 'babel.config.mjs'],
rules: {
'import/no-default-export': 'off',
},
},
],
};
22 changes: 10 additions & 12 deletions .github/workflows/deploy-published-releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ jobs:
deploy-library:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
contents: read # This is required for actions/checkout
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
node-version: 23
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Cache dependencies
id: cache-dependencies
Expand All @@ -44,7 +47,7 @@ jobs:

- name: Prepare release
run: |-
cp package.json LICENSE README.md build/
cp LICENSE README.md build/
cd build
find . -type f -path '*/*\.js.map' -exec sed -i -e "s~../src~src~" {} +
sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json
Expand All @@ -53,13 +56,11 @@ jobs:
sed -i -e "s~<@playgroundConnectUrl@>~${PLAYGROUND_CONNECT_URL}~" constants.*
sed -i -e "s~<@previewWidgetOrigin@>~${PREVIEW_WIDGET_ORIGIN}~" constants.*
sed -i -e "s~<@previewWidgetUrl@>~${PREVIEW_WIDGET_URL}~" constants.*
cp -r ../src src

- name: Publish pre-release to NPM
if: ${{ github.event.release.prerelease }}
run: |-
cd build
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
npm publish --access public --tag next
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand All @@ -68,7 +69,6 @@ jobs:
if: ${{ !github.event.release.prerelease }}
run: |-
cd build
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
deploy-preview-widget:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
contents: read # This is required for actions/checkout
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -114,7 +114,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 23

- name: Cache dependencies
id: cache-dependencies
Expand All @@ -125,12 +125,10 @@ jobs:

- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |-
npm ci
run: npm ci

- name: Build package
run: |-
npm run build
run: npm run build

- id: auth
name: Authenticate to Google Cloud
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/library-validations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 23

- name: Cache dependencies
id: cache-dependencies
Expand All @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 23

- name: Cache dependencies
id: cache-dependencies
Expand All @@ -63,7 +63,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 23

- name: Cache dependencies
id: cache-dependencies
Expand All @@ -86,7 +86,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 23

- name: Cache dependencies
id: cache-dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/preview-validations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 23

- name: Cache dependencies
id: cache-dependencies
Expand All @@ -47,7 +47,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 23

- name: Cache dependencies
id: cache-dependencies
Expand All @@ -74,7 +74,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 23

- name: Cache dependencies
id: cache-dependencies
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish-pr-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 23

- name: Cache dependencies
id: cache-dependencies
Expand All @@ -35,13 +35,12 @@ jobs:

- name: Prepare release
run: |-
cp package.json LICENSE README.md build/
cp LICENSE README.md build/
cd build
find . -type f -path '*/*\.js.map' -exec sed -i -e "s~../src~src~" {} +
sed -i -e "s~<@version@>~0.0.0-dev~" constants.*
sed -i -e "s~<@baseEndpointUrl@>~${BASE_ENDPOINT}~" constants.*
sed -i -e "s~parseInt('<@maxQueryLength@>', 10)~${MAX_QUERY_LENGTH}~" constants.*
cp -r ../src src

- name: Publish preview
run: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Drafter
name: Update release notes

on:
push:
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

7 changes: 2 additions & 5 deletions jest.config.js → jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
export default {
testEnvironment: 'jsdom',
preset: 'ts-jest/presets/js-with-babel',
preset: 'ts-jest',
testMatch: ['<rootDir>/test/**/*.test.ts'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
transformIgnorePatterns: [
'/node_modules/(?!@croct/content/)',
],
};
Loading