diff --git a/.eslintrc.js b/.eslintrc.js index 46722ae2da..92f30898c7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { root: true, // This tells ESLint to load the config from the package `eslint-config-custom` - extends: ["custom"], + extends: ["@webstudio-is/eslint-config-custom"], }; diff --git a/.github/actions/publish/action.yaml b/.github/actions/publish/action.yaml new file mode 100644 index 0000000000..24a129d324 --- /dev/null +++ b/.github/actions/publish/action.yaml @@ -0,0 +1,28 @@ +name: 'Release NPM package' +description: 'Release NPM package' +inputs: + package: + description: 'Package.json location (relative)' + default: 'package.json' + required: true + token: + description: 'NPM Token' + default: 'null' + required: true +runs: + using: "composite" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install Dependencies + run: yarn install + shell: bash + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ inputs.token }} + dry-run: false + check-version: true + access: 'public' + package: ${{ inputs.package }} \ No newline at end of file diff --git a/.github/workflows/design-system.yml b/.github/workflows/design-system.yml new file mode 100644 index 0000000000..109456bc75 --- /dev/null +++ b/.github/workflows/design-system.yml @@ -0,0 +1,16 @@ +name: Design System Publish +on: + push: + paths: + - "packages/design-system/**/*" + - ".github/workflows/design-system.yml" + - ".github/actions/publish/action.yaml" +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/publish + with: + package: "./packages/design-system/package.json" + token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/eslint-config-custom.yml b/.github/workflows/eslint-config-custom.yml new file mode 100644 index 0000000000..3effb53420 --- /dev/null +++ b/.github/workflows/eslint-config-custom.yml @@ -0,0 +1,16 @@ +name: Eslint Config Publish +on: + push: + paths: + - "packages/eslint-config-custom/**/*" + - ".github/workflows/eslint-config-custom.yml" + - ".github/actions/publish/action.yaml" +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/publish + with: + package: "./packages/eslint-config-custom/package.json" + token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/icons.yml b/.github/workflows/icons.yml new file mode 100644 index 0000000000..3deb808f0b --- /dev/null +++ b/.github/workflows/icons.yml @@ -0,0 +1,16 @@ +name: Icons Publish +on: + push: + paths: + - "packages/icons/**/*" + - ".github/workflows/icons-publish.yml" + - ".github/actions/publish/action.yaml" +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/publish + with: + package: "./packages/icons/package.json" + token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/jest-config.yml b/.github/workflows/jest-config.yml new file mode 100644 index 0000000000..2d5a1079cb --- /dev/null +++ b/.github/workflows/jest-config.yml @@ -0,0 +1,16 @@ +name: Jest Config Publish +on: + push: + paths: + - "packages/jest-config/**/*" + - ".github/workflows/jest-config.yml" + - ".github/actions/publish/action.yaml" +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/publish + with: + package: "./packages/jest-config/package.json" + token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/react-sdk-publish.yml b/.github/workflows/react-sdk-publish.yml deleted file mode 100644 index ff7d173cff..0000000000 --- a/.github/workflows/react-sdk-publish.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: SDK publish -on: - push: - paths: - - 'packages/react-sdk/**/*' - - '.github/workflows/react-sdk-publish.yml' -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Install Dependencies - run: yarn install - - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.NPM_TOKEN }} - dry-run: false - check-version: true - package: './packages/react-sdk/package.json' \ No newline at end of file diff --git a/.github/workflows/react-sdk.yml b/.github/workflows/react-sdk.yml new file mode 100644 index 0000000000..9a122a632b --- /dev/null +++ b/.github/workflows/react-sdk.yml @@ -0,0 +1,16 @@ +name: SDK publish +on: + push: + paths: + - "packages/react-sdk/**/*" + - ".github/workflows/react-sdk.yml" + - ".github/actions/publish/action.yaml" +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/publish + with: + package: "./packages/react-sdk/package.json" + token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/tsconfig.yml b/.github/workflows/tsconfig.yml new file mode 100644 index 0000000000..f9b6ed774e --- /dev/null +++ b/.github/workflows/tsconfig.yml @@ -0,0 +1,16 @@ +name: Tsconfig Publish +on: + push: + paths: + - "packages/tsconfig/**/*" + - ".github/workflows/tsconfig.yml" + - ".github/actions/publish/action.yaml" +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/publish + with: + package: "./packages/tsconfig/package.json" + token: ${{ secrets.NPM_TOKEN }} diff --git a/apps/designer/package.json b/apps/designer/package.json index 8d8b1720d3..d723f6bcd9 100644 --- a/apps/designer/package.json +++ b/apps/designer/package.json @@ -102,12 +102,12 @@ "esbuild-jest": "^0.5.0", "esbuild-node-externals": "^1.4.1", "esbuild-node-loader": "^0.8.0", - "eslint-config-custom": "*", "jest": "^27.5.1", "prettier": "^2.6.2", "react-test-renderer": "^17.0.2", "relative-deps": "^1.0.7", - "tsconfig": "*", + "@webstudio-is/eslint-config-custom": "*", + "@webstudio-is/tsconfig": "*", "typescript": "4.6.4" }, "sideEffects": false, diff --git a/apps/designer/tsconfig.json b/apps/designer/tsconfig.json index fbf716785d..4ce92c95f5 100644 --- a/apps/designer/tsconfig.json +++ b/apps/designer/tsconfig.json @@ -1,6 +1,5 @@ { - // Extends can't use node's resolution rn https://github.com/dividab/tsconfig-paths/issues/209#issuecomment-1177261091 - "extends": "../../node_modules/tsconfig/remix.json", + "extends": "../../node_modules/@webstudio-is/tsconfig/remix.json", "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"], "compilerOptions": { "paths": { diff --git a/package.json b/package.json index 504f3f4a01..cbcd14529f 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "storybook": "turbo run storybook:run" }, "devDependencies": { - "eslint-config-custom": "*", + "@webstudio-is/eslint-config-custom": "*", "husky": ">=6", "lint-staged": "^13.0.2", "prettier": "latest", diff --git a/packages/asset-uploader/jest.config.js b/packages/asset-uploader/jest.config.js index 03c0db11ea..9eae0843c6 100644 --- a/packages/asset-uploader/jest.config.js +++ b/packages/asset-uploader/jest.config.js @@ -1,5 +1,5 @@ // eslint-disable-next-line -const base = require("jest-config/jest.config.js"); +const base = require("@webstudio-is/jest-config"); module.exports = { ...base, diff --git a/packages/asset-uploader/package.json b/packages/asset-uploader/package.json index 97d13c136b..875be06eba 100644 --- a/packages/asset-uploader/package.json +++ b/packages/asset-uploader/package.json @@ -23,7 +23,7 @@ "@types/app-root-path": "^1.2.4", "@types/node": "^17.0.21", "@types/sharp": "^0.30.4", - "jest-config": "*", + "@webstudio-is/jest-config": "*", "tsup": "^6.1.3", "typescript": "^4.6.2", "zod": "^3.17.3" diff --git a/packages/asset-uploader/tsconfig.json b/packages/asset-uploader/tsconfig.json index fe21c2ae7b..654f479a30 100644 --- a/packages/asset-uploader/tsconfig.json +++ b/packages/asset-uploader/tsconfig.json @@ -1,6 +1,6 @@ // Extends can't use node's resolution rn https://github.com/dividab/tsconfig-paths/issues/209#issuecomment-1177261091 { - "extends": "../../node_modules/tsconfig/base.json", + "extends": "../../node_modules/@webstudio-is/tsconfig/base.json", "include": ["./src/**/*.ts"], "compilerOptions": { "module": "commonjs", diff --git a/packages/design-system/tsconfig.json b/packages/design-system/tsconfig.json index 329cf3ea13..e599e806b6 100644 --- a/packages/design-system/tsconfig.json +++ b/packages/design-system/tsconfig.json @@ -1,6 +1,6 @@ // Extends can't use node's resolution rn https://github.com/dividab/tsconfig-paths/issues/209#issuecomment-1177261091 { - "extends": "../../node_modules/tsconfig/base.json", + "extends": "../../node_modules/@webstudio-is/tsconfig/base.json", "include": ["./src/**/*.ts", "./src/**/*.tsx"], "compilerOptions": { "lib": ["DOM", "DOM.Iterable", "ES2019"], diff --git a/packages/eslint-config-custom/package.json b/packages/eslint-config-custom/package.json index 158b766152..30efd8e4c4 100644 --- a/packages/eslint-config-custom/package.json +++ b/packages/eslint-config-custom/package.json @@ -1,6 +1,6 @@ { - "name": "eslint-config-custom", - "version": "0.0.0", + "name": "@webstudio-is/eslint-config-custom", + "version": "1.0.0", "main": "index.js", "license": "MIT", "dependencies": { diff --git a/packages/icons/package.json b/packages/icons/package.json index b764e507ef..69a6fb16c7 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -1,7 +1,7 @@ { "name": "@webstudio-is/icons", - "version": "0.5.0", - "description": "Webstudio JavaScript / TypeScript API", + "version": "0.1.0", + "description": "Webstudio Icons", "author": "Webstudio ", "homepage": "https://webstudio.is", "scripts": { diff --git a/packages/icons/tsconfig.json b/packages/icons/tsconfig.json index 329cf3ea13..e599e806b6 100644 --- a/packages/icons/tsconfig.json +++ b/packages/icons/tsconfig.json @@ -1,6 +1,6 @@ // Extends can't use node's resolution rn https://github.com/dividab/tsconfig-paths/issues/209#issuecomment-1177261091 { - "extends": "../../node_modules/tsconfig/base.json", + "extends": "../../node_modules/@webstudio-is/tsconfig/base.json", "include": ["./src/**/*.ts", "./src/**/*.tsx"], "compilerOptions": { "lib": ["DOM", "DOM.Iterable", "ES2019"], diff --git a/packages/jest-config/jest.config.js b/packages/jest-config/index.js similarity index 100% rename from packages/jest-config/jest.config.js rename to packages/jest-config/index.js diff --git a/packages/jest-config/package.json b/packages/jest-config/package.json index ef615bcf82..001d6d9a39 100644 --- a/packages/jest-config/package.json +++ b/packages/jest-config/package.json @@ -1,6 +1,6 @@ { - "name": "jest-config", - "version": "0.0.0", + "name": "@webstudio-is/jest-config", + "version": "1.0.1", "license": "MIT", "dependencies": { "@types/jest": "^27.4.1", diff --git a/packages/prisma-client/tsconfig.json b/packages/prisma-client/tsconfig.json index e895781976..ff828da22f 100644 --- a/packages/prisma-client/tsconfig.json +++ b/packages/prisma-client/tsconfig.json @@ -1,6 +1,6 @@ // Extends can't use node's resolution rn https://github.com/dividab/tsconfig-paths/issues/209#issuecomment-1177261091 { - "extends": "../../node_modules/tsconfig/base.json", + "extends": "../../node_modules/@webstudio-is/tsconfig/base.json", "include": ["./src/**/*.ts"], "compilerOptions": { "module": "commonjs", diff --git a/packages/react-sdk/jest.config.js b/packages/react-sdk/jest.config.js index 03c0db11ea..9eae0843c6 100644 --- a/packages/react-sdk/jest.config.js +++ b/packages/react-sdk/jest.config.js @@ -1,5 +1,5 @@ // eslint-disable-next-line -const base = require("jest-config/jest.config.js"); +const base = require("@webstudio-is/jest-config"); module.exports = { ...base, diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json index 3b6256d555..5bf5020e21 100644 --- a/packages/react-sdk/package.json +++ b/packages/react-sdk/package.json @@ -33,18 +33,18 @@ "@types/css-tree": "^1.0.7", "@types/fs-extra": "^9.0.13", "@types/node": "^17.0.21", - "@webstudio-is/prisma-client": "*", "babel-loader": "^8.2.5", "camelcase": "^6.3.0", "css-tree": "^2.1.0", "esbuild": "^0.14.25", "esbuild-node-externals": "^1.4.1", "esbuild-node-loader": "^0.8.0", - "jest-config": "*", + "@webstudio-is/jest-config": "*", "mdn-data": "2.0.23", "react": "^17.0.2", "react-docgen-typescript": "^2.2.2", "react-dom": "^17.0.2", + "@webstudio-is/prisma-client": "*", "tsup": "^6.1.3", "typescript": "^4.6.2" }, @@ -59,9 +59,9 @@ "@stitches/core": "^1.2.7", "@webstudio-is/icons": "*", "immer": "^9.0.12", - "jest-config": "*", "mitt": "^3.0.0", "react-nano-state": "^0.4.0", + "@webstudio-is/jest-config": "*", "zod": "^3.17.3" }, "main": "lib/index.js", diff --git a/packages/react-sdk/tsconfig.json b/packages/react-sdk/tsconfig.json index 329cf3ea13..e599e806b6 100644 --- a/packages/react-sdk/tsconfig.json +++ b/packages/react-sdk/tsconfig.json @@ -1,6 +1,6 @@ // Extends can't use node's resolution rn https://github.com/dividab/tsconfig-paths/issues/209#issuecomment-1177261091 { - "extends": "../../node_modules/tsconfig/base.json", + "extends": "../../node_modules/@webstudio-is/tsconfig/base.json", "include": ["./src/**/*.ts", "./src/**/*.tsx"], "compilerOptions": { "lib": ["DOM", "DOM.Iterable", "ES2019"], diff --git a/packages/tsconfig/package.json b/packages/tsconfig/package.json index a32fc41922..56f2bd444d 100644 --- a/packages/tsconfig/package.json +++ b/packages/tsconfig/package.json @@ -1,7 +1,7 @@ { - "name": "tsconfig", - "version": "0.0.0", - "private": true, + "name": "@webstudio-is/tsconfig", + "version": "1.0.0", + "private": false, "main": "index.js", "files": [ "base.json",