From 2294063323ed258ded3e30f53ad863b162fd681c Mon Sep 17 00:00:00 2001 From: lucasfelixc Date: Wed, 30 Sep 2026 17:37:07 -0300 Subject: [PATCH] chore: implement npm publishing --- .changeset/config.json | 8 +++-- .github/workflows/publish.yml | 14 +++++---- .npmrc | 1 - packages/adapters/react/LICENSE | 21 +++++++++++++ packages/adapters/react/package.json | 42 +++++++++++++++++++++----- packages/core/LICENSE | 21 +++++++++++++ packages/core/package.json | 45 ++++++++++++++++++++++------ packages/svg/LICENSE | 21 +++++++++++++ packages/svg/package.json | 44 +++++++++++++++++++++------ 9 files changed, 182 insertions(+), 35 deletions(-) delete mode 100644 .npmrc create mode 100644 packages/adapters/react/LICENSE create mode 100644 packages/core/LICENSE create mode 100644 packages/svg/LICENSE diff --git a/.changeset/config.json b/.changeset/config.json index 5c58ec9..2bdde5a 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -4,8 +4,12 @@ "commit": false, "fixed": [], "linked": [], - "access": "restricted", + "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": [], + "privatePackages": { "version": false, "tag": false }, + "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { + "onlyUpdatePeerDependentsWhenOutOfRange": true + } } diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d7ecc75..5f9decb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,13 +5,15 @@ on: branches: - main +concurrency: ${{ github.workflow }}-${{ github.ref }} + jobs: release: runs-on: ubuntu-latest permissions: contents: write pull-requests: write - packages: write + id-token: write steps: - uses: actions/checkout@v4 with: @@ -23,8 +25,9 @@ jobs: with: node-version: 22 cache: pnpm - registry-url: https://npm.pkg.github.com - scope: '@spatialkit' + registry-url: https://registry.npmjs.org + + - run: npm install -g npm@latest - run: pnpm install --frozen-lockfile @@ -34,8 +37,7 @@ jobs: with: publish: pnpm changeset publish version: pnpm changeset version - commit: "chore: version packages" - title: "chore: version packages" + commit: 'chore: version packages' + title: 'chore: version packages' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 3e4c91a..0000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -@spatialkit:registry=https://npm.pkg.github.com diff --git a/packages/adapters/react/LICENSE b/packages/adapters/react/LICENSE new file mode 100644 index 0000000..0bd224f --- /dev/null +++ b/packages/adapters/react/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 spatialkit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/adapters/react/package.json b/packages/adapters/react/package.json index 6c39904..7c6fdd8 100644 --- a/packages/adapters/react/package.json +++ b/packages/adapters/react/package.json @@ -1,8 +1,29 @@ { "name": "@spatialkit/react", "version": "0.1.0", + "description": "React adapter for @spatialkit/core: SpatialCanvas component and hooks for interactive 2D editors.", + "keywords": [ + "2d", + "editor", + "floor-plan", + "react", + "react-hooks", + "svg", + "pan-zoom", + "typescript" + ], + "license": "MIT", + "author": "Lucas Felix", + "homepage": "https://github.com/spatialkit/spatial/tree/main/packages/adapters/react#readme", + "bugs": "https://github.com/spatialkit/spatial/issues", + "repository": { + "type": "git", + "url": "git+https://github.com/spatialkit/spatial.git", + "directory": "packages/adapters/react" + }, "private": false, "type": "module", + "sideEffects": false, "main": "dist/index.cjs", "module": "dist/index.js", "types": "dist/index.d.ts", @@ -11,14 +32,16 @@ ], "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" - } - }, - "repository": { - "type": "git", - "url": "https://github.com/spatialkit/spatial.git" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" }, "scripts": { "build": "tsup src/index.ts --dts --format esm,cjs --clean", @@ -38,5 +61,8 @@ "peerDependencies": { "@spatialkit/core": "0.x", "react": "^18.0.0" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/core/LICENSE b/packages/core/LICENSE new file mode 100644 index 0000000..0bd224f --- /dev/null +++ b/packages/core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 spatialkit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/core/package.json b/packages/core/package.json index f7e695d..4f18a72 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,8 +1,30 @@ { "name": "@spatialkit/core", "version": "0.1.0", + "description": "Framework-agnostic scene engine for interactive 2D editors: entities, viewport, events, hit testing and selection.", + "keywords": [ + "2d", + "editor", + "floor-plan", + "scene-graph", + "viewport", + "pan-zoom", + "hit-testing", + "selection", + "typescript" + ], + "license": "MIT", + "author": "Lucas Felix", + "homepage": "https://github.com/spatialkit/spatial/tree/main/packages/core#readme", + "bugs": "https://github.com/spatialkit/spatial/issues", + "repository": { + "type": "git", + "url": "git+https://github.com/spatialkit/spatial.git", + "directory": "packages/core" + }, "private": false, "type": "module", + "sideEffects": false, "main": "dist/index.cjs", "module": "dist/index.js", "types": "dist/index.d.ts", @@ -11,14 +33,16 @@ ], "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" - } - }, - "repository": { - "type": "git", - "url": "https://github.com/spatialkit/spatial.git" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" }, "scripts": { "test": "vitest run", @@ -28,5 +52,8 @@ }, "devDependencies": { "vitest": "^2.0.0" + }, + "publishConfig": { + "access": "public" } -} \ No newline at end of file +} diff --git a/packages/svg/LICENSE b/packages/svg/LICENSE new file mode 100644 index 0000000..0bd224f --- /dev/null +++ b/packages/svg/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 spatialkit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/svg/package.json b/packages/svg/package.json index aac8951..c0e5e41 100644 --- a/packages/svg/package.json +++ b/packages/svg/package.json @@ -1,8 +1,29 @@ { "name": "@spatialkit/svg", "version": "0.1.0", + "description": "SVG renderer and pointer handlers for @spatialkit/core: pan, zoom, pinch, selection, drag, resize and grid.", + "keywords": [ + "2d", + "editor", + "floor-plan", + "svg", + "renderer", + "pan-zoom", + "pinch-zoom", + "typescript" + ], + "license": "MIT", + "author": "Lucas Felix", + "homepage": "https://github.com/spatialkit/spatial/tree/main/packages/svg#readme", + "bugs": "https://github.com/spatialkit/spatial/issues", + "repository": { + "type": "git", + "url": "git+https://github.com/spatialkit/spatial.git", + "directory": "packages/svg" + }, "private": false, "type": "module", + "sideEffects": false, "main": "dist/index.cjs", "module": "dist/index.js", "types": "dist/index.d.ts", @@ -11,14 +32,16 @@ ], "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" - } - }, - "repository": { - "type": "git", - "url": "https://github.com/spatialkit/spatial.git" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" }, "scripts": { "build": "tsup src/index.ts --dts --format esm,cjs --clean", @@ -32,5 +55,8 @@ }, "peerDependencies": { "@spatialkit/core": "0.x" + }, + "publishConfig": { + "access": "public" } -} \ No newline at end of file +}