From 3eb6c2ed5deedea574ac2c8e95253c0c345f6724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grimm?= Date: Thu, 18 Jul 2024 17:53:43 -0500 Subject: [PATCH 1/7] feat: Add new start:yalc script --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index d69f6c1b1..c6df333ee 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,10 @@ "setup": "npm install && npm run validate", "validate": "npm run lint && npm run type-check && npm run test", "start": "tsdx watch --onSuccess \"./scripts/organize-styles.sh\"", + "prestart:yalc": "npm run clean && yalc publish", + "start:yalc": "tsdx watch --tsconfig tsconfig.dist.json --onSuccess=\"npm run start:yalc:success\"", + "poststart:yalc": "yalc installations clean", + "start:yalc:success": "./scripts/organize-styles.sh && yalc push --sig", "build": "scripts/build.sh", "build:storybook": "build-storybook -o docs", "clean": "rimraf es lib styles dist", From 9ec978228b2289825ca6f7ea1cf02a928cf5b981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grimm?= Date: Thu, 18 Jul 2024 17:55:25 -0500 Subject: [PATCH 2/7] chore: Exclude tests and build dirs from declarations --- tsconfig.dist.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tsconfig.dist.json b/tsconfig.dist.json index f0e357d5a..d2e9fc897 100644 --- a/tsconfig.dist.json +++ b/tsconfig.dist.json @@ -6,9 +6,12 @@ }, "exclude": [ "node_modules", + "dist", + "lib", "**/__mocks__", "**/__tests__", "**/storybook-helper.*", - "**/*.stories.*" + "**/*.stories.*", + "**/*.test.*" ] } From adbabf202a088ceaed399bcb8e61c84abc02f562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grimm?= Date: Thu, 18 Jul 2024 17:56:50 -0500 Subject: [PATCH 3/7] chore: Don't emit types from base tsconfig --- tsconfig.dist.json | 3 ++- tsconfig.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tsconfig.dist.json b/tsconfig.dist.json index d2e9fc897..547e3c0c7 100644 --- a/tsconfig.dist.json +++ b/tsconfig.dist.json @@ -2,7 +2,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": "./src", - "declarationDir": "lib" + "declarationDir": "lib", + "noEmit": false }, "exclude": [ "node_modules", diff --git a/tsconfig.json b/tsconfig.json index 7239613bb..6a429a33e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,8 @@ }, "jsx": "react", "esModuleInterop": true, - "skipLibCheck": true + "skipLibCheck": true, + "noEmit": true }, "exclude": ["node_modules", "dist"] } From 641a762b9a3bad62a6a71add0ab4b036df4e26e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grimm?= Date: Thu, 18 Jul 2024 18:01:00 -0500 Subject: [PATCH 4/7] fix: Make sure declarations are updated correctly with tsdx watch There is an issue with some tsdx dependencies (the rollup typescript plugin) that causes ts declarations to not be rebuilt when running tsdx. See https://github.com/rollup/plugins/issues/418 --- package-lock.json | 334 ++++++++++++++++++++++++++-------------------- package.json | 12 +- 2 files changed, 196 insertions(+), 150 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8a68baea3..feaa2385f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "@doist/prettier-config": "^3.0.5", "@doist/tsconfig": "^1.0.0", "@geometricpanda/storybook-addon-badges": "^0.2.2", + "@rollup/plugin-typescript": "11.1.6", "@storybook/addon-actions": "^6.5.3", "@storybook/addon-controls": "^6.5.3", "@storybook/addon-docs": "^6.5.3", @@ -97,12 +98,13 @@ "react-svg-loader": "^3.0.3", "react-test-renderer": "^17.0.2", "rimraf": "^3.0.2", - "rollup-plugin-postcss": "^3.1.1", + "rollup": "2.79.1", + "rollup-plugin-postcss": "3.1.8", "rollup-plugin-styles": "^3.14.1", "style-loader": "^0.23.1", "svg-url-loader": "^6.0.0", "ts-loader": "^8.0.2", - "tsdx": "^0.14.1", + "tsdx": "0.14.1", "tslib": "^2.0.0", "typescript": "^4.6.4", "webpack": "^4.43.0" @@ -4195,6 +4197,66 @@ "rollup": "^1.20.0 || ^2.0.0" } }, + "node_modules/@rollup/plugin-typescript": { + "version": "11.1.6", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.6.tgz", + "integrity": "sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0||^4.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-typescript/node_modules/@rollup/pluginutils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-typescript/node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "node_modules/@rollup/plugin-typescript/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, "node_modules/@rollup/pluginutils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", @@ -12861,14 +12923,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cli-truncate/node_modules/ansi-regex": { - "version": "5.0.0", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/cli-truncate/node_modules/ansi-styles": { "version": "4.3.0", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -12920,30 +12974,6 @@ "node": ">=8" } }, - "node_modules/cli-truncate/node_modules/string-width": { - "version": "4.2.0", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-truncate/node_modules/strip-ansi": { - "version": "6.0.0", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/cli-width": { "version": "2.2.1", "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", @@ -17663,10 +17693,28 @@ "version": "1.0.0", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { - "version": "1.1.1", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { "version": "1.1.5", @@ -18313,6 +18361,18 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hast-to-hyperscript": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz", @@ -19255,19 +19315,6 @@ "node": ">=8" } }, - "node_modules/inquirer/node_modules/string-width": { - "version": "4.2.0", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/inquirer/node_modules/strip-ansi": { "version": "6.0.0", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", @@ -19500,12 +19547,15 @@ } }, "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", + "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -30928,12 +30978,12 @@ "dev": true }, "node_modules/resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -31056,11 +31106,10 @@ } }, "node_modules/rollup": { - "version": "2.74.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.74.1.tgz", - "integrity": "sha512-K2zW7kV8Voua5eGkbnBtWYfMIhYhT9Pel2uhBk2WO5eMee161nPze/XRfvEQPFYz7KgrCCnmh2Wy0AMFLGGmMA==", + "version": "2.79.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", + "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", "dev": true, - "peer": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -31072,8 +31121,9 @@ } }, "node_modules/rollup-plugin-postcss": { - "version": "3.1.6", - "integrity": "sha512-lkKMTXhPyaNgELFFf7mAGLqFTr13Lswak1YkP+b9rfl6YNVHxs3PYgZFAGLOyLvOtSuCVRq6BryXs1EgyC+nHQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/rollup-plugin-postcss/-/rollup-plugin-postcss-3.1.8.tgz", + "integrity": "sha512-JHnGfW8quNc6ePxEkZ05HEZ1YiRxDgY9RKEetMfsrwxR2kh/d90OVScTc6b1c2Q17Cs/5TRYL+1uddG21lQe3w==", "dev": true, "dependencies": { "chalk": "^4.0.0", @@ -36156,20 +36206,6 @@ "node": ">=6.5.0" } }, - "node_modules/tsdx/node_modules/rollup": { - "version": "1.32.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.32.1.tgz", - "integrity": "sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/node": "*", - "acorn": "^7.1.0" - }, - "bin": { - "rollup": "dist/bin/rollup" - } - }, "node_modules/tsdx/node_modules/saxes": { "version": "3.1.11", "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.11.tgz", @@ -36548,9 +36584,9 @@ } }, "node_modules/typescript": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz", - "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -41024,6 +41060,41 @@ "magic-string": "^0.25.5" } }, + "@rollup/plugin-typescript": { + "version": "11.1.6", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.6.tgz", + "integrity": "sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "dependencies": { + "@rollup/pluginutils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + } + }, + "@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + } + } + }, "@rollup/pluginutils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", @@ -47529,11 +47600,6 @@ "string-width": "^4.2.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, "ansi-styles": { "version": "4.3.0", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -47569,24 +47635,6 @@ "astral-regex": "^2.0.0", "is-fullwidth-code-point": "^3.0.0" } - }, - "string-width": { - "version": "4.2.0", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } } } }, @@ -51323,9 +51371,17 @@ "version": "1.0.0", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "optional": true + }, "function-bind": { - "version": "1.1.1", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true }, "function.prototype.name": { @@ -51815,6 +51871,15 @@ "minimalistic-assert": "^1.0.1" } }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, "hast-to-hyperscript": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz", @@ -52540,16 +52605,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "string-width": { - "version": "4.2.0", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, "strip-ansi": { "version": "6.0.0", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", @@ -52721,12 +52776,12 @@ } }, "is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", + "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", "dev": true, "requires": { - "has": "^1.0.3" + "hasown": "^2.0.2" } }, "is-data-descriptor": { @@ -61416,12 +61471,12 @@ "dev": true }, "resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "requires": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -61509,18 +61564,18 @@ } }, "rollup": { - "version": "2.74.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.74.1.tgz", - "integrity": "sha512-K2zW7kV8Voua5eGkbnBtWYfMIhYhT9Pel2uhBk2WO5eMee161nPze/XRfvEQPFYz7KgrCCnmh2Wy0AMFLGGmMA==", + "version": "2.79.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", + "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", "dev": true, - "peer": true, "requires": { "fsevents": "~2.3.2" } }, "rollup-plugin-postcss": { - "version": "3.1.6", - "integrity": "sha512-lkKMTXhPyaNgELFFf7mAGLqFTr13Lswak1YkP+b9rfl6YNVHxs3PYgZFAGLOyLvOtSuCVRq6BryXs1EgyC+nHQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/rollup-plugin-postcss/-/rollup-plugin-postcss-3.1.8.tgz", + "integrity": "sha512-JHnGfW8quNc6ePxEkZ05HEZ1YiRxDgY9RKEetMfsrwxR2kh/d90OVScTc6b1c2Q17Cs/5TRYL+1uddG21lQe3w==", "dev": true, "requires": { "chalk": "^4.0.0", @@ -63789,7 +63844,7 @@ "prettier": "^1.19.1", "progress-estimator": "^0.2.2", "regenerator-runtime": "^0.13.7", - "rollup": "^1.32.1", + "rollup": "2.79.1", "rollup-plugin-sourcemaps": "^0.6.2", "rollup-plugin-terser": "^5.1.2", "rollup-plugin-typescript2": "^0.27.3", @@ -65478,17 +65533,6 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, - "rollup": { - "version": "1.32.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.32.1.tgz", - "integrity": "sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A==", - "dev": true, - "requires": { - "@types/estree": "*", - "@types/node": "*", - "acorn": "^7.1.0" - } - }, "saxes": { "version": "3.1.11", "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.11.tgz", @@ -65776,9 +65820,9 @@ } }, "typescript": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz", - "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index c6df333ee..c3bc48577 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "@doist/prettier-config": "^3.0.5", "@doist/tsconfig": "^1.0.0", "@geometricpanda/storybook-addon-badges": "^0.2.2", + "@rollup/plugin-typescript": "11.1.6", "@storybook/addon-actions": "^6.5.3", "@storybook/addon-controls": "^6.5.3", "@storybook/addon-docs": "^6.5.3", @@ -136,12 +137,13 @@ "react-svg-loader": "^3.0.3", "react-test-renderer": "^17.0.2", "rimraf": "^3.0.2", - "rollup-plugin-postcss": "^3.1.1", + "rollup": "2.79.1", + "rollup-plugin-postcss": "3.1.8", "rollup-plugin-styles": "^3.14.1", "style-loader": "^0.23.1", "svg-url-loader": "^6.0.0", "ts-loader": "^8.0.2", - "tsdx": "^0.14.1", + "tsdx": "0.14.1", "tslib": "^2.0.0", "typescript": "^4.6.4", "webpack": "^4.43.0" @@ -157,9 +159,9 @@ "use-callback-ref": "^1.3.0" }, "overrides": { - "tsdx": { - "typescript": "^4.6.4" - } + "typescript": "^4.6.4", + "@rollup/plugin-typescript": "11.1.6", + "rollup": "2.79.1" }, "bugs": { "url": "https://github.com/Doist/reactist/issues" From 051bae5c6588a953ea9e7bc9d7d7ecb63f2ba914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grimm?= Date: Fri, 19 Jul 2024 11:00:17 -0500 Subject: [PATCH 5/7] fix: Specify CSS extract file --- tsdx.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsdx.config.js b/tsdx.config.js index 76bb93a7c..166fc8c9f 100644 --- a/tsdx.config.js +++ b/tsdx.config.js @@ -11,7 +11,7 @@ module.exports = { mode: 'local', generateScopedName: '[hash:8]', }, - mode: 'extract', + mode: ['extract', 'index.css'], url: { inline: true }, }), ].concat(config.plugins) From c42efd619a0a0503206464625ed7a242d4517429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grimm?= Date: Mon, 22 Jul 2024 15:09:09 -0500 Subject: [PATCH 6/7] doc: Update doc for developing w/ Reactist --- README.md | 52 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 9244b79d7..5bc66e623 100644 --- a/README.md +++ b/README.md @@ -88,45 +88,65 @@ This boots up a development server with hot reloading on http://localhost:6006. ## Inside your application -For the second development mode you can leverage `npm link`. First run: +For the second development mode you can leverage `npm start:yalc`. First, make sure you have `yalc` installed globally: + +```shell +npm install -g yalc +``` + +Then, in the reactist repository run: ```sh -npm run start +npm run start:yalc ``` -this will update the build artifacts whenever you change something. +this will publish Reactist to `yalc` and watch for changes. -In your real application you need to first delete the current _@doist/reactist_ dependency and then link to your local one. +In your host application you can then link to your local Reactist version: ```sh cd ~/your-app -# delete current reactist dependency -rm -rf ./node_modules/@doist/reactist - -# link local reactist version -npm link ../reactist +yalc add @doist/reactist ``` -The relative path to reactist may need to be changed to match your local environment. +In your real application you need to first delete the current _@doist/reactist_ dependency and then link to your local one. -To undo the changes and switch back to the reactist version from npm do the following: +To undo the changes and switch back to the reactist version from npm, do the following: ```sh cd ~/your-app -# first remove linked reactist dependency -rm -rf ./node_modules/@doist/reactist +# restore the original reactist version +yalc remove @doist/reactist +# re-install reactist from npm +npm install +``` -# re-install reactist from npm (-E avoids updating the version / package-lock.json) -npm install -E @doist/reactist +For convenience, you can add a `dev:reactist` script in your host application to automate the process of adding and removing the local Reactist version: + +```json5 +{ + // ... + scripts: { + // ... + 'predev:reactist': 'yalc add @doist/reactist', + 'dev:reactist': 'npm run dev', // or whatever your development script is + 'postdev:reactist': 'yalc remove @doist/reactist && npm i', + }, +} ``` +Then, to develop against Reactist, just run `npm run dev:reactist`. + +````sh + + ## Development tips and tricks Independent of the development you operate in to produce a new build (e.g. before submitting a PR) run: ```sh npm run build -``` +```` **Note:** This will **not** update the docs. In case you want to update the docs you need to run: From b9baa88a15c6241e305cb56bd9747847a40fdb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grimm?= Date: Wed, 24 Jul 2024 13:20:36 -0500 Subject: [PATCH 7/7] fix: Remove vestigial sentence and fix backticks --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5bc66e623..a4d4a66c9 100644 --- a/README.md +++ b/README.md @@ -109,8 +109,6 @@ cd ~/your-app yalc add @doist/reactist ``` -In your real application you need to first delete the current _@doist/reactist_ dependency and then link to your local one. - To undo the changes and switch back to the reactist version from npm, do the following: ```sh @@ -135,10 +133,11 @@ For convenience, you can add a `dev:reactist` script in your host application to } ``` -Then, to develop against Reactist, just run `npm run dev:reactist`. - -````sh +Then, to develop against Reactist, just run: +```sh +npm run dev:reactist +``` ## Development tips and tricks @@ -146,7 +145,7 @@ Independent of the development you operate in to produce a new build (e.g. befor ```sh npm run build -```` +``` **Note:** This will **not** update the docs. In case you want to update the docs you need to run: