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
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
module.exports = {
extends: '@vertexvis/vertexvis-typescript',
parser: '@typescript-eslint/parser',
rules: {
'@typescript-eslint/func-call-spacing': 'off',
},
overrides: [
{
files: ['*.d.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['*.js', '*.jsx', '*.mjs'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
],
};
68 changes: 25 additions & 43 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout changes"
uses: actions/checkout@v4
- name: Set Node Version
id: nvm
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Cache dependencies
uses: actions/cache@v4
uses: actions/checkout@v6
- name: 'Setup Node'
uses: actions/setup-node@v6
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
- name: Enable Corepack
run: corepack enable
- name: "Install"
run: "yarn install"
- name: "Build"
run: "yarn build"
- name: "Upload build artifacts"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: build-artifact
path: |
Expand All @@ -40,20 +34,14 @@ jobs:
steps:
- name: "Checkout changes"
uses: actions/checkout@v4
- name: Set Node Version
id: nvm
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Cache dependencies
uses: actions/cache@v4
- name: 'Setup Node'
uses: actions/setup-node@v6
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
- name: Enable Corepack
run: corepack enable
- name: "Install"
run: "yarn install"
- name: "Lint"
Expand All @@ -63,26 +51,20 @@ jobs:
needs: [build]
steps:
- name: "Checkout changes"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Download build artifacts"
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
name: build-artifact
path: packages
- name: Set Node Version
id: nvm
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- name: Setup NodeJS
uses: actions/setup-node@v4
- name: 'Setup Node'
uses: actions/setup-node@v6
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
- name: Enable Corepack
run: corepack enable
- name: "Install"
run: "yarn install"
- name: "Test"
Expand Down
76 changes: 29 additions & 47 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout changes"
uses: actions/checkout@v4
- name: Set Node Version
id: nvm
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- name: Setup NodeJS
uses: actions/setup-node@v4
uses: actions/checkout@v6
- name: 'Setup Node'
uses: actions/setup-node@v6
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
- name: Enable Corepack
run: corepack enable
- name: "Install"
run: "yarn install"
- name: "Build"
run: "yarn build"
- name: "Test"
run: "yarn test"
- name: "Upload build artifacts"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: build-artifact
path: |
Expand All @@ -44,41 +38,35 @@ jobs:
publish: ${{ steps.detect-publish.outputs.publish }}
steps:
- name: "Checkout changes"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Detect publish"
id: "detect-publish"
run: |
result=`./scripts/detect_release.sh`
echo $result
echo ::set-output name=publish::$result
echo "publish=$result" >> "$GITHUB_OUTPUT"

publish-canary:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: "Checkout changes"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Download build artifacts"
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
name: build-artifact
path: packages
- name: Set Node Version
id: nvm
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- name: Setup NodeJS
uses: actions/setup-node@v1
- name: 'Setup Node'
uses: actions/setup-node@v6
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
registry-url: https://registry.npmjs.org
scope: "@vertexvis"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Enable Corepack
run: corepack enable
- name: "Install"
run: "yarn install"
- name: "Publish Canary to NPM"
Expand All @@ -97,28 +85,22 @@ jobs:
if: needs.detect-publish-release.outputs.publish == 1
steps:
- name: "Checkout changes"
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: "Download build artifacts"
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
name: build-artifact
path: packages
- name: Set Node Version
id: nvm
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
- name: Setup NodeJS
uses: actions/setup-node@v4
- name: 'Setup Node'
uses: actions/setup-node@v6
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
registry-url: https://registry.npmjs.org
scope: "@vertexvis"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Enable Corepack
run: corepack enable
- name: "Install"
run: "yarn install"
- name: "Publish Release to NPM"
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.17.4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬

v22.22.2
35 changes: 20 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,37 @@
"packages/*"
],
"scripts": {
"bootstrap": "lerna bootstrap",
"build": "lerna run build",
"clean": "lerna clean && rm -r node_modules/",
"clean": "yarn workspaces foreach -A run clean || rm -rf node_modules packages/*/node_modules",
"generate:vscode-workspace": "./scripts/generate_vscode_workspace.sh",
"format": "lerna run format",
"lerna": "lerna",
"lint": "lerna run lint",
"postinstall": "yarn generate:vscode-workspace && yarn bootstrap",
"postinstall": "yarn generate:vscode-workspace",
"release": "./scripts/release.sh",
"release:ask": "ASK_VERSION=true ./scripts/release.sh",
"test": "lerna run test",
"test:coverage": "lerna run test:coverage",
"version:bump": "./scripts/version_bump.sh"
},
"devDependencies": {
"@types/jest": "^26.0.24",
"@vertexvis/build-tools": "^0.8.4",
"@vertexvis/eslint-config-vertexvis-typescript": "^0.4.0",
"@vertexvis/jest-config-vertexvis": "^0.5.2",
"@types/jest": "^29.0.0",
"@typescript-eslint/eslint-plugin": "^8.62.0",
"@typescript-eslint/parser": "^8.62.0",
"@vertexvis/build-tools": "^0.10.2",
"@vertexvis/eslint-config-vertexvis-typescript": "^0.5.2",
"@vertexvis/jest-config-vertexvis": "^0.5.5",
"@vertexvis/typescript-config-vertexvis": "^1.1.0",
"eslint": "^7.32.0",
"jest": "^27.0.6",
"lerna": "^4.0.0",
"rollup": "^1",
"rollup-plugin-typescript2": "^0.30.0",
"ts-jest": "^27.0.4",
"typescript": "^4.3.5"
}
"eslint": "^8.57.0",
"jest": "^29.0.0",
"lerna": "^6.6.0",
"rollup": "^2",
"rollup-plugin-typescript2": "^0.37.0",
"ts-jest": "^29.4.11",
"typescript": "^5.6.3"
},
"engines": {
"node": ">=22.22.2"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
8 changes: 5 additions & 3 deletions packages/rollup-plugin-web-workers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,24 @@
"start": "jest --watch",
"test:clean": "rm -fr ./dist-test && mkdir ./dist-test",
"pretest:build": "yarn test:clean",
"test:build": "rollup --config ./rollup.testing.js",
"test:build": "yarn workspace @vertexvis/web-workers build && yarn build && rollup --config ./rollup.testing.js",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking - this is something we want to merge and not only for testing, correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's funky. Because rollup-web-workers references web-workers, you build that first, then build all then run test. Might be able to trim this down or find a more efficient way, but this does the trick for now

"pretest": "yarn test:build",
"test": "jest --runInBand",
"test:coverage": "yarn test"
},
"peerDependencies": {
"rollup": "^1",
"rollup": ">=2",
"threads": "^1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^21.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/expect-puppeteer": "^4.4.6",
"@vertexvis/web-workers": "0.1.0",
"get-port": "^5.1.1",
"http-server": "^13.0.0",
"jest-puppeteer": "^5.0.4",
"puppeteer": "^10.2.0",
"rollup-plugin-copy": "^3.4.0"
"rollup-plugin-copy": "^3.5.0"
}
}
2 changes: 1 addition & 1 deletion packages/rollup-plugin-web-workers/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { config, output, typescript, input } from '@vertexvis/build-tools';
import { config, input, output, typescript } from '@vertexvis/build-tools';

export default config(
input('src/index.ts'),
Expand Down
33 changes: 27 additions & 6 deletions packages/rollup-plugin-web-workers/rollup.testing.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import path from 'node:path';

import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import copy from 'rollup-plugin-copy';
import { terser } from 'rollup-plugin-terser';
import workers from './dist/bundle.esm';

import workers from './dist/bundle.esm.js';

function threadsBrowserEntry() {
return {
name: 'threads-browser-entry',
resolveId(source) {
if (source === 'threads') {
return path.resolve('../../node_modules/threads/dist-esm/index.js');
}

return null;
},
};
}

const browserPlugins = [
threadsBrowserEntry(),
commonjs(),
nodeResolve({ browser: true }),
];

export default {
input: './test-src/main.js',
Expand All @@ -11,10 +33,9 @@ export default {
format: 'esm',
},
plugins: [
commonjs(),
resolve({ browser: true }),
...browserPlugins,
workers({
plugins: [commonjs(), resolve({ browser: true }), terser()],
plugins: [...browserPlugins, terser()],
}),
terser(),
copy({
Expand Down
Loading
Loading