From d1fb8703e0c6a454370abe139a7ad6d5f195885c Mon Sep 17 00:00:00 2001 From: Igor Kamyshev Date: Mon, 29 Jul 2024 12:18:56 +0700 Subject: [PATCH] Correct naming --- apps/website/docs/.vitepress/config.mjs | 4 ++++ apps/website/docs/contracts/index.md | 0 packages/contract/CHANGELOG.md | 1 - packages/contract/README.md | 3 --- packages/contract/src/index.ts | 1 - packages/contracts/CHANGELOG.md | 1 + packages/contracts/README.md | 3 +++ packages/{contract => contracts}/package.json | 18 +++++++++--------- .../src/contracts.test.ts} | 2 +- .../src/contract.ts => contracts/src/index.ts} | 0 .../src/interop.test.ts | 2 +- .../{contract => contracts}/src/protocol.ts | 0 packages/{contract => contracts}/tsconfig.json | 0 .../{contract => contracts}/vite.config.js | 4 ++-- tsconfig.base.json | 2 +- 15 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 apps/website/docs/contracts/index.md delete mode 100644 packages/contract/CHANGELOG.md delete mode 100644 packages/contract/README.md delete mode 100644 packages/contract/src/index.ts create mode 100644 packages/contracts/CHANGELOG.md create mode 100644 packages/contracts/README.md rename packages/{contract => contracts}/package.json (55%) rename packages/{contract/src/contract.test.ts => contracts/src/contracts.test.ts} (99%) rename packages/{contract/src/contract.ts => contracts/src/index.ts} (100%) rename packages/{contract => contracts}/src/interop.test.ts (96%) rename packages/{contract => contracts}/src/protocol.ts (100%) rename packages/{contract => contracts}/tsconfig.json (100%) rename packages/{contract => contracts}/vite.config.js (83%) diff --git a/apps/website/docs/.vitepress/config.mjs b/apps/website/docs/.vitepress/config.mjs index be997375..b3fd5101 100644 --- a/apps/website/docs/.vitepress/config.mjs +++ b/apps/website/docs/.vitepress/config.mjs @@ -48,6 +48,7 @@ export default defineConfig({ { text: 'redux', link: '/redux/' }, { text: 'web-api', link: '/web-api/' }, { text: 'factories', link: '/factories/' }, + { text: 'contracts', link: '/contracts/' }, ], }, { text: 'Magazine', link: '/magazine/' }, @@ -114,6 +115,9 @@ export default defineConfig({ { text: 'Motivation', link: '/factories/motivation' }, { text: 'Important Caveats', link: '/factories/important_caveats' }, ]), + ...createSidebar('contracts', [ + { text: 'Get Started', link: '/contracts/' }, + ]), '/magazine/': [ { text: 'Architecture', diff --git a/apps/website/docs/contracts/index.md b/apps/website/docs/contracts/index.md new file mode 100644 index 00000000..e69de29b diff --git a/packages/contract/CHANGELOG.md b/packages/contract/CHANGELOG.md deleted file mode 100644 index eb3f7643..00000000 --- a/packages/contract/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -# @withease/contract diff --git a/packages/contract/README.md b/packages/contract/README.md deleted file mode 100644 index 5a80c5e0..00000000 --- a/packages/contract/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @withease/web-api - -Read documentation [here](https://withease.effector.dev/web-api/). diff --git a/packages/contract/src/index.ts b/packages/contract/src/index.ts deleted file mode 100644 index 9d2b01fd..00000000 --- a/packages/contract/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { type UnContract, bool, str, num, rec, arr, val, or } from './contract'; diff --git a/packages/contracts/CHANGELOG.md b/packages/contracts/CHANGELOG.md new file mode 100644 index 00000000..724991ef --- /dev/null +++ b/packages/contracts/CHANGELOG.md @@ -0,0 +1 @@ +# @withease/contracts diff --git a/packages/contracts/README.md b/packages/contracts/README.md new file mode 100644 index 00000000..8bc8be06 --- /dev/null +++ b/packages/contracts/README.md @@ -0,0 +1,3 @@ +# @withease/contracts + +Read documentation [here](https://withease.effector.dev/contracts/). diff --git a/packages/contract/package.json b/packages/contracts/package.json similarity index 55% rename from packages/contract/package.json rename to packages/contracts/package.json index 03beb00a..8e2f3f1e 100644 --- a/packages/contract/package.json +++ b/packages/contracts/package.json @@ -1,5 +1,5 @@ { - "name": "@withease/contract", + "name": "@withease/contracts", "version": "0.0.1", "license": "MIT", "scripts": { @@ -13,24 +13,24 @@ "files": [ "dist" ], - "main": "./dist/contract.cjs", - "module": "./dist/contract.js", - "types": "./dist/contract.d.ts", + "main": "./dist/contracts.cjs", + "module": "./dist/contracts.js", + "types": "./dist/contracts.d.ts", "exports": { ".": { "import": { - "types": "./dist/contract.d.ts", - "default": "./dist/contract.js" + "types": "./dist/contracts.d.ts", + "default": "./dist/contracts.js" }, "require": { - "types": "./dist/contract.d.cts", - "default": "./dist/contract.cjs" + "types": "./dist/contracts.d.cts", + "default": "./dist/contracts.cjs" } } }, "size-limit": [ { - "path": "./dist/contract.js", + "path": "./dist/contracts.js", "limit": "603 B" } ] diff --git a/packages/contract/src/contract.test.ts b/packages/contracts/src/contracts.test.ts similarity index 99% rename from packages/contract/src/contract.test.ts rename to packages/contracts/src/contracts.test.ts index fab9a275..2af9e433 100644 --- a/packages/contract/src/contract.test.ts +++ b/packages/contracts/src/contracts.test.ts @@ -1,6 +1,6 @@ import { describe, it, test, expect } from 'vitest'; -import { bool, num, str, rec, or, val, arr } from './contract'; +import { bool, num, str, rec, or, val, arr } from './contracts'; describe('bool', () => { it('valid', () => { diff --git a/packages/contract/src/contract.ts b/packages/contracts/src/index.ts similarity index 100% rename from packages/contract/src/contract.ts rename to packages/contracts/src/index.ts diff --git a/packages/contract/src/interop.test.ts b/packages/contracts/src/interop.test.ts similarity index 96% rename from packages/contract/src/interop.test.ts rename to packages/contracts/src/interop.test.ts index b59c8a0d..958fc2e7 100644 --- a/packages/contract/src/interop.test.ts +++ b/packages/contracts/src/interop.test.ts @@ -5,7 +5,7 @@ import { object, string } from 'superstruct'; import { runtypeContract } from '@farfetched/runtypes'; import { superstructContract } from '@farfetched/superstruct'; -import { rec, arr } from './contract'; +import { rec, arr } from './contracts'; describe('runtypes', () => { it('supports Runtype inside', () => { diff --git a/packages/contract/src/protocol.ts b/packages/contracts/src/protocol.ts similarity index 100% rename from packages/contract/src/protocol.ts rename to packages/contracts/src/protocol.ts diff --git a/packages/contract/tsconfig.json b/packages/contracts/tsconfig.json similarity index 100% rename from packages/contract/tsconfig.json rename to packages/contracts/tsconfig.json diff --git a/packages/contract/vite.config.js b/packages/contracts/vite.config.js similarity index 83% rename from packages/contract/vite.config.js rename to packages/contracts/vite.config.js index b44ff98a..b5117dbb 100644 --- a/packages/contract/vite.config.js +++ b/packages/contracts/vite.config.js @@ -11,8 +11,8 @@ export default { build: { lib: { entry: 'src/index.ts', - name: '@withease/contract', - fileName: 'contract', + name: '@withease/contracts', + fileName: 'contracts', formats: ['es', 'cjs'], }, }, diff --git a/tsconfig.base.json b/tsconfig.base.json index fd233ce0..aefd3c0d 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -17,7 +17,7 @@ "@withease/i18next": ["packages/i18next/src/index.ts"], "@withease/redux": ["packages/redux/src/index.ts"], "@withease/web-api": ["packages/web-api/src/index.ts"], - "@withease/contract": ["packages/contract/src/index.ts"] + "@withease/contracts": ["packages/contracts/src/index.ts"] } }, "exclude": ["node_modules"]