diff --git a/.github/workflows/ci_build.yaml b/.github/workflows/ci_build.yaml new file mode 100644 index 0000000..39dd78f --- /dev/null +++ b/.github/workflows/ci_build.yaml @@ -0,0 +1,66 @@ +# +# Copyright 2021-Present The Serverless Workflow Specification Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: "CI :: Build" + +on: + push: + branches: [main] + pull_request: + branches: ["**"] + types: [opened, reopened, ready_for_review, synchronize] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.event.pull_request && format('ci-build-full-pr-{0}', github.event.pull_request.number) || format('ci-build-full-push-main-{0}', github.ref) }} + cancel-in-progress: true + +jobs: + build-and-test: + timeout-minutes: 30 + if: github.event_name != 'pull_request' || github.event.pull_request.draft == false + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: 24 + + - name: Setup pnpm + uses: pnpm/action-setup@v5 + with: + version: 10.31.0 + cache: true + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Check for dependency mismatches + run: pnpm dependencies:check + + - name: Build and test + run: pnpm build:prod diff --git a/.syncpackrc.json b/.syncpackrc.json new file mode 100644 index 0000000..8633361 --- /dev/null +++ b/.syncpackrc.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://unpkg.com/syncpack@14.2.0/dist/schema.json", + "versionGroups": [ + { + "label": "Use workspace protocol for local packages", + "dependencies": ["$LOCAL"], + "dependencyTypes": ["prod", "dev"], + "pinVersion": "workspace:*" + }, + { + "label": "Peer deps must be consistent across packages", + "dependencyTypes": ["peer"], + "policy": "sameRange" + } + ] +} diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 3199425..0000000 --- a/package-lock.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "serverless-workflow-editor", - "version": "0.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "serverless-workflow-editor", - "version": "0.0.0", - "license": "Apache-2.0", - "devDependencies": { - "husky": "^9.1.7" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/husky": { - "version": "9.1.7", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", - "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", - "dev": true, - "license": "MIT", - "bin": { - "husky": "bin.js" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/typicode" - } - } - } -} diff --git a/package.json b/package.json index 7018d56..09c05a2 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,17 @@ "url": "https://github.com/serverlessworkflow/editor.git" }, "scripts": { + "dependencies:check": "syncpack lint", + "dependencies:fix": "syncpack fix", + "build:prod": "pnpm -r --stream --if-present build:prod", + "build:dev": "pnpm -r --stream --if-present build:dev", "prepare": "husky" }, "devDependencies": { - "husky": "^9.1.7" + "husky": "^9.1.7", + "syncpack": "^14.2.0" }, "engines": { - "node": ">=20" + "node": ">=24" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..c839afe --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,107 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + husky: + specifier: ^9.1.7 + version: 9.1.7 + syncpack: + specifier: ^14.2.0 + version: 14.2.0 + +packages: + + husky@9.1.7: + resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} + engines: {node: '>=18'} + hasBin: true + + syncpack-darwin-arm64@14.2.0: + resolution: {integrity: sha512-+oOucezHzqvUfdRowva3KS4d08H2QSxiPAGrSS3j3zrJJSoscelM5j6fbtXiv9lghNxwAJVPdgXdBO5xGGKA+A==} + cpu: [arm64] + os: [darwin] + + syncpack-darwin-x64@14.2.0: + resolution: {integrity: sha512-l+kR78DeuLWPyHNJvs/Q8W8OgF4PGGqTtYbmCTDoim4v46J8C+moDBsd+7OmHsLC6lMxOetvGz3EYgNpyFGIIg==} + cpu: [x64] + os: [darwin] + + syncpack-linux-arm64-musl@14.2.0: + resolution: {integrity: sha512-xfoTKDl8QoQiHdg393ua50SdayWq/kyrolEylXcoz0FI0mxc76UYmBUKrr/u6XzNRXfb0cgR8s7LrOjwHyHgVA==} + cpu: [arm64] + os: [linux] + + syncpack-linux-arm64@14.2.0: + resolution: {integrity: sha512-SCR+HT8SHU3vvjSWZi8ViSZjGZv2PaI1ak/EqQsH/oz7h6UzR8DITmOUEy+O++r6Ka8zrxloV9FL1HzuZnxFYQ==} + cpu: [arm64] + os: [linux] + + syncpack-linux-x64-musl@14.2.0: + resolution: {integrity: sha512-mC+XuYZ7o4A73Npr3xQ2gByOhKkSEFIDR9tMZ3RP1ShVEosnLYllqHIyRjShPPN777pKMAiDKl3frvAmvOGTbw==} + cpu: [x64] + os: [linux] + + syncpack-linux-x64@14.2.0: + resolution: {integrity: sha512-8GG7OogvlILG+kFcQwS1tGTimK5feqFlxbeh96xNfNsUgX+SDHMyut6UsA4ca16QLl8ru6iqJmBZYur6EISQRg==} + cpu: [x64] + os: [linux] + + syncpack-windows-arm64@14.2.0: + resolution: {integrity: sha512-BsN0jZ7wlVi79SA37H5ynXYlwgpIQzQjEMO6e6ra80V/X5myC4Js4MiudHavtsrCxtuoUq7bDY86rRzyKRoD1g==} + cpu: [arm64] + os: [win32] + + syncpack-windows-x64@14.2.0: + resolution: {integrity: sha512-swrwXueQ438vyB1uJWt3mfho0jUiDT6wJDl3fKfk3BwLPsAARidNnHo4V+uweJ/89aQSGuNN0Xp41klU2N9/jg==} + cpu: [x64] + os: [win32] + + syncpack@14.2.0: + resolution: {integrity: sha512-ZQFEYD6Tq5lwbFkeDM+8ZhNxQlZ6MZcc1TM0KjwI3DpDAm8dWJE5FPlXPGAKtPNvX66MJVueTZPtYwAvBrSQWQ==} + engines: {node: '>=14.17.0'} + hasBin: true + +snapshots: + + husky@9.1.7: {} + + syncpack-darwin-arm64@14.2.0: + optional: true + + syncpack-darwin-x64@14.2.0: + optional: true + + syncpack-linux-arm64-musl@14.2.0: + optional: true + + syncpack-linux-arm64@14.2.0: + optional: true + + syncpack-linux-x64-musl@14.2.0: + optional: true + + syncpack-linux-x64@14.2.0: + optional: true + + syncpack-windows-arm64@14.2.0: + optional: true + + syncpack-windows-x64@14.2.0: + optional: true + + syncpack@14.2.0: + optionalDependencies: + syncpack-darwin-arm64: 14.2.0 + syncpack-darwin-x64: 14.2.0 + syncpack-linux-arm64: 14.2.0 + syncpack-linux-arm64-musl: 14.2.0 + syncpack-linux-x64: 14.2.0 + syncpack-linux-x64-musl: 14.2.0 + syncpack-windows-arm64: 14.2.0 + syncpack-windows-x64: 14.2.0