diff --git a/empty-object.js b/empty-object.js index f053ebf7..cb0ff5c3 100644 --- a/empty-object.js +++ b/empty-object.js @@ -1 +1 @@ -module.exports = {}; +export {}; diff --git a/esbuild.config.js b/esbuild.config.js index cd12b9c3..30a4bd09 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -1,14 +1,15 @@ // @ts-check +import { fileURLToPath } from 'node:url'; +import { builtinModules as nativeNodeApis } from 'node:module'; + // Used as a polyfill for node apis when they aren't available. // The key is the node api name and the value is the stand-in object. -const emptyModulePath = require.resolve(`./empty-object.js`); -const utilModulePath = require.resolve(`./micro-util-nofill.js`); +const emptyModulePath = fileURLToPath(import.meta.resolve(`./empty-object.js`)); +const utilModulePath = fileURLToPath(import.meta.resolve(`./micro-util-nofill.js`)); // get all native node apis - -const nativeNodeApis = require('module').builtinModules; - +/** @type {Record} */ const alias = {}; for (const nodeApi of nativeNodeApis) { if (nodeApi === 'util') { @@ -21,8 +22,7 @@ for (const nodeApi of nativeNodeApis) { } /** @type {import('esbuild').BuildOptions} */ -module.exports = { - plugins: [], +export default { alias, loader: { '.jpg': 'file', diff --git a/package-lock.json b/package-lock.json index ef9ff716..0f4648ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,17 +16,17 @@ "@file-services/path": "^9.4.1", "@file-services/resolve": "^9.4.1", "@playwright/browser-chromium": "^1.49.1", - "@types/chai": "^4.3.20", - "@types/chai-as-promised": "^7.1.8", + "@types/chai": "^5.0.1", + "@types/chai-as-promised": "^8.0.1", "@types/mocha": "^10.0.10", "@types/node": "22", "@types/react": "^18.3.13", "@types/react-dom": "^18.3.1", "@types/sinon": "^17.0.3", "@wixc3/create-disposables": "^2.2.0", - "@wixc3/testing": "^17.1.1", - "chai": "^4.5.0", - "chai-as-promised": "^7.1.2", + "@wixc3/testing": "^18.0.0", + "chai": "^5.1.2", + "chai-as-promised": "^8.0.1", "esbuild": "^0.24.2", "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", @@ -1012,16 +1012,6 @@ "type-detect": "4.0.8" } }, - "node_modules/@sinonjs/commons/node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/@sinonjs/fake-timers": { "version": "13.0.5", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", @@ -1044,6 +1034,16 @@ "type-detect": "^4.1.0" } }, + "node_modules/@sinonjs/samsam/node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/@sinonjs/text-encoding": { "version": "0.7.3", "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", @@ -1052,16 +1052,19 @@ "license": "(Unlicense OR Apache-2.0)" }, "node_modules/@types/chai": { - "version": "4.3.20", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", - "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.0.1.tgz", + "integrity": "sha512-5T8ajsg3M/FOncpLYW7sdOcD6yf4+722sze/tc4KQV0P8Z2rAr3SAuHCIkYmYpt8VbcQlnz8SxlOlPQYefe4cA==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*" + } }, "node_modules/@types/chai-as-promised": { - "version": "7.1.8", - "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.8.tgz", - "integrity": "sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-8.0.1.tgz", + "integrity": "sha512-dAlDhLjJlABwAVYObo9TPWYTRg9NaQM5CXeaeJYcYAkvzUf0JRLIiog88ao2Wqy/20WUnhbbUZcgvngEbJ3YXQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1074,6 +1077,13 @@ "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", "license": "MIT" }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -1392,9 +1402,9 @@ "link": true }, "node_modules/@wixc3/common": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/@wixc3/common/-/common-17.1.1.tgz", - "integrity": "sha512-IB448WzOJTl7Sehck105dm6c1+CJK5A/zdhu6fnUCUADNgWH3kEU03x+WpHy2QnWzkS77iR2T7ZZJVF4kiKUHQ==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@wixc3/common/-/common-18.0.0.tgz", + "integrity": "sha512-vvNWAy9Y4gh97XDUj10ApLc/fKBB9kFF7utPXzt6U31ZuK2oU0ObGepRaC6SMbC/xQ9lc/GIJKvPtQ4XKWuC8Q==", "dev": true, "license": "MIT", "dependencies": { @@ -1413,13 +1423,13 @@ "link": true }, "node_modules/@wixc3/patterns": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/@wixc3/patterns/-/patterns-17.1.1.tgz", - "integrity": "sha512-1DngjWnvu2jIlE2K+ZWLw3bVARVunsHHQu6xRolaI63naDCPNS+W6qvkLHVi8A61AiSFJPL3YX7jtlLkrqgFRw==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@wixc3/patterns/-/patterns-18.0.0.tgz", + "integrity": "sha512-ovOZ8DPpT3EYPDcHtdR4ks0V9pVbzEfPx2AAjrNiOS9uMHU04K0dslGxe8d2bYdlYwtwMuwqO2FNIQfchlaE0Q==", "dev": true, "license": "MIT", "dependencies": { - "@wixc3/common": "^17.1.1", + "@wixc3/common": "^18.0.0", "promise-assist": "^2.0.1" } }, @@ -1428,18 +1438,19 @@ "link": true }, "node_modules/@wixc3/testing": { - "version": "17.1.1", - "resolved": "https://registry.npmjs.org/@wixc3/testing/-/testing-17.1.1.tgz", - "integrity": "sha512-erufJQvLI+rgDZTNO6JYJdK9mZp0n2durBDKZBWqpEBA5Pw+oVeT9ZiEsNIybmcl0llT0LTz8h2TuiiR6LPMSg==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@wixc3/testing/-/testing-18.0.0.tgz", + "integrity": "sha512-LdDsBqvgE9bsJCT+Gc/LCaKOOVNt3savm94KjVIY2tQ9+mfNzCUfTY3OGBOa59q4FOQK4J3e4+1SGjfdalGdkQ==", "dev": true, "license": "MIT", "dependencies": { - "@wixc3/common": "^17.1.1", - "@wixc3/patterns": "^17.1.1", - "chai": "^4.4.1", + "@wixc3/common": "^18.0.0", + "@wixc3/patterns": "^18.0.0", + "chai": "^5.1.2", "create-temp-directory": "^2.4.0", - "prettier": "^3.2.5", - "promise-assist": "^2.0.1" + "prettier": "^3.4.2", + "promise-assist": "^2.0.1", + "sinon": "^19.0.2" } }, "node_modules/@zxing/text-encoding": { @@ -1719,13 +1730,13 @@ } }, "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, "license": "MIT", "engines": { - "node": "*" + "node": ">=12" } }, "node_modules/available-typed-arrays": { @@ -1923,32 +1934,30 @@ } }, "node_modules/chai": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", - "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dev": true, "license": "MIT", "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.1.0" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, "node_modules/chai-as-promised": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz", - "integrity": "sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-8.0.1.tgz", + "integrity": "sha512-OIEJtOL8xxJSH8JJWbIoRjybbzR52iFuDHuF8eb+nTPD6tgXLjRqsgnUGqQfFODxYvq5QdirT0pN9dZ0+Gz6rA==", "dev": true, - "license": "WTFPL", + "license": "MIT", "dependencies": { - "check-error": "^1.0.2" + "check-error": "^2.0.0" }, "peerDependencies": { "chai": ">= 2.1.2 < 6" @@ -1972,16 +1981,13 @@ } }, "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.2" - }, "engines": { - "node": "*" + "node": ">= 16" } }, "node_modules/chokidar": { @@ -2311,14 +2317,11 @@ } }, "node_modules/deep-eql": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", - "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, "license": "MIT", - "dependencies": { - "type-detect": "^4.0.0" - }, "engines": { "node": ">=6" } @@ -3276,16 +3279,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/get-intrinsic": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", @@ -4260,14 +4253,11 @@ } }, "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", "dev": true, - "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.1" - } + "license": "MIT" }, "node_modules/lru-cache": { "version": "10.4.3", @@ -5003,13 +4993,13 @@ "license": "MIT" }, "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, "license": "MIT", "engines": { - "node": "*" + "node": ">= 14.16" } }, "node_modules/picomatch": { @@ -6201,9 +6191,9 @@ } }, "node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 7213ff46..594b5527 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,7 @@ { "name": "codux-core-monorepo", + "private": true, + "type": "module", "workspaces": [ "packages/*" ], @@ -19,17 +21,17 @@ "@file-services/path": "^9.4.1", "@file-services/resolve": "^9.4.1", "@playwright/browser-chromium": "^1.49.1", - "@types/chai": "^4.3.20", - "@types/chai-as-promised": "^7.1.8", + "@types/chai": "^5.0.1", + "@types/chai-as-promised": "^8.0.1", "@types/mocha": "^10.0.10", "@types/node": "22", "@types/react": "^18.3.13", "@types/react-dom": "^18.3.1", "@types/sinon": "^17.0.3", "@wixc3/create-disposables": "^2.2.0", - "@wixc3/testing": "^17.1.1", - "chai": "^4.5.0", - "chai-as-promised": "^7.1.2", + "@wixc3/testing": "^18.0.0", + "chai": "^5.1.2", + "chai-as-promised": "^8.0.1", "esbuild": "^0.24.2", "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", @@ -47,6 +49,5 @@ "typescript": "~5.7.2", "typescript-eslint": "^8.18.2" }, - "license": "MIT", - "private": true + "license": "MIT" } diff --git a/packages/app-core/package.json b/packages/app-core/package.json index 8c9c93fd..79136d23 100644 --- a/packages/app-core/package.json +++ b/packages/app-core/package.json @@ -1,17 +1,12 @@ { "name": "@wixc3/app-core", - "description": "Common types and helpers for building applications", "version": "4.6.2", - "main": "dist/index.js", + "type": "module", + "description": "Common types and helpers for building applications", "exports": { - ".": { - "import": "./dist/index.js", - "require": "./dist/index.js" - }, - "./test-kit": { - "import": "./dist/test-kit/index.js", - "require": "./dist/test-kit/index.js" - } + ".": "./dist/index.js", + "./test-kit": "./dist/test-kit/index.js", + "./package.json": "./package.json" }, "peerDependencies": { "react": ">=18.0.0", @@ -32,5 +27,6 @@ "homepage": "https://github.com/wixplosives/codux-core", "publishConfig": { "access": "public" - } + }, + "sideEffects": false } diff --git a/packages/app-core/src/define-app.tsx b/packages/app-core/src/define-app.tsx index 5b9c6451..d110f4b4 100644 --- a/packages/app-core/src/define-app.tsx +++ b/packages/app-core/src/define-app.tsx @@ -1,5 +1,5 @@ -import { reactErrorHandledRendering } from '@wixc3/react-board/dist/react-error-handled-render'; -import { IReactApp, OmitReactApp } from './define-app-types'; +import { reactErrorHandledRendering } from '@wixc3/react-board/react-error-handled-render'; +import { IReactApp, OmitReactApp } from './define-app-types.js'; export function defineApp( input: OmitReactApp>, diff --git a/packages/app-core/src/index.ts b/packages/app-core/src/index.ts index ac638df7..569146e9 100644 --- a/packages/app-core/src/index.ts +++ b/packages/app-core/src/index.ts @@ -1,2 +1,2 @@ -export * from './define-app'; -export * from './define-app-types'; +export * from './define-app.js'; +export * from './define-app-types.js'; diff --git a/packages/board-core/package.json b/packages/board-core/package.json index adf2fdca..72b0bc65 100644 --- a/packages/board-core/package.json +++ b/packages/board-core/package.json @@ -1,8 +1,12 @@ { "name": "@wixc3/board-core", - "description": "Types and helpers for component boards", "version": "4.6.2", - "main": "dist/index.js", + "type": "module", + "description": "Types and helpers for component boards", + "exports": { + ".": "./dist/index.js", + "./package.json": "./package.json" + }, "files": [ "dist", "!dist/test", @@ -14,5 +18,6 @@ "homepage": "https://github.com/wixplosives/codux-core", "publishConfig": { "access": "public" - } + }, + "sideEffects": false } diff --git a/packages/board-core/src/create-metadata.ts b/packages/board-core/src/create-metadata.ts index 9a85b32c..30387b56 100644 --- a/packages/board-core/src/create-metadata.ts +++ b/packages/board-core/src/create-metadata.ts @@ -1,4 +1,4 @@ -import type { HookMap, IGeneralMetadata } from './types'; +import type { HookMap, IGeneralMetadata } from './types.js'; export type OmitGeneralMetadata> = Omit; diff --git a/packages/board-core/src/create-renderable-base.ts b/packages/board-core/src/create-renderable-base.ts index 02853795..12db586d 100644 --- a/packages/board-core/src/create-renderable-base.ts +++ b/packages/board-core/src/create-renderable-base.ts @@ -1,7 +1,7 @@ -import type { IRenderableMetadataBase } from './types'; -import { createMetadata, OmitGeneralMetadata } from './create-metadata'; -import { setupBoardStage } from './setup-stage'; -import { callHooks } from './hooks'; +import type { IRenderableMetadataBase } from './types.js'; +import { createMetadata, OmitGeneralMetadata } from './create-metadata.js'; +import { setupBoardStage } from './setup-stage.js'; +import { callHooks } from './hooks.js'; export type OmitIRenderableMetadataBase = Omit< OmitGeneralMetadata, diff --git a/packages/board-core/src/hooks.ts b/packages/board-core/src/hooks.ts index 570c1092..9033f361 100644 --- a/packages/board-core/src/hooks.ts +++ b/packages/board-core/src/hooks.ts @@ -1,4 +1,4 @@ -import type { IGeneralMetadata, PluginInfo, Plugin, HookMap, HOOK } from './types'; +import type { IGeneralMetadata, PluginInfo, Plugin, HookMap, HOOK } from './types.js'; export type HookNames> = keyof NonNullable & string; diff --git a/packages/board-core/src/index.ts b/packages/board-core/src/index.ts index 62193a3b..8d849914 100644 --- a/packages/board-core/src/index.ts +++ b/packages/board-core/src/index.ts @@ -1,5 +1,5 @@ -export * from './create-metadata'; -export * from './create-renderable-base'; -export * from './setup-stage'; -export * from './hooks'; -export * from './types'; +export * from './create-metadata.js'; +export * from './create-renderable-base.js'; +export * from './setup-stage.js'; +export * from './hooks.js'; +export * from './types.js'; diff --git a/packages/board-core/src/setup-stage.tsx b/packages/board-core/src/setup-stage.tsx index 4546182e..8c0b2587 100644 --- a/packages/board-core/src/setup-stage.tsx +++ b/packages/board-core/src/setup-stage.tsx @@ -1,5 +1,5 @@ -import { callHooks } from './hooks'; -import type { BoardSetupStageFunction, IWindowEnvironmentProps } from './types'; +import { callHooks } from './hooks.js'; +import type { BoardSetupStageFunction, IWindowEnvironmentProps } from './types.js'; export const defaultWindowStyles = { width: 1024, diff --git a/packages/board-plugins/README.md b/packages/board-plugins/README.md index 1bec0976..8acd222f 100644 --- a/packages/board-plugins/README.md +++ b/packages/board-plugins/README.md @@ -12,7 +12,7 @@ For instance, `cssVarsPlugin` is only applicable to `IRenderable` and uses the ` ```tsx import { createBoard } from '@wixc3/react-board'; import { tagsPlugin, cssVarsPlugin } from '@wixc3/board-plugins'; -import { AutoComplete } from './auto-complete'; +import { AutoComplete } from './auto-complete.js'; createBoard({ name: 'some board', diff --git a/packages/board-plugins/package.json b/packages/board-plugins/package.json index d35b5ddd..aa15babb 100644 --- a/packages/board-plugins/package.json +++ b/packages/board-plugins/package.json @@ -1,8 +1,12 @@ { "name": "@wixc3/board-plugins", - "description": "Plugins for boards", "version": "4.6.2", - "main": "dist/index.js", + "type": "module", + "description": "Plugins for boards", + "exports": { + ".": "./dist/index.js", + "./package.json": "./package.json" + }, "files": [ "dist", "!dist/test", @@ -17,5 +21,6 @@ "homepage": "https://github.com/wixplosives/codux-core", "publishConfig": { "access": "public" - } + }, + "sideEffects": false } diff --git a/packages/board-plugins/src/index.ts b/packages/board-plugins/src/index.ts index 1d2463e9..6ca3e99f 100644 --- a/packages/board-plugins/src/index.ts +++ b/packages/board-plugins/src/index.ts @@ -1,2 +1,2 @@ -export * from './css-vars-plugin'; -export * from './react-context-plugin'; +export * from './css-vars-plugin.js'; +export * from './react-context-plugin.js'; diff --git a/packages/board-plugins/test/css-vars-plugin.spec.ts b/packages/board-plugins/test/css-vars-plugin.spec.ts index e9c9f5a2..78fd1b11 100644 --- a/packages/board-plugins/test/css-vars-plugin.spec.ts +++ b/packages/board-plugins/test/css-vars-plugin.spec.ts @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import board from './fixtures/css-vars-user.board'; +import board from './fixtures/css-vars-user.board.js'; describe('css var plugin', () => { const cleanupAfterTest = new Set<() => unknown>(); diff --git a/packages/board-plugins/test/fixtures/context-user.board.tsx b/packages/board-plugins/test/fixtures/context-user.board.tsx index 2c63b1bb..f750d121 100644 --- a/packages/board-plugins/test/fixtures/context-user.board.tsx +++ b/packages/board-plugins/test/fixtures/context-user.board.tsx @@ -1,6 +1,6 @@ import { reactContextPlugin } from '@wixc3/board-plugins'; import { createBoard } from '@wixc3/react-board'; -import { ContextUser, textContext } from './context-user'; +import { ContextUser, textContext } from './context-user.js'; export default createBoard({ name: 'Context user', diff --git a/packages/board-plugins/test/fixtures/css-vars-user.board.tsx b/packages/board-plugins/test/fixtures/css-vars-user.board.tsx index b7864d48..0cea1d22 100644 --- a/packages/board-plugins/test/fixtures/css-vars-user.board.tsx +++ b/packages/board-plugins/test/fixtures/css-vars-user.board.tsx @@ -1,6 +1,6 @@ import { cssVarsPlugin } from '@wixc3/board-plugins'; import { createBoard } from '@wixc3/react-board'; -import { CSSVarsUser } from './css-vars-user'; +import { CSSVarsUser } from './css-vars-user.js'; export default createBoard({ name: 'Checkbox', diff --git a/packages/board-plugins/test/react-context-plugin.spec.ts b/packages/board-plugins/test/react-context-plugin.spec.ts index 4ec118ab..cda9860f 100644 --- a/packages/board-plugins/test/react-context-plugin.spec.ts +++ b/packages/board-plugins/test/react-context-plugin.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; import { createDisposables } from '@wixc3/create-disposables'; -import board from './fixtures/context-user.board'; +import board from './fixtures/context-user.board.js'; describe('react context plugin', () => { const disposables = createDisposables(); diff --git a/packages/codux-ui/package.json b/packages/codux-ui/package.json index 9518865c..09e16e0e 100644 --- a/packages/codux-ui/package.json +++ b/packages/codux-ui/package.json @@ -1,8 +1,8 @@ { "name": "@wixc3/codux-ui", - "description": "Common ui components which integrate with codux", "version": "4.6.2", "type": "module", + "description": "Common ui components which integrate with codux", "exports": { "./image": { "types": "./dist/image/index.d.ts", diff --git a/packages/define-remix-app/package.json b/packages/define-remix-app/package.json index 2a3b92a6..10558752 100644 --- a/packages/define-remix-app/package.json +++ b/packages/define-remix-app/package.json @@ -1,8 +1,12 @@ { "name": "@wixc3/define-remix-app", - "description": "Remix App definition for Codux", "version": "4.6.2", - "main": "dist/index.js", + "type": "module", + "description": "Remix App definition for Codux", + "exports": { + ".": "./dist/index.js", + "./package.json": "./package.json" + }, "peerDependencies": { "react": "^18.0.0", "react-dom": "^18.0.0" @@ -25,5 +29,6 @@ "homepage": "https://github.com/wixplosives/codux-core", "publishConfig": { "access": "public" - } + }, + "sideEffects": false } diff --git a/packages/define-remix-app/src/defer.ts b/packages/define-remix-app/src/defer.ts index 0ca19fc4..b36111fd 100644 --- a/packages/define-remix-app/src/defer.ts +++ b/packages/define-remix-app/src/defer.ts @@ -1,6 +1,6 @@ import { isDeferredData } from '@remix-run/router'; import { json } from '@remix-run/node'; -import { CoduxDeferredHeaderKey, serializeResponse } from './remix-app-utils'; +import { CoduxDeferredHeaderKey, serializeResponse } from './remix-app-utils.js'; type JSONValue = string | number | boolean | null | JSONValue[] | { [key: string]: JSONValue }; diff --git a/packages/define-remix-app/src/define-remix-app.tsx b/packages/define-remix-app/src/define-remix-app.tsx index e37f9ad8..d788ee31 100644 --- a/packages/define-remix-app/src/define-remix-app.tsx +++ b/packages/define-remix-app/src/define-remix-app.tsx @@ -29,12 +29,12 @@ import { routePathId, serializeResponse, toCamelCase, -} from './remix-app-utils'; -import { clearLoadedModules, manifestToRouter } from './manifest-to-router'; -import { parentLayoutWarning } from './content'; -import { pageTemplate } from './page-template'; -import { Navigation } from './navigation'; -import { tryToSerializeDeferredData } from './defer'; +} from './remix-app-utils.js'; +import { clearLoadedModules, manifestToRouter } from './manifest-to-router.js'; +import { parentLayoutWarning } from './content.js'; +import { pageTemplate } from './page-template.js'; +import { Navigation } from './navigation.js'; +import { tryToSerializeDeferredData } from './defer.js'; export interface IDefineRemixAppProps { appPath: string; bookmarks?: string[]; diff --git a/packages/define-remix-app/src/index.ts b/packages/define-remix-app/src/index.ts index adc10250..0de42152 100644 --- a/packages/define-remix-app/src/index.ts +++ b/packages/define-remix-app/src/index.ts @@ -1,5 +1,5 @@ -export * from './define-remix-app'; -import defineRemixApp from './define-remix-app'; +export * from './define-remix-app.js'; +import defineRemixApp from './define-remix-app.js'; export default defineRemixApp; -export * from './content'; -export { pageTemplate } from './page-template'; +export * from './content.js'; +export { pageTemplate } from './page-template.js'; diff --git a/packages/define-remix-app/src/manifest-to-router.tsx b/packages/define-remix-app/src/manifest-to-router.tsx index 73caf36c..63657779 100644 --- a/packages/define-remix-app/src/manifest-to-router.tsx +++ b/packages/define-remix-app/src/manifest-to-router.tsx @@ -5,16 +5,16 @@ import { RouteModuleInfo, SerializedResponse, serializeRequest, -} from './remix-app-utils'; +} from './remix-app-utils.js'; import { createRemixStub } from '@remix-run/testing'; import { lazy, Suspense, useCallback, useEffect, useState } from 'react'; import type { ActionFunctionArgs, LinksFunction, LoaderFunction } from '@remix-run/node'; import React from 'react'; import { ClientActionFunction, ClientLoaderFunction, useLocation, useNavigate, useRevalidator } from '@remix-run/react'; -import { createHandleProxy } from './handle-proxy'; -import { createLinksProxy } from './links-proxy'; -import { Navigation } from './navigation'; -import { deserializeDeferredResult, isDeferredResult } from './defer'; +import { createHandleProxy } from './handle-proxy.js'; +import { createLinksProxy } from './links-proxy.js'; +import { Navigation } from './navigation.js'; +import { deserializeDeferredResult, isDeferredResult } from './defer.js'; type RouteObject = Parameters[0][0]; diff --git a/packages/define-remix-app/test/define-remix.spec.ts b/packages/define-remix-app/test/define-remix.spec.ts index cfb29161..f8a1ab40 100644 --- a/packages/define-remix-app/test/define-remix.spec.ts +++ b/packages/define-remix-app/test/define-remix.spec.ts @@ -1,38 +1,40 @@ -import defineRemixApp, { INVALID_MSGS, parentLayoutWarning, pageTemplate } from '@wixc3/define-remix-app'; +import * as chai from 'chai'; +import { expect } from 'chai'; + +import { IDirectoryContents } from '@file-services/types'; +import * as remixRunNode from '@remix-run/node'; +import * as remixRunReact from '@remix-run/react'; +import * as remixRunServerRuntime from '@remix-run/server-runtime'; +import { IAppManifest, RouteInfo, RoutingPattern } from '@wixc3/app-core'; import { AppDefDriver } from '@wixc3/app-core/test-kit'; +import defineRemixApp, { INVALID_MSGS, pageTemplate, parentLayoutWarning } from '@wixc3/define-remix-app'; +import { waitFor } from 'promise-assist'; +import * as React from 'react'; +import { ParentLayoutWithExtra, RouteExtraInfo, RouteModuleInfo } from '../src/remix-app-utils.js'; import { + actionPage, + clientActionPage, + clientLoaderWithFallbackPage, + coduxActionPage, + deferedActionPage, + layoutWithErrorBoundary, loaderOnly, - simpleLayout, - simpleRoot, rootWithLayout, - rootWithLayoutAndErrorBoundary, - layoutWithErrorBoundary, rootWithLayout2, - actionPage, - deferedActionPage, - clientLoaderWithFallbackPage, - clientActionPage, + rootWithLayoutAndErrorBoundary, + simpleLayout, + simpleRoot, userApiConsumer, userApiPage, - coduxActionPage, -} from './test-cases/roots'; +} from './test-cases/roots.js'; import { - pageSource, - rootSource as originRootSource, - expectRoute, expectLoaderData, expectRootLayout, + expectRoute, + rootSource as originRootSource, + pageSource, preserveStringAsCode, -} from './test-cases/route-builder'; -import chai, { expect } from 'chai'; -import { IAppManifest, RouteInfo, RoutingPattern } from '@wixc3/app-core'; -import { ParentLayoutWithExtra, RouteExtraInfo, RouteModuleInfo } from '../src/remix-app-utils'; -import { waitFor } from 'promise-assist'; -import { IDirectoryContents } from '@file-services/types'; -import * as React from 'react'; -import * as remixRunReact from '@remix-run/react'; -import * as remixRunNode from '@remix-run/node'; -import * as remixRunServerRuntime from '@remix-run/server-runtime'; +} from './test-cases/route-builder.js'; import { chaiRetryPlugin } from '@wixc3/testing'; chai.use(chaiRetryPlugin); diff --git a/packages/react-board/README.md b/packages/react-board/README.md index cc314cef..d837a45b 100644 --- a/packages/react-board/README.md +++ b/packages/react-board/README.md @@ -25,7 +25,7 @@ This library can be used to create boards for `Hello`: // hello.board.tsx import { createBoard } from '@wixc3/react-board'; -import { Hello } from './hello'; +import { Hello } from './hello.js'; createBoard({ name: 'basic board', @@ -42,7 +42,7 @@ This is useful when the board is wrapped in a router or a context provider that // hello.board.tsx import { createBoard, ContentSlot } from '@wixc3/react-board'; -import { Hello } from './hello'; +import { Hello } from './hello.js'; createBoard({ name: 'hello board', diff --git a/packages/react-board/package.json b/packages/react-board/package.json index 3996897c..14bd4e0b 100644 --- a/packages/react-board/package.json +++ b/packages/react-board/package.json @@ -1,8 +1,13 @@ { "name": "@wixc3/react-board", - "description": "Library for creation of React component boards", "version": "4.6.2", - "main": "dist/index.js", + "type": "module", + "description": "Library for creation of React component boards", + "exports": { + ".": "./dist/index.js", + "./react-error-handled-render": "./dist/react-error-handled-render.js", + "./package.json": "./package.json" + }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" @@ -22,5 +27,6 @@ "homepage": "https://github.com/wixplosives/codux-core", "publishConfig": { "access": "public" - } + }, + "sideEffects": false } diff --git a/packages/react-board/src/create-board.tsx b/packages/react-board/src/create-board.tsx index 7f626205..f58f34e4 100644 --- a/packages/react-board/src/create-board.tsx +++ b/packages/react-board/src/create-board.tsx @@ -1,6 +1,6 @@ import { baseRender, createRenderableBase, getPluginsWithHooks } from '@wixc3/board-core'; -import { reactErrorHandledRendering } from './react-error-handled-render'; -import type { IReactBoard, OmitReactBoard } from './types'; +import { reactErrorHandledRendering } from './react-error-handled-render.js'; +import type { IReactBoard, OmitReactBoard } from './types.js'; export function createBoard(input: OmitReactBoard): IReactBoard { const res: IReactBoard = createRenderableBase({ diff --git a/packages/react-board/src/index.ts b/packages/react-board/src/index.ts index 008ba56f..9efeeb45 100644 --- a/packages/react-board/src/index.ts +++ b/packages/react-board/src/index.ts @@ -1,4 +1,4 @@ -export * from './create-board'; -export * from './types'; -export * from './content-slot'; -export * from './variant'; +export * from './create-board.js'; +export * from './types.js'; +export * from './content-slot.js'; +export * from './variant.js'; diff --git a/packages/react-board/test/create-board.spec.tsx b/packages/react-board/test/create-board.spec.tsx index 9e961731..ecd2ec30 100644 --- a/packages/react-board/test/create-board.spec.tsx +++ b/packages/react-board/test/create-board.spec.tsx @@ -1,11 +1,13 @@ -import React from 'react'; -import { createBoard } from '@wixc3/react-board'; +import * as chai from 'chai'; +import { expect } from 'chai'; +import chaiAsPromised from 'chai-as-promised'; + import { createMetadata } from '@wixc3/board-core'; import { cssVarsPlugin } from '@wixc3/board-plugins'; import { createDisposables } from '@wixc3/create-disposables'; -import board from './fixtures/simple.board'; -import chaiAsPromised from 'chai-as-promised'; -import chai, { expect } from 'chai'; +import { createBoard } from '@wixc3/react-board'; +import React from 'react'; +import board from './fixtures/simple.board.js'; chai.use(chaiAsPromised); diff --git a/packages/react-board/test/error-handling.spec.ts b/packages/react-board/test/error-handling.spec.ts index 833802c1..e9113e02 100644 --- a/packages/react-board/test/error-handling.spec.ts +++ b/packages/react-board/test/error-handling.spec.ts @@ -1,8 +1,10 @@ -import { createDisposables } from '@wixc3/create-disposables'; -import throwingOnMountBoard from './fixtures/throwing.board'; -import throwingOnRerenderBoard from './fixtures/throwing-on-click.board'; +import * as chai from 'chai'; +import { expect } from 'chai'; import chaiAsPromised from 'chai-as-promised'; -import chai, { expect } from 'chai'; + +import { createDisposables } from '@wixc3/create-disposables'; +import throwingOnRerenderBoard from './fixtures/throwing-on-click.board.js'; +import throwingOnMountBoard from './fixtures/throwing.board.js'; chai.use(chaiAsPromised); diff --git a/packages/react-board/test/fixtures/checkbox.board.tsx b/packages/react-board/test/fixtures/checkbox.board.tsx index cf88cbb7..c467adc4 100644 --- a/packages/react-board/test/fixtures/checkbox.board.tsx +++ b/packages/react-board/test/fixtures/checkbox.board.tsx @@ -1,6 +1,6 @@ import { createBoard } from '@wixc3/react-board'; import { useState } from 'react'; -import { Checkbox } from './checkbox'; +import { Checkbox } from './checkbox.js'; export default createBoard({ name: 'checkbox', diff --git a/packages/react-board/test/fixtures/playground.ts b/packages/react-board/test/fixtures/playground.ts index 8beac832..3d75302b 100644 --- a/packages/react-board/test/fixtures/playground.ts +++ b/packages/react-board/test/fixtures/playground.ts @@ -1,5 +1,5 @@ import type { IRenderableMetadataBase } from '@wixc3/board-core'; -import CheckBoxBoard from './checkbox.board'; +import CheckBoxBoard from './checkbox.board.js'; const examples = [CheckBoxBoard]; diff --git a/pleb.config.mjs b/pleb.config.mjs index 81bf9aef..72b081cc 100644 --- a/pleb.config.mjs +++ b/pleb.config.mjs @@ -4,11 +4,5 @@ export default { { name: 'react-dom', reason: `remix isn't compatible with react@19 yet` }, { name: '@types/react', reason: `remix isn't compatible with react@19 yet` }, { name: '@types/react-dom', reason: `remix isn't compatible with react@19 yet` }, - { name: 'typescript', reason: 'remix breaks with typescript@5.7 (reported upstream)' }, - - { name: 'chai', reason: 'esm-only' }, - { name: '@types/chai', reason: 'esm-only' }, - { name: 'chai-as-promised', reason: 'esm-only' }, - { name: '@types/chai-as-promised', reason: 'esm-only' }, ], };