diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 34a0e51..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,161 +0,0 @@ -unit_tests: &unit_tests - steps: - - checkout - - setup_remote_docker - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: NPM Rebuild - command: npm install - - run: - name: Run unit tests. - command: npm run ci:test -# canary_tests: &canary_tests -# steps: -# - checkout -# - setup_remote_docker -# - restore_cache: -# key: dependency-cache-{{ checksum "package-lock.json" }} -# - run: -# name: NPM Rebuild -# command: npm install -# - run: -# name: Install Webpack Canary -# command: npm i --no-save webpack@next -# - run: -# name: Run unit tests. -# command: npm run ci:test - -version: 2 -jobs: - dependency_cache: - docker: - - image: webpackcontrib/circleci-node-base:latest - steps: - - checkout - - setup_remote_docker - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: Install Dependencies - command: npm install - - save_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - paths: - - ./node_modules - - node8-latest: - docker: - - image: webpackcontrib/circleci-node8:latest - steps: - - checkout - - setup_remote_docker - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: NPM Rebuild - command: npm install - - run: - name: Run unit tests. - command: npm run ci:coverage - - run: - name: Submit coverage data to codecov. - command: bash <(curl -s https://codecov.io/bash) - when: on_success - node6-latest: - docker: - - image: webpackcontrib/circleci-node6:latest - <<: *unit_tests - node9-latest: - docker: - - image: webpackcontrib/circleci-node9:latest - <<: *unit_tests - # node8-canary: - # docker: - # - image: webpackcontrib/circleci-node8:latest - # <<: *canary_tests - analysis: - docker: - - image: webpackcontrib/circleci-node-base:latest - steps: - - checkout - - setup_remote_docker - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: NPM Rebuild - command: npm install - - run: - name: Run linting. - command: npm run lint - - run: - name: Run NSP Security Check. - command: npm run security - # - run: - # name: Validate Commit Messages - # command: npm run ci:lint:commits - publish: - docker: - - image: webpackcontrib/circleci-node-base:latest - steps: - - checkout - - setup_remote_docker - - restore_cache: - key: dependency-cache-{{ checksum "package-lock.json" }} - - run: - name: NPM Rebuild - command: npm install - - run: - name: Validate Commit Messages - command: npm run release:validate - - run: - name: Publish to NPM - command: printf "noop running conventional-github-releaser" - -version: 2.0 -workflows: - version: 2 - validate-publish: - jobs: - - dependency_cache - - node6-latest: - requires: - - dependency_cache - filters: - tags: - only: /.*/ - - analysis: - requires: - - dependency_cache - filters: - tags: - only: /.*/ - - node8-latest: - requires: - - analysis - - node6-latest - filters: - tags: - only: /.*/ - - node9-latest: - requires: - - analysis - - node6-latest - filters: - tags: - only: /.*/ - # - node8-canary: - # requires: - # - analysis - # - node6-latest - filters: - tags: - only: /.*/ - - publish: - requires: - - node8-latest - - node9-latest - filters: - branches: - only: - - master diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..2df7184 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @gathertown/eng-prod diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..42c2be0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,92 @@ +name: CI + +on: + push: {} + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [18, 20, 22, 24] + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: Restore cache + uses: actions/cache@v4 + with: + path: node_modules + key: dependency-cache-${{ hashFiles('yarn.lock') }} + - name: Install dependencies + run: corepack enable && corepack install && yarn install --immutable + - name: Run unit tests + run: yarn run ci:coverage + # - name: Submit coverage data to codecov + # run: bash <(curl -s https://codecov.io/bash) + + analysis: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + - name: Restore cache + uses: actions/cache@v4 + with: + path: node_modules + key: dependency-cache-${{ hashFiles('yarn.lock') }} + - name: Install dependencies + run: corepack enable && corepack install && yarn install --immutable + - name: Run linting + run: yarn run lint + + # publish: + # runs-on: ubuntu-latest + # steps: + # - name: Checkout code + # uses: actions/checkout@v2 + # - name: Set up Node.js + # uses: actions/setup-node@v4 + # with: + # node-version-file: .nvmrc + # - name: Restore cache + # uses: actions/cache@v4 + # with: + # path: node_modules + # key: dependency-cache-${{ hashFiles('yarn.lock') }} + # - name: Install dependencies + # run: corepack enable && corepack install && yarn install --immutable + # - name: Validate Commit Messages + # run: yarn run release:validate + # - name: Publish to NPM + # run: printf "noop running conventional-github-releaser" + # + # validate-publish: + # needs: [dependency_cache, test, analysis] + # runs-on: ubuntu-latest + # steps: + # - name: Checkout code + # uses: actions/checkout@v2 + # - name: Set up Node.js + # uses: actions/setup-node@v4 + # with: + # node-version-file: .nvmrc + # - name: Restore cache + # uses: actions/cache@v4 + # with: + # path: node_modules + # key: dependency-cache-${{ hashFiles('yarn.lock') }} + # - name: Install dependencies + # run: corepack enable && corepack install && yarn install --immutable + # - name: Validate Commit Messages + # run: yarn run release:validate + # - name: Publish to NPM + # run: printf "noop running conventional-github-releaser" diff --git a/.gitignore b/.gitignore index e511a91..af5ac89 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ Thumbs.db # Yarn .pnp.* .yarn/install-state.gz +.yarn/plugins diff --git a/.jestrc b/.jestrc deleted file mode 100644 index 5f22ee6..0000000 --- a/.jestrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "testEnvironment": "node" -} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..ba33190 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20.19.2 diff --git a/.yarnrc.yml b/.yarnrc.yml index 00c2ce1..3c67397 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,5 +1,21 @@ defaultSemverRangePrefix: "~" enableConstraintsChecks: true +enableGlobalCache: true enableTelemetry: false nmMode: hardlinks-local nodeLinker: node-modules + +supportedArchitectures: + os: + - current + - darwin + - linux + - win32 + cpu: + - current + - x64 + - arm64 + +plugins: + - path: .yarn/plugins/@yarnpkg/plugin-engines.cjs + spec: "https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js" diff --git a/LICENSE b/LICENSE index d7c15ef..e500223 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ -Additions and modifications to `worker-loader` copyright (c) 2018 Walker Henderson +Additions and modifications to `worlet-loader` copyright (c) 2025 Gather Presence, Inc. +Based on additions and modifications to `worker-loader` copyright (c) 2018 Walker Henderson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..c381f85 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,5 @@ +const config = { + testEnvironment: "node", +}; + +module.exports = config diff --git a/package.json b/package.json index 0ee2c72..250c654 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@gathertown/worklet-loader", "version": "3.0.0", - "author": "Walker Henderson", + "author": "Gather Presence, Inc. ", "description": "worklet loader module for webpack", "repository": { "url": "git+https://github.com/gathertown/worklet-loader.git" @@ -14,20 +14,20 @@ "dist" ], "scripts": { - "start": "npm run build -- -w", + "start": "yarn run build -w", "build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js' --copy-files", "clean": "rm -rf dist", "lint": "eslint --cache src test", "lint-staged": "lint-staged", - "prebuild": "npm run clean", - "prepare": "npm run build", + "prebuild": "yarn run clean", + "prepare": "yarn run build", "release": "standard-version", "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --collectCoverageFrom='src/**/*.js' --coverage", - "ci:lint": "npm run lint && npm run security", - "ci:test": "npm run test -- --runInBand", - "ci:coverage": "npm run test:coverage -- --runInBand", + "ci:lint": "yarn run lint", + "ci:test": "yarn run test --runInBand", + "ci:coverage": "yarn run test:coverage --runInBand", "defaults": "webpack-defaults", "webpack-defaults": "webpack-defaults" }, @@ -64,7 +64,7 @@ } }, "engines": { - "node": ">= 6.9.0 || >= 8.9.0" + "node": ">=18.20.8 <25" }, "pre-commit": "lint-staged", "lint-staged": { diff --git a/yarn.lock b/yarn.lock index 8c3e81c..39b5652 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1343,6 +1343,37 @@ __metadata: languageName: node linkType: hard +"@gathertown/worklet-loader@workspace:.": + version: 0.0.0-use.local + resolution: "@gathertown/worklet-loader@workspace:." + dependencies: + "@babel/cli": "npm:^7.27.2" + "@babel/core": "npm:^7.27.1" + "@babel/preset-env": "npm:^7.27.2" + "@webpack-contrib/eslint-config-webpack": "npm:~3.0.0" + babel-jest: "npm:^29.7.0" + cross-env: "npm:^7.0.3" + eslint: "npm:^8.57.1" + eslint-config-webpack: "npm:^1.0.0" + eslint-plugin-import: "npm:^2.2.0" + jest: "npm:^29.7.0" + lint-staged: "npm:^16.0.0" + loader-utils: "npm:^2.0.4" + pre-commit: "npm:^1.0.0" + schema-utils: "npm:^4.3.2" + standard-version: "npm:^9.5.0" + webpack: "npm:^5.99.8" + peerDependencies: + "@rspack/core": 0.x || 1.x + webpack: ^5.0.0 + peerDependenciesMeta: + "@rspack/core": + optional: true + webpack: + optional: true + languageName: unknown + linkType: soft + "@humanwhocodes/config-array@npm:^0.13.0": version: 0.13.0 resolution: "@humanwhocodes/config-array@npm:0.13.0" @@ -8269,37 +8300,6 @@ __metadata: languageName: node linkType: hard -"worklet-loader@workspace:.": - version: 0.0.0-use.local - resolution: "worklet-loader@workspace:." - dependencies: - "@babel/cli": "npm:^7.27.2" - "@babel/core": "npm:^7.27.1" - "@babel/preset-env": "npm:^7.27.2" - "@webpack-contrib/eslint-config-webpack": "npm:~3.0.0" - babel-jest: "npm:^29.7.0" - cross-env: "npm:^7.0.3" - eslint: "npm:^8.57.1" - eslint-config-webpack: "npm:^1.0.0" - eslint-plugin-import: "npm:^2.2.0" - jest: "npm:^29.7.0" - lint-staged: "npm:^16.0.0" - loader-utils: "npm:^2.0.4" - pre-commit: "npm:^1.0.0" - schema-utils: "npm:^4.3.2" - standard-version: "npm:^9.5.0" - webpack: "npm:^5.99.8" - peerDependencies: - "@rspack/core": 0.x || 1.x - webpack: ^5.0.0 - peerDependenciesMeta: - "@rspack/core": - optional: true - webpack: - optional: true - languageName: unknown - linkType: soft - "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0"