From 5a7f907601b80af140b4452ada4bc3d03adf2d21 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Wed, 16 Sep 2026 10:30:35 -0400 Subject: [PATCH 01/47] fix(sideEffects): unblock tree-shaking on variance, gamut-styles, gamut-tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit None of these three packages declared a `sideEffects` field, which is the most conservative default: webpack must assume every module in the barrel is side-effectful and cannot drop unused exports. That currently applies to the packages everything else depends on. Verified safe to mark `sideEffects: false`: - no module-level `document`/`window` access or `injectGlobal` in either package's source - gamut-styles' globals/{Reboot,Variables,Typography}.tsx and GamutProvider.tsx use Emotion's `` component, which runs at render time inside React, not at module evaluation - AssetProvider.tsx's createFontLinks is an exported function, not a module-eval call This is PR 0a of the tsdown migration plan (GMT-1741) — a standalone fix for a live tree-shaking bug on the current Babel build, landing ahead of the build-tooling change. gamut and gamut-illustrations carry a separate, deliberately-added sideEffects glob (added in #932 to fix real style-order drift) that needs a CSS-diff experiment before it can be safely removed; that's scoped to PR 0b. Verified: `yarn build`, `jest --selectProjects gamut-styles variance gamut-tests` (181/181 passing), and `yarn build-storybook` (production webpack build) all succeed unchanged. --- packages/gamut-styles/package.json | 3 ++- packages/gamut-tests/package.json | 1 + packages/variance/package.json | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/gamut-styles/package.json b/packages/gamut-styles/package.json index 5bc7da58c8..ff15d6b66e 100644 --- a/packages/gamut-styles/package.json +++ b/packages/gamut-styles/package.json @@ -35,5 +35,6 @@ "repository": "git@github.com:Codecademy/skillsoft-gamut.git", "scripts": { "build": "nx build gamut-styles" - } + }, + "sideEffects": false } diff --git a/packages/gamut-tests/package.json b/packages/gamut-tests/package.json index f7d629eacb..b18688a88f 100644 --- a/packages/gamut-tests/package.json +++ b/packages/gamut-tests/package.json @@ -32,5 +32,6 @@ "build": "nx build gamut-tests", "verify": "tsc --noEmit" }, + "sideEffects": false, "types": "./dist/index.d.ts" } diff --git a/packages/variance/package.json b/packages/variance/package.json index bc7ef8066f..45ac8d1ae4 100644 --- a/packages/variance/package.json +++ b/packages/variance/package.json @@ -31,5 +31,6 @@ "scripts": { "build": "nx build variance" }, + "sideEffects": false, "types": "dist/index.d.ts" } From f8919149a80ee0fa916f06937c5cc3caa11304d5 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Wed, 16 Sep 2026 11:29:51 -0400 Subject: [PATCH 02/47] build(tsdown): migrate variance, gamut-styles, gamut to the hybrid build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces `babel ./src --out-dir ./dist` with `tsdown` for JS, keeping the existing `tsc --emitDeclarationOnly` step for declarations (the hybrid). Chain must migrate atomically (variance -> gamut-styles -> gamut) — a half-migrated chain doesn't load, because Babel's ESM output has extensionless relative specifiers that Node's own resolver rejects. - dts: false in every tsdown.config.ts; tsc keeps emitting declarations into the same dist/ (clean: false in tsdown, single `rm -rf ./dist` at the head of the build target owns cleaning). Bundled tsdown declarations were tried and rejected: 50x TS4023 downstream, since a bundled .d.ts doesn't re-export names its dependents need. - No external/deps.neverBundle needed for variance or gamut-styles — tsdown auto-externalizes anything in a package's own `dependencies` / `peerDependencies`, which already covers everything they import. gamut needs one exception: `deps.neverBundle: [/\.css$/]`, since tsdown refuses to bundle a relative .css import without @tsdown/css, and externalizing it matches the current cpy-based approach exactly. - Output naming: since none of these packages set `"type": "module"`, tsdown names CJS `dist/index.js` and ESM `dist/index.mjs` (not `.cjs`/`.mjs` as sketched in early spike notes) — package.json `exports`/`main`/`module`/`types` updated to match the real filenames. Kept `main`/`types` accurate (not just `exports`), since this repo's tsconfig.base.json uses legacy `moduleResolution: "node"`, which ignores `exports` entirely for internal cross-package typechecking. - gamut-styles: added the missing `types` field and dropped `files` entries (core, utils, core.scss, utils.scss) that don't exist on disk. - gamut: sideEffects reduced to `["**/*.css", "**/*.scss"]` (the two `dist/**/[A-Z]**/*.js` globs from #932 are now dead — they matched gamut's old per-file dist shape, which no longer exists). Re-verify with the CSS-diff + esbuild single-import probe from the sideEffects investigation once the leaf packages (icons/patterns/illustrations) are also migrated, since gamut's own barrel depth was masking whether this field does anything until now. - BarChart/BarRow/elements.tsx: `@emotion/babel-plugin` stamps a `target` on every styled() call unconditionally, and `target` is what makes the `${CategoryLabel}` component-selector interpolation work. The plugin only runs on the babel path now (jest/Storybook loader), not through tsdown, so this is the one site that needs an explicit target to avoid a silent `.undefined` fallback in the production bundle. Verified in the built dist/index.js: `target: "gmt-category-label"` survives. - tsconfig.base.json: isolatedModules: true, ratcheting against the type-only re-export debt rolldown can't see through (verified 0 errors across every build-relevant package before enabling). - gamut build:watch now runs `tsdown --watch` instead of a full rebuild on every source change (watch mode is otherwise unverified — worth confirming latency once used for real). Verified: `yarn nx run-many --target=build --projects=variance,gamut-styles,gamut`, full jest suite for all four affected packages (1457/1457 passing), `yarn verify` (isolatedModules didn't break typecheck anywhere), and direct CJS `require()` of variance's and gamut-styles' dist output. gamut's own CJS load still fails via require() — but only because it transitively depends on gamut-icons, which is still Babel-built and has a pre-existing (unrelated) ERR_UNSUPPORTED_DIR_IMPORT under Node's require(esm); confirmed identical failure on the untouched dist before this change. Resolves once gamut-icons migrates next. Part of the tsdown build migration (GMT-1741). --- package.json | 3 + packages/gamut-styles/package.json | 19 +- packages/gamut-styles/project.json | 2 +- packages/gamut-styles/tsdown.config.ts | 18 + packages/gamut/package.json | 19 +- packages/gamut/project.json | 2 +- .../gamut/src/BarChart/BarRow/elements.tsx | 9 +- packages/gamut/tsdown.config.ts | 24 + packages/variance/package.json | 10 +- packages/variance/project.json | 4 +- packages/variance/tsdown.config.ts | 23 + tsconfig.base.json | 1 + yarn.lock | 1028 ++++++++++++++++- 13 files changed, 1140 insertions(+), 22 deletions(-) create mode 100644 packages/gamut-styles/tsdown.config.ts create mode 100644 packages/gamut/tsdown.config.ts create mode 100644 packages/variance/tsdown.config.ts diff --git a/package.json b/package.json index d2e7157f24..a258d416ac 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "react-helmet-async": "^2.0.5" }, "devDependencies": { + "@arethetypeswrong/cli": "^0.18.5", "@babel/cli": "7.24.7", "@babel/core": "7.24.7", "@babel/preset-env": "^7.24.7", @@ -81,6 +82,7 @@ "onchange": "^7.0.2", "playwright": "^1.49.1", "prettier": "^2.8.7", + "publint": "^0.3.24", "react-test-renderer": "^19.0.0", "start-server-and-test": "^2.1.5", "storybook": "^10.3.1", @@ -90,6 +92,7 @@ "syncpack": "^10.9.3", "ts-jest": "^29.4.12", "ts-node": "10.9.1", + "tsdown": "0.23.0", "tslib": "2.4.0", "typescript": "5.9.3" }, diff --git a/packages/gamut-styles/package.json b/packages/gamut-styles/package.json index ff15d6b66e..e43eceef59 100644 --- a/packages/gamut-styles/package.json +++ b/packages/gamut-styles/package.json @@ -10,17 +10,21 @@ "get-nonce": "^1.0.0", "polished": "^4.1.2" }, + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + } + }, "files": [ "dist", - "core", - "fonts", - "utils", - "core.scss", - "utils.scss" + "fonts" ], "license": "MIT", "main": "dist/index.js", - "module": "dist/index.js", + "module": "dist/index.mjs", "peerDependencies": { "@emotion/cache": "^11.4.0", "@emotion/react": "^11.4.0", @@ -36,5 +40,6 @@ "scripts": { "build": "nx build gamut-styles" }, - "sideEffects": false + "sideEffects": false, + "types": "dist/index.d.ts" } diff --git a/packages/gamut-styles/project.json b/packages/gamut-styles/project.json index d96a8341bd..504fbd86bf 100644 --- a/packages/gamut-styles/project.json +++ b/packages/gamut-styles/project.json @@ -12,8 +12,8 @@ "cwd": "packages/gamut-styles", "commands": [ "rm -rf ./dist", + "tsdown", "tsc --emitDeclarationOnly --project tsconfig.lib.json", - "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"", "cpy './src/**/*.{d.ts,svg,png}' ./dist" ], "parallel": false diff --git a/packages/gamut-styles/tsdown.config.ts b/packages/gamut-styles/tsdown.config.ts new file mode 100644 index 0000000000..ec252e6956 --- /dev/null +++ b/packages/gamut-styles/tsdown.config.ts @@ -0,0 +1,18 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + entry: ['src/index.ts'], + format: ['esm', 'cjs'], + // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. + // See packages/variance/tsdown.config.ts for the full rationale. + dts: false, + outDir: 'dist', + // dist/ is shared with tsc's declaration output — never clean from here. + clean: false, + // No explicit external needed — this package's own dependencies + + // peerDependencies (@emotion/*, @skillsoft/variance, lodash, react, stylis, + // framer-motion, polished, get-nonce) are auto-externalized by tsdown. + platform: 'neutral', + sourcemap: true, + treeshake: true, +}); diff --git a/packages/gamut/package.json b/packages/gamut/package.json index 8a1bd30cc9..b6860c0bc8 100644 --- a/packages/gamut/package.json +++ b/packages/gamut/package.json @@ -30,13 +30,21 @@ "react-use": "^17.6.1", "sanitize-markdown": "^2.6.7" }, + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + } + }, "files": [ "dist", "bin" ], "license": "MIT", "main": "./dist/index.js", - "module": "./dist/index.js", + "module": "./dist/index.mjs", "overrides": { "@react-aria/interactions": "3.25.0" }, @@ -58,14 +66,13 @@ "repository": "git@github.com:Codecademy/skillsoft-gamut.git", "scripts": { "build": "nx build gamut", - "build:watch": "yarn build && onchange ./src -- yarn build", + "build:watch": "tsdown --watch", "compile": "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"", "verify": "tsc --noEmit && tsc --project tsconfig.bin.json" }, "sideEffects": [ "**/*.css", - "**/*.scss", - "dist/**/[A-Z]**/[A-Z]*.js", - "dist/**/[A-Z]**/index.js" - ] + "**/*.scss" + ], + "types": "./dist/index.d.ts" } diff --git a/packages/gamut/project.json b/packages/gamut/project.json index 7eed6d43f9..1723562d6d 100644 --- a/packages/gamut/project.json +++ b/packages/gamut/project.json @@ -12,7 +12,7 @@ "cwd": "packages/gamut", "commands": [ "rm -rf ./dist", - "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"", + "tsdown", "tsc --emitDeclarationOnly --project ./tsconfig.lib.json", "cpy './src/**/*.{d.ts,css,svg,png}' ./dist" ], diff --git a/packages/gamut/src/BarChart/BarRow/elements.tsx b/packages/gamut/src/BarChart/BarRow/elements.tsx index 3e47e70f11..640e21e4e5 100644 --- a/packages/gamut/src/BarChart/BarRow/elements.tsx +++ b/packages/gamut/src/BarChart/BarRow/elements.tsx @@ -15,7 +15,14 @@ export const TotalValueLabelsHoverTarget = styled(FlexBox)( }) ); -export const CategoryLabel = styled(Text)( +// `target` is normally stamped automatically by `@emotion/babel-plugin`, which +// only runs the source through Babel — not through the tsdown/rolldown build. +// It's what makes the `${CategoryLabel}` component-selector interpolation below +// work; without it, `@emotion/styled` falls back to `.undefined` in production. +// Pass it explicitly here since this is the only component-selector site in the +// package — a lint rule flags any future `${Component}` style interpolation +// that doesn't have an explicit `target`. +export const CategoryLabel = styled(Text, { target: 'gmt-category-label' })( css({ fontWeight: 'bold', diff --git a/packages/gamut/tsdown.config.ts b/packages/gamut/tsdown.config.ts new file mode 100644 index 0000000000..3cfb826bfd --- /dev/null +++ b/packages/gamut/tsdown.config.ts @@ -0,0 +1,24 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + entry: ['src/index.tsx'], + format: ['esm', 'cjs'], + // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. + // See packages/variance/tsdown.config.ts for the full rationale. + dts: false, + outDir: 'dist', + // dist/ is shared with tsc's declaration output — never clean from here. + clean: false, + // This package's own dependencies + peerDependencies are auto-externalized by + // tsdown. The one thing that auto-detection can't cover is the single relative + // `.css` side-effect import (Video/lib/VidstackPlayer/vidstack-styles.css): + // tsdown refuses to bundle a `.css` import unless `@tsdown/css` is installed, + // and externalizing it matches the current build exactly — it `cpy`s the CSS + // into dist and lets the consumer's bundler handle the side-effect import. + deps: { + neverBundle: [/\.css$/], + }, + platform: 'neutral', + sourcemap: true, + treeshake: true, +}); diff --git a/packages/variance/package.json b/packages/variance/package.json index 45ac8d1ae4..9625a1bcc1 100644 --- a/packages/variance/package.json +++ b/packages/variance/package.json @@ -7,6 +7,14 @@ "csstype": "^3.0.7", "lodash": "^4.17.23" }, + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + } + }, "files": [ "dist" ], @@ -19,7 +27,7 @@ ], "license": "MIT", "main": "dist/index.js", - "module": "dist/index.js", + "module": "dist/index.mjs", "peerDependencies": { "@emotion/react": "*", "typescript": ">=4.3.5" diff --git a/packages/variance/project.json b/packages/variance/project.json index f80e1f779a..ab4938d2de 100644 --- a/packages/variance/project.json +++ b/packages/variance/project.json @@ -12,8 +12,8 @@ "cwd": "packages/variance", "commands": [ "rm -rf ./dist", - "tsc --project tsconfig.lib.json", - "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"" + "tsdown", + "tsc --project tsconfig.lib.json" ], "parallel": false } diff --git a/packages/variance/tsdown.config.ts b/packages/variance/tsdown.config.ts new file mode 100644 index 0000000000..9aad9e3c78 --- /dev/null +++ b/packages/variance/tsdown.config.ts @@ -0,0 +1,23 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + entry: ['src/index.ts'], + format: ['esm', 'cjs'], + // Hybrid: declarations come from `tsc --project tsconfig.lib.json`, not from here. + // tsdown's own `dts` produces bundled declarations that downstream packages can't + // name (TS4023) — keeping tsc also makes rolldown-plugin-dts#174 (directives + // leaking into .d.ts) structurally unreachable, since declarations carry no + // statements to leak through. + dts: false, + outDir: 'dist', + // dist/ is shared with tsc's declaration output — never clean from here. The + // build target's `rm -rf ./dist` step owns cleaning. + clean: false, + // No explicit `external`/`deps.neverBundle` needed: tsdown reads this package's + // own `dependencies` + `peerDependencies` (csstype, lodash, @emotion/react, + // typescript) and externalizes them automatically. That matches today's Babel + // build exactly — it never bundled third-party deps either. + platform: 'neutral', + sourcemap: true, + treeshake: true, +}); diff --git a/tsconfig.base.json b/tsconfig.base.json index 2f1d075a7b..26be4dd739 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -7,6 +7,7 @@ "esModuleInterop": true, "experimentalDecorators": true, "forceConsistentCasingInFileNames": true, + "isolatedModules": true, "lib": ["es2017", "dom"], "module": "esnext", "moduleResolution": "node", diff --git a/yarn.lock b/yarn.lock index 250708a9a0..0a0e20c635 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,6 +22,46 @@ __metadata: languageName: node linkType: hard +"@andrewbranch/untar.js@npm:^1.0.3": + version: 1.0.4 + resolution: "@andrewbranch/untar.js@npm:1.0.4" + checksum: 10c0/858acf6771f14fccf5d3ddeeabaab330f1d60350aec32c7a87afe78f36e43ca593bda7066b7f6146b0147def6928ec523ae321c5dadac4693afd4e1da2f40b26 + languageName: node + linkType: hard + +"@arethetypeswrong/cli@npm:^0.18.5": + version: 0.18.5 + resolution: "@arethetypeswrong/cli@npm:0.18.5" + dependencies: + "@arethetypeswrong/core": "npm:0.18.5" + chalk: "npm:^4.1.2" + cli-table3: "npm:^0.6.3" + commander: "npm:^10.0.1" + marked: "npm:^9.1.2" + marked-terminal: "npm:^7.1.0" + semver: "npm:^7.5.4" + bin: + attw: ./dist/index.js + checksum: 10c0/c9550aadb461d913c5f42f6a75a655b310e500d20804aa2c266f87c4b89c33dfd47cd6f56cc8061624c309ac4a6620cf2e84ccdaaf66877a8dcb78dd519b40c7 + languageName: node + linkType: hard + +"@arethetypeswrong/core@npm:0.18.5": + version: 0.18.5 + resolution: "@arethetypeswrong/core@npm:0.18.5" + dependencies: + "@andrewbranch/untar.js": "npm:^1.0.3" + "@loaderkit/resolve": "npm:^1.0.2" + cjs-module-lexer: "npm:^1.2.3" + fflate: "npm:^0.8.3" + lru-cache: "npm:^11.0.1" + semver: "npm:^7.5.4" + typescript: "npm:5.6.1-rc" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10c0/fae68eb6ee9324692a427f288bc2db7a85a80b98f028a02fb5dc302edcb7a46c7dce51afb9b83d85e17c19f346b8741ed6b23c25fe9011ed83fd713ce7c029a9 + languageName: node + linkType: hard + "@asamuzakjp/css-color@npm:^3.2.0": version: 3.2.0 resolution: "@asamuzakjp/css-color@npm:3.2.0" @@ -1540,6 +1580,13 @@ __metadata: languageName: node linkType: hard +"@braidai/lang@npm:^1.0.0": + version: 1.1.2 + resolution: "@braidai/lang@npm:1.1.2" + checksum: 10c0/24bc85bf85dfe027102b19f418a591202b00cc8be12525ceff8adb65d5ebdda0dc1a0463c1e2cb6de1d85cd409012aa85850d9377bae61160162afbea278ab26 + languageName: node + linkType: hard + "@bufbuild/protobuf@npm:^2.0.0": version: 2.2.5 resolution: "@bufbuild/protobuf@npm:2.2.5" @@ -1588,6 +1635,13 @@ __metadata: languageName: node linkType: hard +"@colors/colors@npm:1.5.0": + version: 1.5.0 + resolution: "@colors/colors@npm:1.5.0" + checksum: 10c0/eb42729851adca56d19a08e48d5a1e95efd2a32c55ae0323de8119052be0510d4b7a1611f2abcbf28c044a6c11e6b7d38f99fccdad7429300c37a8ea5fb95b44 + languageName: node + linkType: hard + "@commander-js/extra-typings@npm:^14.0.0": version: 14.0.0 resolution: "@commander-js/extra-typings@npm:14.0.0" @@ -2900,6 +2954,15 @@ __metadata: languageName: node linkType: hard +"@loaderkit/resolve@npm:^1.0.2": + version: 1.0.6 + resolution: "@loaderkit/resolve@npm:1.0.6" + dependencies: + "@braidai/lang": "npm:^1.0.0" + checksum: 10c0/e7dfcc0fa8f073c3048c9b8ef702d82dcc4390dc8d57438ac3a652e4936d66df2ca7ae8a4f2b6901157493dd42236156c1f47a5280f680a12bdef2f1b870135c + languageName: node + linkType: hard + "@ltd/j-toml@npm:^1.38.0": version: 1.38.0 resolution: "@ltd/j-toml@npm:1.38.0" @@ -3813,6 +3876,13 @@ __metadata: languageName: node linkType: hard +"@oxc-project/types@npm:=0.149.0": + version: 0.149.0 + resolution: "@oxc-project/types@npm:0.149.0" + checksum: 10c0/f91ff8101300ce5a29fbfc57bdaafd9c1c9d3d9b46c63093f437c479d047042eb615cb6c3ddac91a0d289701ce60c365632866a85d0f1e0d159b20180115187e + languageName: node + linkType: hard + "@oxc-resolver/binding-android-arm-eabi@npm:11.19.1": version: 11.19.1 resolution: "@oxc-resolver/binding-android-arm-eabi@npm:11.19.1" @@ -4115,6 +4185,24 @@ __metadata: languageName: node linkType: hard +"@publint/pack@npm:^0.1.7": + version: 0.1.7 + resolution: "@publint/pack@npm:0.1.7" + dependencies: + tinyexec: "npm:^1.3.0" + checksum: 10c0/bbb63243bd86991074ea06bcdc84ad574a0ee30d694df70fdba2f5f7bbf82d4257717c243807e985b0f75199ed1fc03e17d9e86bc8944b86da49025b1f38d769 + languageName: node + linkType: hard + +"@quansync/fs@npm:^1.0.0": + version: 1.0.0 + resolution: "@quansync/fs@npm:1.0.0" + dependencies: + quansync: "npm:^1.0.0" + checksum: 10c0/41a7e145d4fc349eaeac20ee7ffe0c876a7c26b2268d5704b462b3e7379091221336e315b2b346d5b07a531502a41cad15c9f374800cc60b6339d074ef99aa16 + languageName: node + linkType: hard + "@react-aria/autocomplete@npm:3.0.0-beta.1": version: 3.0.0-beta.1 resolution: "@react-aria/autocomplete@npm:3.0.0-beta.1" @@ -5818,6 +5906,118 @@ __metadata: languageName: node linkType: hard +"@rolldown/binding-android-arm-eabi@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-android-arm-eabi@npm:1.2.8" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@rolldown/binding-android-arm64@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-android-arm64@npm:1.2.8" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@rolldown/binding-darwin-arm64@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-darwin-arm64@npm:1.2.8" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rolldown/binding-darwin-x64@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-darwin-x64@npm:1.2.8" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rolldown/binding-freebsd-x64@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-freebsd-x64@npm:1.2.8" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@rolldown/binding-linux-arm-gnueabihf@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-arm-gnueabihf@npm:1.2.8" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@rolldown/binding-linux-arm64-gnu@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-arm64-gnu@npm:1.2.8" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rolldown/binding-linux-arm64-musl@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-arm64-musl@npm:1.2.8" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rolldown/binding-linux-ppc64-gnu@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-ppc64-gnu@npm:1.2.8" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@rolldown/binding-linux-s390x-gnu@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-s390x-gnu@npm:1.2.8" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@rolldown/binding-linux-x64-gnu@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-x64-gnu@npm:1.2.8" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rolldown/binding-linux-x64-musl@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-x64-musl@npm:1.2.8" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rolldown/binding-openharmony-arm64@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-openharmony-arm64@npm:1.2.8" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@rolldown/binding-win32-arm64-msvc@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-win32-arm64-msvc@npm:1.2.8" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rolldown/binding-win32-x64-msvc@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-win32-x64-msvc@npm:1.2.8" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@rolldown/pluginutils@npm:^1.0.0": + version: 1.0.1 + resolution: "@rolldown/pluginutils@npm:1.0.1" + checksum: 10c0/99d9b06d90196823e4d8c841f258db7a16e5dbba5824a2962b05d907b79f1ba929d56f22dd744fd530936e568c865ee56a719dc31e57e13bc0a8eb4764a8d8dd + languageName: node + linkType: hard + "@rollup/plugin-babel@npm:^6.0.4": version: 6.0.4 resolution: "@rollup/plugin-babel@npm:6.0.4" @@ -6259,6 +6459,13 @@ __metadata: languageName: node linkType: hard +"@sindresorhus/is@npm:^4.6.0": + version: 4.6.0 + resolution: "@sindresorhus/is@npm:4.6.0" + checksum: 10c0/33b6fb1d0834ec8dd7689ddc0e2781c2bfd8b9c4e4bacbcb14111e0ae00621f2c264b8a7d36541799d74888b5dccdf422a891a5cb5a709ace26325eedc81e22e + languageName: node + linkType: hard + "@sinonjs/commons@npm:^3.0.1": version: 3.0.1 resolution: "@sinonjs/commons@npm:3.0.1" @@ -8565,6 +8772,181 @@ __metadata: languageName: node linkType: hard +"@yuku-codegen/binding-android-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-android-arm64@npm:0.9.5" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-codegen/binding-darwin-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-darwin-arm64@npm:0.9.5" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-codegen/binding-darwin-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-darwin-x64@npm:0.9.5" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@yuku-codegen/binding-freebsd-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-freebsd-x64@npm:0.9.5" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-arm-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-arm-gnu@npm:0.9.5" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-arm-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-arm-musl@npm:0.9.5" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-arm64-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-arm64-gnu@npm:0.9.5" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-arm64-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-arm64-musl@npm:0.9.5" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-x64-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-x64-gnu@npm:0.9.5" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-x64-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-x64-musl@npm:0.9.5" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@yuku-codegen/binding-win32-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-win32-arm64@npm:0.9.5" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-codegen/binding-win32-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-win32-x64@npm:0.9.5" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@yuku-parser/binding-android-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-android-arm64@npm:0.9.5" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-parser/binding-darwin-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-darwin-arm64@npm:0.9.5" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-parser/binding-darwin-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-darwin-x64@npm:0.9.5" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@yuku-parser/binding-freebsd-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-freebsd-x64@npm:0.9.5" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-arm-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-arm-gnu@npm:0.9.5" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-arm-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-arm-musl@npm:0.9.5" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-arm64-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-arm64-gnu@npm:0.9.5" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-arm64-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-arm64-musl@npm:0.9.5" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-x64-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-x64-gnu@npm:0.9.5" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-x64-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-x64-musl@npm:0.9.5" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@yuku-parser/binding-win32-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-win32-arm64@npm:0.9.5" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-parser/binding-win32-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-win32-x64@npm:0.9.5" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@yuku-toolchain/types@npm:^0.9.5": + version: 0.9.5 + resolution: "@yuku-toolchain/types@npm:0.9.5" + checksum: 10c0/cc20d7de43e393656501263a8d123cb2b03a9f281e23fbb8f9a2984dded5fab5df1c3007587ec978ada752328ca708f2ffadd1e0046c5f4a60c4d06a46ff694c + languageName: node + linkType: hard + "@zkochan/js-yaml@npm:0.0.7": version: 0.0.7 resolution: "@zkochan/js-yaml@npm:0.0.7" @@ -8776,6 +9158,13 @@ __metadata: languageName: node linkType: hard +"ansi-regex@npm:^6.1.0": + version: 6.3.0 + resolution: "ansi-regex@npm:6.3.0" + checksum: 10c0/bc047786d0531f1f22d1e22e9863e8554488a399f1ee5270b753efa6de938a788d27456f2b256770f11fdd8b1e847483bc1b55ddc2b3ffe82ec45c875292c651 + languageName: node + linkType: hard + "ansi-regex@npm:^6.2.2": version: 6.2.2 resolution: "ansi-regex@npm:6.2.2" @@ -8815,6 +9204,13 @@ __metadata: languageName: node linkType: hard +"any-promise@npm:^1.0.0": + version: 1.3.0 + resolution: "any-promise@npm:1.3.0" + checksum: 10c0/60f0298ed34c74fef50daab88e8dab786036ed5a7fad02e012ab57e376e0a0b4b29e83b95ea9b5e7d89df762f5f25119b83e00706ecaccb22cfbacee98d74889 + languageName: node + linkType: hard + "anymatch@npm:^3.1.3, anymatch@npm:~3.1.2": version: 3.1.3 resolution: "anymatch@npm:3.1.3" @@ -9609,6 +10005,13 @@ __metadata: languageName: node linkType: hard +"cac@npm:^7.0.0": + version: 7.0.0 + resolution: "cac@npm:7.0.0" + checksum: 10c0/e9da33cb9f0425546ae92a450d479276f9969a050fe64f5d6fedf058bdd87f22a370797fe1c158e07655fa9fc183749df7cb2037431e3772faa7bee9919fb763 + languageName: node + linkType: hard + "cacache@npm:^20.0.1": version: 20.0.3 resolution: "cacache@npm:20.0.3" @@ -9792,7 +10195,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^5.2.0": +"chalk@npm:^5.2.0, chalk@npm:^5.4.1": version: 5.6.2 resolution: "chalk@npm:5.6.2" checksum: 10c0/99a4b0f0e7991796b1e7e3f52dceb9137cae2a9dfc8fc0784a550dc4c558e15ab32ed70b14b21b52beb2679b4892b41a0aa44249bcb996f01e125d58477c6976 @@ -9968,6 +10371,22 @@ __metadata: languageName: node linkType: hard +"cli-highlight@npm:^2.1.11": + version: 2.1.11 + resolution: "cli-highlight@npm:2.1.11" + dependencies: + chalk: "npm:^4.0.0" + highlight.js: "npm:^10.7.1" + mz: "npm:^2.4.0" + parse5: "npm:^5.1.1" + parse5-htmlparser2-tree-adapter: "npm:^6.0.0" + yargs: "npm:^16.0.0" + bin: + highlight: bin/highlight + checksum: 10c0/b5b4af3b968aa9df77eee449a400fbb659cf47c4b03a395370bd98d5554a00afaa5819b41a9a8a1ca0d37b0b896a94e57c65289b37359a25b700b1f56eb04852 + languageName: node + linkType: hard + "cli-spinners@npm:2.6.1": version: 2.6.1 resolution: "cli-spinners@npm:2.6.1" @@ -9982,6 +10401,19 @@ __metadata: languageName: node linkType: hard +"cli-table3@npm:^0.6.3, cli-table3@npm:^0.6.5": + version: 0.6.5 + resolution: "cli-table3@npm:0.6.5" + dependencies: + "@colors/colors": "npm:1.5.0" + string-width: "npm:^4.2.0" + dependenciesMeta: + "@colors/colors": + optional: true + checksum: 10c0/d7cc9ed12212ae68241cc7a3133c52b844113b17856e11f4f81308acc3febcea7cc9fd298e70933e294dd642866b29fd5d113c2c098948701d0c35f09455de78 + languageName: node + linkType: hard + "cli-truncate@npm:^5.0.0": version: 5.2.0 resolution: "cli-truncate@npm:5.2.0" @@ -10010,6 +10442,17 @@ __metadata: languageName: node linkType: hard +"cliui@npm:^7.0.2": + version: 7.0.4 + resolution: "cliui@npm:7.0.4" + dependencies: + string-width: "npm:^4.2.0" + strip-ansi: "npm:^6.0.0" + wrap-ansi: "npm:^7.0.0" + checksum: 10c0/6035f5daf7383470cef82b3d3db00bec70afb3423538c50394386ffbbab135e26c3689c41791f911fa71b62d13d3863c712fdd70f0fbdffd938a1e6fd09aac00 + languageName: node + linkType: hard + "cliui@npm:^8.0.1": version: 8.0.1 resolution: "cliui@npm:8.0.1" @@ -10146,6 +10589,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^10.0.1": + version: 10.0.1 + resolution: "commander@npm:10.0.1" + checksum: 10c0/53f33d8927758a911094adadda4b2cbac111a5b377d8706700587650fd8f45b0bbe336de4b5c3fe47fd61f420a3d9bd452b6e0e6e5600a7e74d7bf0174f6efe3 + languageName: node + linkType: hard + "commander@npm:^12.1.0": version: 12.1.0 resolution: "commander@npm:12.1.0" @@ -11069,6 +11519,13 @@ __metadata: languageName: node linkType: hard +"defu@npm:^6.1.7": + version: 6.1.7 + resolution: "defu@npm:6.1.7" + checksum: 10c0/e6635388103c8be3c574ac31302f6930e5e6eeedba32cb1b30cf993c7d9fb571aec2485446dfa23bfa63e55e66156fe109027a9695db82a50f931e91e8d4bedb + languageName: node + linkType: hard + "delayed-stream@npm:~1.0.0": version: 1.0.0 resolution: "delayed-stream@npm:1.0.0" @@ -11379,6 +11836,18 @@ __metadata: languageName: node linkType: hard +"dts-resolver@npm:^3.0.0": + version: 3.0.0 + resolution: "dts-resolver@npm:3.0.0" + peerDependencies: + oxc-resolver: ">=11.0.0" + peerDependenciesMeta: + oxc-resolver: + optional: true + checksum: 10c0/ae52c4e09b43def702b02d7edbfa04798522907f22879809f8890e5c61fc762403f46a1c415c2d1a6440b01960bbaf98c72def1771b0962d3b15fec40983a4ab + languageName: node + linkType: hard + "dunder-proto@npm:^1.0.0, dunder-proto@npm:^1.0.1": version: 1.0.1 resolution: "dunder-proto@npm:1.0.1" @@ -11464,6 +11933,13 @@ __metadata: languageName: node linkType: hard +"emojilib@npm:^2.4.0": + version: 2.4.0 + resolution: "emojilib@npm:2.4.0" + checksum: 10c0/6e66ba8921175842193f974e18af448bb6adb0cf7aeea75e08b9d4ea8e9baba0e4a5347b46ed901491dcaba277485891c33a8d70b0560ca5cc9672a94c21ab8f + languageName: node + linkType: hard + "emojis-list@npm:^3.0.0": version: 3.0.0 resolution: "emojis-list@npm:3.0.0" @@ -11471,6 +11947,13 @@ __metadata: languageName: node linkType: hard +"empathic@npm:^2.0.1": + version: 2.0.1 + resolution: "empathic@npm:2.0.1" + checksum: 10c0/577f2868bfcad4ffbf911b57c75016125eb8cc8a7d32cf2d3e9fbcb31bfe6e9e6b66d9457ac34ccb2cd38bff353b3af34287899e0360b8c561ff6d4a048aca62 + languageName: node + linkType: hard + "encodeurl@npm:~1.0.2": version: 1.0.2 resolution: "encodeurl@npm:1.0.2" @@ -12598,6 +13081,13 @@ __metadata: languageName: node linkType: hard +"fflate@npm:^0.8.3": + version: 0.8.3 + resolution: "fflate@npm:0.8.3" + checksum: 10c0/eab181ca37f5348ae76d4b6f840e0026e30220e33153289ac942222d8b9638237d486507dbcc09878d724095bd354993a2ee48bbee99c8f2c6440d4448719aa7 + languageName: node + linkType: hard + "figures@npm:3.2.0": version: 3.2.0 resolution: "figures@npm:3.2.0" @@ -13227,6 +13717,15 @@ __metadata: languageName: node linkType: hard +"get-tsconfig@npm:5.0.0-beta.6": + version: 5.0.0-beta.6 + resolution: "get-tsconfig@npm:5.0.0-beta.6" + dependencies: + resolve-pkg-maps: "npm:^1.0.0" + checksum: 10c0/661d07b469ca6a76d8075a40aef66b90e22775fe2cc5462b349f5af14def39d8ee8572a63a1cd65acb91fcf7f546969d20b330f8afe480ab5360136aaacc0fc3 + languageName: node + linkType: hard + "gh-pages@npm:^5.0.0": version: 5.0.0 resolution: "gh-pages@npm:5.0.0" @@ -13579,6 +14078,13 @@ __metadata: languageName: node linkType: hard +"highlight.js@npm:^10.7.1": + version: 10.7.3 + resolution: "highlight.js@npm:10.7.3" + checksum: 10c0/073837eaf816922427a9005c56c42ad8786473dc042332dfe7901aa065e92bc3d94ebf704975257526482066abb2c8677cc0326559bb8621e046c21c5991c434 + languageName: node + linkType: hard + "hoist-non-react-statics@npm:^3.3.1": version: 3.3.2 resolution: "hoist-non-react-statics@npm:3.3.2" @@ -13597,6 +14103,13 @@ __metadata: languageName: node linkType: hard +"hookable@npm:^6.1.1": + version: 6.1.1 + resolution: "hookable@npm:6.1.1" + checksum: 10c0/bb46cd9ffc0a997af21febd97835da4e59a6989adec73dc3c215fcc44c7ac01de4781f251c3d420bf45862d2592a695f5f0de095b6f5df52db8afb5166938212 + languageName: node + linkType: hard + "hosted-git-info@npm:^4.0.1": version: 4.1.0 resolution: "hosted-git-info@npm:4.1.0" @@ -14028,6 +14541,13 @@ __metadata: languageName: node linkType: hard +"import-without-cache@npm:^0.4.0": + version: 0.4.0 + resolution: "import-without-cache@npm:0.4.0" + checksum: 10c0/5ba51078dc15f08cd1ef4e12f3d274a7e1906319ac831b5ddf036a033ab3b4395264b93c64be8b6050be27546754a4c3a84fcfbe8e827ba221203cc47c608a46 + languageName: node + linkType: hard + "imurmurhash@npm:^0.1.4": version: 0.1.4 resolution: "imurmurhash@npm:0.1.4" @@ -15987,6 +16507,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.1": + version: 11.5.2 + resolution: "lru-cache@npm:11.5.2" + checksum: 10c0/ece1ad731f5b655e85d67047d04bfc13823dc77aa61c5454924a9869ba600a0104e39cc33d726021feef812bc347ca34a5608a5eb1972a5dd0870b7ecd42c3f2 + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -16121,6 +16648,23 @@ __metadata: languageName: node linkType: hard +"marked-terminal@npm:^7.1.0": + version: 7.3.0 + resolution: "marked-terminal@npm:7.3.0" + dependencies: + ansi-escapes: "npm:^7.0.0" + ansi-regex: "npm:^6.1.0" + chalk: "npm:^5.4.1" + cli-highlight: "npm:^2.1.11" + cli-table3: "npm:^0.6.5" + node-emoji: "npm:^2.2.0" + supports-hyperlinks: "npm:^3.1.0" + peerDependencies: + marked: ">=1 <16" + checksum: 10c0/59d23c2ed9488c40856d828f431ae1d5d57426e791bbce8f05ec5a7d3a1f848cdb3b8d8880d76ae45570415f8b48ae459f50bbbd88ece5a31306f1e3de57f021 + languageName: node + linkType: hard + "marked@npm:^4.3.0": version: 4.3.0 resolution: "marked@npm:4.3.0" @@ -16130,6 +16674,15 @@ __metadata: languageName: node linkType: hard +"marked@npm:^9.1.2": + version: 9.1.6 + resolution: "marked@npm:9.1.6" + bin: + marked: bin/marked.js + checksum: 10c0/010bbd33c0f38300259c5d3bf0063deb36bab098d37ac0a3be5a35a65674a4c693427fc6704f486a89f638e9b36c36b8e220a93d47163f4e70e45a1fa8ca7b60 + languageName: node + linkType: hard + "math-intrinsics@npm:^1.1.0": version: 1.1.0 resolution: "math-intrinsics@npm:1.1.0" @@ -17021,6 +17574,13 @@ __metadata: languageName: node linkType: hard +"mri@npm:^1.1.0": + version: 1.2.0 + resolution: "mri@npm:1.2.0" + checksum: 10c0/a3d32379c2554cf7351db6237ddc18dc9e54e4214953f3da105b97dc3babe0deb3ffe99cf409b38ea47cc29f9430561ba6b53b24ab8f9ce97a4b50409e4a50e7 + languageName: node + linkType: hard + "ms@npm:2.0.0": version: 2.0.0 resolution: "ms@npm:2.0.0" @@ -17047,6 +17607,17 @@ __metadata: languageName: node linkType: hard +"mz@npm:^2.4.0": + version: 2.7.0 + resolution: "mz@npm:2.7.0" + dependencies: + any-promise: "npm:^1.0.0" + object-assign: "npm:^4.0.1" + thenify-all: "npm:^1.0.0" + checksum: 10c0/103114e93f87362f0b56ab5b2e7245051ad0276b646e3902c98397d18bb8f4a77f2ea4a2c9d3ad516034ea3a56553b60d3f5f78220001ca4c404bd711bd0af39 + languageName: node + linkType: hard + "nano-css@npm:^5.6.2": version: 5.6.2 resolution: "nano-css@npm:5.6.2" @@ -17157,6 +17728,18 @@ __metadata: languageName: node linkType: hard +"node-emoji@npm:^2.2.0": + version: 2.2.0 + resolution: "node-emoji@npm:2.2.0" + dependencies: + "@sindresorhus/is": "npm:^4.6.0" + char-regex: "npm:^1.0.2" + emojilib: "npm:^2.4.0" + skin-tone: "npm:^2.0.0" + checksum: 10c0/9525defbd90a82a2131758c2470203fa2a2faa8edd177147a8654a26307fe03594e52847ecbe2746d06cfc5c50acd12bd500f035350a7609e8217c9894c19aad + languageName: node + linkType: hard + "node-fetch@npm:2.7.0": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" @@ -17639,6 +18222,13 @@ __metadata: languageName: node linkType: hard +"obug@npm:^2.1.4": + version: 2.2.1 + resolution: "obug@npm:2.2.1" + checksum: 10c0/8a7c001847d880fa6ba83c7bbee6a80fd271ee628439cd508c8647d53b217abb1759e2d5e4aaeb09a35d0a274bdb225a0a5a78eded3213d63e656153cf411b63 + languageName: node + linkType: hard + "on-finished@npm:2.4.1, on-finished@npm:^2.4.1": version: 2.4.1 resolution: "on-finished@npm:2.4.1" @@ -18015,6 +18605,13 @@ __metadata: languageName: node linkType: hard +"package-manager-detector@npm:^1.8.0": + version: 1.8.0 + resolution: "package-manager-detector@npm:1.8.0" + checksum: 10c0/4c8e2c47fdc874465d3b3b11934401db9d73470ccbdabeb092e46cb94abbc491d5befc8c271b5ea1ae9c6a881f44c2997e011873365bde9fd6c3dc001221ff7a + languageName: node + linkType: hard + "param-case@npm:^3.0.4": version: 3.0.4 resolution: "param-case@npm:3.0.4" @@ -18088,6 +18685,15 @@ __metadata: languageName: node linkType: hard +"parse5-htmlparser2-tree-adapter@npm:^6.0.0": + version: 6.0.1 + resolution: "parse5-htmlparser2-tree-adapter@npm:6.0.1" + dependencies: + parse5: "npm:^6.0.1" + checksum: 10c0/dfa5960e2aaf125707e19a4b1bc333de49232eba5a6ffffb95d313a7d6087c3b7a274b58bee8d3bd41bdf150638815d1d601a42bbf2a0345208c3c35b1279556 + languageName: node + linkType: hard + "parse5@npm:4.0.0": version: 4.0.0 resolution: "parse5@npm:4.0.0" @@ -18095,6 +18701,20 @@ __metadata: languageName: node linkType: hard +"parse5@npm:^5.1.1": + version: 5.1.1 + resolution: "parse5@npm:5.1.1" + checksum: 10c0/b0f87a77a7fea5f242e3d76917c983bbea47703b9371801d51536b78942db6441cbda174bf84eb30e47315ddc6f8a0b57d68e562c790154430270acd76c1fa03 + languageName: node + linkType: hard + +"parse5@npm:^6.0.1": + version: 6.0.1 + resolution: "parse5@npm:6.0.1" + checksum: 10c0/595821edc094ecbcfb9ddcb46a3e1fe3a718540f8320eff08b8cf6742a5114cce2d46d45f95c26191c11b184dcaf4e2960abcd9c5ed9eb9393ac9a37efcfdecb + languageName: node + linkType: hard + "parse5@npm:^7.0.0, parse5@npm:^7.2.1": version: 7.3.0 resolution: "parse5@npm:7.3.0" @@ -18234,6 +18854,13 @@ __metadata: languageName: node linkType: hard +"picomatch@npm:^4.0.4, picomatch@npm:^4.0.7": + version: 4.0.7 + resolution: "picomatch@npm:4.0.7" + checksum: 10c0/beb6ae02c43ae44e84883b90830196d9046b1726ead292adcf7f57945e0bb0d992d68563d87e03b484b6f3c9a5c6defda7523477f047d7f0e663f126cc01787f + languageName: node + linkType: hard + "pify@npm:^2.0.0, pify@npm:^2.3.0": version: 2.3.0 resolution: "pify@npm:2.3.0" @@ -18923,6 +19550,20 @@ __metadata: languageName: node linkType: hard +"publint@npm:^0.3.24": + version: 0.3.24 + resolution: "publint@npm:0.3.24" + dependencies: + "@publint/pack": "npm:^0.1.7" + package-manager-detector: "npm:^1.8.0" + picocolors: "npm:^1.1.1" + sade: "npm:^1.8.1" + bin: + publint: ./src/cli.js + checksum: 10c0/ad938ca375aa196845cd2705c49295662839fb991374c24d9acb85945177ebe73c95c8b82666858826b36a8dad943427a0ef0eb1f8b7eaa8abe4c8bc5f55781c + languageName: node + linkType: hard + "punycode@npm:^2.1.0, punycode@npm:^2.3.1": version: 2.3.1 resolution: "punycode@npm:2.3.1" @@ -18960,6 +19601,13 @@ __metadata: languageName: node linkType: hard +"quansync@npm:^1.0.0": + version: 1.0.0 + resolution: "quansync@npm:1.0.0" + checksum: 10c0/076542634399a0cc46078baab6b31acee7a88c5a435234345f645aedaa42bc6a63836e655fb39b1b21a83c98ec86a4b73ec5e2b2d6f3fdc22711eeeff9463253 + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -19831,6 +20479,13 @@ __metadata: languageName: node linkType: hard +"resolve-pkg-maps@npm:^1.0.0": + version: 1.0.0 + resolution: "resolve-pkg-maps@npm:1.0.0" + checksum: 10c0/fb8f7bbe2ca281a73b7ef423a1cbc786fb244bd7a95cbe5c3fba25b27d327150beca8ba02f622baea65919a57e061eb5005204daa5f93ed590d9b77463a567ab + languageName: node + linkType: hard + "resolve.exports@npm:2.0.3": version: 2.0.3 resolution: "resolve.exports@npm:2.0.3" @@ -19975,6 +20630,93 @@ __metadata: languageName: node linkType: hard +"rolldown-plugin-dts@npm:^0.28.5": + version: 0.28.5 + resolution: "rolldown-plugin-dts@npm:0.28.5" + dependencies: + dts-resolver: "npm:^3.0.0" + get-tsconfig: "npm:5.0.0-beta.6" + obug: "npm:^2.1.4" + yuku-ast: "npm:^0.9.3" + yuku-codegen: "npm:^0.9.3" + yuku-parser: "npm:^0.9.3" + peerDependencies: + "@typescript/native-preview": "*" + "@volar/typescript": ~2.4.0 + rolldown: ^1.2.0 + typescript: ^5.0.0 || ^6.0.0 || ~7.0.0 + vue-tsc: ~3.2.0 || ~3.3.0 + peerDependenciesMeta: + "@typescript/native-preview": + optional: true + "@volar/typescript": + optional: true + typescript: + optional: true + vue-tsc: + optional: true + checksum: 10c0/9042dbf2dae88ae59d1115d86e7a6c39a041dd07f89939d39d7c12f66cd3395292177c95160558b7492c8a9ad3d08b66f11e153305ec48ce292b2bf34664fd53 + languageName: node + linkType: hard + +"rolldown@npm:~1.2.7": + version: 1.2.8 + resolution: "rolldown@npm:1.2.8" + dependencies: + "@oxc-project/types": "npm:=0.149.0" + "@rolldown/binding-android-arm-eabi": "npm:1.2.8" + "@rolldown/binding-android-arm64": "npm:1.2.8" + "@rolldown/binding-darwin-arm64": "npm:1.2.8" + "@rolldown/binding-darwin-x64": "npm:1.2.8" + "@rolldown/binding-freebsd-x64": "npm:1.2.8" + "@rolldown/binding-linux-arm-gnueabihf": "npm:1.2.8" + "@rolldown/binding-linux-arm64-gnu": "npm:1.2.8" + "@rolldown/binding-linux-arm64-musl": "npm:1.2.8" + "@rolldown/binding-linux-ppc64-gnu": "npm:1.2.8" + "@rolldown/binding-linux-s390x-gnu": "npm:1.2.8" + "@rolldown/binding-linux-x64-gnu": "npm:1.2.8" + "@rolldown/binding-linux-x64-musl": "npm:1.2.8" + "@rolldown/binding-openharmony-arm64": "npm:1.2.8" + "@rolldown/binding-win32-arm64-msvc": "npm:1.2.8" + "@rolldown/binding-win32-x64-msvc": "npm:1.2.8" + "@rolldown/pluginutils": "npm:^1.0.0" + dependenciesMeta: + "@rolldown/binding-android-arm-eabi": + optional: true + "@rolldown/binding-android-arm64": + optional: true + "@rolldown/binding-darwin-arm64": + optional: true + "@rolldown/binding-darwin-x64": + optional: true + "@rolldown/binding-freebsd-x64": + optional: true + "@rolldown/binding-linux-arm-gnueabihf": + optional: true + "@rolldown/binding-linux-arm64-gnu": + optional: true + "@rolldown/binding-linux-arm64-musl": + optional: true + "@rolldown/binding-linux-ppc64-gnu": + optional: true + "@rolldown/binding-linux-s390x-gnu": + optional: true + "@rolldown/binding-linux-x64-gnu": + optional: true + "@rolldown/binding-linux-x64-musl": + optional: true + "@rolldown/binding-openharmony-arm64": + optional: true + "@rolldown/binding-win32-arm64-msvc": + optional: true + "@rolldown/binding-win32-x64-msvc": + optional: true + bin: + rolldown: ./bin/cli.mjs + checksum: 10c0/5a9c6b30a7ef0af257a963e6b0b95d5a60b23512b7dbcca617273bd63fb0892b88be6b33dc9a6cb66350f47d260eff6456af0b7afef34898767f3527ce0d967d + languageName: node + linkType: hard + "rollup-plugin-typescript2@npm:^0.36.0": version: 0.36.0 resolution: "rollup-plugin-typescript2@npm:0.36.0" @@ -20107,6 +20849,15 @@ __metadata: languageName: node linkType: hard +"sade@npm:^1.8.1": + version: 1.8.1 + resolution: "sade@npm:1.8.1" + dependencies: + mri: "npm:^1.1.0" + checksum: 10c0/da8a3a5d667ad5ce3bf6d4f054bbb9f711103e5df21003c5a5c1a8a77ce12b640ed4017dd423b13c2307ea7e645adee7c2ae3afe8051b9db16a6f6d3da3f90b1 + languageName: node + linkType: hard + "safe-array-concat@npm:^1.1.2, safe-array-concat@npm:^1.1.3": version: 1.1.3 resolution: "safe-array-concat@npm:1.1.3" @@ -20787,6 +21538,7 @@ __metadata: version: 0.0.0-use.local resolution: "skillsoft-gamut@workspace:." dependencies: + "@arethetypeswrong/cli": "npm:^0.18.5" "@babel/cli": "npm:7.24.7" "@babel/core": "npm:7.24.7" "@babel/preset-env": "npm:^7.24.7" @@ -20859,6 +21611,7 @@ __metadata: onchange: "npm:^7.0.2" playwright: "npm:^1.49.1" prettier: "npm:^2.8.7" + publint: "npm:^0.3.24" react: "npm:^19.0.0" react-dom: "npm:^19.0.0" react-helmet-async: "npm:^2.0.5" @@ -20871,11 +21624,21 @@ __metadata: syncpack: "npm:^10.9.3" ts-jest: "npm:^29.4.12" ts-node: "npm:10.9.1" + tsdown: "npm:0.23.0" tslib: "npm:2.4.0" typescript: "npm:5.9.3" languageName: unknown linkType: soft +"skin-tone@npm:^2.0.0": + version: 2.0.0 + resolution: "skin-tone@npm:2.0.0" + dependencies: + unicode-emoji-modifier-base: "npm:^1.0.0" + checksum: 10c0/82d4c2527864f9cbd6cb7f3c4abb31e2224752234d5013b881d3e34e9ab543545b05206df5a17d14b515459fcb265ce409f9cfe443903176b0360cd20e4e4ba5 + languageName: node + linkType: hard + "slash@npm:^2.0.0": version: 2.0.0 resolution: "slash@npm:2.0.0" @@ -21652,7 +22415,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^7.1.0": +"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" dependencies: @@ -21677,6 +22440,16 @@ __metadata: languageName: node linkType: hard +"supports-hyperlinks@npm:^3.1.0": + version: 3.2.0 + resolution: "supports-hyperlinks@npm:3.2.0" + dependencies: + has-flag: "npm:^4.0.0" + supports-color: "npm:^7.0.0" + checksum: 10c0/bca527f38d4c45bc95d6a24225944675746c515ddb91e2456d00ae0b5c537658e9dd8155b996b191941b0c19036195a098251304b9082bbe00cd1781f3cd838e + languageName: node + linkType: hard + "supports-preserve-symlinks-flag@npm:^1.0.0": version: 1.0.0 resolution: "supports-preserve-symlinks-flag@npm:1.0.0" @@ -21917,6 +22690,24 @@ __metadata: languageName: node linkType: hard +"thenify-all@npm:^1.0.0": + version: 1.6.0 + resolution: "thenify-all@npm:1.6.0" + dependencies: + thenify: "npm:>= 3.1.0 < 4" + checksum: 10c0/9b896a22735e8122754fe70f1d65f7ee691c1d70b1f116fda04fea103d0f9b356e3676cb789506e3909ae0486a79a476e4914b0f92472c2e093d206aed4b7d6b + languageName: node + linkType: hard + +"thenify@npm:>= 3.1.0 < 4": + version: 3.3.1 + resolution: "thenify@npm:3.3.1" + dependencies: + any-promise: "npm:^1.0.0" + checksum: 10c0/f375aeb2b05c100a456a30bc3ed07ef03a39cbdefe02e0403fb714b8c7e57eeaad1a2f5c4ecfb9ce554ce3db9c2b024eba144843cd9e344566d9fcee73b04767 + languageName: node + linkType: hard + "thingies@npm:^1.20.0": version: 1.21.0 resolution: "thingies@npm:1.21.0" @@ -21968,6 +22759,13 @@ __metadata: languageName: node linkType: hard +"tinyexec@npm:^1.3.0, tinyexec@npm:^1.3.1": + version: 1.3.1 + resolution: "tinyexec@npm:1.3.1" + checksum: 10c0/c590369cb3fa73cc18a3998caec8a00f9712d91309c881be3ac52b160fb2f80c7b1fbf3591858ab6abab47ad55385b0c86ec19982e32441a01f55298dab9ccd2 + languageName: node + linkType: hard + "tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.15": version: 0.2.15 resolution: "tinyglobby@npm:0.2.15" @@ -21978,6 +22776,16 @@ __metadata: languageName: node linkType: hard +"tinyglobby@npm:^0.2.17": + version: 0.2.17 + resolution: "tinyglobby@npm:0.2.17" + dependencies: + fdir: "npm:^6.5.0" + picomatch: "npm:^4.0.4" + checksum: 10c0/7f7bb0f197c88bc4b20c231e0deca4240ca3bf313a88f5a7fee93a872b84966a4d50220947c0455ad07a60b3b360961c5b7fd979222aeb716a9f99b412002e4c + languageName: node + linkType: hard + "tinyrainbow@npm:^2.0.0": version: 2.0.0 resolution: "tinyrainbow@npm:2.0.0" @@ -22272,6 +23080,59 @@ __metadata: languageName: node linkType: hard +"tsdown@npm:0.23.0": + version: 0.23.0 + resolution: "tsdown@npm:0.23.0" + dependencies: + cac: "npm:^7.0.0" + defu: "npm:^6.1.7" + empathic: "npm:^2.0.1" + hookable: "npm:^6.1.1" + import-without-cache: "npm:^0.4.0" + obug: "npm:^2.1.4" + picomatch: "npm:^4.0.7" + rolldown: "npm:~1.2.7" + rolldown-plugin-dts: "npm:^0.28.5" + tinyexec: "npm:^1.3.1" + tinyglobby: "npm:^0.2.17" + tree-kill: "npm:^1.2.2" + unconfig-core: "npm:^7.5.0" + verkit: "npm:^0.4.0" + peerDependencies: + "@arethetypeswrong/core": ^0.18.1 + "@tsdown/css": 0.23.0 + "@tsdown/exe": 0.23.0 + "@vitejs/devtools": "*" + publint: ^0.3.8 + tsx: "*" + typescript: ^5.0.0 || ^6.0.0 || ^7.0.0 + unplugin-unused: ">=0.5.0" + unrun: "*" + peerDependenciesMeta: + "@arethetypeswrong/core": + optional: true + "@tsdown/css": + optional: true + "@tsdown/exe": + optional: true + "@vitejs/devtools": + optional: true + publint: + optional: true + tsx: + optional: true + typescript: + optional: true + unplugin-unused: + optional: true + unrun: + optional: true + bin: + tsdown: ./dist/run.mjs + checksum: 10c0/0b9f77653ec9955a5b830576d6a4d6ba1feb82d4adb7624a1b529e34fdf772c165cdbf817ef44ad907d507fa1170ad960ba99bd88f448f3d57e0da07cf6c9643 + languageName: node + linkType: hard + "tslib@npm:2.4.0": version: 2.4.0 resolution: "tslib@npm:2.4.0" @@ -22430,6 +23291,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:5.6.1-rc": + version: 5.6.1-rc + resolution: "typescript@npm:5.6.1-rc" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/9d6e99b7ddbc797ebc8d09e5d7f2f81ce5f288a4e607bcded3c545ced8582796c937fba31bede5660a56f978b2f68e7c4ee85614b307425a2b4617535721509f + languageName: node + linkType: hard + "typescript@npm:5.9.3, typescript@npm:~5.9.2": version: 5.9.3 resolution: "typescript@npm:5.9.3" @@ -22440,6 +23311,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@npm%3A5.6.1-rc#optional!builtin": + version: 5.6.1-rc + resolution: "typescript@patch:typescript@npm%3A5.6.1-rc#optional!builtin::version=5.6.1-rc&hash=8c6c40" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/9c6f8d864bc2efc964d1bfc94bf2e14f35cd2ad3df5e92d5304c8759674ba77ae927078a5fc06a527c087953615465dd5decc2d4d28ca8e13c11f9b29e068d93 + languageName: node + linkType: hard + "typescript@patch:typescript@npm%3A5.9.3#optional!builtin, typescript@patch:typescript@npm%3A~5.9.2#optional!builtin": version: 5.9.3 resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" @@ -22471,6 +23352,16 @@ __metadata: languageName: node linkType: hard +"unconfig-core@npm:^7.5.0": + version: 7.5.0 + resolution: "unconfig-core@npm:7.5.0" + dependencies: + "@quansync/fs": "npm:^1.0.0" + quansync: "npm:^1.0.0" + checksum: 10c0/9c9f745254aa8e267140430a432353d17ee87f625b0ea0668e189d88736828d117b66bd2dd41f1d48bd40d44d5b7c7d160e8b7996a60c8f484e2975ef73c7cb7 + languageName: node + linkType: hard + "undici-types@npm:~6.21.0": version: 6.21.0 resolution: "undici-types@npm:6.21.0" @@ -22485,6 +23376,13 @@ __metadata: languageName: node linkType: hard +"unicode-emoji-modifier-base@npm:^1.0.0": + version: 1.0.0 + resolution: "unicode-emoji-modifier-base@npm:1.0.0" + checksum: 10c0/b37623fcf0162186debd20f116483e035a2d5b905b932a2c472459d9143d446ebcbefb2a494e2fe4fa7434355396e2a95ec3fc1f0c29a3bc8f2c827220e79c66 + languageName: node + linkType: hard + "unicode-match-property-ecmascript@npm:^2.0.0": version: 2.0.0 resolution: "unicode-match-property-ecmascript@npm:2.0.0" @@ -22924,6 +23822,13 @@ __metadata: languageName: node linkType: hard +"verkit@npm:^0.4.0": + version: 0.4.0 + resolution: "verkit@npm:0.4.0" + checksum: 10c0/a3b794fa0902a3643ee2ae073eeb6fcc50e1245aa339f888aab7e02120d9d195beae9894fd1a8f8ea0fc2c0b20f089459d6d1aecfebe889e94bf8bf70f01c60e + languageName: node + linkType: hard + "vfile-message@npm:^4.0.0": version: 4.0.3 resolution: "vfile-message@npm:4.0.3" @@ -23647,7 +24552,7 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^20.2.9": +"yargs-parser@npm:^20.2.2, yargs-parser@npm:^20.2.9": version: 20.2.9 resolution: "yargs-parser@npm:20.2.9" checksum: 10c0/0685a8e58bbfb57fab6aefe03c6da904a59769bd803a722bb098bd5b0f29d274a1357762c7258fb487512811b8063fb5d2824a3415a0a4540598335b3b086c72 @@ -23673,6 +24578,21 @@ __metadata: languageName: node linkType: hard +"yargs@npm:^16.0.0": + version: 16.2.2 + resolution: "yargs@npm:16.2.2" + dependencies: + cliui: "npm:^7.0.2" + escalade: "npm:^3.1.1" + get-caller-file: "npm:^2.0.5" + require-directory: "npm:^2.1.1" + string-width: "npm:^4.2.0" + y18n: "npm:^5.0.5" + yargs-parser: "npm:^20.2.2" + checksum: 10c0/1ca2152581ee7c9c9fb4174767ff7294b1c272d2d0a1f6eb13c39ce177fded85eb9c96711e00cd7913c0a9b88b6e763713ee11cae81b9b62fd97bdd0b03d5549 + languageName: node + linkType: hard + "yargs@npm:^17.6.2, yargs@npm:^17.7.2": version: 17.7.2 resolution: "yargs@npm:17.7.2" @@ -23709,6 +24629,108 @@ __metadata: languageName: node linkType: hard +"yuku-ast@npm:^0.9.3, yuku-ast@npm:^0.9.5": + version: 0.9.5 + resolution: "yuku-ast@npm:0.9.5" + dependencies: + "@yuku-toolchain/types": "npm:^0.9.5" + checksum: 10c0/cc6159880196008f10765e9c64d6fbc6ceab87ea5451d88907992bf007d10e1bc533c93a5a7b00bb3ac5903e13fed76be447f65d3f8e6a6da210509009e32043 + languageName: node + linkType: hard + +"yuku-codegen@npm:^0.9.3": + version: 0.9.5 + resolution: "yuku-codegen@npm:0.9.5" + dependencies: + "@yuku-codegen/binding-android-arm64": "npm:0.9.5" + "@yuku-codegen/binding-darwin-arm64": "npm:0.9.5" + "@yuku-codegen/binding-darwin-x64": "npm:0.9.5" + "@yuku-codegen/binding-freebsd-x64": "npm:0.9.5" + "@yuku-codegen/binding-linux-arm-gnu": "npm:0.9.5" + "@yuku-codegen/binding-linux-arm-musl": "npm:0.9.5" + "@yuku-codegen/binding-linux-arm64-gnu": "npm:0.9.5" + "@yuku-codegen/binding-linux-arm64-musl": "npm:0.9.5" + "@yuku-codegen/binding-linux-x64-gnu": "npm:0.9.5" + "@yuku-codegen/binding-linux-x64-musl": "npm:0.9.5" + "@yuku-codegen/binding-win32-arm64": "npm:0.9.5" + "@yuku-codegen/binding-win32-x64": "npm:0.9.5" + "@yuku-toolchain/types": "npm:^0.9.5" + dependenciesMeta: + "@yuku-codegen/binding-android-arm64": + optional: true + "@yuku-codegen/binding-darwin-arm64": + optional: true + "@yuku-codegen/binding-darwin-x64": + optional: true + "@yuku-codegen/binding-freebsd-x64": + optional: true + "@yuku-codegen/binding-linux-arm-gnu": + optional: true + "@yuku-codegen/binding-linux-arm-musl": + optional: true + "@yuku-codegen/binding-linux-arm64-gnu": + optional: true + "@yuku-codegen/binding-linux-arm64-musl": + optional: true + "@yuku-codegen/binding-linux-x64-gnu": + optional: true + "@yuku-codegen/binding-linux-x64-musl": + optional: true + "@yuku-codegen/binding-win32-arm64": + optional: true + "@yuku-codegen/binding-win32-x64": + optional: true + checksum: 10c0/fff0d52b38af71a4f2f76ef44406a0c3237957ca2ed0118c156e495b48d03a431f8132808b7f52e8c09d9838267c3cbd6074b9a3e4bca825d442b7a4613bedd8 + languageName: node + linkType: hard + +"yuku-parser@npm:^0.9.3": + version: 0.9.5 + resolution: "yuku-parser@npm:0.9.5" + dependencies: + "@yuku-parser/binding-android-arm64": "npm:0.9.5" + "@yuku-parser/binding-darwin-arm64": "npm:0.9.5" + "@yuku-parser/binding-darwin-x64": "npm:0.9.5" + "@yuku-parser/binding-freebsd-x64": "npm:0.9.5" + "@yuku-parser/binding-linux-arm-gnu": "npm:0.9.5" + "@yuku-parser/binding-linux-arm-musl": "npm:0.9.5" + "@yuku-parser/binding-linux-arm64-gnu": "npm:0.9.5" + "@yuku-parser/binding-linux-arm64-musl": "npm:0.9.5" + "@yuku-parser/binding-linux-x64-gnu": "npm:0.9.5" + "@yuku-parser/binding-linux-x64-musl": "npm:0.9.5" + "@yuku-parser/binding-win32-arm64": "npm:0.9.5" + "@yuku-parser/binding-win32-x64": "npm:0.9.5" + "@yuku-toolchain/types": "npm:^0.9.5" + yuku-ast: "npm:^0.9.5" + dependenciesMeta: + "@yuku-parser/binding-android-arm64": + optional: true + "@yuku-parser/binding-darwin-arm64": + optional: true + "@yuku-parser/binding-darwin-x64": + optional: true + "@yuku-parser/binding-freebsd-x64": + optional: true + "@yuku-parser/binding-linux-arm-gnu": + optional: true + "@yuku-parser/binding-linux-arm-musl": + optional: true + "@yuku-parser/binding-linux-arm64-gnu": + optional: true + "@yuku-parser/binding-linux-arm64-musl": + optional: true + "@yuku-parser/binding-linux-x64-gnu": + optional: true + "@yuku-parser/binding-linux-x64-musl": + optional: true + "@yuku-parser/binding-win32-arm64": + optional: true + "@yuku-parser/binding-win32-x64": + optional: true + checksum: 10c0/e01bd82ac6369166320cfe64770e9e3cbd48a502844cd11afc5b11bb5cbbe484c70af804e0dde50142cc6daad9689ffeb88099731a836e32601df07813527489 + languageName: node + linkType: hard + "zwitch@npm:^2.0.0": version: 2.0.4 resolution: "zwitch@npm:2.0.4" From e18c7fa2d0ea378492395c98d17c7714b5e7b6f3 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Wed, 16 Sep 2026 12:17:29 -0400 Subject: [PATCH 03/47] build(tsdown): migrate gamut-icons, gamut-patterns, gamut-illustrations, gamut-tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same hybrid pattern as the previous commit (tsdown for JS, tsc for declarations), applied to the four remaining Babel-built packages. Nothing depends on these, so they could lag the dependency chain — but since gamut itself depends on gamut-icons/gamut-patterns/gamut-illustrations, finishing them now is what actually resolves gamut's own CJS load (the previous commit's ERR_UNSUPPORTED_DIR_IMPORT was gamut-icons transitively, not gamut). SVGR steps (icon/pattern codegen, the `-icon.svg` rename) are untouched — tsdown/rolldown only replaces the babel step in each pipeline. ## unbundle: true, added to every package (retroactively, including the ## previous commit's three) A single-component import probe (`import { FillButton } from '@skillsoft/gamut'`, bundled with esbuild) found the default tsdown output — one concatenated dist/index.mjs per package, root-only entry — pulls in 100% of that file's ~428KB plus every heavy dependency any of gamut's ~130 exports uses transitively (@vidstack/react, gamut-icons' whole barrel, react-aria-components, framer-motion, @formatjs/*, react-select): 1.59MB for one button, 15x today's Babel-build baseline of 103KB. Same problem on gamut-icons: importing one icon pulled in all 377 (586KB). `unbundle: true` (tsdown mirrors src/ file-by-file instead of concatenating) fixes it completely — 112KB for the gamut probe, 73KB for the icon probe, both at or below the Babel baseline — while keeping tsdown's real relative-import extensions (.mjs/.js, not Babel's extensionless ones) and the speed win. Applied to all seven packages for consistency; the failure mode is structural (one shared module scope), not size-dependent, so there's no reason to leave any package on the default. One benign side effect, checked: unbundle's finer-grained CJS module graph surfaces a pre-existing circular import in Tip's style utilities as a Node "accessing non-existent property inside circular dependency" console warning. Confirmed not a functional bug — the values are only read inside function bodies, never captured at module-eval time, so by call time the cycle has resolved; verified by requiring the built module directly and calling it, real style values came back. ## Storybook deep imports into /src broke — and revealed Storybook doesn't ## actually consume any package's dist packages/styleguide/.storybook/main.ts already aliases every bare `@skillsoft/gamut*` specifier straight to that package's `../src` directory (exact-match, `$`-anchored). That means Storybook has never consumed built dist output, for any package, independent of this migration — it only compiles raw TypeScript source through webpack. The "Storybook proves the dist/exports map works" framing from earlier in this migration doesn't hold; it only incidentally caught real breaks because a handful of imports carry an extra `/src` path segment that doesn't match the bare-specifier alias, so those specific ones fall through to real node_modules -> exports resolution. 13 such imports broke once the exports map went strict: - 7 were lazy — the symbols they wanted are already exported at the package root (theme, trueColors, Box, FillButton, etc). Fixed by importing from the root, matching the codebase's own `@skillsoft/gamut/import-paths` eslint rule. - 6 reach into genuinely internal groupings with no public equivalent (icon categories, raw typography variant metadata, the full system-props registry for a docs table) — each already carried an acknowledged `// eslint-disable-next-line @skillsoft/gamut/import-paths` comment, pre-existing debt this migration surfaced rather than introduced. Fixed with four new Storybook-only webpack aliases pointing at the same monorepo source paths, keeping every package's `exports` map an honest description of its published surface instead of growing it to fit docs tooling. Verified: full `yarn build`/`yarn test`/`yarn verify` (10 projects, 1276 tests), direct CJS `require()` of all seven packages' dist output (matching export counts throughout), `yarn build-storybook` + `nx run styleguide:storybook-test` (87 suites / 493 tests, including the icon galleries and typography-variant table the new aliases unblock), and a 493-story Emotion-CSS diff across sideEffects on vs. off — byte-identical (0 differences), now under real tree-shaking (unbundle mode), confirming the 2020 style-order bug (#932) genuinely doesn't reproduce under Emotion 11, not just that it was unreachable to test. Part of the tsdown build migration (GMT-1741). --- packages/gamut-icons/package.json | 10 +++++++- packages/gamut-icons/project.json | 2 +- packages/gamut-icons/tsdown.config.ts | 25 +++++++++++++++++++ packages/gamut-illustrations/package.json | 16 ++++++++---- packages/gamut-illustrations/project.json | 2 +- packages/gamut-illustrations/tsdown.config.ts | 21 ++++++++++++++++ packages/gamut-patterns/package.json | 10 +++++++- packages/gamut-patterns/project.json | 2 +- packages/gamut-patterns/tsdown.config.ts | 20 +++++++++++++++ packages/gamut-styles/tsdown.config.ts | 2 ++ packages/gamut-tests/package.json | 10 +++++++- packages/gamut-tests/project.json | 2 +- packages/gamut-tests/tsdown.config.ts | 20 +++++++++++++++ packages/gamut/tsdown.config.ts | 9 +++++++ .../components/Scales/ColorScale.tsx | 2 +- .../components/TokenTable/elements.tsx | 2 +- packages/styleguide/.storybook/main.ts | 25 +++++++++++++++++++ .../.storybook/theming/GamutTheme.ts | 2 +- .../.storybook/theming/GamutThemeProvider.tsx | 2 +- .../styleguide/src/lib/Foundations/Layout.mdx | 2 +- .../Component guidelines/Alerts.mdx | 2 +- packages/variance/tsdown.config.ts | 5 ++++ 22 files changed, 175 insertions(+), 18 deletions(-) create mode 100644 packages/gamut-icons/tsdown.config.ts create mode 100644 packages/gamut-illustrations/tsdown.config.ts create mode 100644 packages/gamut-patterns/tsdown.config.ts create mode 100644 packages/gamut-tests/tsdown.config.ts diff --git a/packages/gamut-icons/package.json b/packages/gamut-icons/package.json index 897bc19bcd..7b1e72c985 100644 --- a/packages/gamut-icons/package.json +++ b/packages/gamut-icons/package.json @@ -7,12 +7,20 @@ "@skillsoft/gamut-styles": "0.0.1", "@skillsoft/variance": "0.0.1" }, + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + } + }, "files": [ "dist" ], "license": "MIT", "main": "dist/index.js", - "module": "dist/index.js", + "module": "dist/index.mjs", "peerDependencies": { "@emotion/react": "^11.4.0", "@emotion/styled": "^11.3.0", diff --git a/packages/gamut-icons/project.json b/packages/gamut-icons/project.json index 33258ba49f..d70f2c782e 100644 --- a/packages/gamut-icons/project.json +++ b/packages/gamut-icons/project.json @@ -20,7 +20,7 @@ "rm -rf ./src/icons", "find ./src/svg -depth -type f \\( -name '*.svg' ! -name '*-icon.svg' \\) -exec sh -c 'mv \"$1\" \"${1%.svg}-icon.svg\"' _ {} \\;", "svgr --out-dir ./src/icons --ext 'tsx' ./src/svg", - "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"", + "tsdown", "tsc --emitDeclarationOnly", "cpy './src/**/*.svg' ./dist" ], diff --git a/packages/gamut-icons/tsdown.config.ts b/packages/gamut-icons/tsdown.config.ts new file mode 100644 index 0000000000..e6a9d0e95f --- /dev/null +++ b/packages/gamut-icons/tsdown.config.ts @@ -0,0 +1,25 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + entry: ['src/index.ts'], + format: ['esm', 'cjs'], + // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. + // See packages/variance/tsdown.config.ts for the full rationale. + dts: false, + outDir: 'dist', + // dist/ is shared with tsc's declaration output — never clean from here. + clean: false, + // No explicit external needed — this package's own dependencies + + // peerDependencies (@skillsoft/gamut-styles, @skillsoft/variance, + // @emotion/*, lodash, react) are auto-externalized by tsdown. + // Mirror src/ file-by-file rather than bundling all 377 icons into one + // dist/index.mjs — verified a single flat bundle here means importing ONE + // icon pulls in all 377 (586KB) regardless of `sideEffects: false`, since + // named-export elision within one shared module scope doesn't happen in + // practice. unbundle + sideEffects: false together restore real + // per-icon tree-shaking, same convention most icon packages use. + unbundle: true, + platform: 'neutral', + sourcemap: true, + treeshake: true, +}); diff --git a/packages/gamut-illustrations/package.json b/packages/gamut-illustrations/package.json index 3125110056..b2e3f118e0 100644 --- a/packages/gamut-illustrations/package.json +++ b/packages/gamut-illustrations/package.json @@ -8,13 +8,21 @@ "@skillsoft/gamut-styles": "0.0.1", "classnames": "^2.2.5" }, + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + } + }, "files": [ "dist" ], "homepage": "https://github.com/Codecademy/skillsoft-gamut#readme", "license": "MIT", "main": "./dist/index.js", - "module": "./dist/index.js", + "module": "./dist/index.mjs", "peerDependencies": { "@emotion/react": "^11.4.0", "@emotion/styled": "^11.3.0", @@ -28,8 +36,6 @@ "scripts": { "build": "nx build gamut-illustrations" }, - "sideEffects": [ - "dist/**/[A-Z]**/[A-Z]*.js", - "dist/**/[A-Z]**/index.js" - ] + "sideEffects": false, + "types": "./dist/index.d.ts" } diff --git a/packages/gamut-illustrations/project.json b/packages/gamut-illustrations/project.json index d74ecd4923..7c8b7f6015 100644 --- a/packages/gamut-illustrations/project.json +++ b/packages/gamut-illustrations/project.json @@ -12,7 +12,7 @@ "cwd": "packages/gamut-illustrations", "commands": [ "rm -rf ./dist", - "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"", + "tsdown", "tsc --emitDeclarationOnly" ], "parallel": false diff --git a/packages/gamut-illustrations/tsdown.config.ts b/packages/gamut-illustrations/tsdown.config.ts new file mode 100644 index 0000000000..c4bb570a8e --- /dev/null +++ b/packages/gamut-illustrations/tsdown.config.ts @@ -0,0 +1,21 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + entry: ['src/index.ts'], + format: ['esm', 'cjs'], + // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. + // See packages/variance/tsdown.config.ts for the full rationale. + dts: false, + outDir: 'dist', + // dist/ is shared with tsc's declaration output — never clean from here. + clean: false, + // No explicit external needed — dependencies + peerDependencies cover + // everything this package imports. + // Mirror src/ file-by-file — see packages/gamut-icons/tsdown.config.ts for + // why (same shape: many illustration components, single bundle defeats + // shaking). + unbundle: true, + platform: 'neutral', + sourcemap: true, + treeshake: true, +}); diff --git a/packages/gamut-patterns/package.json b/packages/gamut-patterns/package.json index bc3b2fd44f..5bcd8a2d6e 100644 --- a/packages/gamut-patterns/package.json +++ b/packages/gamut-patterns/package.json @@ -9,13 +9,21 @@ "@skillsoft/variance": "0.0.1", "classnames": "^2.2.5" }, + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + } + }, "files": [ "dist" ], "homepage": "https://github.com/Codecademy/skillsoft-gamut#readme", "license": "MIT", "main": "dist/index.js", - "module": "dist/index.js", + "module": "dist/index.mjs", "peerDependencies": { "@emotion/react": "^11.4.0", "@emotion/styled": "^11.3.0", diff --git a/packages/gamut-patterns/project.json b/packages/gamut-patterns/project.json index b8c4be96bc..79ce23c6b4 100644 --- a/packages/gamut-patterns/project.json +++ b/packages/gamut-patterns/project.json @@ -19,7 +19,7 @@ "rm -rf ./dist", "rm -rf ./src/patterns", "svgr --out-dir ./src/patterns --ext 'tsx' ./src/svg", - "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"", + "tsdown", "tsc --emitDeclarationOnly", "cpy './src/**/*.svg' ./dist" ], diff --git a/packages/gamut-patterns/tsdown.config.ts b/packages/gamut-patterns/tsdown.config.ts new file mode 100644 index 0000000000..12e2428daa --- /dev/null +++ b/packages/gamut-patterns/tsdown.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + entry: ['src/index.tsx'], + format: ['esm', 'cjs'], + // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. + // See packages/variance/tsdown.config.ts for the full rationale. + dts: false, + outDir: 'dist', + // dist/ is shared with tsc's declaration output — never clean from here. + clean: false, + // No explicit external needed — dependencies + peerDependencies cover + // everything this package imports. + // Mirror src/ file-by-file — see packages/gamut-icons/tsdown.config.ts for + // why (same shape: many pattern components, single bundle defeats shaking). + unbundle: true, + platform: 'neutral', + sourcemap: true, + treeshake: true, +}); diff --git a/packages/gamut-styles/tsdown.config.ts b/packages/gamut-styles/tsdown.config.ts index ec252e6956..3fd3b42277 100644 --- a/packages/gamut-styles/tsdown.config.ts +++ b/packages/gamut-styles/tsdown.config.ts @@ -12,6 +12,8 @@ export default defineConfig({ // No explicit external needed — this package's own dependencies + // peerDependencies (@emotion/*, @skillsoft/variance, lodash, react, stylis, // framer-motion, polished, get-nonce) are auto-externalized by tsdown. + // Mirror src/ file-by-file — see packages/variance/tsdown.config.ts for why. + unbundle: true, platform: 'neutral', sourcemap: true, treeshake: true, diff --git a/packages/gamut-tests/package.json b/packages/gamut-tests/package.json index b18688a88f..d8fbf72a64 100644 --- a/packages/gamut-tests/package.json +++ b/packages/gamut-tests/package.json @@ -8,6 +8,14 @@ "component-test-setup": "*", "lodash": "^4.17.23" }, + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + } + }, "files": [ "dist" ], @@ -20,7 +28,7 @@ ], "license": "MIT", "main": "dist/index.js", - "module": "dist/index.js", + "module": "dist/index.mjs", "peerDependencies": { "react": "^17.0.2 || ^18.3.0 || ^19.0.0" }, diff --git a/packages/gamut-tests/project.json b/packages/gamut-tests/project.json index a19e362271..be41b7bb36 100644 --- a/packages/gamut-tests/project.json +++ b/packages/gamut-tests/project.json @@ -12,7 +12,7 @@ "cwd": "packages/gamut-tests", "commands": [ "rm -rf ./dist", - "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"", + "tsdown", "tsc --emitDeclarationOnly" ], "parallel": false diff --git a/packages/gamut-tests/tsdown.config.ts b/packages/gamut-tests/tsdown.config.ts new file mode 100644 index 0000000000..aefff91f5c --- /dev/null +++ b/packages/gamut-tests/tsdown.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + entry: ['src/index.tsx'], + format: ['esm', 'cjs'], + // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. + // See packages/variance/tsdown.config.ts for the full rationale. + dts: false, + outDir: 'dist', + // dist/ is shared with tsc's declaration output — never clean from here. + clean: false, + // No explicit external needed — dependencies + peerDependencies cover + // everything this package imports. Consumed from jest setup files via + // `require()`, so the CJS half of the dual output matters most here. + // Mirror src/ file-by-file for consistency with every other package here. + unbundle: true, + platform: 'neutral', + sourcemap: true, + treeshake: true, +}); diff --git a/packages/gamut/tsdown.config.ts b/packages/gamut/tsdown.config.ts index 3cfb826bfd..e24c197175 100644 --- a/packages/gamut/tsdown.config.ts +++ b/packages/gamut/tsdown.config.ts @@ -9,6 +9,15 @@ export default defineConfig({ outDir: 'dist', // dist/ is shared with tsc's declaration output — never clean from here. clean: false, + // Mirror src/ file-by-file instead of concatenating into one dist/index.mjs. + // A single flat bundle proved to defeat downstream tree-shaking entirely: an + // esbuild single-import probe pulled in gamut's whole 428KB bundle plus + // every heavy dependency any component uses (vidstack, framer-motion, + // formatjs, react-aria, react-select — ~8MB pre-minify), none of which the + // one imported component needed. unbundle keeps rolldown's speed and valid + // ESM/CJS output while giving a downstream bundler per-file granularity to + // actually shake, matching today's per-file Babel output shape. + unbundle: true, // This package's own dependencies + peerDependencies are auto-externalized by // tsdown. The one thing that auto-detection can't cover is the single relative // `.css` side-effect import (Video/lib/VidstackPlayer/vidstack-styles.css): diff --git a/packages/styleguide/.storybook/components/Scales/ColorScale.tsx b/packages/styleguide/.storybook/components/Scales/ColorScale.tsx index 30cf0828c8..6af430c34a 100644 --- a/packages/styleguide/.storybook/components/Scales/ColorScale.tsx +++ b/packages/styleguide/.storybook/components/Scales/ColorScale.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { themed } from '@skillsoft/gamut-styles'; import styled from '@emotion/styled'; -import { Box, GridBox } from '@skillsoft/gamut/src'; +import { Box, GridBox } from '@skillsoft/gamut'; const HexCode = styled.span` font-family: ${themed('fontFamily.monospace')}; diff --git a/packages/styleguide/.storybook/components/TokenTable/elements.tsx b/packages/styleguide/.storybook/components/TokenTable/elements.tsx index c14bd9e9c8..108aa26dbb 100644 --- a/packages/styleguide/.storybook/components/TokenTable/elements.tsx +++ b/packages/styleguide/.storybook/components/TokenTable/elements.tsx @@ -1,4 +1,4 @@ -import { system, variant } from '@skillsoft/gamut-styles/src'; +import { system, variant } from '@skillsoft/gamut-styles'; import styled from '@emotion/styled'; import { StyleProps } from '@skillsoft/variance'; import { Box } from '@skillsoft/gamut'; diff --git a/packages/styleguide/.storybook/main.ts b/packages/styleguide/.storybook/main.ts index 48aabe0cb5..74e446c3a6 100644 --- a/packages/styleguide/.storybook/main.ts +++ b/packages/styleguide/.storybook/main.ts @@ -75,6 +75,31 @@ const config: StorybookConfig = { '../../gamut-patterns/src' ), '@skillsoft/variance$': resolve(__dirname, '../../variance/src'), + // The bare-specifier aliases above only cover each package's public + // surface (their src/index). These four docs-only pages reach past + // that into groupings with no public export (icon categories, raw + // typography variant metadata, the full system-props registry) — the + // source's own `@skillsoft/gamut/import-paths` eslint rule already + // flags each of these sites with an acknowledged disable comment. + // Resolving them here, rather than adding them to any package's + // `exports` map, keeps that map an honest description of the + // published surface instead of growing it to fit docs tooling. + '@skillsoft/gamut-icons/src/icons/mini$': resolve( + __dirname, + '../../gamut-icons/src/icons/mini' + ), + '@skillsoft/gamut-icons/src/icons/regular$': resolve( + __dirname, + '../../gamut-icons/src/icons/regular' + ), + '@skillsoft/gamut/src/Typography/variants$': resolve( + __dirname, + '../../gamut/src/Typography/variants' + ), + '@skillsoft/gamut-styles/src/variance/config$': resolve( + __dirname, + '../../gamut-styles/src/variance/config' + ), }, }; config.infrastructureLogging = { diff --git a/packages/styleguide/.storybook/theming/GamutTheme.ts b/packages/styleguide/.storybook/theming/GamutTheme.ts index 38dac60d54..968a966893 100644 --- a/packages/styleguide/.storybook/theming/GamutTheme.ts +++ b/packages/styleguide/.storybook/theming/GamutTheme.ts @@ -3,7 +3,7 @@ import { theme as gamutTheme, trueColors, coreSwatches, -} from '@skillsoft/gamut-styles/src'; +} from '@skillsoft/gamut-styles'; import logo from '../assets/logo.svg'; diff --git a/packages/styleguide/.storybook/theming/GamutThemeProvider.tsx b/packages/styleguide/.storybook/theming/GamutThemeProvider.tsx index 26ac72a4cd..afb425806e 100644 --- a/packages/styleguide/.storybook/theming/GamutThemeProvider.tsx +++ b/packages/styleguide/.storybook/theming/GamutThemeProvider.tsx @@ -9,7 +9,7 @@ import { lxStudioTheme, percipioTheme, platformTheme, -} from '@skillsoft/gamut-styles/src'; +} from '@skillsoft/gamut-styles'; import { Theme } from '@emotion/react'; const STORYBOOK_CSP_NONCE = 'storybook-csp-nonce'; diff --git a/packages/styleguide/src/lib/Foundations/Layout.mdx b/packages/styleguide/src/lib/Foundations/Layout.mdx index 810f9899f2..8a18b5a975 100644 --- a/packages/styleguide/src/lib/Foundations/Layout.mdx +++ b/packages/styleguide/src/lib/Foundations/Layout.mdx @@ -1,4 +1,4 @@ -import { Box } from '@skillsoft/gamut/src'; +import { Box } from '@skillsoft/gamut'; import { Meta } from '@storybook/addon-docs/blocks'; import { ComponentHeader, LinkTo, TokenTable } from '~styleguide/blocks'; diff --git a/packages/styleguide/src/lib/UX Writing/Component guidelines/Alerts.mdx b/packages/styleguide/src/lib/UX Writing/Component guidelines/Alerts.mdx index 7b06d820c2..5d023abcf5 100644 --- a/packages/styleguide/src/lib/UX Writing/Component guidelines/Alerts.mdx +++ b/packages/styleguide/src/lib/UX Writing/Component guidelines/Alerts.mdx @@ -1,4 +1,4 @@ -import { Alert, Text } from '@skillsoft/gamut/src'; +import { Alert, Text } from '@skillsoft/gamut'; import { Meta } from '@storybook/addon-docs/blocks'; import { AboutHeader, LinkTo } from '~styleguide/blocks'; diff --git a/packages/variance/tsdown.config.ts b/packages/variance/tsdown.config.ts index 9aad9e3c78..12c5c23eb5 100644 --- a/packages/variance/tsdown.config.ts +++ b/packages/variance/tsdown.config.ts @@ -17,6 +17,11 @@ export default defineConfig({ // own `dependencies` + `peerDependencies` (csstype, lodash, @emotion/react, // typescript) and externalizes them automatically. That matches today's Babel // build exactly — it never bundled third-party deps either. + // Mirror src/ file-by-file instead of concatenating into one dist/index.mjs. + // A single flat bundle defeats downstream tree-shaking entirely — verified on + // `gamut`: a single-component import pulled in the whole bundle plus every + // dependency any component uses (~15x the size of an unbundled equivalent). + unbundle: true, platform: 'neutral', sourcemap: true, treeshake: true, From 45a9f16bf8716ca4c4b815397839897d46a5d452 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Wed, 16 Sep 2026 12:34:27 -0400 Subject: [PATCH 04/47] build(tsdown): add packaging verification (publint, attw, exports resolver, lint rule) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes out the remaining PR 1 verification scaffolding from the tsdown migration plan (GMT-1741): the automated guard that substitutes for having real published consumers to catch a broken exports map. ## verify-package nx target (publint + attw), all seven packages Added `publint .` and `attw --pack . --ignore-rules false-cjs` as a new `verify-package` target, depending on `build`, on every tsdown-migrated package. `--ignore-rules false-cjs` suppresses one accepted, deliberate tradeoff of the hybrid build: attw flags "masquerading as CJS" because a single shared `dist/index.d.ts` serves both the `import` and `require` conditions (tsc only emits one declaration tree, not per-format `.d.mts`/`.d.cts` copies). That only affects `moduleResolution: node16`/ `nodenext` consumers importing via ESM syntax — this repo's own tsconfig.base.json uses legacy `moduleResolution: "node"`, and the bundler profile (the actual consumption path) is unaffected. Splitting declarations per format to satisfy this would mean tsc emitting twice the output for a benefit no current consumer needs. Tried adding `"type": "commonjs"` per publint's own suggestion (removes a minor Node startup perf-hit note) and had to revert it immediately — it broke tsdown's own ability to load `tsdown.config.ts`, which uses ESM `import` syntax and lives in the same directory. Every package's config file depends on the "type" field staying unset; verified by testing the change, watching `variance:build` fail with "Cannot use import statement outside a module", and reverting across all seven packages. ## script/verify-exports.mjs Resolves every package's `exports` map from the repo root the way a real consumer would: asserts the root subpath resolves AND loads via both `require()` and `import()`, and asserts old deep `dist/*` paths are blocked with ERR_PACKAGE_PATH_NOT_EXPORTED. The ESM `import()` check surfaced a real, pre-existing gap: variance (and everything depending on it) imports lodash via extensionless deep subpaths (`lodash/get`, not `lodash/get.js`). lodash ships no `exports` map, so Node's native ESM resolver — unlike `require()`, and unlike every bundler's resolver (webpack/esbuild/rollup all probe extensions) — refuses it outright. This is inherent to lodash's own packaging, predates this migration, and only matters for a consumer running raw Node ESM with no bundler in front, which isn't a real path for any package here. Fixing it means rewriting ~25 files' lodash imports across 5 packages; scoped out as a fast-follow rather than blocking here. The script treats it as a clearly-flagged warning, not a failure. ## eslint rule: require-styled-target-for-selector Codifies the BarChart `target` fix from the first tsdown-migration commit as an enforced rule, added to `recommended.ts`. Flags a `styled()` call used via `${Component}` interpolation in a computed style-object key that has no explicit `target` — the exact silent-`.undefined`-in-production failure mode `@emotion/babel-plugin` used to paper over automatically. Verified against the real gamut/gamut-styles/gamut-icons/gamut-patterns/ gamut-illustrations source with `--no-inline-config` (ignoring existing disable comments): zero violations, confirming BarChart was the only site and there's nothing else to fix. ## CI Wired `verify-package` and `verify-exports.mjs` into the storybook-test job's build step, ahead of the Storybook build. Verified: full `yarn build`/`yarn test`/`yarn verify`, `yarn nx run-many --target=verify-package --all` (7/7 clean), `node script/verify-exports.mjs` (all checks passed, lodash gap flagged not failed), and the new eslint rule's test suite (60/60 passing across the whole plugin). Part of the tsdown build migration (GMT-1741). --- .github/workflows/test.yml | 4 + packages/eslint-plugin-gamut/src/index.tsx | 2 + .../eslint-plugin-gamut/src/recommended.ts | 1 + ...require-styled-target-for-selector.test.ts | 54 +++++++++ .../src/require-styled-target-for-selector.ts | 104 ++++++++++++++++ packages/gamut-icons/project.json | 12 ++ packages/gamut-illustrations/project.json | 12 ++ packages/gamut-patterns/project.json | 12 ++ packages/gamut-styles/project.json | 12 ++ packages/gamut-tests/project.json | 12 ++ packages/gamut/project.json | 12 ++ packages/variance/project.json | 12 ++ script/verify-exports.mjs | 111 ++++++++++++++++++ 13 files changed, 360 insertions(+) create mode 100644 packages/eslint-plugin-gamut/src/require-styled-target-for-selector.test.ts create mode 100644 packages/eslint-plugin-gamut/src/require-styled-target-for-selector.ts create mode 100644 script/verify-exports.mjs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 131e9a4ebc..051a96a473 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,10 @@ jobs: - uses: ./.github/actions/yarn - name: Build All Packages run: yarn build + - name: Verify published package shape (publint, attw) + run: npx nx run-many --target=verify-package --all + - name: Verify exports maps resolve + run: node script/verify-exports.mjs - name: Install Playwright (Storybook test runner) run: yarn playwright install chromium --with-deps - name: Storybook build and accessibility tests diff --git a/packages/eslint-plugin-gamut/src/index.tsx b/packages/eslint-plugin-gamut/src/index.tsx index ddfea4df98..5f5df1e335 100644 --- a/packages/eslint-plugin-gamut/src/index.tsx +++ b/packages/eslint-plugin-gamut/src/index.tsx @@ -4,6 +4,7 @@ import noInlineStyle from './no-inline-style'; import noKbdElement from './no-kbd-element'; import preferThemed from './prefer-themed'; import recommended from './recommended'; +import requireStyledTargetForSelector from './require-styled-target-for-selector'; const rules = { 'import-paths': gamutImportPaths, @@ -11,6 +12,7 @@ const rules = { 'no-inline-style': noInlineStyle, 'no-kbd-element': noKbdElement, 'prefer-themed': preferThemed, + 'require-styled-target-for-selector': requireStyledTargetForSelector, }; // Nested under `configs` so ESLint can resolve `extends: ['plugin:@skillsoft/gamut/recommended']`. diff --git a/packages/eslint-plugin-gamut/src/recommended.ts b/packages/eslint-plugin-gamut/src/recommended.ts index 46fd87f56a..276967936a 100644 --- a/packages/eslint-plugin-gamut/src/recommended.ts +++ b/packages/eslint-plugin-gamut/src/recommended.ts @@ -4,5 +4,6 @@ export default { '@skillsoft/gamut/no-inline-style': 'error', '@skillsoft/gamut/prefer-themed': 'error', '@skillsoft/gamut/import-paths': 'error', + '@skillsoft/gamut/require-styled-target-for-selector': 'error', }, }; diff --git a/packages/eslint-plugin-gamut/src/require-styled-target-for-selector.test.ts b/packages/eslint-plugin-gamut/src/require-styled-target-for-selector.test.ts new file mode 100644 index 0000000000..dfd30a9a7d --- /dev/null +++ b/packages/eslint-plugin-gamut/src/require-styled-target-for-selector.test.ts @@ -0,0 +1,54 @@ +import { TSESLint } from '@typescript-eslint/utils'; + +import rule from './require-styled-target-for-selector'; + +const ruleTester = new TSESLint.RuleTester({ + parser: require.resolve('@typescript-eslint/parser'), +}); + +ruleTester.run('require-styled-target-for-selector', rule, { + valid: [ + // no interpolation at all + `const styles = { color: 'red' };`, + // styled() call with an explicit target + ` + const CategoryLabel = styled(Text, { target: 'gmt-category-label' })(css({})); + const styles = { + [\`&:hover \${CategoryLabel}\`]: { textDecoration: 'underline' }, + }; + `, + // interpolated identifier isn't a styled() call at all + ` + const Foo = 'some-string'; + const styles = { + [\`&:hover \${Foo}\`]: { textDecoration: 'underline' }, + }; + `, + // template literal that isn't a computed object key — not the pattern + // this rule cares about + ` + const CategoryLabel = styled(Text)(css({})); + const selector = \`&:hover \${CategoryLabel}\`; + `, + ], + invalid: [ + { + code: ` + const CategoryLabel = styled(Text)(css({})); + const styles = { + [\`&:hover \${CategoryLabel}\`]: { textDecoration: 'underline' }, + }; + `, + errors: [{ messageId: 'missingTarget' }], + }, + { + code: ` + const CategoryLabel = styled(Text, { shouldForwardProp: () => true })(css({})); + const styles = { + [\`&:hover \${CategoryLabel}\`]: { textDecoration: 'underline' }, + }; + `, + errors: [{ messageId: 'missingTarget' }], + }, + ], +}); diff --git a/packages/eslint-plugin-gamut/src/require-styled-target-for-selector.ts b/packages/eslint-plugin-gamut/src/require-styled-target-for-selector.ts new file mode 100644 index 0000000000..74bf6a7419 --- /dev/null +++ b/packages/eslint-plugin-gamut/src/require-styled-target-for-selector.ts @@ -0,0 +1,104 @@ +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; + +import { createRule } from './createRule'; + +/** + * `@emotion/babel-plugin` stamps a `target` property on every `styled()` + * call automatically — that's what makes a component-selector interpolation + * like `` [`&:hover ${OtherComponent}`] `` work at runtime. Gamut's + * production build (tsdown) doesn't run that plugin, so any `styled()` call + * consumed this way needs an explicit `target` in its own source, or the + * selector silently degrades to `.undefined` in production while looking + * correct in dev/test/Storybook (which still run the component through + * Babel). See packages/gamut/src/BarChart/BarRow/elements.tsx for the one + * existing example. + */ + +// `styled(X, options)(...)` is a curried call: the outer CallExpression's +// callee is itself the `styled(X, options)` call, not the identifier +// `styled`. Find that inner call, since `options` (and `target`) live there. +const findStyledCall = ( + node: TSESTree.Node +): TSESTree.CallExpression | undefined => { + if (node.type !== AST_NODE_TYPES.CallExpression) return undefined; + if ( + node.callee.type === AST_NODE_TYPES.Identifier && + node.callee.name === 'styled' + ) { + return node; + } + return findStyledCall(node.callee); +}; + +const hasExplicitTarget = (call: TSESTree.CallExpression): boolean => { + const optionsArg = call.arguments[1]; + return ( + optionsArg?.type === AST_NODE_TYPES.ObjectExpression && + optionsArg.properties.some( + (prop) => + prop.type === AST_NODE_TYPES.Property && + prop.key.type === AST_NODE_TYPES.Identifier && + prop.key.name === 'target' + ) + ); +}; + +export default createRule({ + create(context) { + return { + TemplateLiteral(node: TSESTree.TemplateLiteral) { + // Only care about template literals used as a computed style-object + // key, e.g. `[`&:hover ${Foo}`]: { ... }` — not every template + // literal in the file. + const parent = node.parent; + if ( + parent?.type !== AST_NODE_TYPES.Property || + parent.key !== node || + !parent.computed + ) { + return; + } + + for (const expression of node.expressions) { + if (expression.type !== AST_NODE_TYPES.Identifier) continue; + + const variable = context.sourceCode + .getScope(expression) + .references.find((ref) => ref.identifier === expression) + ?.resolved; + const declarator = variable?.defs.find( + (def) => def.node.type === AST_NODE_TYPES.VariableDeclarator + )?.node as TSESTree.VariableDeclarator | undefined; + const init = declarator?.init; + + const styledCall = init && findStyledCall(init); + if (!styledCall) continue; + + if (!hasExplicitTarget(styledCall)) { + context.report({ + messageId: 'missingTarget', + node: expression, + data: { name: expression.name }, + }); + } + } + }, + }; + }, + defaultOptions: [], + meta: { + docs: { + description: + 'Require an explicit `target` on a styled() component used as a selector interpolation.', + }, + messages: { + missingTarget: + '`{{name}}` is interpolated into a style selector but its styled() call has no explicit `target`. ' + + '@emotion/babel-plugin normally stamps this automatically, but the production build does not run ' + + 'that plugin — add `styled(X, { target: \'some-stable-name\' })` or the selector silently breaks in production.', + }, + type: 'problem', + schema: [], + }, + name: 'require-styled-target-for-selector', +}); diff --git a/packages/gamut-icons/project.json b/packages/gamut-icons/project.json index d70f2c782e..721a5d1e1d 100644 --- a/packages/gamut-icons/project.json +++ b/packages/gamut-icons/project.json @@ -42,6 +42,18 @@ "command": "rm -rf ./dist" } }, + "verify-package": { + "executor": "nx:run-commands", + "dependsOn": ["build"], + "options": { + "cwd": "{projectRoot}", + "commands": [ + "publint .", + "attw --pack . --ignore-rules false-cjs" + ], + "parallel": false + } + }, "publish-build": { "executor": "nx:run-commands", "dependsOn": ["build"], diff --git a/packages/gamut-illustrations/project.json b/packages/gamut-illustrations/project.json index 7c8b7f6015..a0001c7ab2 100644 --- a/packages/gamut-illustrations/project.json +++ b/packages/gamut-illustrations/project.json @@ -32,6 +32,18 @@ "command": "rm -rf ./dist" } }, + "verify-package": { + "executor": "nx:run-commands", + "dependsOn": ["build"], + "options": { + "cwd": "{projectRoot}", + "commands": [ + "publint .", + "attw --pack . --ignore-rules false-cjs" + ], + "parallel": false + } + }, "publish-build": { "executor": "nx:run-commands", "dependsOn": ["build"], diff --git a/packages/gamut-patterns/project.json b/packages/gamut-patterns/project.json index 79ce23c6b4..92ad57df42 100644 --- a/packages/gamut-patterns/project.json +++ b/packages/gamut-patterns/project.json @@ -41,6 +41,18 @@ "command": "rm -rf ./dist" } }, + "verify-package": { + "executor": "nx:run-commands", + "dependsOn": ["build"], + "options": { + "cwd": "{projectRoot}", + "commands": [ + "publint .", + "attw --pack . --ignore-rules false-cjs" + ], + "parallel": false + } + }, "publish-build": { "executor": "nx:run-commands", "dependsOn": ["build"], diff --git a/packages/gamut-styles/project.json b/packages/gamut-styles/project.json index 504fbd86bf..7f5c496f70 100644 --- a/packages/gamut-styles/project.json +++ b/packages/gamut-styles/project.json @@ -35,6 +35,18 @@ "command": "rm -rf ./dist" } }, + "verify-package": { + "executor": "nx:run-commands", + "dependsOn": ["build"], + "options": { + "cwd": "{projectRoot}", + "commands": [ + "publint .", + "attw --pack . --ignore-rules false-cjs" + ], + "parallel": false + } + }, "publish-build": { "executor": "nx:run-commands", "dependsOn": ["build"], diff --git a/packages/gamut-tests/project.json b/packages/gamut-tests/project.json index be41b7bb36..32d909eff7 100644 --- a/packages/gamut-tests/project.json +++ b/packages/gamut-tests/project.json @@ -33,6 +33,18 @@ "command": "rm -rf ./dist" } }, + "verify-package": { + "executor": "nx:run-commands", + "dependsOn": ["build"], + "options": { + "cwd": "{projectRoot}", + "commands": [ + "publint .", + "attw --pack . --ignore-rules false-cjs" + ], + "parallel": false + } + }, "publish-build": { "executor": "nx:run-commands", "dependsOn": ["build"], diff --git a/packages/gamut/project.json b/packages/gamut/project.json index 1723562d6d..21806b5428 100644 --- a/packages/gamut/project.json +++ b/packages/gamut/project.json @@ -34,6 +34,18 @@ "command": "rm -rf ./dist" } }, + "verify-package": { + "executor": "nx:run-commands", + "dependsOn": ["build"], + "options": { + "cwd": "{projectRoot}", + "commands": [ + "publint .", + "attw --pack . --ignore-rules false-cjs" + ], + "parallel": false + } + }, "publish-build": { "executor": "nx:run-commands", "dependsOn": ["build"], diff --git a/packages/variance/project.json b/packages/variance/project.json index ab4938d2de..f4e9089598 100644 --- a/packages/variance/project.json +++ b/packages/variance/project.json @@ -40,6 +40,18 @@ "command": "rm -rf ./dist" } }, + "verify-package": { + "executor": "nx:run-commands", + "dependsOn": ["build"], + "options": { + "cwd": "{projectRoot}", + "commands": [ + "publint .", + "attw --pack . --ignore-rules false-cjs" + ], + "parallel": false + } + }, "publish-build": { "executor": "nx:run-commands", "dependsOn": ["build"], diff --git a/script/verify-exports.mjs b/script/verify-exports.mjs new file mode 100644 index 0000000000..4d0432e3c2 --- /dev/null +++ b/script/verify-exports.mjs @@ -0,0 +1,111 @@ +#!/usr/bin/env node +/** + * Resolves every publishable package's `exports` map from the repo root, + * the same way a real consumer would, and asserts: + * 1. the root subpath resolves AND loads (via both ESM `import` and CJS + * `require`) — not just that the path string is syntactically valid + * 2. old deep `dist/*` paths, which the exports map no longer lists, are + * correctly blocked with ERR_PACKAGE_PATH_NOT_EXPORTED + * + * publint/attw check the package.json fields are internally consistent; + * this script checks Node's actual resolver agrees, since workspace + * symlinks make it easy for that to silently diverge. + */ +import { createRequire } from 'node:module'; + +const require = createRequire(import.meta.url); + +const PACKAGES = [ + 'variance', + 'gamut-styles', + 'gamut-icons', + 'gamut-patterns', + 'gamut-illustrations', + 'gamut-tests', + 'gamut', +]; + +let failures = 0; + +function fail(message) { + failures += 1; + console.error(`✗ ${message}`); +} + +function pass(message) { + console.log(`✓ ${message}`); +} + +for (const pkg of PACKAGES) { + const name = `@skillsoft/${pkg}`; + + // 1. CJS require() resolves and the module actually loads. + try { + // .css files have no CJS transform outside a bundler — stub them, same + // as a real consumer's test environment would. + require.extensions['.css'] = () => {}; + const mod = require(name); + const exportCount = Object.keys(mod).length; + if (exportCount === 0) { + fail(`${name}: loaded via require() but has 0 named exports`); + } else { + pass(`${name}: require() resolves and loads (${exportCount} exports)`); + } + } catch (err) { + fail(`${name}: require() failed — ${err.code ?? err.message}`); + } + + // 2. ESM import resolves and the module actually loads. + // + // Known, non-blocking gap: variance (and everything that transitively + // depends on it) imports lodash via extensionless deep subpaths + // (`lodash/get`, not `lodash/get.js`). lodash ships no `exports` map, so + // Node's *native* ESM resolver — unlike `require()`, and unlike every + // bundler's resolver (webpack, esbuild, rollup all probe extensions) — + // refuses those imports outright. This is inherent to lodash's own + // packaging, predates this migration, and only bites a consumer running + // `node --experimental-vm-modules` or similar with zero bundler in front — + // not a real consumption path for any package here today. Fixing it means + // rewriting ~25 files' lodash imports across 5 packages; tracked as a + // fast-follow, not blocking here. See tsdown migration notes (GMT-1741). + try { + const mod = await import(name); + const exportCount = Object.keys(mod).length; + if (exportCount === 0) { + fail(`${name}: loaded via import() but has 0 named exports`); + } else { + pass(`${name}: import() resolves and loads (${exportCount} exports)`); + } + } catch (err) { + if (err.code === 'ERR_MODULE_NOT_FOUND' && /lodash\//.test(err.message)) { + console.warn( + `⚠ ${name}: import() failed on a lodash deep import (known gap, not blocking) — ${err.message.split('\n')[0]}` + ); + } else { + fail(`${name}: import() failed — ${err.code ?? err.message}`); + } + } + + // 3. Old deep dist paths are blocked — the exports map is root-only, so + // anything reaching past it should fail with ERR_PACKAGE_PATH_NOT_EXPORTED. + for (const deepPath of [`${name}/dist/index.js`, `${name}/src/index.ts`]) { + try { + require.resolve(deepPath); + fail(`${deepPath}: resolved, but the exports map should block this`); + } catch (err) { + if (err.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') { + pass(`${deepPath}: correctly blocked`); + } else { + fail(`${deepPath}: blocked, but with the wrong error — ${err.code}`); + } + } + } +} + +console.log(''); +if (failures > 0) { + console.error(`${failures} check(s) failed.`); + process.exit(1); +} else { + console.log('All export checks passed.'); +} From 37e28f5c0f958845fe48f8d1ce948605e4f76224 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 17 Sep 2026 10:19:45 -0400 Subject: [PATCH 05/47] build(tsdown): replace Babel with tsdown across all gamut packages --- package.json | 4 +- packages/gamut-icons/tsdown.config.ts | 24 ++---------- packages/gamut-illustrations/tsdown.config.ts | 20 ++-------- packages/gamut-patterns/tsdown.config.ts | 19 ++------- packages/gamut-styles/tsdown.config.ts | 19 ++------- packages/gamut-tests/tsdown.config.ts | 19 ++------- packages/gamut/tsdown.config.ts | 35 +++++------------ packages/styleguide/src/lib/About.mdx | 2 +- .../styleguide/src/lib/Meta/Installation.mdx | 39 +++++++++++++++++++ packages/variance/tsdown.config.ts | 29 +++----------- tsdown.base.ts | 34 ++++++++++++++++ yarn.lock | 8 ++-- 12 files changed, 116 insertions(+), 136 deletions(-) create mode 100644 tsdown.base.ts diff --git a/package.json b/package.json index a258d416ac..8714d9d37c 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "react-helmet-async": "^2.0.5" }, "devDependencies": { - "@arethetypeswrong/cli": "^0.18.5", + "@arethetypeswrong/cli": "0.18.5", "@babel/cli": "7.24.7", "@babel/core": "7.24.7", "@babel/preset-env": "^7.24.7", @@ -82,7 +82,7 @@ "onchange": "^7.0.2", "playwright": "^1.49.1", "prettier": "^2.8.7", - "publint": "^0.3.24", + "publint": "0.3.24", "react-test-renderer": "^19.0.0", "start-server-and-test": "^2.1.5", "storybook": "^10.3.1", diff --git a/packages/gamut-icons/tsdown.config.ts b/packages/gamut-icons/tsdown.config.ts index e6a9d0e95f..8dfdd1cae1 100644 --- a/packages/gamut-icons/tsdown.config.ts +++ b/packages/gamut-icons/tsdown.config.ts @@ -1,25 +1,9 @@ import { defineConfig } from 'tsdown'; +// Explicit `.ts` extension required — see packages/variance/tsdown.config.ts. +import { baseConfig } from '../../tsdown.base.ts'; + export default defineConfig({ + ...baseConfig, entry: ['src/index.ts'], - format: ['esm', 'cjs'], - // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. - // See packages/variance/tsdown.config.ts for the full rationale. - dts: false, - outDir: 'dist', - // dist/ is shared with tsc's declaration output — never clean from here. - clean: false, - // No explicit external needed — this package's own dependencies + - // peerDependencies (@skillsoft/gamut-styles, @skillsoft/variance, - // @emotion/*, lodash, react) are auto-externalized by tsdown. - // Mirror src/ file-by-file rather than bundling all 377 icons into one - // dist/index.mjs — verified a single flat bundle here means importing ONE - // icon pulls in all 377 (586KB) regardless of `sideEffects: false`, since - // named-export elision within one shared module scope doesn't happen in - // practice. unbundle + sideEffects: false together restore real - // per-icon tree-shaking, same convention most icon packages use. - unbundle: true, - platform: 'neutral', - sourcemap: true, - treeshake: true, }); diff --git a/packages/gamut-illustrations/tsdown.config.ts b/packages/gamut-illustrations/tsdown.config.ts index c4bb570a8e..8dfdd1cae1 100644 --- a/packages/gamut-illustrations/tsdown.config.ts +++ b/packages/gamut-illustrations/tsdown.config.ts @@ -1,21 +1,9 @@ import { defineConfig } from 'tsdown'; +// Explicit `.ts` extension required — see packages/variance/tsdown.config.ts. +import { baseConfig } from '../../tsdown.base.ts'; + export default defineConfig({ + ...baseConfig, entry: ['src/index.ts'], - format: ['esm', 'cjs'], - // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. - // See packages/variance/tsdown.config.ts for the full rationale. - dts: false, - outDir: 'dist', - // dist/ is shared with tsc's declaration output — never clean from here. - clean: false, - // No explicit external needed — dependencies + peerDependencies cover - // everything this package imports. - // Mirror src/ file-by-file — see packages/gamut-icons/tsdown.config.ts for - // why (same shape: many illustration components, single bundle defeats - // shaking). - unbundle: true, - platform: 'neutral', - sourcemap: true, - treeshake: true, }); diff --git a/packages/gamut-patterns/tsdown.config.ts b/packages/gamut-patterns/tsdown.config.ts index 12e2428daa..b4e771488d 100644 --- a/packages/gamut-patterns/tsdown.config.ts +++ b/packages/gamut-patterns/tsdown.config.ts @@ -1,20 +1,9 @@ import { defineConfig } from 'tsdown'; +// Explicit `.ts` extension required — see packages/variance/tsdown.config.ts. +import { baseConfig } from '../../tsdown.base.ts'; + export default defineConfig({ + ...baseConfig, entry: ['src/index.tsx'], - format: ['esm', 'cjs'], - // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. - // See packages/variance/tsdown.config.ts for the full rationale. - dts: false, - outDir: 'dist', - // dist/ is shared with tsc's declaration output — never clean from here. - clean: false, - // No explicit external needed — dependencies + peerDependencies cover - // everything this package imports. - // Mirror src/ file-by-file — see packages/gamut-icons/tsdown.config.ts for - // why (same shape: many pattern components, single bundle defeats shaking). - unbundle: true, - platform: 'neutral', - sourcemap: true, - treeshake: true, }); diff --git a/packages/gamut-styles/tsdown.config.ts b/packages/gamut-styles/tsdown.config.ts index 3fd3b42277..8dfdd1cae1 100644 --- a/packages/gamut-styles/tsdown.config.ts +++ b/packages/gamut-styles/tsdown.config.ts @@ -1,20 +1,9 @@ import { defineConfig } from 'tsdown'; +// Explicit `.ts` extension required — see packages/variance/tsdown.config.ts. +import { baseConfig } from '../../tsdown.base.ts'; + export default defineConfig({ + ...baseConfig, entry: ['src/index.ts'], - format: ['esm', 'cjs'], - // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. - // See packages/variance/tsdown.config.ts for the full rationale. - dts: false, - outDir: 'dist', - // dist/ is shared with tsc's declaration output — never clean from here. - clean: false, - // No explicit external needed — this package's own dependencies + - // peerDependencies (@emotion/*, @skillsoft/variance, lodash, react, stylis, - // framer-motion, polished, get-nonce) are auto-externalized by tsdown. - // Mirror src/ file-by-file — see packages/variance/tsdown.config.ts for why. - unbundle: true, - platform: 'neutral', - sourcemap: true, - treeshake: true, }); diff --git a/packages/gamut-tests/tsdown.config.ts b/packages/gamut-tests/tsdown.config.ts index aefff91f5c..b4e771488d 100644 --- a/packages/gamut-tests/tsdown.config.ts +++ b/packages/gamut-tests/tsdown.config.ts @@ -1,20 +1,9 @@ import { defineConfig } from 'tsdown'; +// Explicit `.ts` extension required — see packages/variance/tsdown.config.ts. +import { baseConfig } from '../../tsdown.base.ts'; + export default defineConfig({ + ...baseConfig, entry: ['src/index.tsx'], - format: ['esm', 'cjs'], - // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. - // See packages/variance/tsdown.config.ts for the full rationale. - dts: false, - outDir: 'dist', - // dist/ is shared with tsc's declaration output — never clean from here. - clean: false, - // No explicit external needed — dependencies + peerDependencies cover - // everything this package imports. Consumed from jest setup files via - // `require()`, so the CJS half of the dual output matters most here. - // Mirror src/ file-by-file for consistency with every other package here. - unbundle: true, - platform: 'neutral', - sourcemap: true, - treeshake: true, }); diff --git a/packages/gamut/tsdown.config.ts b/packages/gamut/tsdown.config.ts index e24c197175..41ee15f3ef 100644 --- a/packages/gamut/tsdown.config.ts +++ b/packages/gamut/tsdown.config.ts @@ -1,33 +1,18 @@ import { defineConfig } from 'tsdown'; +// Explicit `.ts` extension required — see packages/variance/tsdown.config.ts. +import { baseConfig } from '../../tsdown.base.ts'; + export default defineConfig({ + ...baseConfig, entry: ['src/index.tsx'], - format: ['esm', 'cjs'], - // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. - // See packages/variance/tsdown.config.ts for the full rationale. - dts: false, - outDir: 'dist', - // dist/ is shared with tsc's declaration output — never clean from here. - clean: false, - // Mirror src/ file-by-file instead of concatenating into one dist/index.mjs. - // A single flat bundle proved to defeat downstream tree-shaking entirely: an - // esbuild single-import probe pulled in gamut's whole 428KB bundle plus - // every heavy dependency any component uses (vidstack, framer-motion, - // formatjs, react-aria, react-select — ~8MB pre-minify), none of which the - // one imported component needed. unbundle keeps rolldown's speed and valid - // ESM/CJS output while giving a downstream bundler per-file granularity to - // actually shake, matching today's per-file Babel output shape. - unbundle: true, - // This package's own dependencies + peerDependencies are auto-externalized by - // tsdown. The one thing that auto-detection can't cover is the single relative - // `.css` side-effect import (Video/lib/VidstackPlayer/vidstack-styles.css): - // tsdown refuses to bundle a `.css` import unless `@tsdown/css` is installed, - // and externalizing it matches the current build exactly — it `cpy`s the CSS - // into dist and lets the consumer's bundler handle the side-effect import. + // The one thing base config's dependency auto-externalization can't cover: the + // single relative `.css` side-effect import + // (Video/lib/VidstackPlayer/vidstack-styles.css). tsdown refuses to bundle a + // `.css` import unless `@tsdown/css` is installed, and externalizing it matches + // the current build exactly — it `cpy`s the CSS into dist and lets the + // consumer's bundler handle the side-effect import. deps: { neverBundle: [/\.css$/], }, - platform: 'neutral', - sourcemap: true, - treeshake: true, }); diff --git a/packages/styleguide/src/lib/About.mdx b/packages/styleguide/src/lib/About.mdx index e0236317e3..009f2bc440 100644 --- a/packages/styleguide/src/lib/About.mdx +++ b/packages/styleguide/src/lib/About.mdx @@ -14,7 +14,7 @@ import { parameters as uxWritingParameters } from './UX Writing/About.mdx'; export const parameters = { id: 'Gamut', title: 'Gamut', - subtitle: 'The design system for Codecademy ✨', + subtitle: 'The design system for Skillsoft + Codecademy ✨', }; diff --git a/packages/styleguide/src/lib/Meta/Installation.mdx b/packages/styleguide/src/lib/Meta/Installation.mdx index 32ad36e532..54a206b3cf 100644 --- a/packages/styleguide/src/lib/Meta/Installation.mdx +++ b/packages/styleguide/src/lib/Meta/Installation.mdx @@ -95,12 +95,51 @@ If your app uses a strict Content-Security-Policy (e.g. `style-src` without `'un Your nonce should be the same value you use in your CSP header (e.g. `style-src 'self' 'nonce-{value}'`). +## Module format: ESM vs. CommonJS + +Every Gamut package ships **both** an ESM build (`dist/index.mjs`) and a CommonJS build +(`dist/index.js`), routed automatically by `package.json`'s `exports` map: + +```jsonc +"exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", // `import { X } from '@skillsoft/gamut'` + "require": "./dist/index.js" // `const { X } = require('@skillsoft/gamut')` + } +} +``` + +**In almost every real app, you don't choose — your own code already does.** Whichever +syntax you import Gamut with is what selects the build: + +```ts +import { FillButton } from '@skillsoft/gamut'; // -> dist/index.mjs (ESM) +const { FillButton } = require('@skillsoft/gamut'); // -> dist/index.js (CommonJS) +``` + +Every mainstream bundler (webpack, Vite, esbuild, Next.js, Rspack) and Node itself resolve +this correctly on their own. You only need to think about it explicitly in a few cases: + +- **Running Gamut through native Node ESM with no bundler in front** (a plain + `node --experimental-vm-modules` script, or similar). This is the one case where the + `import` syntax genuinely matters: Node's native ESM resolver is stricter than a bundler's, + and you must use `import` to land on the `.mjs` build. +- **A legacy CommonJS-only tool** that only understands `require()` — it gets the CJS build + automatically via the `require` condition above; nothing to configure. +- **Mixing `require()` and `import()` of the same Gamut package in one process.** Node treats + each condition as a genuinely separate module instantiation. For most components this is + harmless, but anything relying on shared module-scope state (Emotion's cache, theme + context) should stick to one import style per app rather than mixing both. + ## Testing with Jest (and Babel) Gamut depends on packages that ship modern JavaScript from `node_modules`. Jest often skips transpiling `node_modules`, so importing Gamut in tests can surface parse or syntax errors unless your repo opts those dependencies into your test transform. If tests only fail after upgrading Gamut or a transitive dependency, compare your Jest and Babel setup with Gamut's and adjust `transformIgnorePatterns` and plugins accordingly. +Jest's default module resolution is CommonJS-based, so a plain `require('@skillsoft/gamut')` inside a test resolves through the `require` condition above and gets the already-built CJS `dist/index.js` — no transform needed for Gamut itself. This only changes if your Jest config is set up for native ESM (`extensionsToTreatAsEsm`, `--experimental-vm-modules`); in that mode Jest resolves the `import` condition instead and gets `dist/index.mjs`. + ### `transformIgnorePatterns` Allow your test transformer (for example `babel-jest`) to run on specific packages. Gamut's own Jest setup uses a negative lookahead so `@vidstack/react` and `@formatjs` are not ignored: diff --git a/packages/variance/tsdown.config.ts b/packages/variance/tsdown.config.ts index 12c5c23eb5..1c2671a78d 100644 --- a/packages/variance/tsdown.config.ts +++ b/packages/variance/tsdown.config.ts @@ -1,28 +1,11 @@ import { defineConfig } from 'tsdown'; +// The explicit `.ts` extension is required, not stylistic: tsdown's default config +// loader runs on Node's native TS-stripping ESM loader, which (unlike a bundler) +// doesn't do extension probing on relative imports. +import { baseConfig } from '../../tsdown.base.ts'; + export default defineConfig({ + ...baseConfig, entry: ['src/index.ts'], - format: ['esm', 'cjs'], - // Hybrid: declarations come from `tsc --project tsconfig.lib.json`, not from here. - // tsdown's own `dts` produces bundled declarations that downstream packages can't - // name (TS4023) — keeping tsc also makes rolldown-plugin-dts#174 (directives - // leaking into .d.ts) structurally unreachable, since declarations carry no - // statements to leak through. - dts: false, - outDir: 'dist', - // dist/ is shared with tsc's declaration output — never clean from here. The - // build target's `rm -rf ./dist` step owns cleaning. - clean: false, - // No explicit `external`/`deps.neverBundle` needed: tsdown reads this package's - // own `dependencies` + `peerDependencies` (csstype, lodash, @emotion/react, - // typescript) and externalizes them automatically. That matches today's Babel - // build exactly — it never bundled third-party deps either. - // Mirror src/ file-by-file instead of concatenating into one dist/index.mjs. - // A single flat bundle defeats downstream tree-shaking entirely — verified on - // `gamut`: a single-component import pulled in the whole bundle plus every - // dependency any component uses (~15x the size of an unbundled equivalent). - unbundle: true, - platform: 'neutral', - sourcemap: true, - treeshake: true, }); diff --git a/tsdown.base.ts b/tsdown.base.ts new file mode 100644 index 0000000000..bf4b8e8e4d --- /dev/null +++ b/tsdown.base.ts @@ -0,0 +1,34 @@ +import type { UserConfig } from 'tsdown'; + +/** + * Shared across every package's tsdown.config.ts. Mirrors babel.defaults.js's role for + * the old Babel build: one place for the options every package needs identically, with + * each package's own config only setting what's actually different for it (entry, and + * for gamut, deps.neverBundle for its one relative .css import). + */ +export const baseConfig: UserConfig = { + format: ['esm', 'cjs'], + // Hybrid: declarations come from `tsc --emitDeclarationOnly`, not from here. + // tsdown's own `dts` produces bundled declarations that downstream packages can't + // name (TS4023) — keeping tsc also makes rolldown-plugin-dts#174 (directives + // leaking into .d.ts) structurally unreachable, since declarations carry no + // statements to leak through. + dts: false, + outDir: 'dist', + // dist/ is shared with tsc's declaration output — never clean from here. The + // build target's `rm -rf ./dist` step owns cleaning. + clean: false, + // Mirror src/ file-by-file instead of concatenating into one dist/index.mjs. A + // single flat bundle defeats downstream tree-shaking entirely — verified on + // `gamut`: a single-component import pulled in the whole bundle plus every + // dependency any component uses (~15x the size of an unbundled equivalent), and + // on `gamut-icons` (586KB for one icon vs 73KB with this on). No explicit + // `external`/`deps.neverBundle` is needed for most packages either: tsdown reads + // each package's own `dependencies` + `peerDependencies` and externalizes them + // automatically, matching today's Babel build, which never bundled third-party + // deps. + unbundle: true, + platform: 'neutral', + sourcemap: true, + treeshake: true, +}; diff --git a/yarn.lock b/yarn.lock index 0a0e20c635..4904d754e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29,7 +29,7 @@ __metadata: languageName: node linkType: hard -"@arethetypeswrong/cli@npm:^0.18.5": +"@arethetypeswrong/cli@npm:0.18.5": version: 0.18.5 resolution: "@arethetypeswrong/cli@npm:0.18.5" dependencies: @@ -19550,7 +19550,7 @@ __metadata: languageName: node linkType: hard -"publint@npm:^0.3.24": +"publint@npm:0.3.24": version: 0.3.24 resolution: "publint@npm:0.3.24" dependencies: @@ -21538,7 +21538,7 @@ __metadata: version: 0.0.0-use.local resolution: "skillsoft-gamut@workspace:." dependencies: - "@arethetypeswrong/cli": "npm:^0.18.5" + "@arethetypeswrong/cli": "npm:0.18.5" "@babel/cli": "npm:7.24.7" "@babel/core": "npm:7.24.7" "@babel/preset-env": "npm:^7.24.7" @@ -21611,7 +21611,7 @@ __metadata: onchange: "npm:^7.0.2" playwright: "npm:^1.49.1" prettier: "npm:^2.8.7" - publint: "npm:^0.3.24" + publint: "npm:0.3.24" react: "npm:^19.0.0" react-dom: "npm:^19.0.0" react-helmet-async: "npm:^2.0.5" From 501ac4d3f18a446ded426530b82f522740eadece Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 17 Sep 2026 10:26:08 -0400 Subject: [PATCH 06/47] less words --- tsdown.base.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tsdown.base.ts b/tsdown.base.ts index bf4b8e8e4d..56156a70d4 100644 --- a/tsdown.base.ts +++ b/tsdown.base.ts @@ -1,10 +1,7 @@ import type { UserConfig } from 'tsdown'; /** - * Shared across every package's tsdown.config.ts. Mirrors babel.defaults.js's role for - * the old Babel build: one place for the options every package needs identically, with - * each package's own config only setting what's actually different for it (entry, and - * for gamut, deps.neverBundle for its one relative .css import). + * Shared across every package's tsdown.config.ts. */ export const baseConfig: UserConfig = { format: ['esm', 'cjs'], From fdea41bb98cc8c89dab38b48a647f594f39e786d Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 17 Sep 2026 12:56:32 -0400 Subject: [PATCH 07/47] more changes --- package.json | 1 - packages/gamut/package.json | 1 - yarn.lock | 53 ++----------------------------------- 3 files changed, 2 insertions(+), 53 deletions(-) diff --git a/package.json b/package.json index 8714d9d37c..590ec56b0a 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ }, "devDependencies": { "@arethetypeswrong/cli": "0.18.5", - "@babel/cli": "7.24.7", "@babel/core": "7.24.7", "@babel/preset-env": "^7.24.7", "@babel/preset-react": "^7.24.7", diff --git a/packages/gamut/package.json b/packages/gamut/package.json index b6860c0bc8..f5079cce65 100644 --- a/packages/gamut/package.json +++ b/packages/gamut/package.json @@ -67,7 +67,6 @@ "scripts": { "build": "nx build gamut", "build:watch": "tsdown --watch", - "compile": "babel ./src --out-dir ./dist --extensions \".ts,.tsx\"", "verify": "tsc --noEmit && tsc --project tsconfig.bin.json" }, "sideEffects": [ diff --git a/yarn.lock b/yarn.lock index 4904d754e1..f326472612 100644 --- a/yarn.lock +++ b/yarn.lock @@ -75,33 +75,6 @@ __metadata: languageName: node linkType: hard -"@babel/cli@npm:7.24.7": - version: 7.24.7 - resolution: "@babel/cli@npm:7.24.7" - dependencies: - "@jridgewell/trace-mapping": "npm:^0.3.25" - "@nicolo-ribaudo/chokidar-2": "npm:2.1.8-no-fsevents.3" - chokidar: "npm:^3.4.0" - commander: "npm:^6.2.0" - convert-source-map: "npm:^2.0.0" - fs-readdir-recursive: "npm:^1.1.0" - glob: "npm:^7.2.0" - make-dir: "npm:^2.1.0" - slash: "npm:^2.0.0" - peerDependencies: - "@babel/core": ^7.0.0-0 - dependenciesMeta: - "@nicolo-ribaudo/chokidar-2": - optional: true - chokidar: - optional: true - bin: - babel: ./bin/babel.js - babel-external-helpers: ./bin/babel-external-helpers.js - checksum: 10c0/0d29ffa7c817c70cf39243567a17e9e60b1f9632632f2a0f3aef061e28c228146fd98d262e09173f34e963dc7e8c29fb3e535243ffed641980691a0e4386b189 - languageName: node - linkType: hard - "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.24.7, @babel/code-frame@npm:^7.27.1, @babel/code-frame@npm:^7.28.6, @babel/code-frame@npm:^7.29.0": version: 7.29.0 resolution: "@babel/code-frame@npm:7.29.0" @@ -3341,13 +3314,6 @@ __metadata: languageName: node linkType: hard -"@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.3": - version: 2.1.8-no-fsevents.3 - resolution: "@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.3" - checksum: 10c0/27dcabaa0c9a29b3a60217bd3fff87a22cb43ed77863da570c6828e4d0b8f1c6ee52582cd3d439275a2b1f2051005e648ed866b981f2a03b61c645b7e4806ba7 - languageName: node - linkType: hard - "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -10251,7 +10217,7 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:^3.3.1, chokidar@npm:^3.4.0, chokidar@npm:^3.6.0": +"chokidar@npm:^3.3.1, chokidar@npm:^3.6.0": version: 3.6.0 resolution: "chokidar@npm:3.6.0" dependencies: @@ -13537,13 +13503,6 @@ __metadata: languageName: node linkType: hard -"fs-readdir-recursive@npm:^1.1.0": - version: 1.1.0 - resolution: "fs-readdir-recursive@npm:1.1.0" - checksum: 10c0/7e190393952143e674b6d1ad4abcafa1b5d3e337fcc21b0cb051079a7140a54617a7df193d562ef9faf21bd7b2148a38601b3d5c16261fa76f278d88dc69989c - languageName: node - linkType: hard - "fs.realpath@npm:^1.0.0": version: 1.0.0 resolution: "fs.realpath@npm:1.0.0" @@ -13796,7 +13755,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.0.3, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.2.0": +"glob@npm:^7.0.3, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -21539,7 +21498,6 @@ __metadata: resolution: "skillsoft-gamut@workspace:." dependencies: "@arethetypeswrong/cli": "npm:0.18.5" - "@babel/cli": "npm:7.24.7" "@babel/core": "npm:7.24.7" "@babel/preset-env": "npm:^7.24.7" "@babel/preset-react": "npm:^7.24.7" @@ -21639,13 +21597,6 @@ __metadata: languageName: node linkType: hard -"slash@npm:^2.0.0": - version: 2.0.0 - resolution: "slash@npm:2.0.0" - checksum: 10c0/f83dbd3cb62c41bb8fcbbc6bf5473f3234b97fa1d008f571710a9d3757a28c7169e1811cad1554ccb1cc531460b3d221c9a7b37f549398d9a30707f0a5af9193 - languageName: node - linkType: hard - "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" From 30bf3466d8815945ecb492bd31ca2166448f45e5 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Fri, 18 Sep 2026 10:58:19 -0400 Subject: [PATCH 08/47] video --- .../{Molecules => Apps}/Video.figma.tsx | 2 +- .../__snapshots__/gamut.test.ts.snap | 1 - packages/gamut/package.json | 5 +++++ packages/gamut/project.json | 2 +- packages/gamut/src/index.tsx | 7 ++++++- packages/gamut/tsdown.config.ts | 6 +++++- .../lib/{Molecules => Apps}/Video/Video.mdx | 21 +++++++++++++++---- .../Video/Video.stories.tsx | 2 +- .../RadialProgress/RadialProgress.stories.tsx | 3 ++- .../styleguide/src/lib/Molecules/AboutToC.tsx | 2 -- 10 files changed, 38 insertions(+), 13 deletions(-) rename packages/code-connect/{Molecules => Apps}/Video.figma.tsx (93%) rename packages/styleguide/src/lib/{Molecules => Apps}/Video/Video.mdx (76%) rename packages/styleguide/src/lib/{Molecules => Apps}/Video/Video.stories.tsx (97%) diff --git a/packages/code-connect/Molecules/Video.figma.tsx b/packages/code-connect/Apps/Video.figma.tsx similarity index 93% rename from packages/code-connect/Molecules/Video.figma.tsx rename to packages/code-connect/Apps/Video.figma.tsx index c379aabc1e..c198b83563 100644 --- a/packages/code-connect/Molecules/Video.figma.tsx +++ b/packages/code-connect/Apps/Video.figma.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Video } from '@skillsoft/gamut'; +import { Video } from '@skillsoft/gamut/Video'; import figma from '@figma/code-connect'; /** diff --git a/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap b/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap index 14d8d3f58a..30593dae53 100644 --- a/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap +++ b/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap @@ -132,6 +132,5 @@ exports[`Gamut Exported Keys 1`] = ` "useIsMounted", "useLocalQuery", "useSubmitState", - "Video", ] `; diff --git a/packages/gamut/package.json b/packages/gamut/package.json index f5079cce65..1e67294cb6 100644 --- a/packages/gamut/package.json +++ b/packages/gamut/package.json @@ -36,6 +36,11 @@ "types": "./dist/index.d.ts", "import": "./dist/index.mjs", "require": "./dist/index.js" + }, + "./Video": { + "types": "./dist/Video/index.d.ts", + "import": "./dist/Video/index.mjs", + "require": "./dist/Video/index.js" } }, "files": [ diff --git a/packages/gamut/project.json b/packages/gamut/project.json index 21806b5428..1f01215c71 100644 --- a/packages/gamut/project.json +++ b/packages/gamut/project.json @@ -41,7 +41,7 @@ "cwd": "{projectRoot}", "commands": [ "publint .", - "attw --pack . --ignore-rules false-cjs" + "attw --pack . --ignore-rules false-cjs no-resolution" ], "parallel": false } diff --git a/packages/gamut/src/index.tsx b/packages/gamut/src/index.tsx index 523f237b2a..ca55358892 100644 --- a/packages/gamut/src/index.tsx +++ b/packages/gamut/src/index.tsx @@ -53,4 +53,9 @@ export * from './typings/responsive-properties'; export * from './Typography/Text'; export type { HeadingTags } from './Typography/types'; export * from './utils'; -export * from './Video'; +// Not re-exported from the root barrel — import from '@skillsoft/gamut/Video' +// instead. First step toward eventually moving Video out of gamut into its own +// package: it pulls in @vidstack/react and a CSS chain with an optional peer dep +// (css-loader), and keeping it off the barrel means only consumers who actually +// use Video are exposed to that. See tsdown.config.ts for the entry and +// package.json for the exports subpath. diff --git a/packages/gamut/tsdown.config.ts b/packages/gamut/tsdown.config.ts index 41ee15f3ef..5c20c1bb32 100644 --- a/packages/gamut/tsdown.config.ts +++ b/packages/gamut/tsdown.config.ts @@ -5,7 +5,11 @@ import { baseConfig } from '../../tsdown.base.ts'; export default defineConfig({ ...baseConfig, - entry: ['src/index.tsx'], + // Video gets its own entry rather than living only inside the root barrel's + // graph — it's not re-exported from src/index.tsx (see the comment there), so + // without its own entry here it wouldn't build at all. Matches the + // `./Video` subpath in package.json's exports map. + entry: ['src/index.tsx', 'src/Video/index.tsx'], // The one thing base config's dependency auto-externalization can't cover: the // single relative `.css` side-effect import // (Video/lib/VidstackPlayer/vidstack-styles.css). tsdown refuses to bundle a diff --git a/packages/styleguide/src/lib/Molecules/Video/Video.mdx b/packages/styleguide/src/lib/Apps/Video/Video.mdx similarity index 76% rename from packages/styleguide/src/lib/Molecules/Video/Video.mdx rename to packages/styleguide/src/lib/Apps/Video/Video.mdx index 0e9e2a76ad..53782c05a8 100644 --- a/packages/styleguide/src/lib/Molecules/Video/Video.mdx +++ b/packages/styleguide/src/lib/Apps/Video/Video.mdx @@ -1,6 +1,6 @@ import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks'; -import { ComponentHeader } from '~styleguide/blocks'; +import { Callout, ComponentHeader } from '~styleguide/blocks'; import * as VideoStories from './Video.stories'; @@ -23,13 +23,26 @@ export const parameters = { + + Import Video from @skillsoft/gamut/Video — it + is not included in @skillsoft/gamut's default export. + + } +/> + ## Usage -The Video component is a feature-rich video player that supports multiple video sources and formats with enhanced accessibility features. +```tsx +import { Video } from '@skillsoft/gamut/Video'; +``` + +The `Video` component is a video player that supports multiple video sources and formats with enhanced accessibility features. -### Key Features +### Key features -- **Multiple Sources**: Supports YouTube, Vimeo, HLS, and DASH video streams +- **Multiple sources**: Supports YouTube, Vimeo, HLS, and DASH video streams - **Accessibility**: Enhanced keyboard navigation and screen reader support - **Internationalization**: Customizable UI text through translations props - **Captions**: Supports multiple caption formats (VTT, SRT, SSA) diff --git a/packages/styleguide/src/lib/Molecules/Video/Video.stories.tsx b/packages/styleguide/src/lib/Apps/Video/Video.stories.tsx similarity index 97% rename from packages/styleguide/src/lib/Molecules/Video/Video.stories.tsx rename to packages/styleguide/src/lib/Apps/Video/Video.stories.tsx index 914cf76de2..96fe06d547 100644 --- a/packages/styleguide/src/lib/Molecules/Video/Video.stories.tsx +++ b/packages/styleguide/src/lib/Apps/Video/Video.stories.tsx @@ -1,4 +1,4 @@ -import { Video } from '@skillsoft/gamut'; +import { Video } from '@skillsoft/gamut/Video'; import type { Meta, StoryObj } from '@storybook/react'; const meta: Meta = { diff --git a/packages/styleguide/src/lib/Atoms/RadialProgress/RadialProgress.stories.tsx b/packages/styleguide/src/lib/Atoms/RadialProgress/RadialProgress.stories.tsx index d68ef1ab42..e1c0cff750 100644 --- a/packages/styleguide/src/lib/Atoms/RadialProgress/RadialProgress.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/RadialProgress/RadialProgress.stories.tsx @@ -1,4 +1,5 @@ -import { Box, RadialProgress, Video } from '@skillsoft/gamut'; +import { Box, RadialProgress } from '@skillsoft/gamut'; +import { Video } from '@skillsoft/gamut/Video'; import type { Meta, StoryObj } from '@storybook/react'; const meta: Meta = { diff --git a/packages/styleguide/src/lib/Molecules/AboutToC.tsx b/packages/styleguide/src/lib/Molecules/AboutToC.tsx index 91a9089921..0c25ddf284 100644 --- a/packages/styleguide/src/lib/Molecules/AboutToC.tsx +++ b/packages/styleguide/src/lib/Molecules/AboutToC.tsx @@ -12,7 +12,6 @@ import { parameters as popoverParameters } from './Popover/Popover.mdx'; import { parameters as tabsParameters } from './Tabs/Tabs.mdx'; import { parameters as tipsParameters } from './Tips/About.mdx'; import { parameters as toastsParameters } from './Toasts/About.mdx'; -import { parameters as videoParameters } from './Video/Video.mdx'; export const MoleculeAboutToC = () => ( ( tabsParameters, tipsParameters, toastsParameters, - videoParameters, ])} /> ); From 7c5df2cd8198ad25a7cec9996441089c3d278077 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Fri, 18 Sep 2026 12:35:16 -0400 Subject: [PATCH 09/47] fix(tsconfig): fix TS5097 in editors on tsdown.config.ts files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The root tsconfig.json (not used by any real build — every package verifies against its own scoped tsconfig via cwd) is what editors like Zed fall back to for files no package-scoped tsconfig covers, which today means tsdown.config.ts / tsdown.base.ts. Two problems stacked: - The literal `.ts` extension on `import { baseConfig } from '../../tsdown.base.ts'` (required because tsdown's own config loader needs it) needs `allowImportingTsExtensions`, which itself requires `noEmit` or `emitDeclarationOnly`. - tsdown itself ships no `main`/`types` fields, only a modern `exports` map, so it's completely unresolvable under the inherited `moduleResolution: "node"` — confirmed via tsc's own error message. Scoped to this one root config, not tsconfig.base.json (which every package inherits) — verified no real build/verify script uses the bare root config, so this only affects editor diagnostics for the tsdown config files, with zero effect on any package's real typecheck. Part of the tsdown build migration (GMT-1741). Co-Authored-By: Claude Opus 5 (1M context) --- tsconfig.json | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 2ade17862d..11e6500ad8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,25 @@ "compilerOptions": { "jsx": "react-jsx", "baseUrl": ".", - "paths": {} + "paths": {}, + // Not used by any real build — every package builds/verifies against its own + // scoped tsconfig (packages/*/tsconfig.lib.json etc.), picked up via `cwd`. + // This root config only governs editor language servers (Zed, VS Code) for + // files no package-scoped tsconfig covers, which today means the tsdown + // build configs (tsdown.config.ts, tsdown.base.ts) — they live at package + // roots, outside every package's `src/**/*`-scoped tsconfig, and their + // cross-file import needs a literal `.ts` extension (see + // packages/variance/tsdown.config.ts for why). `noEmit` is required + // alongside `allowImportingTsExtensions` — TS enforces that pairing — and + // is harmless here since this config never emits anyway. `tsdown` itself has + // no `main`/`types` fields at all — only a modern `exports` map — so it's + // completely unresolvable under tsconfig.base.json's legacy + // `moduleResolution: "node"` (not just ambiguous; there's no fallback path). + // Overriding to "bundler" here doesn't affect any package's real build or + // typecheck — see gamut-moduleresolution-bundler-migration.md in base camp + // for the separate, scoped follow-up to change that repo-wide. + "noEmit": true, + "allowImportingTsExtensions": true, + "moduleResolution": "bundler" } } From 862eb02a8a924718e0c6c3f44be4d2bd395b5359 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Fri, 18 Sep 2026 12:48:18 -0400 Subject: [PATCH 10/47] build(babel): DRY up per-package babel configs, drop dead styleguide babelrc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All 7 packages' babel.config.js had a byte-identical `presets` array (preset-env + preset-react + preset-typescript), differing only in whether @emotion/babel-plugin was added. Babel's own `extends` merges arrays rather than overriding them, so moving the shared presets into babel.defaults.js (which every package already extends, for its `ignore` patterns) lets each package's own config shrink to just what's actually different for it — the emotion plugin, or nothing at all. Verified the merge behavior directly rather than assuming it: ran @babel/core's transformFileSync against a real gamut-icons component (JSX transform + TS stripping both applied) and a real gamut-styles styled() call (target + label stamping both present) with the package's own config reduced to bare `extends`. Confirmed with the full suite too: build/test/verify all green, 117 test suites / 1563 tests with jest cache cleared, and the BarChart Emotion-target site specifically re-checked given its history this migration. Also dropped gamut-tests' bogus top-level `include: ['./src/**/*']` key while simplifying that file — a no-op given babel's only ever invoked against files already under ./src. Removed packages/styleguide/.babelrc.json — genuinely dead now that Storybook's Vite migration (main #9) wires @emotion/babel-plugin directly via @vitejs/plugin-react's babel option in .storybook/main.ts, rather than reading this file. Confirmed nothing else discovers it (no jest config references styleguide; it has no test target). Part of the tsdown build migration (GMT-1741). Co-Authored-By: Claude Opus 5 (1M context) --- babel.defaults.js | 22 + packages/gamut-icons/babel.config.js | 16 - packages/gamut-illustrations/babel.config.js | 16 - packages/gamut-patterns/babel.config.js | 16 - packages/gamut-styles/babel.config.js | 16 - packages/gamut-tests/babel.config.js | 17 - packages/gamut/babel.config.js | 16 - packages/styleguide/.babelrc.json | 44 - packages/variance/babel.config.js | 16 - yarn.lock | 1088 ++++++++++++++++-- 10 files changed, 1031 insertions(+), 236 deletions(-) delete mode 100644 packages/styleguide/.babelrc.json diff --git a/babel.defaults.js b/babel.defaults.js index 73321cc74d..26036295cc 100644 --- a/babel.defaults.js +++ b/babel.defaults.js @@ -1,3 +1,9 @@ +// Shared across every package's babel.config.js. Every package extended this +// file already for the `ignore` patterns below; `presets` was previously +// re-declared byte-for-byte in all 7 of them (differing only in whether +// @emotion/babel-plugin was added). Babel's `extends` merges arrays rather +// than overriding them, so putting the shared presets here means each +// package's own config only needs to add what's actually different for it. let ignorePatterns = []; if (process.env.NODE_ENV !== 'test') { @@ -15,4 +21,20 @@ if (process.env.NODE_ENV !== 'test') { module.exports = { ignore: ignorePatterns, + presets: [ + [ + '@babel/env', + { + modules: process.env.NODE_ENV === 'test' ? 'commonjs' : false, + targets: 'defaults', + }, + ], + [ + '@babel/react', + { + runtime: 'automatic', + }, + ], + '@babel/preset-typescript', + ], }; diff --git a/packages/gamut-icons/babel.config.js b/packages/gamut-icons/babel.config.js index e325473dfd..dd9f75de4d 100644 --- a/packages/gamut-icons/babel.config.js +++ b/packages/gamut-icons/babel.config.js @@ -1,19 +1,3 @@ module.exports = { extends: '../../babel.defaults.js', - presets: [ - [ - '@babel/env', - { - modules: process.env.NODE_ENV === 'test' ? 'commonjs' : false, - targets: 'defaults', - }, - ], - [ - '@babel/react', - { - runtime: 'automatic', - }, - ], - '@babel/preset-typescript', - ], }; diff --git a/packages/gamut-illustrations/babel.config.js b/packages/gamut-illustrations/babel.config.js index 04bc362829..2ec17bfa7e 100644 --- a/packages/gamut-illustrations/babel.config.js +++ b/packages/gamut-illustrations/babel.config.js @@ -1,21 +1,5 @@ module.exports = { extends: '../../babel.defaults.js', - presets: [ - [ - '@babel/env', - { - modules: process.env.NODE_ENV === 'test' ? 'commonjs' : false, - targets: 'defaults', - }, - ], - [ - '@babel/react', - { - runtime: 'automatic', - }, - ], - '@babel/preset-typescript', - ], plugins: [ [ '@emotion/babel-plugin', diff --git a/packages/gamut-patterns/babel.config.js b/packages/gamut-patterns/babel.config.js index e325473dfd..dd9f75de4d 100644 --- a/packages/gamut-patterns/babel.config.js +++ b/packages/gamut-patterns/babel.config.js @@ -1,19 +1,3 @@ module.exports = { extends: '../../babel.defaults.js', - presets: [ - [ - '@babel/env', - { - modules: process.env.NODE_ENV === 'test' ? 'commonjs' : false, - targets: 'defaults', - }, - ], - [ - '@babel/react', - { - runtime: 'automatic', - }, - ], - '@babel/preset-typescript', - ], }; diff --git a/packages/gamut-styles/babel.config.js b/packages/gamut-styles/babel.config.js index 04bc362829..2ec17bfa7e 100644 --- a/packages/gamut-styles/babel.config.js +++ b/packages/gamut-styles/babel.config.js @@ -1,21 +1,5 @@ module.exports = { extends: '../../babel.defaults.js', - presets: [ - [ - '@babel/env', - { - modules: process.env.NODE_ENV === 'test' ? 'commonjs' : false, - targets: 'defaults', - }, - ], - [ - '@babel/react', - { - runtime: 'automatic', - }, - ], - '@babel/preset-typescript', - ], plugins: [ [ '@emotion/babel-plugin', diff --git a/packages/gamut-tests/babel.config.js b/packages/gamut-tests/babel.config.js index 66e5a32ab7..2ec17bfa7e 100644 --- a/packages/gamut-tests/babel.config.js +++ b/packages/gamut-tests/babel.config.js @@ -1,21 +1,5 @@ module.exports = { extends: '../../babel.defaults.js', - presets: [ - [ - '@babel/env', - { - modules: process.env.NODE_ENV === 'test' ? 'commonjs' : false, - targets: 'defaults', - }, - ], - [ - '@babel/react', - { - runtime: 'automatic', - }, - ], - '@babel/preset-typescript', - ], plugins: [ [ '@emotion/babel-plugin', @@ -26,5 +10,4 @@ module.exports = { }, ], ], - include: ['./src/**/*'], }; diff --git a/packages/gamut/babel.config.js b/packages/gamut/babel.config.js index 04bc362829..2ec17bfa7e 100644 --- a/packages/gamut/babel.config.js +++ b/packages/gamut/babel.config.js @@ -1,21 +1,5 @@ module.exports = { extends: '../../babel.defaults.js', - presets: [ - [ - '@babel/env', - { - modules: process.env.NODE_ENV === 'test' ? 'commonjs' : false, - targets: 'defaults', - }, - ], - [ - '@babel/react', - { - runtime: 'automatic', - }, - ], - '@babel/preset-typescript', - ], plugins: [ [ '@emotion/babel-plugin', diff --git a/packages/styleguide/.babelrc.json b/packages/styleguide/.babelrc.json deleted file mode 100644 index 48b659c23c..0000000000 --- a/packages/styleguide/.babelrc.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "extends": ".../../babel.defaults.js", - "presets": [ - [ - "@babel/env", - { - "modules": false, - "targets": "defaults" - } - ], - [ - "@babel/react", - { - "runtime": "automatic" - } - ], - "@babel/preset-typescript" - ], - "plugins": [ - [ - "@emotion/babel-plugin", - { - "sourceMap": true, - "autoLabel": "always", - "labelFormat": "[local]" - } - ] - ], - "env": { - "test": { - "presets": [ - [ - "@babel/env", - { - "modules": "commonjs", - "targets": { - "node": "current" - } - } - ] - ] - } - } -} diff --git a/packages/variance/babel.config.js b/packages/variance/babel.config.js index 04bc362829..2ec17bfa7e 100644 --- a/packages/variance/babel.config.js +++ b/packages/variance/babel.config.js @@ -1,21 +1,5 @@ module.exports = { extends: '../../babel.defaults.js', - presets: [ - [ - '@babel/env', - { - modules: process.env.NODE_ENV === 'test' ? 'commonjs' : false, - targets: 'defaults', - }, - ], - [ - '@babel/react', - { - runtime: 'automatic', - }, - ], - '@babel/preset-typescript', - ], plugins: [ [ '@emotion/babel-plugin', diff --git a/yarn.lock b/yarn.lock index 6314d0d913..ff3157ddf5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,6 +22,46 @@ __metadata: languageName: node linkType: hard +"@andrewbranch/untar.js@npm:^1.0.3": + version: 1.0.4 + resolution: "@andrewbranch/untar.js@npm:1.0.4" + checksum: 10c0/858acf6771f14fccf5d3ddeeabaab330f1d60350aec32c7a87afe78f36e43ca593bda7066b7f6146b0147def6928ec523ae321c5dadac4693afd4e1da2f40b26 + languageName: node + linkType: hard + +"@arethetypeswrong/cli@npm:0.18.5": + version: 0.18.5 + resolution: "@arethetypeswrong/cli@npm:0.18.5" + dependencies: + "@arethetypeswrong/core": "npm:0.18.5" + chalk: "npm:^4.1.2" + cli-table3: "npm:^0.6.3" + commander: "npm:^10.0.1" + marked: "npm:^9.1.2" + marked-terminal: "npm:^7.1.0" + semver: "npm:^7.5.4" + bin: + attw: ./dist/index.js + checksum: 10c0/c9550aadb461d913c5f42f6a75a655b310e500d20804aa2c266f87c4b89c33dfd47cd6f56cc8061624c309ac4a6620cf2e84ccdaaf66877a8dcb78dd519b40c7 + languageName: node + linkType: hard + +"@arethetypeswrong/core@npm:0.18.5": + version: 0.18.5 + resolution: "@arethetypeswrong/core@npm:0.18.5" + dependencies: + "@andrewbranch/untar.js": "npm:^1.0.3" + "@loaderkit/resolve": "npm:^1.0.2" + cjs-module-lexer: "npm:^1.2.3" + fflate: "npm:^0.8.3" + lru-cache: "npm:^11.0.1" + semver: "npm:^7.5.4" + typescript: "npm:5.6.1-rc" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10c0/fae68eb6ee9324692a427f288bc2db7a85a80b98f028a02fb5dc302edcb7a46c7dce51afb9b83d85e17c19f346b8741ed6b23c25fe9011ed83fd713ce7c029a9 + languageName: node + linkType: hard + "@asamuzakjp/css-color@npm:^3.2.0": version: 3.2.0 resolution: "@asamuzakjp/css-color@npm:3.2.0" @@ -35,33 +75,6 @@ __metadata: languageName: node linkType: hard -"@babel/cli@npm:7.24.7": - version: 7.24.7 - resolution: "@babel/cli@npm:7.24.7" - dependencies: - "@jridgewell/trace-mapping": "npm:^0.3.25" - "@nicolo-ribaudo/chokidar-2": "npm:2.1.8-no-fsevents.3" - chokidar: "npm:^3.4.0" - commander: "npm:^6.2.0" - convert-source-map: "npm:^2.0.0" - fs-readdir-recursive: "npm:^1.1.0" - glob: "npm:^7.2.0" - make-dir: "npm:^2.1.0" - slash: "npm:^2.0.0" - peerDependencies: - "@babel/core": ^7.0.0-0 - dependenciesMeta: - "@nicolo-ribaudo/chokidar-2": - optional: true - chokidar: - optional: true - bin: - babel: ./bin/babel.js - babel-external-helpers: ./bin/babel-external-helpers.js - checksum: 10c0/0d29ffa7c817c70cf39243567a17e9e60b1f9632632f2a0f3aef061e28c228146fd98d262e09173f34e963dc7e8c29fb3e535243ffed641980691a0e4386b189 - languageName: node - linkType: hard - "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.24.7, @babel/code-frame@npm:^7.27.1, @babel/code-frame@npm:^7.28.6, @babel/code-frame@npm:^7.29.0": version: 7.29.0 resolution: "@babel/code-frame@npm:7.29.0" @@ -1744,6 +1757,13 @@ __metadata: languageName: node linkType: hard +"@braidai/lang@npm:^1.0.0": + version: 1.1.2 + resolution: "@braidai/lang@npm:1.1.2" + checksum: 10c0/24bc85bf85dfe027102b19f418a591202b00cc8be12525ceff8adb65d5ebdda0dc1a0463c1e2cb6de1d85cd409012aa85850d9377bae61160162afbea278ab26 + languageName: node + linkType: hard + "@codecademy/eslint-config@npm:8.2.0": version: 8.2.0 resolution: "@codecademy/eslint-config@npm:8.2.0" @@ -1785,6 +1805,13 @@ __metadata: languageName: node linkType: hard +"@colors/colors@npm:1.5.0": + version: 1.5.0 + resolution: "@colors/colors@npm:1.5.0" + checksum: 10c0/eb42729851adca56d19a08e48d5a1e95efd2a32c55ae0323de8119052be0510d4b7a1611f2abcbf28c044a6c11e6b7d38f99fccdad7429300c37a8ea5fb95b44 + languageName: node + linkType: hard + "@commander-js/extra-typings@npm:^14.0.0": version: 14.0.0 resolution: "@commander-js/extra-typings@npm:14.0.0" @@ -3263,6 +3290,15 @@ __metadata: languageName: node linkType: hard +"@loaderkit/resolve@npm:^1.0.2": + version: 1.0.6 + resolution: "@loaderkit/resolve@npm:1.0.6" + dependencies: + "@braidai/lang": "npm:^1.0.0" + checksum: 10c0/e7dfcc0fa8f073c3048c9b8ef702d82dcc4390dc8d57438ac3a652e4936d66df2ca7ae8a4f2b6901157493dd42236156c1f47a5280f680a12bdef2f1b870135c + languageName: node + linkType: hard + "@ltd/j-toml@npm:^1.38.0": version: 1.38.0 resolution: "@ltd/j-toml@npm:1.38.0" @@ -3648,13 +3684,6 @@ __metadata: languageName: node linkType: hard -"@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.3": - version: 2.1.8-no-fsevents.3 - resolution: "@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.3" - checksum: 10c0/27dcabaa0c9a29b3a60217bd3fff87a22cb43ed77863da570c6828e4d0b8f1c6ee52582cd3d439275a2b1f2051005e648ed866b981f2a03b61c645b7e4806ba7 - languageName: node - linkType: hard - "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -4139,6 +4168,13 @@ __metadata: languageName: node linkType: hard +"@oxc-project/types@npm:=0.149.0": + version: 0.149.0 + resolution: "@oxc-project/types@npm:0.149.0" + checksum: 10c0/f91ff8101300ce5a29fbfc57bdaafd9c1c9d3d9b46c63093f437c479d047042eb615cb6c3ddac91a0d289701ce60c365632866a85d0f1e0d159b20180115187e + languageName: node + linkType: hard + "@oxc-resolver/binding-android-arm-eabi@npm:11.19.1": version: 11.19.1 resolution: "@oxc-resolver/binding-android-arm-eabi@npm:11.19.1" @@ -4314,6 +4350,24 @@ __metadata: languageName: node linkType: hard +"@publint/pack@npm:^0.1.7": + version: 0.1.7 + resolution: "@publint/pack@npm:0.1.7" + dependencies: + tinyexec: "npm:^1.3.0" + checksum: 10c0/bbb63243bd86991074ea06bcdc84ad574a0ee30d694df70fdba2f5f7bbf82d4257717c243807e985b0f75199ed1fc03e17d9e86bc8944b86da49025b1f38d769 + languageName: node + linkType: hard + +"@quansync/fs@npm:^1.0.0": + version: 1.0.0 + resolution: "@quansync/fs@npm:1.0.0" + dependencies: + quansync: "npm:^1.0.0" + checksum: 10c0/41a7e145d4fc349eaeac20ee7ffe0c876a7c26b2268d5704b462b3e7379091221336e315b2b346d5b07a531502a41cad15c9f374800cc60b6339d074ef99aa16 + languageName: node + linkType: hard + "@react-aria/autocomplete@npm:3.0.0-beta.1": version: 3.0.0-beta.1 resolution: "@react-aria/autocomplete@npm:3.0.0-beta.1" @@ -6017,6 +6071,111 @@ __metadata: languageName: node linkType: hard +"@rolldown/binding-android-arm-eabi@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-android-arm-eabi@npm:1.2.8" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@rolldown/binding-android-arm64@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-android-arm64@npm:1.2.8" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@rolldown/binding-darwin-arm64@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-darwin-arm64@npm:1.2.8" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rolldown/binding-darwin-x64@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-darwin-x64@npm:1.2.8" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rolldown/binding-freebsd-x64@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-freebsd-x64@npm:1.2.8" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@rolldown/binding-linux-arm-gnueabihf@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-arm-gnueabihf@npm:1.2.8" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@rolldown/binding-linux-arm64-gnu@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-arm64-gnu@npm:1.2.8" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rolldown/binding-linux-arm64-musl@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-arm64-musl@npm:1.2.8" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rolldown/binding-linux-ppc64-gnu@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-ppc64-gnu@npm:1.2.8" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@rolldown/binding-linux-s390x-gnu@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-s390x-gnu@npm:1.2.8" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@rolldown/binding-linux-x64-gnu@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-x64-gnu@npm:1.2.8" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rolldown/binding-linux-x64-musl@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-linux-x64-musl@npm:1.2.8" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rolldown/binding-openharmony-arm64@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-openharmony-arm64@npm:1.2.8" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@rolldown/binding-win32-arm64-msvc@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-win32-arm64-msvc@npm:1.2.8" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rolldown/binding-win32-x64-msvc@npm:1.2.8": + version: 1.2.8 + resolution: "@rolldown/binding-win32-x64-msvc@npm:1.2.8" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@rolldown/pluginutils@npm:1.0.0-rc.3": version: 1.0.0-rc.3 resolution: "@rolldown/pluginutils@npm:1.0.0-rc.3" @@ -6024,6 +6183,13 @@ __metadata: languageName: node linkType: hard +"@rolldown/pluginutils@npm:^1.0.0": + version: 1.0.1 + resolution: "@rolldown/pluginutils@npm:1.0.1" + checksum: 10c0/99d9b06d90196823e4d8c841f258db7a16e5dbba5824a2962b05d907b79f1ba929d56f22dd744fd530936e568c865ee56a719dc31e57e13bc0a8eb4764a8d8dd + languageName: node + linkType: hard + "@rollup/plugin-babel@npm:^6.0.4": version: 6.0.4 resolution: "@rollup/plugin-babel@npm:6.0.4" @@ -6656,6 +6822,13 @@ __metadata: languageName: node linkType: hard +"@sindresorhus/is@npm:^4.6.0": + version: 4.6.0 + resolution: "@sindresorhus/is@npm:4.6.0" + checksum: 10c0/33b6fb1d0834ec8dd7689ddc0e2781c2bfd8b9c4e4bacbcb14111e0ae00621f2c264b8a7d36541799d74888b5dccdf422a891a5cb5a709ace26325eedc81e22e + languageName: node + linkType: hard + "@sinonjs/commons@npm:^3.0.1": version: 3.0.1 resolution: "@sinonjs/commons@npm:3.0.1" @@ -8853,6 +9026,181 @@ __metadata: languageName: node linkType: hard +"@yuku-codegen/binding-android-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-android-arm64@npm:0.9.5" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-codegen/binding-darwin-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-darwin-arm64@npm:0.9.5" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-codegen/binding-darwin-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-darwin-x64@npm:0.9.5" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@yuku-codegen/binding-freebsd-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-freebsd-x64@npm:0.9.5" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-arm-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-arm-gnu@npm:0.9.5" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-arm-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-arm-musl@npm:0.9.5" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-arm64-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-arm64-gnu@npm:0.9.5" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-arm64-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-arm64-musl@npm:0.9.5" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-x64-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-x64-gnu@npm:0.9.5" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@yuku-codegen/binding-linux-x64-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-linux-x64-musl@npm:0.9.5" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@yuku-codegen/binding-win32-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-win32-arm64@npm:0.9.5" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-codegen/binding-win32-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-codegen/binding-win32-x64@npm:0.9.5" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@yuku-parser/binding-android-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-android-arm64@npm:0.9.5" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-parser/binding-darwin-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-darwin-arm64@npm:0.9.5" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-parser/binding-darwin-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-darwin-x64@npm:0.9.5" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@yuku-parser/binding-freebsd-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-freebsd-x64@npm:0.9.5" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-arm-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-arm-gnu@npm:0.9.5" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-arm-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-arm-musl@npm:0.9.5" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-arm64-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-arm64-gnu@npm:0.9.5" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-arm64-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-arm64-musl@npm:0.9.5" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-x64-gnu@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-x64-gnu@npm:0.9.5" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@yuku-parser/binding-linux-x64-musl@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-linux-x64-musl@npm:0.9.5" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@yuku-parser/binding-win32-arm64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-win32-arm64@npm:0.9.5" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@yuku-parser/binding-win32-x64@npm:0.9.5": + version: 0.9.5 + resolution: "@yuku-parser/binding-win32-x64@npm:0.9.5" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@yuku-toolchain/types@npm:^0.9.5": + version: 0.9.5 + resolution: "@yuku-toolchain/types@npm:0.9.5" + checksum: 10c0/cc20d7de43e393656501263a8d123cb2b03a9f281e23fbb8f9a2984dded5fab5df1c3007587ec978ada752328ca708f2ffadd1e0046c5f4a60c4d06a46ff694c + languageName: node + linkType: hard + "@zkochan/js-yaml@npm:0.0.7": version: 0.0.7 resolution: "@zkochan/js-yaml@npm:0.0.7" @@ -9046,6 +9394,13 @@ __metadata: languageName: node linkType: hard +"ansi-regex@npm:^6.1.0": + version: 6.3.0 + resolution: "ansi-regex@npm:6.3.0" + checksum: 10c0/bc047786d0531f1f22d1e22e9863e8554488a399f1ee5270b753efa6de938a788d27456f2b256770f11fdd8b1e847483bc1b55ddc2b3ffe82ec45c875292c651 + languageName: node + linkType: hard + "ansi-regex@npm:^6.2.2": version: 6.2.2 resolution: "ansi-regex@npm:6.2.2" @@ -9085,6 +9440,13 @@ __metadata: languageName: node linkType: hard +"any-promise@npm:^1.0.0": + version: 1.3.0 + resolution: "any-promise@npm:1.3.0" + checksum: 10c0/60f0298ed34c74fef50daab88e8dab786036ed5a7fad02e012ab57e376e0a0b4b29e83b95ea9b5e7d89df762f5f25119b83e00706ecaccb22cfbacee98d74889 + languageName: node + linkType: hard + "anymatch@npm:^3.1.3, anymatch@npm:~3.1.2": version: 3.1.3 resolution: "anymatch@npm:3.1.3" @@ -9817,6 +10179,13 @@ __metadata: languageName: node linkType: hard +"cac@npm:^7.0.0": + version: 7.0.0 + resolution: "cac@npm:7.0.0" + checksum: 10c0/e9da33cb9f0425546ae92a450d479276f9969a050fe64f5d6fedf058bdd87f22a370797fe1c158e07655fa9fc183749df7cb2037431e3772faa7bee9919fb763 + languageName: node + linkType: hard + "cacache@npm:^20.0.1": version: 20.0.3 resolution: "cacache@npm:20.0.3" @@ -9971,7 +10340,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^5.2.0": +"chalk@npm:^5.2.0, chalk@npm:^5.4.1": version: 5.6.2 resolution: "chalk@npm:5.6.2" checksum: 10c0/99a4b0f0e7991796b1e7e3f52dceb9137cae2a9dfc8fc0784a550dc4c558e15ab32ed70b14b21b52beb2679b4892b41a0aa44249bcb996f01e125d58477c6976 @@ -10027,7 +10396,7 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:^3.3.1, chokidar@npm:^3.4.0": +"chokidar@npm:^3.3.1": version: 3.6.0 resolution: "chokidar@npm:3.6.0" dependencies: @@ -10074,6 +10443,13 @@ __metadata: languageName: node linkType: hard +"cjs-module-lexer@npm:^1.2.3": + version: 1.4.3 + resolution: "cjs-module-lexer@npm:1.4.3" + checksum: 10c0/076b3af85adc4d65dbdab1b5b240fe5b45d44fcf0ef9d429044dd94d19be5589376805c44fb2d4b3e684e5fe6a9b7cf3e426476a6507c45283c5fc6ff95240be + languageName: node + linkType: hard + "cjs-module-lexer@npm:^2.1.0": version: 2.1.0 resolution: "cjs-module-lexer@npm:2.1.0" @@ -10122,6 +10498,22 @@ __metadata: languageName: node linkType: hard +"cli-highlight@npm:^2.1.11": + version: 2.1.11 + resolution: "cli-highlight@npm:2.1.11" + dependencies: + chalk: "npm:^4.0.0" + highlight.js: "npm:^10.7.1" + mz: "npm:^2.4.0" + parse5: "npm:^5.1.1" + parse5-htmlparser2-tree-adapter: "npm:^6.0.0" + yargs: "npm:^16.0.0" + bin: + highlight: bin/highlight + checksum: 10c0/b5b4af3b968aa9df77eee449a400fbb659cf47c4b03a395370bd98d5554a00afaa5819b41a9a8a1ca0d37b0b896a94e57c65289b37359a25b700b1f56eb04852 + languageName: node + linkType: hard + "cli-spinners@npm:2.6.1": version: 2.6.1 resolution: "cli-spinners@npm:2.6.1" @@ -10136,6 +10528,19 @@ __metadata: languageName: node linkType: hard +"cli-table3@npm:^0.6.3, cli-table3@npm:^0.6.5": + version: 0.6.5 + resolution: "cli-table3@npm:0.6.5" + dependencies: + "@colors/colors": "npm:1.5.0" + string-width: "npm:^4.2.0" + dependenciesMeta: + "@colors/colors": + optional: true + checksum: 10c0/d7cc9ed12212ae68241cc7a3133c52b844113b17856e11f4f81308acc3febcea7cc9fd298e70933e294dd642866b29fd5d113c2c098948701d0c35f09455de78 + languageName: node + linkType: hard + "cli-truncate@npm:^5.0.0": version: 5.2.0 resolution: "cli-truncate@npm:5.2.0" @@ -10164,6 +10569,17 @@ __metadata: languageName: node linkType: hard +"cliui@npm:^7.0.2": + version: 7.0.4 + resolution: "cliui@npm:7.0.4" + dependencies: + string-width: "npm:^4.2.0" + strip-ansi: "npm:^6.0.0" + wrap-ansi: "npm:^7.0.0" + checksum: 10c0/6035f5daf7383470cef82b3d3db00bec70afb3423538c50394386ffbbab135e26c3689c41791f911fa71b62d13d3863c712fdd70f0fbdffd938a1e6fd09aac00 + languageName: node + linkType: hard + "cliui@npm:^8.0.1": version: 8.0.1 resolution: "cliui@npm:8.0.1" @@ -10286,6 +10702,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^10.0.1": + version: 10.0.1 + resolution: "commander@npm:10.0.1" + checksum: 10c0/53f33d8927758a911094adadda4b2cbac111a5b377d8706700587650fd8f45b0bbe336de4b5c3fe47fd61f420a3d9bd452b6e0e6e5600a7e74d7bf0174f6efe3 + languageName: node + linkType: hard + "commander@npm:^12.1.0": version: 12.1.0 resolution: "commander@npm:12.1.0" @@ -10956,6 +11379,13 @@ __metadata: languageName: node linkType: hard +"defu@npm:^6.1.7": + version: 6.1.7 + resolution: "defu@npm:6.1.7" + checksum: 10c0/e6635388103c8be3c574ac31302f6930e5e6eeedba32cb1b30cf993c7d9fb571aec2485446dfa23bfa63e55e66156fe109027a9695db82a50f931e91e8d4bedb + languageName: node + linkType: hard + "delayed-stream@npm:~1.0.0": version: 1.0.0 resolution: "delayed-stream@npm:1.0.0" @@ -11194,6 +11624,18 @@ __metadata: languageName: node linkType: hard +"dts-resolver@npm:^3.0.0": + version: 3.0.0 + resolution: "dts-resolver@npm:3.0.0" + peerDependencies: + oxc-resolver: ">=11.0.0" + peerDependenciesMeta: + oxc-resolver: + optional: true + checksum: 10c0/ae52c4e09b43def702b02d7edbfa04798522907f22879809f8890e5c61fc762403f46a1c415c2d1a6440b01960bbaf98c72def1771b0962d3b15fec40983a4ab + languageName: node + linkType: hard + "dunder-proto@npm:^1.0.0, dunder-proto@npm:^1.0.1": version: 1.0.1 resolution: "dunder-proto@npm:1.0.1" @@ -11279,7 +11721,14 @@ __metadata: languageName: node linkType: hard -"empathic@npm:^2.0.0": +"emojilib@npm:^2.4.0": + version: 2.4.0 + resolution: "emojilib@npm:2.4.0" + checksum: 10c0/6e66ba8921175842193f974e18af448bb6adb0cf7aeea75e08b9d4ea8e9baba0e4a5347b46ed901491dcaba277485891c33a8d70b0560ca5cc9672a94c21ab8f + languageName: node + linkType: hard + +"empathic@npm:^2.0.0, empathic@npm:^2.0.1": version: 2.0.1 resolution: "empathic@npm:2.0.1" checksum: 10c0/577f2868bfcad4ffbf911b57c75016125eb8cc8a7d32cf2d3e9fbcb31bfe6e9e6b66d9457ac34ccb2cd38bff353b3af34287899e0360b8c561ff6d4a048aca62 @@ -12480,6 +12929,13 @@ __metadata: languageName: node linkType: hard +"fflate@npm:^0.8.3": + version: 0.8.3 + resolution: "fflate@npm:0.8.3" + checksum: 10c0/eab181ca37f5348ae76d4b6f840e0026e30220e33153289ac942222d8b9638237d486507dbcc09878d724095bd354993a2ee48bbee99c8f2c6440d4448719aa7 + languageName: node + linkType: hard + "figures@npm:3.2.0": version: 3.2.0 resolution: "figures@npm:3.2.0" @@ -12879,13 +13335,6 @@ __metadata: languageName: node linkType: hard -"fs-readdir-recursive@npm:^1.1.0": - version: 1.1.0 - resolution: "fs-readdir-recursive@npm:1.1.0" - checksum: 10c0/7e190393952143e674b6d1ad4abcafa1b5d3e337fcc21b0cb051079a7140a54617a7df193d562ef9faf21bd7b2148a38601b3d5c16261fa76f278d88dc69989c - languageName: node - linkType: hard - "fs.realpath@npm:^1.0.0": version: 1.0.0 resolution: "fs.realpath@npm:1.0.0" @@ -13059,6 +13508,15 @@ __metadata: languageName: node linkType: hard +"get-tsconfig@npm:5.0.0-beta.6": + version: 5.0.0-beta.6 + resolution: "get-tsconfig@npm:5.0.0-beta.6" + dependencies: + resolve-pkg-maps: "npm:^1.0.0" + checksum: 10c0/661d07b469ca6a76d8075a40aef66b90e22775fe2cc5462b349f5af14def39d8ee8572a63a1cd65acb91fcf7f546969d20b330f8afe480ab5360136aaacc0fc3 + languageName: node + linkType: hard + "gh-pages@npm:^5.0.0": version: 5.0.0 resolution: "gh-pages@npm:5.0.0" @@ -13140,7 +13598,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.0.3, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.2.0": +"glob@npm:^7.0.3, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -13415,6 +13873,13 @@ __metadata: languageName: node linkType: hard +"highlight.js@npm:^10.7.1": + version: 10.7.3 + resolution: "highlight.js@npm:10.7.3" + checksum: 10c0/073837eaf816922427a9005c56c42ad8786473dc042332dfe7901aa065e92bc3d94ebf704975257526482066abb2c8677cc0326559bb8621e046c21c5991c434 + languageName: node + linkType: hard + "hoist-non-react-statics@npm:^3.3.1": version: 3.3.2 resolution: "hoist-non-react-statics@npm:3.3.2" @@ -13433,6 +13898,13 @@ __metadata: languageName: node linkType: hard +"hookable@npm:^6.1.1": + version: 6.1.1 + resolution: "hookable@npm:6.1.1" + checksum: 10c0/bb46cd9ffc0a997af21febd97835da4e59a6989adec73dc3c215fcc44c7ac01de4781f251c3d420bf45862d2592a695f5f0de095b6f5df52db8afb5166938212 + languageName: node + linkType: hard + "hosted-git-info@npm:^4.0.1": version: 4.1.0 resolution: "hosted-git-info@npm:4.1.0" @@ -13728,6 +14200,13 @@ __metadata: languageName: node linkType: hard +"import-without-cache@npm:^0.4.0": + version: 0.4.0 + resolution: "import-without-cache@npm:0.4.0" + checksum: 10c0/5ba51078dc15f08cd1ef4e12f3d274a7e1906319ac831b5ddf036a033ab3b4395264b93c64be8b6050be27546754a4c3a84fcfbe8e827ba221203cc47c608a46 + languageName: node + linkType: hard + "imurmurhash@npm:^0.1.4": version: 0.1.4 resolution: "imurmurhash@npm:0.1.4" @@ -15536,6 +16015,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.1": + version: 11.5.2 + resolution: "lru-cache@npm:11.5.2" + checksum: 10c0/ece1ad731f5b655e85d67047d04bfc13823dc77aa61c5454924a9869ba600a0104e39cc33d726021feef812bc347ca34a5608a5eb1972a5dd0870b7ecd42c3f2 + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -15595,16 +16081,6 @@ __metadata: languageName: node linkType: hard -"make-dir@npm:^2.1.0": - version: 2.1.0 - resolution: "make-dir@npm:2.1.0" - dependencies: - pify: "npm:^4.0.1" - semver: "npm:^5.6.0" - checksum: 10c0/ada869944d866229819735bee5548944caef560d7a8536ecbc6536edca28c72add47cc4f6fc39c54fb25d06b58da1f8994cf7d9df7dadea047064749efc085d8 - languageName: node - linkType: hard - "make-dir@npm:^3.0.0, make-dir@npm:^3.0.2": version: 3.1.0 resolution: "make-dir@npm:3.1.0" @@ -15679,6 +16155,23 @@ __metadata: languageName: node linkType: hard +"marked-terminal@npm:^7.1.0": + version: 7.3.0 + resolution: "marked-terminal@npm:7.3.0" + dependencies: + ansi-escapes: "npm:^7.0.0" + ansi-regex: "npm:^6.1.0" + chalk: "npm:^5.4.1" + cli-highlight: "npm:^2.1.11" + cli-table3: "npm:^0.6.5" + node-emoji: "npm:^2.2.0" + supports-hyperlinks: "npm:^3.1.0" + peerDependencies: + marked: ">=1 <16" + checksum: 10c0/59d23c2ed9488c40856d828f431ae1d5d57426e791bbce8f05ec5a7d3a1f848cdb3b8d8880d76ae45570415f8b48ae459f50bbbd88ece5a31306f1e3de57f021 + languageName: node + linkType: hard + "marked@npm:^4.3.0": version: 4.3.0 resolution: "marked@npm:4.3.0" @@ -15688,6 +16181,15 @@ __metadata: languageName: node linkType: hard +"marked@npm:^9.1.2": + version: 9.1.6 + resolution: "marked@npm:9.1.6" + bin: + marked: bin/marked.js + checksum: 10c0/010bbd33c0f38300259c5d3bf0063deb36bab098d37ac0a3be5a35a65674a4c693427fc6704f486a89f638e9b36c36b8e220a93d47163f4e70e45a1fa8ca7b60 + languageName: node + linkType: hard + "math-intrinsics@npm:^1.1.0": version: 1.1.0 resolution: "math-intrinsics@npm:1.1.0" @@ -16533,6 +17035,13 @@ __metadata: languageName: node linkType: hard +"mri@npm:^1.1.0": + version: 1.2.0 + resolution: "mri@npm:1.2.0" + checksum: 10c0/a3d32379c2554cf7351db6237ddc18dc9e54e4214953f3da105b97dc3babe0deb3ffe99cf409b38ea47cc29f9430561ba6b53b24ab8f9ce97a4b50409e4a50e7 + languageName: node + linkType: hard + "mrmime@npm:^2.0.0": version: 2.0.1 resolution: "mrmime@npm:2.0.1" @@ -16554,6 +17063,17 @@ __metadata: languageName: node linkType: hard +"mz@npm:^2.4.0": + version: 2.7.0 + resolution: "mz@npm:2.7.0" + dependencies: + any-promise: "npm:^1.0.0" + object-assign: "npm:^4.0.1" + thenify-all: "npm:^1.0.0" + checksum: 10c0/103114e93f87362f0b56ab5b2e7245051ad0276b646e3902c98397d18bb8f4a77f2ea4a2c9d3ad516034ea3a56553b60d3f5f78220001ca4c404bd711bd0af39 + languageName: node + linkType: hard + "nano-css@npm:^5.6.2": version: 5.6.2 resolution: "nano-css@npm:5.6.2" @@ -16645,6 +17165,18 @@ __metadata: languageName: node linkType: hard +"node-emoji@npm:^2.2.0": + version: 2.2.0 + resolution: "node-emoji@npm:2.2.0" + dependencies: + "@sindresorhus/is": "npm:^4.6.0" + char-regex: "npm:^1.0.2" + emojilib: "npm:^2.4.0" + skin-tone: "npm:^2.0.0" + checksum: 10c0/9525defbd90a82a2131758c2470203fa2a2faa8edd177147a8654a26307fe03594e52847ecbe2746d06cfc5c50acd12bd500f035350a7609e8217c9894c19aad + languageName: node + linkType: hard + "node-fetch@npm:2.7.0": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" @@ -17106,6 +17638,13 @@ __metadata: languageName: node linkType: hard +"obug@npm:^2.1.4": + version: 2.2.1 + resolution: "obug@npm:2.2.1" + checksum: 10c0/8a7c001847d880fa6ba83c7bbee6a80fd271ee628439cd508c8647d53b217abb1759e2d5e4aaeb09a35d0a274bdb225a0a5a78eded3213d63e656153cf411b63 + languageName: node + linkType: hard + "on-finished@npm:2.4.1": version: 2.4.1 resolution: "on-finished@npm:2.4.1" @@ -17446,6 +17985,13 @@ __metadata: languageName: node linkType: hard +"package-manager-detector@npm:^1.8.0": + version: 1.8.0 + resolution: "package-manager-detector@npm:1.8.0" + checksum: 10c0/4c8e2c47fdc874465d3b3b11934401db9d73470ccbdabeb092e46cb94abbc491d5befc8c271b5ea1ae9c6a881f44c2997e011873365bde9fd6c3dc001221ff7a + languageName: node + linkType: hard + "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -17502,6 +18048,29 @@ __metadata: languageName: node linkType: hard +"parse5-htmlparser2-tree-adapter@npm:^6.0.0": + version: 6.0.1 + resolution: "parse5-htmlparser2-tree-adapter@npm:6.0.1" + dependencies: + parse5: "npm:^6.0.1" + checksum: 10c0/dfa5960e2aaf125707e19a4b1bc333de49232eba5a6ffffb95d313a7d6087c3b7a274b58bee8d3bd41bdf150638815d1d601a42bbf2a0345208c3c35b1279556 + languageName: node + linkType: hard + +"parse5@npm:^5.1.1": + version: 5.1.1 + resolution: "parse5@npm:5.1.1" + checksum: 10c0/b0f87a77a7fea5f242e3d76917c983bbea47703b9371801d51536b78942db6441cbda174bf84eb30e47315ddc6f8a0b57d68e562c790154430270acd76c1fa03 + languageName: node + linkType: hard + +"parse5@npm:^6.0.1": + version: 6.0.1 + resolution: "parse5@npm:6.0.1" + checksum: 10c0/595821edc094ecbcfb9ddcb46a3e1fe3a718540f8320eff08b8cf6742a5114cce2d46d45f95c26191c11b184dcaf4e2960abcd9c5ed9eb9393ac9a37efcfdecb + languageName: node + linkType: hard + "parse5@npm:^7.0.0, parse5@npm:^7.2.1": version: 7.3.0 resolution: "parse5@npm:7.3.0" @@ -17641,7 +18210,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^4.0.4": +"picomatch@npm:^4.0.4, picomatch@npm:^4.0.7": version: 4.0.7 resolution: "picomatch@npm:4.0.7" checksum: 10c0/beb6ae02c43ae44e84883b90830196d9046b1726ead292adcf7f57945e0bb0d992d68563d87e03b484b6f3c9a5c6defda7523477f047d7f0e663f126cc01787f @@ -17655,13 +18224,6 @@ __metadata: languageName: node linkType: hard -"pify@npm:^4.0.1": - version: 4.0.1 - resolution: "pify@npm:4.0.1" - checksum: 10c0/6f9d404b0d47a965437403c9b90eca8bb2536407f03de165940e62e72c8c8b75adda5516c6b9b23675a5877cc0bcac6bdfb0ef0e39414cd2476d5495da40e7cf - languageName: node - linkType: hard - "pinkie-promise@npm:^2.0.0": version: 2.0.1 resolution: "pinkie-promise@npm:2.0.1" @@ -17981,6 +18543,20 @@ __metadata: languageName: node linkType: hard +"publint@npm:0.3.24": + version: 0.3.24 + resolution: "publint@npm:0.3.24" + dependencies: + "@publint/pack": "npm:^0.1.7" + package-manager-detector: "npm:^1.8.0" + picocolors: "npm:^1.1.1" + sade: "npm:^1.8.1" + bin: + publint: ./src/cli.js + checksum: 10c0/ad938ca375aa196845cd2705c49295662839fb991374c24d9acb85945177ebe73c95c8b82666858826b36a8dad943427a0ef0eb1f8b7eaa8abe4c8bc5f55781c + languageName: node + linkType: hard + "punycode@npm:^2.1.0, punycode@npm:^2.3.1": version: 2.3.1 resolution: "punycode@npm:2.3.1" @@ -18018,6 +18594,13 @@ __metadata: languageName: node linkType: hard +"quansync@npm:^1.0.0": + version: 1.0.0 + resolution: "quansync@npm:1.0.0" + checksum: 10c0/076542634399a0cc46078baab6b31acee7a88c5a435234345f645aedaa42bc6a63836e655fb39b1b21a83c98ec86a4b73ec5e2b2d6f3fdc22711eeeff9463253 + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -18827,6 +19410,13 @@ __metadata: languageName: node linkType: hard +"resolve-pkg-maps@npm:^1.0.0": + version: 1.0.0 + resolution: "resolve-pkg-maps@npm:1.0.0" + checksum: 10c0/fb8f7bbe2ca281a73b7ef423a1cbc786fb244bd7a95cbe5c3fba25b27d327150beca8ba02f622baea65919a57e061eb5005204daa5f93ed590d9b77463a567ab + languageName: node + linkType: hard + "resolve.exports@npm:2.0.3": version: 2.0.3 resolution: "resolve.exports@npm:2.0.3" @@ -18964,6 +19554,93 @@ __metadata: languageName: node linkType: hard +"rolldown-plugin-dts@npm:^0.28.5": + version: 0.28.5 + resolution: "rolldown-plugin-dts@npm:0.28.5" + dependencies: + dts-resolver: "npm:^3.0.0" + get-tsconfig: "npm:5.0.0-beta.6" + obug: "npm:^2.1.4" + yuku-ast: "npm:^0.9.3" + yuku-codegen: "npm:^0.9.3" + yuku-parser: "npm:^0.9.3" + peerDependencies: + "@typescript/native-preview": "*" + "@volar/typescript": ~2.4.0 + rolldown: ^1.2.0 + typescript: ^5.0.0 || ^6.0.0 || ~7.0.0 + vue-tsc: ~3.2.0 || ~3.3.0 + peerDependenciesMeta: + "@typescript/native-preview": + optional: true + "@volar/typescript": + optional: true + typescript: + optional: true + vue-tsc: + optional: true + checksum: 10c0/9042dbf2dae88ae59d1115d86e7a6c39a041dd07f89939d39d7c12f66cd3395292177c95160558b7492c8a9ad3d08b66f11e153305ec48ce292b2bf34664fd53 + languageName: node + linkType: hard + +"rolldown@npm:~1.2.7": + version: 1.2.8 + resolution: "rolldown@npm:1.2.8" + dependencies: + "@oxc-project/types": "npm:=0.149.0" + "@rolldown/binding-android-arm-eabi": "npm:1.2.8" + "@rolldown/binding-android-arm64": "npm:1.2.8" + "@rolldown/binding-darwin-arm64": "npm:1.2.8" + "@rolldown/binding-darwin-x64": "npm:1.2.8" + "@rolldown/binding-freebsd-x64": "npm:1.2.8" + "@rolldown/binding-linux-arm-gnueabihf": "npm:1.2.8" + "@rolldown/binding-linux-arm64-gnu": "npm:1.2.8" + "@rolldown/binding-linux-arm64-musl": "npm:1.2.8" + "@rolldown/binding-linux-ppc64-gnu": "npm:1.2.8" + "@rolldown/binding-linux-s390x-gnu": "npm:1.2.8" + "@rolldown/binding-linux-x64-gnu": "npm:1.2.8" + "@rolldown/binding-linux-x64-musl": "npm:1.2.8" + "@rolldown/binding-openharmony-arm64": "npm:1.2.8" + "@rolldown/binding-win32-arm64-msvc": "npm:1.2.8" + "@rolldown/binding-win32-x64-msvc": "npm:1.2.8" + "@rolldown/pluginutils": "npm:^1.0.0" + dependenciesMeta: + "@rolldown/binding-android-arm-eabi": + optional: true + "@rolldown/binding-android-arm64": + optional: true + "@rolldown/binding-darwin-arm64": + optional: true + "@rolldown/binding-darwin-x64": + optional: true + "@rolldown/binding-freebsd-x64": + optional: true + "@rolldown/binding-linux-arm-gnueabihf": + optional: true + "@rolldown/binding-linux-arm64-gnu": + optional: true + "@rolldown/binding-linux-arm64-musl": + optional: true + "@rolldown/binding-linux-ppc64-gnu": + optional: true + "@rolldown/binding-linux-s390x-gnu": + optional: true + "@rolldown/binding-linux-x64-gnu": + optional: true + "@rolldown/binding-linux-x64-musl": + optional: true + "@rolldown/binding-openharmony-arm64": + optional: true + "@rolldown/binding-win32-arm64-msvc": + optional: true + "@rolldown/binding-win32-x64-msvc": + optional: true + bin: + rolldown: ./bin/cli.mjs + checksum: 10c0/5a9c6b30a7ef0af257a963e6b0b95d5a60b23512b7dbcca617273bd63fb0892b88be6b33dc9a6cb66350f47d260eff6456af0b7afef34898767f3527ce0d967d + languageName: node + linkType: hard + "rollup-plugin-typescript2@npm:^0.36.0": version: 0.36.0 resolution: "rollup-plugin-typescript2@npm:0.36.0" @@ -19189,6 +19866,15 @@ __metadata: languageName: node linkType: hard +"sade@npm:^1.8.1": + version: 1.8.1 + resolution: "sade@npm:1.8.1" + dependencies: + mri: "npm:^1.1.0" + checksum: 10c0/da8a3a5d667ad5ce3bf6d4f054bbb9f711103e5df21003c5a5c1a8a77ce12b640ed4017dd423b13c2307ea7e645adee7c2ae3afe8051b9db16a6f6d3da3f90b1 + languageName: node + linkType: hard + "safe-array-concat@npm:^1.1.2, safe-array-concat@npm:^1.1.3": version: 1.1.3 resolution: "safe-array-concat@npm:1.1.3" @@ -19322,15 +20008,6 @@ __metadata: languageName: node linkType: hard -"semver@npm:^5.6.0": - version: 5.7.2 - resolution: "semver@npm:5.7.2" - bin: - semver: bin/semver - checksum: 10c0/e4cf10f86f168db772ae95d86ba65b3fd6c5967c94d97c708ccb463b778c2ee53b914cd7167620950fc07faf5a564e6efe903836639e512a1aa15fbc9667fa25 - languageName: node - linkType: hard - "semver@npm:^6.0.0, semver@npm:^6.3.0, semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" @@ -19554,7 +20231,7 @@ __metadata: version: 0.0.0-use.local resolution: "skillsoft-gamut@workspace:." dependencies: - "@babel/cli": "npm:7.24.7" + "@arethetypeswrong/cli": "npm:0.18.5" "@babel/core": "npm:7.24.7" "@babel/preset-env": "npm:^7.24.7" "@babel/preset-react": "npm:^7.24.7" @@ -19627,6 +20304,7 @@ __metadata: onchange: "npm:^7.0.2" playwright: "npm:^1.49.1" prettier: "npm:^2.8.7" + publint: "npm:0.3.24" react: "npm:^19.0.0" react-dom: "npm:^19.0.0" react-helmet-async: "npm:^2.0.5" @@ -19638,6 +20316,7 @@ __metadata: syncpack: "npm:^10.9.3" ts-jest: "npm:^29.4.12" ts-node: "npm:10.9.1" + tsdown: "npm:0.23.0" tslib: "npm:2.4.0" typescript: "npm:5.9.3" vite: "npm:^7.0.0" @@ -19645,10 +20324,12 @@ __metadata: languageName: unknown linkType: soft -"slash@npm:^2.0.0": +"skin-tone@npm:^2.0.0": version: 2.0.0 - resolution: "slash@npm:2.0.0" - checksum: 10c0/f83dbd3cb62c41bb8fcbbc6bf5473f3234b97fa1d008f571710a9d3757a28c7169e1811cad1554ccb1cc531460b3d221c9a7b37f549398d9a30707f0a5af9193 + resolution: "skin-tone@npm:2.0.0" + dependencies: + unicode-emoji-modifier-base: "npm:^1.0.0" + checksum: 10c0/82d4c2527864f9cbd6cb7f3c4abb31e2224752234d5013b881d3e34e9ab543545b05206df5a17d14b515459fcb265ce409f9cfe443903176b0360cd20e4e4ba5 languageName: node linkType: hard @@ -20341,7 +21022,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^7.1.0": +"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" dependencies: @@ -20366,6 +21047,16 @@ __metadata: languageName: node linkType: hard +"supports-hyperlinks@npm:^3.1.0": + version: 3.2.0 + resolution: "supports-hyperlinks@npm:3.2.0" + dependencies: + has-flag: "npm:^4.0.0" + supports-color: "npm:^7.0.0" + checksum: 10c0/bca527f38d4c45bc95d6a24225944675746c515ddb91e2456d00ae0b5c537658e9dd8155b996b191941b0c19036195a098251304b9082bbe00cd1781f3cd838e + languageName: node + linkType: hard + "supports-preserve-symlinks-flag@npm:^1.0.0": version: 1.0.0 resolution: "supports-preserve-symlinks-flag@npm:1.0.0" @@ -20573,6 +21264,24 @@ __metadata: languageName: node linkType: hard +"thenify-all@npm:^1.0.0": + version: 1.6.0 + resolution: "thenify-all@npm:1.6.0" + dependencies: + thenify: "npm:>= 3.1.0 < 4" + checksum: 10c0/9b896a22735e8122754fe70f1d65f7ee691c1d70b1f116fda04fea103d0f9b356e3676cb789506e3909ae0486a79a476e4914b0f92472c2e093d206aed4b7d6b + languageName: node + linkType: hard + +"thenify@npm:>= 3.1.0 < 4": + version: 3.3.1 + resolution: "thenify@npm:3.3.1" + dependencies: + any-promise: "npm:^1.0.0" + checksum: 10c0/f375aeb2b05c100a456a30bc3ed07ef03a39cbdefe02e0403fb714b8c7e57eeaad1a2f5c4ecfb9ce554ce3db9c2b024eba144843cd9e344566d9fcee73b04767 + languageName: node + linkType: hard + "throttle-debounce@npm:^3.0.1": version: 3.0.1 resolution: "throttle-debounce@npm:3.0.1" @@ -20622,6 +21331,13 @@ __metadata: languageName: node linkType: hard +"tinyexec@npm:^1.3.0, tinyexec@npm:^1.3.1": + version: 1.3.1 + resolution: "tinyexec@npm:1.3.1" + checksum: 10c0/c590369cb3fa73cc18a3998caec8a00f9712d91309c881be3ac52b160fb2f80c7b1fbf3591858ab6abab47ad55385b0c86ec19982e32441a01f55298dab9ccd2 + languageName: node + linkType: hard + "tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.15": version: 0.2.15 resolution: "tinyglobby@npm:0.2.15" @@ -20632,7 +21348,7 @@ __metadata: languageName: node linkType: hard -"tinyglobby@npm:^0.2.14": +"tinyglobby@npm:^0.2.14, tinyglobby@npm:^0.2.17": version: 0.2.17 resolution: "tinyglobby@npm:0.2.17" dependencies: @@ -20913,6 +21629,59 @@ __metadata: languageName: node linkType: hard +"tsdown@npm:0.23.0": + version: 0.23.0 + resolution: "tsdown@npm:0.23.0" + dependencies: + cac: "npm:^7.0.0" + defu: "npm:^6.1.7" + empathic: "npm:^2.0.1" + hookable: "npm:^6.1.1" + import-without-cache: "npm:^0.4.0" + obug: "npm:^2.1.4" + picomatch: "npm:^4.0.7" + rolldown: "npm:~1.2.7" + rolldown-plugin-dts: "npm:^0.28.5" + tinyexec: "npm:^1.3.1" + tinyglobby: "npm:^0.2.17" + tree-kill: "npm:^1.2.2" + unconfig-core: "npm:^7.5.0" + verkit: "npm:^0.4.0" + peerDependencies: + "@arethetypeswrong/core": ^0.18.1 + "@tsdown/css": 0.23.0 + "@tsdown/exe": 0.23.0 + "@vitejs/devtools": "*" + publint: ^0.3.8 + tsx: "*" + typescript: ^5.0.0 || ^6.0.0 || ^7.0.0 + unplugin-unused: ">=0.5.0" + unrun: "*" + peerDependenciesMeta: + "@arethetypeswrong/core": + optional: true + "@tsdown/css": + optional: true + "@tsdown/exe": + optional: true + "@vitejs/devtools": + optional: true + publint: + optional: true + tsx: + optional: true + typescript: + optional: true + unplugin-unused: + optional: true + unrun: + optional: true + bin: + tsdown: ./dist/run.mjs + checksum: 10c0/0b9f77653ec9955a5b830576d6a4d6ba1feb82d4adb7624a1b529e34fdf772c165cdbf817ef44ad907d507fa1170ad960ba99bd88f448f3d57e0da07cf6c9643 + languageName: node + linkType: hard + "tslib@npm:2.4.0": version: 2.4.0 resolution: "tslib@npm:2.4.0" @@ -21064,6 +21833,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:5.6.1-rc": + version: 5.6.1-rc + resolution: "typescript@npm:5.6.1-rc" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/9d6e99b7ddbc797ebc8d09e5d7f2f81ce5f288a4e607bcded3c545ced8582796c937fba31bede5660a56f978b2f68e7c4ee85614b307425a2b4617535721509f + languageName: node + linkType: hard + "typescript@npm:5.9.3, typescript@npm:~5.9.2": version: 5.9.3 resolution: "typescript@npm:5.9.3" @@ -21074,6 +21853,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@npm%3A5.6.1-rc#optional!builtin": + version: 5.6.1-rc + resolution: "typescript@patch:typescript@npm%3A5.6.1-rc#optional!builtin::version=5.6.1-rc&hash=8c6c40" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/9c6f8d864bc2efc964d1bfc94bf2e14f35cd2ad3df5e92d5304c8759674ba77ae927078a5fc06a527c087953615465dd5decc2d4d28ca8e13c11f9b29e068d93 + languageName: node + linkType: hard + "typescript@patch:typescript@npm%3A5.9.3#optional!builtin, typescript@patch:typescript@npm%3A~5.9.2#optional!builtin": version: 5.9.3 resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" @@ -21105,6 +21894,16 @@ __metadata: languageName: node linkType: hard +"unconfig-core@npm:^7.5.0": + version: 7.5.0 + resolution: "unconfig-core@npm:7.5.0" + dependencies: + "@quansync/fs": "npm:^1.0.0" + quansync: "npm:^1.0.0" + checksum: 10c0/9c9f745254aa8e267140430a432353d17ee87f625b0ea0668e189d88736828d117b66bd2dd41f1d48bd40d44d5b7c7d160e8b7996a60c8f484e2975ef73c7cb7 + languageName: node + linkType: hard + "undici-types@npm:~6.21.0": version: 6.21.0 resolution: "undici-types@npm:6.21.0" @@ -21119,6 +21918,13 @@ __metadata: languageName: node linkType: hard +"unicode-emoji-modifier-base@npm:^1.0.0": + version: 1.0.0 + resolution: "unicode-emoji-modifier-base@npm:1.0.0" + checksum: 10c0/b37623fcf0162186debd20f116483e035a2d5b905b932a2c472459d9143d446ebcbefb2a494e2fe4fa7434355396e2a95ec3fc1f0c29a3bc8f2c827220e79c66 + languageName: node + linkType: hard + "unicode-match-property-ecmascript@npm:^2.0.0": version: 2.0.0 resolution: "unicode-match-property-ecmascript@npm:2.0.0" @@ -21544,6 +22350,13 @@ __metadata: languageName: node linkType: hard +"verkit@npm:^0.4.0": + version: 0.4.0 + resolution: "verkit@npm:0.4.0" + checksum: 10c0/a3b794fa0902a3643ee2ae073eeb6fcc50e1245aa339f888aab7e02120d9d195beae9894fd1a8f8ea0fc2c0b20f089459d6d1aecfebe889e94bf8bf70f01c60e + languageName: node + linkType: hard + "vfile-message@npm:^4.0.0": version: 4.0.3 resolution: "vfile-message@npm:4.0.3" @@ -22278,7 +23091,7 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^20.2.9": +"yargs-parser@npm:^20.2.2, yargs-parser@npm:^20.2.9": version: 20.2.9 resolution: "yargs-parser@npm:20.2.9" checksum: 10c0/0685a8e58bbfb57fab6aefe03c6da904a59769bd803a722bb098bd5b0f29d274a1357762c7258fb487512811b8063fb5d2824a3415a0a4540598335b3b086c72 @@ -22304,6 +23117,21 @@ __metadata: languageName: node linkType: hard +"yargs@npm:^16.0.0": + version: 16.2.2 + resolution: "yargs@npm:16.2.2" + dependencies: + cliui: "npm:^7.0.2" + escalade: "npm:^3.1.1" + get-caller-file: "npm:^2.0.5" + require-directory: "npm:^2.1.1" + string-width: "npm:^4.2.0" + y18n: "npm:^5.0.5" + yargs-parser: "npm:^20.2.2" + checksum: 10c0/1ca2152581ee7c9c9fb4174767ff7294b1c272d2d0a1f6eb13c39ce177fded85eb9c96711e00cd7913c0a9b88b6e763713ee11cae81b9b62fd97bdd0b03d5549 + languageName: node + linkType: hard + "yargs@npm:^17.6.2, yargs@npm:^17.7.2": version: 17.7.2 resolution: "yargs@npm:17.7.2" @@ -22333,6 +23161,108 @@ __metadata: languageName: node linkType: hard +"yuku-ast@npm:^0.9.3, yuku-ast@npm:^0.9.5": + version: 0.9.5 + resolution: "yuku-ast@npm:0.9.5" + dependencies: + "@yuku-toolchain/types": "npm:^0.9.5" + checksum: 10c0/cc6159880196008f10765e9c64d6fbc6ceab87ea5451d88907992bf007d10e1bc533c93a5a7b00bb3ac5903e13fed76be447f65d3f8e6a6da210509009e32043 + languageName: node + linkType: hard + +"yuku-codegen@npm:^0.9.3": + version: 0.9.5 + resolution: "yuku-codegen@npm:0.9.5" + dependencies: + "@yuku-codegen/binding-android-arm64": "npm:0.9.5" + "@yuku-codegen/binding-darwin-arm64": "npm:0.9.5" + "@yuku-codegen/binding-darwin-x64": "npm:0.9.5" + "@yuku-codegen/binding-freebsd-x64": "npm:0.9.5" + "@yuku-codegen/binding-linux-arm-gnu": "npm:0.9.5" + "@yuku-codegen/binding-linux-arm-musl": "npm:0.9.5" + "@yuku-codegen/binding-linux-arm64-gnu": "npm:0.9.5" + "@yuku-codegen/binding-linux-arm64-musl": "npm:0.9.5" + "@yuku-codegen/binding-linux-x64-gnu": "npm:0.9.5" + "@yuku-codegen/binding-linux-x64-musl": "npm:0.9.5" + "@yuku-codegen/binding-win32-arm64": "npm:0.9.5" + "@yuku-codegen/binding-win32-x64": "npm:0.9.5" + "@yuku-toolchain/types": "npm:^0.9.5" + dependenciesMeta: + "@yuku-codegen/binding-android-arm64": + optional: true + "@yuku-codegen/binding-darwin-arm64": + optional: true + "@yuku-codegen/binding-darwin-x64": + optional: true + "@yuku-codegen/binding-freebsd-x64": + optional: true + "@yuku-codegen/binding-linux-arm-gnu": + optional: true + "@yuku-codegen/binding-linux-arm-musl": + optional: true + "@yuku-codegen/binding-linux-arm64-gnu": + optional: true + "@yuku-codegen/binding-linux-arm64-musl": + optional: true + "@yuku-codegen/binding-linux-x64-gnu": + optional: true + "@yuku-codegen/binding-linux-x64-musl": + optional: true + "@yuku-codegen/binding-win32-arm64": + optional: true + "@yuku-codegen/binding-win32-x64": + optional: true + checksum: 10c0/fff0d52b38af71a4f2f76ef44406a0c3237957ca2ed0118c156e495b48d03a431f8132808b7f52e8c09d9838267c3cbd6074b9a3e4bca825d442b7a4613bedd8 + languageName: node + linkType: hard + +"yuku-parser@npm:^0.9.3": + version: 0.9.5 + resolution: "yuku-parser@npm:0.9.5" + dependencies: + "@yuku-parser/binding-android-arm64": "npm:0.9.5" + "@yuku-parser/binding-darwin-arm64": "npm:0.9.5" + "@yuku-parser/binding-darwin-x64": "npm:0.9.5" + "@yuku-parser/binding-freebsd-x64": "npm:0.9.5" + "@yuku-parser/binding-linux-arm-gnu": "npm:0.9.5" + "@yuku-parser/binding-linux-arm-musl": "npm:0.9.5" + "@yuku-parser/binding-linux-arm64-gnu": "npm:0.9.5" + "@yuku-parser/binding-linux-arm64-musl": "npm:0.9.5" + "@yuku-parser/binding-linux-x64-gnu": "npm:0.9.5" + "@yuku-parser/binding-linux-x64-musl": "npm:0.9.5" + "@yuku-parser/binding-win32-arm64": "npm:0.9.5" + "@yuku-parser/binding-win32-x64": "npm:0.9.5" + "@yuku-toolchain/types": "npm:^0.9.5" + yuku-ast: "npm:^0.9.5" + dependenciesMeta: + "@yuku-parser/binding-android-arm64": + optional: true + "@yuku-parser/binding-darwin-arm64": + optional: true + "@yuku-parser/binding-darwin-x64": + optional: true + "@yuku-parser/binding-freebsd-x64": + optional: true + "@yuku-parser/binding-linux-arm-gnu": + optional: true + "@yuku-parser/binding-linux-arm-musl": + optional: true + "@yuku-parser/binding-linux-arm64-gnu": + optional: true + "@yuku-parser/binding-linux-arm64-musl": + optional: true + "@yuku-parser/binding-linux-x64-gnu": + optional: true + "@yuku-parser/binding-linux-x64-musl": + optional: true + "@yuku-parser/binding-win32-arm64": + optional: true + "@yuku-parser/binding-win32-x64": + optional: true + checksum: 10c0/e01bd82ac6369166320cfe64770e9e3cbd48a502844cd11afc5b11bb5cbbe484c70af804e0dde50142cc6daad9689ffeb88099731a836e32601df07813527489 + languageName: node + linkType: hard + "zwitch@npm:^2.0.0": version: 2.0.4 resolution: "zwitch@npm:2.0.4" From c410e1425da63a3ab351bcae5f3290f99bf06f33 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Fri, 18 Sep 2026 12:56:54 -0400 Subject: [PATCH 11/47] merged in main + dedupd --- yarn.lock | 597 +++--------------------------------------------------- 1 file changed, 30 insertions(+), 567 deletions(-) diff --git a/yarn.lock b/yarn.lock index ff3157ddf5..d6b612c65f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -75,18 +75,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.24.7, @babel/code-frame@npm:^7.27.1, @babel/code-frame@npm:^7.28.6, @babel/code-frame@npm:^7.29.0": - version: 7.29.0 - resolution: "@babel/code-frame@npm:7.29.0" - dependencies: - "@babel/helper-validator-identifier": "npm:^7.28.5" - js-tokens: "npm:^4.0.0" - picocolors: "npm:^1.1.1" - checksum: 10c0/d34cc504e7765dfb576a663d97067afb614525806b5cad1a5cc1a7183b916fec8ff57fa233585e3926fd5a9e6b31aae6df91aa81ae9775fb7a28f658d3346f0d - languageName: node - linkType: hard - -"@babel/code-frame@npm:^7.29.7": +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.24.7, @babel/code-frame@npm:^7.27.1, @babel/code-frame@npm:^7.29.7": version: 7.29.7 resolution: "@babel/code-frame@npm:7.29.7" dependencies: @@ -97,14 +86,7 @@ __metadata: languageName: node linkType: hard -"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.26.0, @babel/compat-data@npm:^7.28.6": - version: 7.29.0 - resolution: "@babel/compat-data@npm:7.29.0" - checksum: 10c0/08f348554989d23aa801bf1405aa34b15e841c0d52d79da7e524285c77a5f9d298e70e11d91cc578d8e2c9542efc586d50c5f5cf8e1915b254a9dcf786913a94 - languageName: node - linkType: hard - -"@babel/compat-data@npm:^7.29.7": +"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.26.0, @babel/compat-data@npm:^7.29.7": version: 7.29.7 resolution: "@babel/compat-data@npm:7.29.7" checksum: 10c0/47913f05e08a45a1c9df38c02b4b49e391005085b489432647a1abe112e5d9c75e3be8ea5972b7f6da4ec5d1339922ceb9ea02b8a25d4ed1cb8636e5261f344e @@ -134,30 +116,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.12.3, @babel/core@npm:^7.21.3, @babel/core@npm:^7.22.5, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.9, @babel/core@npm:^7.27.4, @babel/core@npm:^7.28.0, @babel/core@npm:^7.7.5": - version: 7.29.0 - resolution: "@babel/core@npm:7.29.0" - dependencies: - "@babel/code-frame": "npm:^7.29.0" - "@babel/generator": "npm:^7.29.0" - "@babel/helper-compilation-targets": "npm:^7.28.6" - "@babel/helper-module-transforms": "npm:^7.28.6" - "@babel/helpers": "npm:^7.28.6" - "@babel/parser": "npm:^7.29.0" - "@babel/template": "npm:^7.28.6" - "@babel/traverse": "npm:^7.29.0" - "@babel/types": "npm:^7.29.0" - "@jridgewell/remapping": "npm:^2.3.5" - convert-source-map: "npm:^2.0.0" - debug: "npm:^4.1.0" - gensync: "npm:^1.0.0-beta.2" - json5: "npm:^2.2.3" - semver: "npm:^6.3.1" - checksum: 10c0/5127d2e8e842ae409e11bcbb5c2dff9874abf5415e8026925af7308e903f4f43397341467a130490d1a39884f461bc2b67f3063bce0be44340db89687fd852aa - languageName: node - linkType: hard - -"@babel/core@npm:^7.29.0": +"@babel/core@npm:^7.12.3, @babel/core@npm:^7.21.3, @babel/core@npm:^7.22.5, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.9, @babel/core@npm:^7.27.4, @babel/core@npm:^7.28.0, @babel/core@npm:^7.29.0, @babel/core@npm:^7.7.5": version: 7.29.7 resolution: "@babel/core@npm:7.29.7" dependencies: @@ -180,20 +139,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.22.5, @babel/generator@npm:^7.24.7, @babel/generator@npm:^7.27.5, @babel/generator@npm:^7.29.0": - version: 7.29.1 - resolution: "@babel/generator@npm:7.29.1" - dependencies: - "@babel/parser": "npm:^7.29.0" - "@babel/types": "npm:^7.29.0" - "@jridgewell/gen-mapping": "npm:^0.3.12" - "@jridgewell/trace-mapping": "npm:^0.3.28" - jsesc: "npm:^3.0.2" - checksum: 10c0/349086e6876258ef3fb2823030fee0f6c0eb9c3ebe35fc572e16997f8c030d765f636ddc6299edae63e760ea6658f8ee9a2edfa6d6b24c9a80c917916b973551 - languageName: node - linkType: hard - -"@babel/generator@npm:^7.29.7, @babel/generator@npm:^7.29.8": +"@babel/generator@npm:^7.22.5, @babel/generator@npm:^7.24.7, @babel/generator@npm:^7.27.5, @babel/generator@npm:^7.29.7, @babel/generator@npm:^7.29.8": version: 7.29.8 resolution: "@babel/generator@npm:7.29.8" dependencies: @@ -225,20 +171,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.24.7, @babel/helper-compilation-targets@npm:^7.25.9, @babel/helper-compilation-targets@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helper-compilation-targets@npm:7.28.6" - dependencies: - "@babel/compat-data": "npm:^7.28.6" - "@babel/helper-validator-option": "npm:^7.27.1" - browserslist: "npm:^4.24.0" - lru-cache: "npm:^5.1.1" - semver: "npm:^6.3.1" - checksum: 10c0/3fcdf3b1b857a1578e99d20508859dbd3f22f3c87b8a0f3dc540627b4be539bae7f6e61e49d931542fe5b557545347272bbdacd7f58a5c77025a18b745593a50 - languageName: node - linkType: hard - -"@babel/helper-compilation-targets@npm:^7.29.7": +"@babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.24.7, @babel/helper-compilation-targets@npm:^7.25.9, @babel/helper-compilation-targets@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-compilation-targets@npm:7.29.7" dependencies: @@ -296,13 +229,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-globals@npm:^7.28.0": - version: 7.28.0 - resolution: "@babel/helper-globals@npm:7.28.0" - checksum: 10c0/5a0cd0c0e8c764b5f27f2095e4243e8af6fa145daea2b41b53c0c1414fe6ff139e3640f4e2207ae2b3d2153a1abd346f901c26c290ee7cb3881dd922d4ee9232 - languageName: node - linkType: hard - "@babel/helper-globals@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-globals@npm:7.29.7" @@ -320,17 +246,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.18.6, @babel/helper-module-imports@npm:^7.25.9, @babel/helper-module-imports@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helper-module-imports@npm:7.28.6" - dependencies: - "@babel/traverse": "npm:^7.28.6" - "@babel/types": "npm:^7.28.6" - checksum: 10c0/b49d8d8f204d9dbfd5ac70c54e533e5269afb3cea966a9d976722b13e9922cc773a653405f53c89acb247d5aebdae4681d631a3ae3df77ec046b58da76eda2ac - languageName: node - linkType: hard - -"@babel/helper-module-imports@npm:^7.29.7": +"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.18.6, @babel/helper-module-imports@npm:^7.25.9, @babel/helper-module-imports@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-module-imports@npm:7.29.7" dependencies: @@ -340,20 +256,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.24.7, @babel/helper-module-transforms@npm:^7.25.9, @babel/helper-module-transforms@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helper-module-transforms@npm:7.28.6" - dependencies: - "@babel/helper-module-imports": "npm:^7.28.6" - "@babel/helper-validator-identifier": "npm:^7.28.5" - "@babel/traverse": "npm:^7.28.6" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/6f03e14fc30b287ce0b839474b5f271e72837d0cafe6b172d759184d998fbee3903a035e81e07c2c596449e504f453463d58baa65b6f40a37ded5bec74620b2b - languageName: node - linkType: hard - -"@babel/helper-module-transforms@npm:^7.29.7": +"@babel/helper-module-transforms@npm:^7.24.7, @babel/helper-module-transforms@npm:^7.25.9, @babel/helper-module-transforms@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-module-transforms@npm:7.29.7" dependencies: @@ -375,14 +278,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.25.9, @babel/helper-plugin-utils@npm:^7.27.1, @babel/helper-plugin-utils@npm:^7.8.0": - version: 7.28.6 - resolution: "@babel/helper-plugin-utils@npm:7.28.6" - checksum: 10c0/3f5f8acc152fdbb69a84b8624145ff4f9b9f6e776cb989f9f968f8606eb7185c5c3cfcf3ba08534e37e1e0e1c118ac67080610333f56baa4f7376c99b5f1143d - languageName: node - linkType: hard - -"@babel/helper-plugin-utils@npm:^7.29.7": +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.25.9, @babel/helper-plugin-utils@npm:^7.27.1, @babel/helper-plugin-utils@npm:^7.29.7, @babel/helper-plugin-utils@npm:^7.8.0": version: 7.29.7 resolution: "@babel/helper-plugin-utils@npm:7.29.7" checksum: 10c0/380477a06133274a2759f9355929cb60a95e8b8fee624a1ae1fa349e1d1645b89daca456f72833f6d1062bffa12ee4271c5bf0cc5a61c0166cdc24c7591e2408 @@ -435,13 +331,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.27.1": - version: 7.27.1 - resolution: "@babel/helper-string-parser@npm:7.27.1" - checksum: 10c0/8bda3448e07b5583727c103560bcf9c4c24b3c1051a4c516d4050ef69df37bb9a4734a585fe12725b8c2763de0a265aa1e909b485a4e3270b7cfd3e4dbe4b602 - languageName: node - linkType: hard - "@babel/helper-string-parser@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-string-parser@npm:7.29.7" @@ -449,28 +338,14 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.25.9, @babel/helper-validator-identifier@npm:^7.28.5": - version: 7.28.5 - resolution: "@babel/helper-validator-identifier@npm:7.28.5" - checksum: 10c0/42aaebed91f739a41f3d80b72752d1f95fd7c72394e8e4bd7cdd88817e0774d80a432451bcba17c2c642c257c483bf1d409dd4548883429ea9493a3bc4ab0847 - languageName: node - linkType: hard - -"@babel/helper-validator-identifier@npm:^7.29.7": +"@babel/helper-validator-identifier@npm:^7.25.9, @babel/helper-validator-identifier@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-validator-identifier@npm:7.29.7" checksum: 10c0/4795354e7ae0dcafa72de1cd04ec51252dc1498517170beaf019e03effc5b7bf13c6b21a3949a77e07b8125be7f106ed1131350d8ebd4566ae874094a726d62b languageName: node linkType: hard -"@babel/helper-validator-option@npm:^7.25.9, @babel/helper-validator-option@npm:^7.27.1": - version: 7.27.1 - resolution: "@babel/helper-validator-option@npm:7.27.1" - checksum: 10c0/6fec5f006eba40001a20f26b1ef5dbbda377b7b68c8ad518c05baa9af3f396e780bdfded24c4eef95d14bb7b8fd56192a6ed38d5d439b97d10efc5f1a191d148 - languageName: node - linkType: hard - -"@babel/helper-validator-option@npm:^7.29.7": +"@babel/helper-validator-option@npm:^7.25.9, @babel/helper-validator-option@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-validator-option@npm:7.29.7" checksum: 10c0/d2a06c6d0ac40ba4a2f219fc2cab249c7a94bacdb2686273b7f9598571c908809b48468ff588915a346e6cc7296f60b581023d1d498b747fed06f779d335c2cc @@ -488,17 +363,7 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.24.7, @babel/helpers@npm:^7.28.6": - version: 7.29.2 - resolution: "@babel/helpers@npm:7.29.2" - dependencies: - "@babel/template": "npm:^7.28.6" - "@babel/types": "npm:^7.29.0" - checksum: 10c0/dab0e65b9318b2502a62c58bc0913572318595eec0482c31f0ad416b72636e6698a1d7c57cd2791d4528eb8c548bca88d338dc4d2a55a108dc1f6702f9bc5512 - languageName: node - linkType: hard - -"@babel/helpers@npm:^7.29.7": +"@babel/helpers@npm:^7.24.7, @babel/helpers@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helpers@npm:7.29.7" dependencies: @@ -508,18 +373,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.7, @babel/parser@npm:^7.28.6, @babel/parser@npm:^7.29.0": - version: 7.29.2 - resolution: "@babel/parser@npm:7.29.2" - dependencies: - "@babel/types": "npm:^7.29.0" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/e5a4e69e3ac7acdde995f37cf299a68458cfe7009dff66bd0962fd04920bef287201169006af365af479c08ff216bfefbb595e331f87f6ae7283858aebbc3317 - languageName: node - linkType: hard - -"@babel/parser@npm:^7.29.7, @babel/parser@npm:^7.29.8": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.7, @babel/parser@npm:^7.29.7, @babel/parser@npm:^7.29.8": version: 7.29.8 resolution: "@babel/parser@npm:7.29.8" dependencies: @@ -1664,18 +1518,7 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.22.5, @babel/template@npm:^7.24.7, @babel/template@npm:^7.25.9, @babel/template@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/template@npm:7.28.6" - dependencies: - "@babel/code-frame": "npm:^7.28.6" - "@babel/parser": "npm:^7.28.6" - "@babel/types": "npm:^7.28.6" - checksum: 10c0/66d87225ed0bc77f888181ae2d97845021838c619944877f7c4398c6748bcf611f216dfd6be74d39016af502bca876e6ce6873db3c49e4ac354c56d34d57e9f5 - languageName: node - linkType: hard - -"@babel/template@npm:^7.29.7": +"@babel/template@npm:^7.22.5, @babel/template@npm:^7.24.7, @babel/template@npm:^7.25.9, @babel/template@npm:^7.29.7": version: 7.29.7 resolution: "@babel/template@npm:7.29.7" dependencies: @@ -1686,22 +1529,7 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.25.9, @babel/traverse@npm:^7.28.0, @babel/traverse@npm:^7.28.6, @babel/traverse@npm:^7.29.0": - version: 7.29.0 - resolution: "@babel/traverse@npm:7.29.0" - dependencies: - "@babel/code-frame": "npm:^7.29.0" - "@babel/generator": "npm:^7.29.0" - "@babel/helper-globals": "npm:^7.28.0" - "@babel/parser": "npm:^7.29.0" - "@babel/template": "npm:^7.28.6" - "@babel/types": "npm:^7.29.0" - debug: "npm:^4.3.1" - checksum: 10c0/f63ef6e58d02a9fbf3c0e2e5f1c877da3e0bc57f91a19d2223d53e356a76859cbaf51171c9211c71816d94a0e69efa2732fd27ffc0e1bbc84b636e60932333eb - languageName: node - linkType: hard - -"@babel/traverse@npm:^7.29.7": +"@babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.25.9, @babel/traverse@npm:^7.28.0, @babel/traverse@npm:^7.29.7": version: 7.29.8 resolution: "@babel/traverse@npm:7.29.8" dependencies: @@ -1716,17 +1544,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.6, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.22.5, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.9, @babel/types@npm:^7.27.3, @babel/types@npm:^7.28.2, @babel/types@npm:^7.28.6, @babel/types@npm:^7.29.0, @babel/types@npm:^7.4.4": - version: 7.29.0 - resolution: "@babel/types@npm:7.29.0" - dependencies: - "@babel/helper-string-parser": "npm:^7.27.1" - "@babel/helper-validator-identifier": "npm:^7.28.5" - checksum: 10c0/23cc3466e83bcbfab8b9bd0edaafdb5d4efdb88b82b3be6728bbade5ba2f0996f84f63b1c5f7a8c0d67efded28300898a5f930b171bb40b311bca2029c4e9b4f - languageName: node - linkType: hard - -"@babel/types@npm:^7.29.7, @babel/types@npm:^7.29.8": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.6, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.22.5, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.9, @babel/types@npm:^7.27.3, @babel/types@npm:^7.28.2, @babel/types@npm:^7.29.7, @babel/types@npm:^7.29.8, @babel/types@npm:^7.4.4": version: 7.29.8 resolution: "@babel/types@npm:7.29.8" dependencies: @@ -3238,14 +3056,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15, @jridgewell/sourcemap-codec@npm:^1.5.0": - version: 1.5.0 - resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" - checksum: 10c0/2eb864f276eb1096c3c11da3e9bb518f6d9fc0023c78344cdc037abadc725172c70314bdb360f2d4b7bffec7f5d657ce006816bc5d4ecb35e61b66132db00c18 - languageName: node - linkType: hard - -"@jridgewell/sourcemap-codec@npm:^1.5.5": +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15, @jridgewell/sourcemap-codec@npm:^1.5.0, @jridgewell/sourcemap-codec@npm:^1.5.5": version: 1.6.0 resolution: "@jridgewell/sourcemap-codec@npm:1.6.0" checksum: 10c0/b5be700e45a775f218589c3466c4ffea630582b4988657652da464e5ab8a7d18bf928ee4fd2363fb346ede4bea9c6ff0bae05a538358c4565ece6199531b5f72 @@ -6304,23 +6115,7 @@ __metadata: languageName: node linkType: hard -"@rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.1.0": - version: 5.2.0 - resolution: "@rollup/pluginutils@npm:5.2.0" - dependencies: - "@types/estree": "npm:^1.0.0" - estree-walker: "npm:^2.0.2" - picomatch: "npm:^4.0.2" - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - checksum: 10c0/794890d512751451bcc06aa112366ef47ea8f9125dac49b1abf72ff8b079518b09359de9c60a013b33266541634e765ae61839c749fae0edb59a463418665c55 - languageName: node - linkType: hard - -"@rollup/pluginutils@npm:^5.0.2": +"@rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.0.2, @rollup/pluginutils@npm:^5.1.0": version: 5.4.0 resolution: "@rollup/pluginutils@npm:5.4.0" dependencies: @@ -6336,13 +6131,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.47.1" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - "@rollup/rollup-android-arm-eabi@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-android-arm-eabi@npm:4.63.1" @@ -6350,13 +6138,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-android-arm64@npm:4.47.1" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-android-arm64@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-android-arm64@npm:4.63.1" @@ -6364,13 +6145,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-darwin-arm64@npm:4.47.1" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-darwin-arm64@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-darwin-arm64@npm:4.63.1" @@ -6378,13 +6152,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-darwin-x64@npm:4.47.1" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-darwin-x64@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-darwin-x64@npm:4.63.1" @@ -6392,13 +6159,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-freebsd-arm64@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.47.1" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-freebsd-arm64@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-freebsd-arm64@npm:4.63.1" @@ -6406,13 +6166,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-freebsd-x64@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-freebsd-x64@npm:4.47.1" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-freebsd-x64@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-freebsd-x64@npm:4.63.1" @@ -6420,13 +6173,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.47.1" - conditions: os=linux & cpu=arm & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-arm-gnueabihf@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.63.1" @@ -6434,13 +6180,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.47.1" - conditions: os=linux & cpu=arm & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-arm-musleabihf@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.63.1" @@ -6448,13 +6187,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.47.1" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-arm64-gnu@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.63.1" @@ -6462,13 +6194,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.47.1" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-arm64-musl@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-arm64-musl@npm:4.63.1" @@ -6490,20 +6215,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-loongarch64-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.47.1" - conditions: os=linux & cpu=loong64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-ppc64-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.47.1" - conditions: os=linux & cpu=ppc64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-ppc64-gnu@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.63.1" @@ -6518,13 +6229,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.47.1" - conditions: os=linux & cpu=riscv64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-riscv64-gnu@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.63.1" @@ -6532,13 +6236,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-musl@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.47.1" - conditions: os=linux & cpu=riscv64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-riscv64-musl@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.63.1" @@ -6546,13 +6243,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.47.1" - conditions: os=linux & cpu=s390x & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-s390x-gnu@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.63.1" @@ -6560,13 +6250,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.47.1" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-x64-gnu@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-x64-gnu@npm:4.63.1" @@ -6574,13 +6257,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.47.1" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-x64-musl@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-x64-musl@npm:4.63.1" @@ -6602,13 +6278,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.47.1" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-win32-arm64-msvc@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.63.1" @@ -6616,13 +6285,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.47.1" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@rollup/rollup-win32-ia32-msvc@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.63.1" @@ -6637,13 +6299,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.47.1" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-win32-x64-msvc@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-win32-x64-msvc@npm:4.63.1" @@ -8053,14 +7708,7 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:*, @types/estree@npm:1.0.8, @types/estree@npm:^1.0.0, @types/estree@npm:^1.0.8": - version: 1.0.8 - resolution: "@types/estree@npm:1.0.8" - checksum: 10c0/39d34d1afaa338ab9763f37ad6066e3f349444f9052b9676a7cc0252ef9485a41c6d81c9c4e0d26e9077993354edf25efc853f3224dd4b447175ef62bdcc86a5 - languageName: node - linkType: hard - -"@types/estree@npm:1.0.9": +"@types/estree@npm:*, @types/estree@npm:1.0.9, @types/estree@npm:^1.0.0, @types/estree@npm:^1.0.8": version: 1.0.9 resolution: "@types/estree@npm:1.0.9" checksum: 10c0/3ad3286ca2988cd550dafb8f2ad599c8474868e954fa601a36655bdfefd8039f7c714b8c1c7f2ae219ffbd58bd4660e66fa7479a0120fc02d4777057d4865387 @@ -9394,20 +9042,13 @@ __metadata: languageName: node linkType: hard -"ansi-regex@npm:^6.1.0": +"ansi-regex@npm:^6.1.0, ansi-regex@npm:^6.2.2": version: 6.3.0 resolution: "ansi-regex@npm:6.3.0" checksum: 10c0/bc047786d0531f1f22d1e22e9863e8554488a399f1ee5270b753efa6de938a788d27456f2b256770f11fdd8b1e847483bc1b55ddc2b3ffe82ec45c875292c651 languageName: node linkType: hard -"ansi-regex@npm:^6.2.2": - version: 6.2.2 - resolution: "ansi-regex@npm:6.2.2" - checksum: 10c0/05d4acb1d2f59ab2cf4b794339c7b168890d44dda4bf0ce01152a8da0213aca207802f930442ce8cd22d7a92f44907664aac6508904e75e038fa944d2601b30f - languageName: node - linkType: hard - "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -13576,18 +13217,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^13.0.0": - version: 13.0.0 - resolution: "glob@npm:13.0.0" - dependencies: - minimatch: "npm:^10.1.1" - minipass: "npm:^7.1.2" - path-scurry: "npm:^2.0.0" - checksum: 10c0/8e2f5821f3f7c312dd102e23a15b80c79e0837a9872784293ba2e15ec73b3f3749a49a42a31bfcb4e52c84820a474e92331c2eebf18819d20308f5c33876630a - languageName: node - linkType: hard - -"glob@npm:^13.0.1": +"glob@npm:^13.0.0, glob@npm:^13.0.1": version: 13.0.6 resolution: "glob@npm:13.0.6" dependencies: @@ -16008,14 +15638,7 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^11.0.0, lru-cache@npm:^11.1.0, lru-cache@npm:^11.2.1": - version: 11.2.4 - resolution: "lru-cache@npm:11.2.4" - checksum: 10c0/4a24f9b17537619f9144d7b8e42cd5a225efdfd7076ebe7b5e7dc02b860a818455201e67fbf000765233fe7e339d3c8229fc815e9b58ee6ede511e07608c19b2 - languageName: node - linkType: hard - -"lru-cache@npm:^11.0.1": +"lru-cache@npm:^11.0.0, lru-cache@npm:^11.0.1, lru-cache@npm:^11.1.0, lru-cache@npm:^11.2.1": version: 11.5.2 resolution: "lru-cache@npm:11.5.2" checksum: 10c0/ece1ad731f5b655e85d67047d04bfc13823dc77aa61c5454924a9869ba600a0104e39cc33d726021feef812bc347ca34a5608a5eb1972a5dd0870b7ecd42c3f2 @@ -16063,7 +15686,7 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.0, magic-string@npm:^0.30.17": +"magic-string@npm:^0.30.0, magic-string@npm:^0.30.17, magic-string@npm:^0.30.3": version: 0.30.21 resolution: "magic-string@npm:0.30.21" dependencies: @@ -16072,15 +15695,6 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.3": - version: 0.30.17 - resolution: "magic-string@npm:0.30.17" - dependencies: - "@jridgewell/sourcemap-codec": "npm:^1.5.0" - checksum: 10c0/16826e415d04b88378f200fe022b53e638e3838b9e496edda6c0e086d7753a44a6ed187adc72d19f3623810589bf139af1a315541cd6a26ae0771a0193eaf7b8 - languageName: node - linkType: hard - "make-dir@npm:^3.0.0, make-dir@npm:^3.0.2": version: 3.1.0 resolution: "make-dir@npm:3.1.0" @@ -16845,7 +16459,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^10.1.1, minimatch@npm:^10.2.2": +"minimatch@npm:^10.2.2": version: 10.2.5 resolution: "minimatch@npm:10.2.5" dependencies: @@ -16966,14 +16580,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.0.4, minipass@npm:^7.1.2": - version: 7.1.2 - resolution: "minipass@npm:7.1.2" - checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557 - languageName: node - linkType: hard - -"minipass@npm:^7.1.3": +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.0.4, minipass@npm:^7.1.2, minipass@npm:^7.1.3": version: 7.1.3 resolution: "minipass@npm:7.1.3" checksum: 10c0/539da88daca16533211ea5a9ee98dc62ff5742f531f54640dd34429e621955e91cc280a91a776026264b7f9f6735947629f920944e9c1558369e8bf22eb33fbb @@ -17093,15 +16700,6 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.3.11": - version: 3.3.11 - resolution: "nanoid@npm:3.3.11" - bin: - nanoid: bin/nanoid.cjs - checksum: 10c0/40e7f70b3d15f725ca072dfc4f74e81fcf1fbb02e491cf58ac0c79093adc9b0a73b152bcde57df4b79cd097e13023d7504acb38404a4da7bc1cd8e887b82fe0b - languageName: node - linkType: hard - "nanoid@npm:^3.3.18": version: 3.3.18 resolution: "nanoid@npm:3.3.18" @@ -18125,16 +17723,6 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^2.0.0": - version: 2.0.1 - resolution: "path-scurry@npm:2.0.1" - dependencies: - lru-cache: "npm:^11.0.0" - minipass: "npm:^7.1.2" - checksum: 10c0/2a16ed0e81fbc43513e245aa5763354e25e787dab0d539581a6c3f0f967461a159ed6236b2559de23aa5b88e7dc32b469b6c47568833dd142a4b24b4f5cd2620 - languageName: node - linkType: hard - "path-scurry@npm:^2.0.2": version: 2.0.2 resolution: "path-scurry@npm:2.0.2" @@ -18203,14 +17791,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^4.0.2, picomatch@npm:^4.0.3": - version: 4.0.4 - resolution: "picomatch@npm:4.0.4" - checksum: 10c0/e2c6023372cc7b5764719a5ffb9da0f8e781212fa7ca4bd0562db929df8e117460f00dff3cb7509dacfc06b86de924b247f504d0ce1806a37fac4633081466b0 - languageName: node - linkType: hard - -"picomatch@npm:^4.0.4, picomatch@npm:^4.0.7": +"picomatch@npm:^4.0.2, picomatch@npm:^4.0.3, picomatch@npm:^4.0.4, picomatch@npm:^4.0.7": version: 4.0.7 resolution: "picomatch@npm:4.0.7" checksum: 10c0/beb6ae02c43ae44e84883b90830196d9046b1726ead292adcf7f57945e0bb0d992d68563d87e03b484b6f3c9a5c6defda7523477f047d7f0e663f126cc01787f @@ -18386,18 +17967,7 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.4.38": - version: 8.5.8 - resolution: "postcss@npm:8.5.8" - dependencies: - nanoid: "npm:^3.3.11" - picocolors: "npm:^1.1.1" - source-map-js: "npm:^1.2.1" - checksum: 10c0/dd918f7127ee7c60a0295bae2e72b3787892296e1d1c3c564d7a2a00c68d8df83cadc3178491259daa19ccc54804fb71ed8c937c6787e08d8bd4bedf8d17044c - languageName: node - linkType: hard - -"postcss@npm:^8.5.6": +"postcss@npm:^8.4.38, postcss@npm:^8.5.6": version: 8.5.28 resolution: "postcss@npm:8.5.28" dependencies: @@ -19657,82 +19227,7 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.14.0": - version: 4.47.1 - resolution: "rollup@npm:4.47.1" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.47.1" - "@rollup/rollup-android-arm64": "npm:4.47.1" - "@rollup/rollup-darwin-arm64": "npm:4.47.1" - "@rollup/rollup-darwin-x64": "npm:4.47.1" - "@rollup/rollup-freebsd-arm64": "npm:4.47.1" - "@rollup/rollup-freebsd-x64": "npm:4.47.1" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.47.1" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.47.1" - "@rollup/rollup-linux-arm64-gnu": "npm:4.47.1" - "@rollup/rollup-linux-arm64-musl": "npm:4.47.1" - "@rollup/rollup-linux-loongarch64-gnu": "npm:4.47.1" - "@rollup/rollup-linux-ppc64-gnu": "npm:4.47.1" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.47.1" - "@rollup/rollup-linux-riscv64-musl": "npm:4.47.1" - "@rollup/rollup-linux-s390x-gnu": "npm:4.47.1" - "@rollup/rollup-linux-x64-gnu": "npm:4.47.1" - "@rollup/rollup-linux-x64-musl": "npm:4.47.1" - "@rollup/rollup-win32-arm64-msvc": "npm:4.47.1" - "@rollup/rollup-win32-ia32-msvc": "npm:4.47.1" - "@rollup/rollup-win32-x64-msvc": "npm:4.47.1" - "@types/estree": "npm:1.0.8" - fsevents: "npm:~2.3.2" - dependenciesMeta: - "@rollup/rollup-android-arm-eabi": - optional: true - "@rollup/rollup-android-arm64": - optional: true - "@rollup/rollup-darwin-arm64": - optional: true - "@rollup/rollup-darwin-x64": - optional: true - "@rollup/rollup-freebsd-arm64": - optional: true - "@rollup/rollup-freebsd-x64": - optional: true - "@rollup/rollup-linux-arm-gnueabihf": - optional: true - "@rollup/rollup-linux-arm-musleabihf": - optional: true - "@rollup/rollup-linux-arm64-gnu": - optional: true - "@rollup/rollup-linux-arm64-musl": - optional: true - "@rollup/rollup-linux-loongarch64-gnu": - optional: true - "@rollup/rollup-linux-ppc64-gnu": - optional: true - "@rollup/rollup-linux-riscv64-gnu": - optional: true - "@rollup/rollup-linux-riscv64-musl": - optional: true - "@rollup/rollup-linux-s390x-gnu": - optional: true - "@rollup/rollup-linux-x64-gnu": - optional: true - "@rollup/rollup-linux-x64-musl": - optional: true - "@rollup/rollup-win32-arm64-msvc": - optional: true - "@rollup/rollup-win32-ia32-msvc": - optional: true - "@rollup/rollup-win32-x64-msvc": - optional: true - fsevents: - optional: true - bin: - rollup: dist/bin/rollup - checksum: 10c0/4d792f8a8bfb4408485bbc6c1f393a88422230c14d06b9de4d27bcf443fe3569f9fa4ed6111972bf6b8b515bd0133bfeb16ab66cdf32494ef0fbd2da41dc2855 - languageName: node - linkType: hard - -"rollup@npm:^4.43.0": +"rollup@npm:^4.14.0, rollup@npm:^4.43.0": version: 4.63.1 resolution: "rollup@npm:4.63.1" dependencies: @@ -21324,31 +20819,14 @@ __metadata: languageName: node linkType: hard -"tinyexec@npm:^1.0.4": - version: 1.0.4 - resolution: "tinyexec@npm:1.0.4" - checksum: 10c0/d4a5bbcf6bdb23527a4b74c4aa566f41432167112fe76f420ec7e3a90a3ecfd3a7d944383e2719fc3987b69400f7b928daf08700d145fb527c2e80ec01e198bd - languageName: node - linkType: hard - -"tinyexec@npm:^1.3.0, tinyexec@npm:^1.3.1": +"tinyexec@npm:^1.0.4, tinyexec@npm:^1.3.0, tinyexec@npm:^1.3.1": version: 1.3.1 resolution: "tinyexec@npm:1.3.1" checksum: 10c0/c590369cb3fa73cc18a3998caec8a00f9712d91309c881be3ac52b160fb2f80c7b1fbf3591858ab6abab47ad55385b0c86ec19982e32441a01f55298dab9ccd2 languageName: node linkType: hard -"tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.15": - version: 0.2.15 - resolution: "tinyglobby@npm:0.2.15" - dependencies: - fdir: "npm:^6.5.0" - picomatch: "npm:^4.0.3" - checksum: 10c0/869c31490d0d88eedb8305d178d4c75e7463e820df5a9b9d388291daf93e8b1eb5de1dad1c1e139767e4269fe75f3b10d5009b2cc14db96ff98986920a186844 - languageName: node - linkType: hard - -"tinyglobby@npm:^0.2.14, tinyglobby@npm:^0.2.17": +"tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.14, tinyglobby@npm:^0.2.15, tinyglobby@npm:^0.2.17": version: 0.2.17 resolution: "tinyglobby@npm:0.2.17" dependencies: @@ -22963,22 +22441,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.18.0": - version: 8.18.3 - resolution: "ws@npm:8.18.3" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 10c0/eac918213de265ef7cb3d4ca348b891a51a520d839aa51cdb8ca93d4fa7ff9f6ccb339ccee89e4075324097f0a55157c89fa3f7147bde9d8d7e90335dc087b53 - languageName: node - linkType: hard - -"ws@npm:^8.18.2": +"ws@npm:^8.18.0, ws@npm:^8.18.2": version: 8.21.3 resolution: "ws@npm:8.21.3" peerDependencies: From cca5dad5446fe660e2576403297a93e248bc171b Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Fri, 18 Sep 2026 15:38:16 -0400 Subject: [PATCH 12/47] build(storybook): swap Emotion's Babel transform for @swc/plugin-emotion Storybook's Vite preview now uses @vitejs/plugin-react-swc + @swc/plugin-emotion instead of @vitejs/plugin-react + @emotion/babel-plugin, removing Babel from Storybook's build pipeline. Speeds up the dev-loop HMR turnaround (~3-5x faster per-edit in local measurement); cold build-storybook time is roughly a wash. @vitejs/plugin-react-swc, @swc/plugin-emotion, and the @swc/core resolution are pinned to versions from the same release window (June-July 2026) rather than latest - newer combinations crash with an undocumented WASM/ABI mismatch between the plugin and swc_core. Bump these three together. Co-Authored-By: Claude Sonnet 5 --- package.json | 3 + packages/styleguide/.storybook/main.ts | 36 ++++--- yarn.lock | 144 +++++++++++++++---------- 3 files changed, 111 insertions(+), 72 deletions(-) diff --git a/package.json b/package.json index 7d6756448b..9fcb2371ac 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "@svgr/cli": "5.5.0", "@swc-node/register": "^1.11.1", "@swc/core": "^1.15.18", + "@swc/plugin-emotion": "14.15.0", "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "^7.0.1", "@testing-library/react": "^16.0.0", @@ -60,6 +61,7 @@ "@typescript-eslint/eslint-plugin": "^8.57.0", "@typescript-eslint/parser": "^8.57.0", "@vitejs/plugin-react": "^5.0.0", + "@vitejs/plugin-react-swc": "4.3.0", "@vitest/browser": "^3.2.4", "babel-jest": "30.4.1", "babel-plugin-macros": "^3.0.1", @@ -115,6 +117,7 @@ "private": true, "repository": "git@github.com:Codecademy/skillsoft-gamut.git", "resolutions": { + "@swc/core": "1.15.43", "@react-aria/interactions": "3.25.0", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.0", diff --git a/packages/styleguide/.storybook/main.ts b/packages/styleguide/.storybook/main.ts index de463856d4..6f970c5a8e 100644 --- a/packages/styleguide/.storybook/main.ts +++ b/packages/styleguide/.storybook/main.ts @@ -2,7 +2,14 @@ import { createRequire } from 'node:module'; import { dirname, join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; -import react from '@vitejs/plugin-react'; +// `@vitejs/plugin-react-swc`, `@swc/plugin-emotion`, and the `@swc/core` +// resolution below are pinned to versions from the same release window +// (June-July 2026) on purpose, not left behind by accident. Newer +// `@swc/plugin-emotion`/`@swc/core` pairs (as of Sept 2026) crash with an +// opaque WASM panic on real story/mdx files due to an undocumented ABI +// mismatch between the plugin and swc_core - see the "storybook swc emotion +// spike" notes for the repro. Bump these three together, not individually. +import react from '@vitejs/plugin-react-swc'; import type { StorybookConfig } from '@storybook/react-vite'; import type { Alias, AliasOptions } from 'vite'; @@ -52,25 +59,24 @@ const config: StorybookConfig = { viteFinal(config, { configType }) { /* * Storybook's react-vite framework transpiles JSX with esbuild and does not - * add @vitejs/plugin-react. We add it ourselves so Emotion's Babel plugin - * runs, reproducing the webpack setup's `.babelrc.json` transform (autoLabel - * + source maps for stable, readable Emotion class names). + * add a react plugin. We add @vitejs/plugin-react-swc ourselves so + * Emotion's swc plugin runs, reproducing the webpack setup's `.babelrc.json` + * transform (autoLabel + source maps for stable, readable Emotion class + * names). */ config.plugins = [ ...(config.plugins ?? []), react({ - babel: { - plugins: [ - [ - '@emotion/babel-plugin', - { - sourceMap: true, - autoLabel: 'always', - labelFormat: '[local]', - }, - ], + plugins: [ + [ + '@swc/plugin-emotion', + { + sourceMap: true, + autoLabel: 'always', + labelFormat: '[local]', + }, ], - }, + ], }), ]; diff --git a/yarn.lock b/yarn.lock index d6b612c65f..9e7cd77b79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5994,6 +5994,13 @@ __metadata: languageName: node linkType: hard +"@rolldown/pluginutils@npm:1.0.0-rc.7": + version: 1.0.0-rc.7 + resolution: "@rolldown/pluginutils@npm:1.0.0-rc.7" + checksum: 10c0/9d5490b5805b25bcd1720ca01c4c032b55a0ef953dab36a8dd42c568e82214576baa464f3027cd5dff3fabcfbe3bf3db2251d12b60220f5d1cd2ffde5ee37082 + languageName: node + linkType: hard + "@rolldown/pluginutils@npm:^1.0.0": version: 1.0.1 resolution: "@rolldown/pluginutils@npm:1.0.1" @@ -7245,108 +7252,108 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-darwin-arm64@npm:1.15.21" +"@swc/core-darwin-arm64@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-darwin-arm64@npm:1.15.43" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-darwin-x64@npm:1.15.21" +"@swc/core-darwin-x64@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-darwin-x64@npm:1.15.43" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.15.21" +"@swc/core-linux-arm-gnueabihf@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.15.43" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-linux-arm64-gnu@npm:1.15.21" +"@swc/core-linux-arm64-gnu@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-linux-arm64-gnu@npm:1.15.43" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-linux-arm64-musl@npm:1.15.21" +"@swc/core-linux-arm64-musl@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-linux-arm64-musl@npm:1.15.43" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-ppc64-gnu@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-linux-ppc64-gnu@npm:1.15.21" +"@swc/core-linux-ppc64-gnu@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-linux-ppc64-gnu@npm:1.15.43" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-s390x-gnu@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-linux-s390x-gnu@npm:1.15.21" +"@swc/core-linux-s390x-gnu@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-linux-s390x-gnu@npm:1.15.43" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-linux-x64-gnu@npm:1.15.21" +"@swc/core-linux-x64-gnu@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-linux-x64-gnu@npm:1.15.43" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-linux-x64-musl@npm:1.15.21" +"@swc/core-linux-x64-musl@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-linux-x64-musl@npm:1.15.43" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-win32-arm64-msvc@npm:1.15.21" +"@swc/core-win32-arm64-msvc@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-win32-arm64-msvc@npm:1.15.43" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-win32-ia32-msvc@npm:1.15.21" +"@swc/core-win32-ia32-msvc@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-win32-ia32-msvc@npm:1.15.43" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.15.21": - version: 1.15.21 - resolution: "@swc/core-win32-x64-msvc@npm:1.15.21" +"@swc/core-win32-x64-msvc@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core-win32-x64-msvc@npm:1.15.43" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@swc/core@npm:^1.15.18, @swc/core@npm:^1.5.22": - version: 1.15.21 - resolution: "@swc/core@npm:1.15.21" +"@swc/core@npm:1.15.43": + version: 1.15.43 + resolution: "@swc/core@npm:1.15.43" dependencies: - "@swc/core-darwin-arm64": "npm:1.15.21" - "@swc/core-darwin-x64": "npm:1.15.21" - "@swc/core-linux-arm-gnueabihf": "npm:1.15.21" - "@swc/core-linux-arm64-gnu": "npm:1.15.21" - "@swc/core-linux-arm64-musl": "npm:1.15.21" - "@swc/core-linux-ppc64-gnu": "npm:1.15.21" - "@swc/core-linux-s390x-gnu": "npm:1.15.21" - "@swc/core-linux-x64-gnu": "npm:1.15.21" - "@swc/core-linux-x64-musl": "npm:1.15.21" - "@swc/core-win32-arm64-msvc": "npm:1.15.21" - "@swc/core-win32-ia32-msvc": "npm:1.15.21" - "@swc/core-win32-x64-msvc": "npm:1.15.21" + "@swc/core-darwin-arm64": "npm:1.15.43" + "@swc/core-darwin-x64": "npm:1.15.43" + "@swc/core-linux-arm-gnueabihf": "npm:1.15.43" + "@swc/core-linux-arm64-gnu": "npm:1.15.43" + "@swc/core-linux-arm64-musl": "npm:1.15.43" + "@swc/core-linux-ppc64-gnu": "npm:1.15.43" + "@swc/core-linux-s390x-gnu": "npm:1.15.43" + "@swc/core-linux-x64-gnu": "npm:1.15.43" + "@swc/core-linux-x64-musl": "npm:1.15.43" + "@swc/core-win32-arm64-msvc": "npm:1.15.43" + "@swc/core-win32-ia32-msvc": "npm:1.15.43" + "@swc/core-win32-x64-msvc": "npm:1.15.43" "@swc/counter": "npm:^0.1.3" - "@swc/types": "npm:^0.1.25" + "@swc/types": "npm:^0.1.27" peerDependencies: "@swc/helpers": ">=0.5.17" dependenciesMeta: @@ -7377,7 +7384,7 @@ __metadata: peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 10c0/ee33b7f776e632140505f0b5364bb7cb7bd0ddb405dc6795ded3daa8337acd845284520294a3d90cdd817e9cb108c270ab22e7ae969e17f41910f45ec9946cae + checksum: 10c0/ed586746b5a3ce104bf8137a01dace430c9ed7a4f8741cbc1e6b69e6bd15db94d2b90fc35270e95f6eb73c0fd18e0bbd6a6b08987edef27d88da6105998a8c34 languageName: node linkType: hard @@ -7410,12 +7417,21 @@ __metadata: languageName: node linkType: hard -"@swc/types@npm:^0.1.25": - version: 0.1.25 - resolution: "@swc/types@npm:0.1.25" +"@swc/plugin-emotion@npm:14.15.0": + version: 14.15.0 + resolution: "@swc/plugin-emotion@npm:14.15.0" + dependencies: + "@swc/counter": "npm:^0.1.3" + checksum: 10c0/df88c872a2ef6c38548b0ce44493294fd1e677fcb02e59203cb4ea59639a8bd83c1d8c6118717f6510860de89fdf0f06e8104c0063c7965defc6b426dc20aa05 + languageName: node + linkType: hard + +"@swc/types@npm:^0.1.27": + version: 0.1.28 + resolution: "@swc/types@npm:0.1.28" dependencies: "@swc/counter": "npm:^0.1.3" - checksum: 10c0/847a5b20b131281f89d640a7ed4887fb65724807d53d334b230e84b98c21097aa10cd28a074f9ed287a6ce109e443dd4bafbe7dcfb62333d7806c4ea3e7f8aca + checksum: 10c0/7f2e959a7ee000ec4216acc6b7634e2d2fbe404b6ad3adf72bb91970a67359d7d429f60556342784dbe66912c7c987426683159e749332581a87e04de0524357 languageName: node linkType: hard @@ -8317,6 +8333,18 @@ __metadata: languageName: node linkType: hard +"@vitejs/plugin-react-swc@npm:4.3.0": + version: 4.3.0 + resolution: "@vitejs/plugin-react-swc@npm:4.3.0" + dependencies: + "@rolldown/pluginutils": "npm:1.0.0-rc.7" + "@swc/core": "npm:^1.15.11" + peerDependencies: + vite: ^4 || ^5 || ^6 || ^7 || ^8 + checksum: 10c0/36228152f549e0db226ad59a41fcd4fc3df636575637c9190d5927081162f2c0f592756aa11d4fd4a7e34c734b911b319b0e87570f73b1cd67d7a38d8cbff80d + languageName: node + linkType: hard + "@vitejs/plugin-react@npm:^5.0.0": version: 5.2.0 resolution: "@vitejs/plugin-react@npm:5.2.0" @@ -19757,6 +19785,7 @@ __metadata: "@svgr/cli": "npm:5.5.0" "@swc-node/register": "npm:^1.11.1" "@swc/core": "npm:^1.15.18" + "@swc/plugin-emotion": "npm:14.15.0" "@testing-library/dom": "npm:^10.4.1" "@testing-library/jest-dom": "npm:^7.0.1" "@testing-library/react": "npm:^16.0.0" @@ -19775,6 +19804,7 @@ __metadata: "@typescript-eslint/parser": "npm:^8.57.0" "@vidstack/react": "npm:^1.12.12" "@vitejs/plugin-react": "npm:^5.0.0" + "@vitejs/plugin-react-swc": "npm:4.3.0" "@vitest/browser": "npm:^3.2.4" babel-jest: "npm:30.4.1" babel-plugin-macros: "npm:^3.0.1" From 7a9912b13988fb65e60476534d1efc192e17ed62 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Mon, 21 Sep 2026 09:59:39 -0400 Subject: [PATCH 13/47] comment format --- packages/styleguide/.storybook/main.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/styleguide/.storybook/main.ts b/packages/styleguide/.storybook/main.ts index 6f970c5a8e..75a3d8ff4d 100644 --- a/packages/styleguide/.storybook/main.ts +++ b/packages/styleguide/.storybook/main.ts @@ -2,13 +2,16 @@ import { createRequire } from 'node:module'; import { dirname, join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; -// `@vitejs/plugin-react-swc`, `@swc/plugin-emotion`, and the `@swc/core` -// resolution below are pinned to versions from the same release window -// (June-July 2026) on purpose, not left behind by accident. Newer -// `@swc/plugin-emotion`/`@swc/core` pairs (as of Sept 2026) crash with an -// opaque WASM panic on real story/mdx files due to an undocumented ABI -// mismatch between the plugin and swc_core - see the "storybook swc emotion -// spike" notes for the repro. Bump these three together, not individually. +/* +* `@vitejs/plugin-react-swc`, `@swc/plugin-emotion`, and the `@swc/core` +* resolution below are pinned to versions from the same release window +* (June-July 2026) on purpose, not left behind by accident. Newer +* `@swc/plugin-emotion`/`@swc/core` pairs (as of Sept 2026) crash with an +* opaque WASM panic on real story/mdx files due to an undocumented ABI +* mismatch between the plugin and swc_core - see the "storybook swc emotion +* spike" notes for the repro. Bump these three together, not individually. +*/ + import react from '@vitejs/plugin-react-swc'; import type { StorybookConfig } from '@storybook/react-vite'; import type { Alias, AliasOptions } from 'vite'; From a0318bfa220af9abe3b38a54fa77dbda6eb780b1 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Mon, 21 Sep 2026 10:31:14 -0400 Subject: [PATCH 14/47] fix node versions --- .github/workflows/deploy-alpha.yml | 1 - .github/workflows/test.yml | 1 - .nvmrc | 2 +- package.json | 2 +- packages/styleguide/netlify.toml | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-alpha.yml b/.github/workflows/deploy-alpha.yml index fd6a3da4c5..47129d86b0 100644 --- a/.github/workflows/deploy-alpha.yml +++ b/.github/workflows/deploy-alpha.yml @@ -5,7 +5,6 @@ on: types: [opened, synchronize, reopened] env: - NODE_VERSION: '22.13.1' NODE_OPTIONS: '--max_old_space_size=8196' NX_CLOUD: false IGNORE_COMMIT_MESSAGE: 'chore(release): publish' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 051a96a473..ba07b15223 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,6 @@ on: - main env: - NODE_VERSION: '22.13.1' NODE_OPTIONS: '--max_old_space_size=8196' NX_CLOUD: false diff --git a/.nvmrc b/.nvmrc index cc7ce7f49f..32cfab6364 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v22.13.1 +v22.18.0 diff --git a/package.json b/package.json index 7d6756448b..d8d883e798 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "vitest": "^3.2.4" }, "engines": { - "node": "^22.13.1", + "node": "^22.18.0 || ^24.11.0 || >=26.0.0", "yarn": "^4.12.0" }, "license": "MIT", diff --git a/packages/styleguide/netlify.toml b/packages/styleguide/netlify.toml index 0be156ca12..a1c98d3873 100644 --- a/packages/styleguide/netlify.toml +++ b/packages/styleguide/netlify.toml @@ -4,5 +4,5 @@ publish = "dist/storybook/styleguide" [build.environment] - NODE_VERSION = "22.13.1" + NODE_VERSION = "22.18.0" NODE_OPTIONS = "--max_old_space_size=8196" From 402fa61635d6796fe63d04577f6eff510eb3bdc9 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Mon, 21 Sep 2026 13:22:38 -0400 Subject: [PATCH 15/47] start swapping out babel; --- package.json | 3 +- yarn.lock | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 139 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9fcb2371ac..b0db1ee755 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@storybook/test-runner": "^0.24.1", "@svgr/cli": "5.5.0", "@swc-node/register": "^1.11.1", - "@swc/core": "^1.15.18", + "@swc/core": "1.15.43", "@swc/plugin-emotion": "14.15.0", "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "^7.0.1", @@ -117,7 +117,6 @@ "private": true, "repository": "git@github.com:Codecademy/skillsoft-gamut.git", "resolutions": { - "@swc/core": "1.15.43", "@react-aria/interactions": "3.25.0", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.0", diff --git a/yarn.lock b/yarn.lock index 9e7cd77b79..23010d313a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7259,6 +7259,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-darwin-arm64@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-darwin-arm64@npm:1.16.2" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + "@swc/core-darwin-x64@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-darwin-x64@npm:1.15.43" @@ -7266,6 +7273,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-darwin-x64@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-darwin-x64@npm:1.16.2" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + "@swc/core-linux-arm-gnueabihf@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-arm-gnueabihf@npm:1.15.43" @@ -7273,6 +7287,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-linux-arm-gnueabihf@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.16.2" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + "@swc/core-linux-arm64-gnu@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-arm64-gnu@npm:1.15.43" @@ -7280,6 +7301,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-linux-arm64-gnu@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-linux-arm64-gnu@npm:1.16.2" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + "@swc/core-linux-arm64-musl@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-arm64-musl@npm:1.15.43" @@ -7287,6 +7315,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-linux-arm64-musl@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-linux-arm64-musl@npm:1.16.2" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + "@swc/core-linux-ppc64-gnu@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-ppc64-gnu@npm:1.15.43" @@ -7294,6 +7329,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-linux-ppc64-gnu@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-linux-ppc64-gnu@npm:1.16.2" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + "@swc/core-linux-s390x-gnu@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-s390x-gnu@npm:1.15.43" @@ -7301,6 +7343,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-linux-s390x-gnu@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-linux-s390x-gnu@npm:1.16.2" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + "@swc/core-linux-x64-gnu@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-x64-gnu@npm:1.15.43" @@ -7308,6 +7357,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-linux-x64-gnu@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-linux-x64-gnu@npm:1.16.2" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + "@swc/core-linux-x64-musl@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-x64-musl@npm:1.15.43" @@ -7315,6 +7371,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-linux-x64-musl@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-linux-x64-musl@npm:1.16.2" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + "@swc/core-win32-arm64-msvc@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-win32-arm64-msvc@npm:1.15.43" @@ -7322,6 +7385,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-win32-arm64-msvc@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-win32-arm64-msvc@npm:1.16.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + "@swc/core-win32-ia32-msvc@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-win32-ia32-msvc@npm:1.15.43" @@ -7329,6 +7399,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-win32-ia32-msvc@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-win32-ia32-msvc@npm:1.16.2" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + "@swc/core-win32-x64-msvc@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-win32-x64-msvc@npm:1.15.43" @@ -7336,6 +7413,13 @@ __metadata: languageName: node linkType: hard +"@swc/core-win32-x64-msvc@npm:1.16.2": + version: 1.16.2 + resolution: "@swc/core-win32-x64-msvc@npm:1.16.2" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@swc/core@npm:1.15.43": version: 1.15.43 resolution: "@swc/core@npm:1.15.43" @@ -7388,6 +7472,58 @@ __metadata: languageName: node linkType: hard +"@swc/core@npm:^1.15.11, @swc/core@npm:^1.5.22": + version: 1.16.2 + resolution: "@swc/core@npm:1.16.2" + dependencies: + "@swc/core-darwin-arm64": "npm:1.16.2" + "@swc/core-darwin-x64": "npm:1.16.2" + "@swc/core-linux-arm-gnueabihf": "npm:1.16.2" + "@swc/core-linux-arm64-gnu": "npm:1.16.2" + "@swc/core-linux-arm64-musl": "npm:1.16.2" + "@swc/core-linux-ppc64-gnu": "npm:1.16.2" + "@swc/core-linux-s390x-gnu": "npm:1.16.2" + "@swc/core-linux-x64-gnu": "npm:1.16.2" + "@swc/core-linux-x64-musl": "npm:1.16.2" + "@swc/core-win32-arm64-msvc": "npm:1.16.2" + "@swc/core-win32-ia32-msvc": "npm:1.16.2" + "@swc/core-win32-x64-msvc": "npm:1.16.2" + "@swc/counter": "npm:^0.1.3" + "@swc/types": "npm:^0.1.28" + peerDependencies: + "@swc/helpers": ">=0.5.17" + dependenciesMeta: + "@swc/core-darwin-arm64": + optional: true + "@swc/core-darwin-x64": + optional: true + "@swc/core-linux-arm-gnueabihf": + optional: true + "@swc/core-linux-arm64-gnu": + optional: true + "@swc/core-linux-arm64-musl": + optional: true + "@swc/core-linux-ppc64-gnu": + optional: true + "@swc/core-linux-s390x-gnu": + optional: true + "@swc/core-linux-x64-gnu": + optional: true + "@swc/core-linux-x64-musl": + optional: true + "@swc/core-win32-arm64-msvc": + optional: true + "@swc/core-win32-ia32-msvc": + optional: true + "@swc/core-win32-x64-msvc": + optional: true + peerDependenciesMeta: + "@swc/helpers": + optional: true + checksum: 10c0/8019735e27852f03b0e09ae7f8c3f00e6a2e3f49b72127e09c20cffde335fe3b776afb20bfd3b3f5c540d42667f1b7467a4e10aa11c50ff59c6f86a9513544a8 + languageName: node + linkType: hard + "@swc/counter@npm:^0.1.3": version: 0.1.3 resolution: "@swc/counter@npm:0.1.3" @@ -7426,7 +7562,7 @@ __metadata: languageName: node linkType: hard -"@swc/types@npm:^0.1.27": +"@swc/types@npm:^0.1.27, @swc/types@npm:^0.1.28": version: 0.1.28 resolution: "@swc/types@npm:0.1.28" dependencies: @@ -19784,7 +19920,7 @@ __metadata: "@storybook/test-runner": "npm:^0.24.1" "@svgr/cli": "npm:5.5.0" "@swc-node/register": "npm:^1.11.1" - "@swc/core": "npm:^1.15.18" + "@swc/core": "npm:1.15.43" "@swc/plugin-emotion": "npm:14.15.0" "@testing-library/dom": "npm:^10.4.1" "@testing-library/jest-dom": "npm:^7.0.1" From 092bf537dabeeea62814f13b98379f90efa0a4ec Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Mon, 21 Sep 2026 13:52:25 -0400 Subject: [PATCH 16/47] resolution needed --- package.json | 1 + yarn.lock | 138 +-------------------------------------------------- 2 files changed, 2 insertions(+), 137 deletions(-) diff --git a/package.json b/package.json index 47a8a31a86..527d9156a6 100644 --- a/package.json +++ b/package.json @@ -118,6 +118,7 @@ "repository": "git@github.com:Codecademy/skillsoft-gamut.git", "resolutions": { "@react-aria/interactions": "3.25.0", + "@swc/core": "1.15.43", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.0", "@types/react-test-renderer": "^18.2.0", diff --git a/yarn.lock b/yarn.lock index 23010d313a..a19e396ccc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7259,13 +7259,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-darwin-arm64@npm:1.16.2" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@swc/core-darwin-x64@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-darwin-x64@npm:1.15.43" @@ -7273,13 +7266,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-darwin-x64@npm:1.16.2" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@swc/core-linux-arm-gnueabihf@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-arm-gnueabihf@npm:1.15.43" @@ -7287,13 +7273,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.16.2" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - "@swc/core-linux-arm64-gnu@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-arm64-gnu@npm:1.15.43" @@ -7301,13 +7280,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-linux-arm64-gnu@npm:1.16.2" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - "@swc/core-linux-arm64-musl@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-arm64-musl@npm:1.15.43" @@ -7315,13 +7287,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-linux-arm64-musl@npm:1.16.2" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - "@swc/core-linux-ppc64-gnu@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-ppc64-gnu@npm:1.15.43" @@ -7329,13 +7294,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-ppc64-gnu@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-linux-ppc64-gnu@npm:1.16.2" - conditions: os=linux & cpu=ppc64 & libc=glibc - languageName: node - linkType: hard - "@swc/core-linux-s390x-gnu@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-s390x-gnu@npm:1.15.43" @@ -7343,13 +7301,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-s390x-gnu@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-linux-s390x-gnu@npm:1.16.2" - conditions: os=linux & cpu=s390x & libc=glibc - languageName: node - linkType: hard - "@swc/core-linux-x64-gnu@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-x64-gnu@npm:1.15.43" @@ -7357,13 +7308,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-linux-x64-gnu@npm:1.16.2" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - "@swc/core-linux-x64-musl@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-linux-x64-musl@npm:1.15.43" @@ -7371,13 +7315,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-linux-x64-musl@npm:1.16.2" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - "@swc/core-win32-arm64-msvc@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-win32-arm64-msvc@npm:1.15.43" @@ -7385,13 +7322,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-win32-arm64-msvc@npm:1.16.2" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@swc/core-win32-ia32-msvc@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-win32-ia32-msvc@npm:1.15.43" @@ -7399,13 +7329,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-win32-ia32-msvc@npm:1.16.2" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@swc/core-win32-x64-msvc@npm:1.15.43": version: 1.15.43 resolution: "@swc/core-win32-x64-msvc@npm:1.15.43" @@ -7413,13 +7336,6 @@ __metadata: languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.16.2": - version: 1.16.2 - resolution: "@swc/core-win32-x64-msvc@npm:1.16.2" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@swc/core@npm:1.15.43": version: 1.15.43 resolution: "@swc/core@npm:1.15.43" @@ -7472,58 +7388,6 @@ __metadata: languageName: node linkType: hard -"@swc/core@npm:^1.15.11, @swc/core@npm:^1.5.22": - version: 1.16.2 - resolution: "@swc/core@npm:1.16.2" - dependencies: - "@swc/core-darwin-arm64": "npm:1.16.2" - "@swc/core-darwin-x64": "npm:1.16.2" - "@swc/core-linux-arm-gnueabihf": "npm:1.16.2" - "@swc/core-linux-arm64-gnu": "npm:1.16.2" - "@swc/core-linux-arm64-musl": "npm:1.16.2" - "@swc/core-linux-ppc64-gnu": "npm:1.16.2" - "@swc/core-linux-s390x-gnu": "npm:1.16.2" - "@swc/core-linux-x64-gnu": "npm:1.16.2" - "@swc/core-linux-x64-musl": "npm:1.16.2" - "@swc/core-win32-arm64-msvc": "npm:1.16.2" - "@swc/core-win32-ia32-msvc": "npm:1.16.2" - "@swc/core-win32-x64-msvc": "npm:1.16.2" - "@swc/counter": "npm:^0.1.3" - "@swc/types": "npm:^0.1.28" - peerDependencies: - "@swc/helpers": ">=0.5.17" - dependenciesMeta: - "@swc/core-darwin-arm64": - optional: true - "@swc/core-darwin-x64": - optional: true - "@swc/core-linux-arm-gnueabihf": - optional: true - "@swc/core-linux-arm64-gnu": - optional: true - "@swc/core-linux-arm64-musl": - optional: true - "@swc/core-linux-ppc64-gnu": - optional: true - "@swc/core-linux-s390x-gnu": - optional: true - "@swc/core-linux-x64-gnu": - optional: true - "@swc/core-linux-x64-musl": - optional: true - "@swc/core-win32-arm64-msvc": - optional: true - "@swc/core-win32-ia32-msvc": - optional: true - "@swc/core-win32-x64-msvc": - optional: true - peerDependenciesMeta: - "@swc/helpers": - optional: true - checksum: 10c0/8019735e27852f03b0e09ae7f8c3f00e6a2e3f49b72127e09c20cffde335fe3b776afb20bfd3b3f5c540d42667f1b7467a4e10aa11c50ff59c6f86a9513544a8 - languageName: node - linkType: hard - "@swc/counter@npm:^0.1.3": version: 0.1.3 resolution: "@swc/counter@npm:0.1.3" @@ -7562,7 +7426,7 @@ __metadata: languageName: node linkType: hard -"@swc/types@npm:^0.1.27, @swc/types@npm:^0.1.28": +"@swc/types@npm:^0.1.27": version: 0.1.28 resolution: "@swc/types@npm:0.1.28" dependencies: From eb619302ea17205a1a33db3e8206d69fd2e6d533 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Mon, 21 Sep 2026 14:15:34 -0400 Subject: [PATCH 17/47] remove cirucular deps --- .../src/ConnectedForm/ConnectedFormGroup.tsx | 7 ++++++- .../ConnectedInputs/ConnectedCheckbox.tsx | 4 ++-- .../ConnectedInputs/ConnectedInput.tsx | 4 ++-- .../ConnectedNestedCheckboxes/index.tsx | 4 ++-- .../ConnectedNestedCheckboxes/utils.tsx | 3 ++- .../ConnectedInputs/ConnectedRadio.tsx | 4 ++-- .../ConnectedInputs/ConnectedRadioGroup.tsx | 4 ++-- .../ConnectedInputs/ConnectedSelect.tsx | 4 ++-- .../ConnectedInputs/ConnectedTextArea.tsx | 4 ++-- packages/gamut/src/ConnectedForm/types.ts | 4 ++-- packages/gamut/src/ConnectedForm/utils.tsx | 10 ++++++---- packages/styleguide/.storybook/main.ts | 18 ++++++++++++++++++ 12 files changed, 48 insertions(+), 22 deletions(-) diff --git a/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx b/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx index e998090a6d..7bb14bfbd9 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx @@ -4,8 +4,13 @@ import { useEffect, useId } from 'react'; import * as React from 'react'; import { RegisterOptions } from 'react-hook-form'; -import { FormError, FormGroup, FormGroupLabel, FormGroupProps } from '..'; import { Anchor } from '../Anchor'; +import { + FormError, + FormGroup, + FormGroupLabel, + FormGroupProps, +} from '../Form'; import { Markdown } from '../Markdown'; import { InfoTipSubComponentProps } from '../Tip/InfoTip/type-utils'; import { Text } from '../Typography'; diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedCheckbox.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedCheckbox.tsx index a13b0c37e8..79e7282d75 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedCheckbox.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedCheckbox.tsx @@ -2,8 +2,8 @@ import * as React from 'react'; import { useId } from 'react'; import { Controller } from 'react-hook-form'; -import { Checkbox } from '../..'; -import { useField } from '..'; +import { Checkbox } from '../../Form'; +import { useField } from '../utils'; import { ConnectedCheckboxProps } from './types'; export const ConnectedCheckbox: React.FC = ({ diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx index 9ec0c7615a..4976755904 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; -import { Input } from '../..'; -import { useField } from '..'; +import { Input } from '../../Form'; +import { useField } from '../utils'; import { ConnectedInputProps } from './types'; export const ConnectedInput: React.FC = ({ diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/index.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/index.tsx index 964acba677..d67c8c0fb2 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/index.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/index.tsx @@ -2,8 +2,8 @@ import * as React from 'react'; import { useEffect, useMemo, useState } from 'react'; import { Controller } from 'react-hook-form'; -import { Box } from '../../..'; -import { useField } from '../..'; +import { Box } from '../../../Box'; +import { useField } from '../../utils'; import { ConnectedNestedCheckboxesProps } from '../types'; import { calculateStates, diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx index 45d387f160..a9f816194f 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx @@ -1,4 +1,5 @@ -import { Box, Checkbox, CheckboxLabelUnion } from '../../..'; +import { Box } from '../../../Box'; +import { Checkbox, CheckboxLabelUnion } from '../../../Form'; import { NestedGridFormCheckboxOption } from '../../../GridForm/types'; import { MinimalCheckboxProps, NestedConnectedCheckboxOption } from '../types'; diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadio.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadio.tsx index 7cd5f856c3..4e86ab45a5 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadio.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadio.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; -import { Radio } from '../..'; -import { useField } from '..'; +import { Radio } from '../../Form'; +import { useField } from '../utils'; import { ConnectedRadioProps } from './types'; export const ConnectedRadio: React.FC = ({ diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroup.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroup.tsx index cf8965b126..824203c6bf 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroup.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroup.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; -import { RadioGroup } from '../..'; -import { useField } from '..'; +import { RadioGroup } from '../../Form'; +import { useField } from '../utils'; import { ConnectedRadioGroupProps } from './types'; export const ConnectedRadioGroup: React.FC = ({ diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx index d00138eaae..f609593cf0 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; -import { Select } from '../..'; -import { useField } from '..'; +import { Select } from '../../Form'; +import { useField } from '../utils'; import { ConnectedSelectProps } from './types'; export const ConnectedSelect: React.FC = ({ diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedTextArea.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedTextArea.tsx index 8182b7fa5d..fa2e9c32b1 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedTextArea.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedTextArea.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; -import { TextArea } from '../..'; -import { useField } from '..'; +import { TextArea } from '../../Form'; +import { useField } from '../utils'; import { ConnectedTextAreaProps } from './types'; export const ConnectedTextArea: React.FC = ({ diff --git a/packages/gamut/src/ConnectedForm/types.ts b/packages/gamut/src/ConnectedForm/types.ts index 324697f984..07d1c5c3b8 100644 --- a/packages/gamut/src/ConnectedForm/types.ts +++ b/packages/gamut/src/ConnectedForm/types.ts @@ -1,6 +1,6 @@ import { FieldValues, FormState } from 'react-hook-form'; -import { +import type { ConnectedCheckbox, ConnectedInput, ConnectedNestedCheckboxes, @@ -8,7 +8,7 @@ import { ConnectedSelect, ConnectedTextArea, } from './ConnectedInputs'; -import { BaseConnectedFieldProps } from './ConnectedInputs/types'; +import type { BaseConnectedFieldProps } from './ConnectedInputs/types'; export type ConnectedField = | typeof ConnectedCheckbox diff --git a/packages/gamut/src/ConnectedForm/utils.tsx b/packages/gamut/src/ConnectedForm/utils.tsx index 7330477fa9..c0ddf9aadd 100644 --- a/packages/gamut/src/ConnectedForm/utils.tsx +++ b/packages/gamut/src/ConnectedForm/utils.tsx @@ -23,12 +23,14 @@ import { import { FormRequiredText } from '../Form'; import { ConnectedForm, - ConnectedFormGroup, - ConnectedFormGroupProps, ConnectedFormProps, FormPropsContext, -} from '.'; -import { ConnectedField, SubmitContextProps } from './types'; +} from './ConnectedForm'; +import { + ConnectedFormGroup, + ConnectedFormGroupProps, +} from './ConnectedFormGroup'; +import type { ConnectedField, SubmitContextProps } from './types'; interface ConnectedGroupStrictProps { ( diff --git a/packages/styleguide/.storybook/main.ts b/packages/styleguide/.storybook/main.ts index 75a3d8ff4d..6eb259cf28 100644 --- a/packages/styleguide/.storybook/main.ts +++ b/packages/styleguide/.storybook/main.ts @@ -83,6 +83,24 @@ const config: StorybookConfig = { }), ]; + /* + * `@emotion/babel-plugin` skips stamping `target` when the source already + * passes one (see BarChart/BarRow/elements.tsx); `@swc/plugin-emotion` + * stamps it unconditionally, so the transformed output has the key twice + * and esbuild flags it. Duplicate keys written by hand are still caught + * upstream by TypeScript and eslint's `no-dupe-keys`, so the only ones + * reaching esbuild here are the plugin's. + */ + if (config.esbuild !== false) { + config.esbuild = { + ...config.esbuild, + logOverride: { + ...config.esbuild?.logOverride, + 'duplicate-object-key': 'silent', + }, + }; + } + /* * Reproduce the webpack `resolve.alias` map. The `$`-suffixed webpack * aliases matched the bare package specifier only, so we use anchored From e56a6e72c948e38f153617daaed10e20f1350fee Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Tue, 22 Sep 2026 15:47:22 -0400 Subject: [PATCH 18/47] prettier --- packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx b/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx index 7bb14bfbd9..1b791e9400 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx @@ -5,12 +5,7 @@ import * as React from 'react'; import { RegisterOptions } from 'react-hook-form'; import { Anchor } from '../Anchor'; -import { - FormError, - FormGroup, - FormGroupLabel, - FormGroupProps, -} from '../Form'; +import { FormError, FormGroup, FormGroupLabel, FormGroupProps } from '../Form'; import { Markdown } from '../Markdown'; import { InfoTipSubComponentProps } from '../Tip/InfoTip/type-utils'; import { Text } from '../Typography'; From e3c151380d5bab21e50d1065cbe388ee361f9d81 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Wed, 23 Sep 2026 15:08:26 -0400 Subject: [PATCH 19/47] make type exports explicit --- .eslintrc.js | 13 +++++++++++ packages/eslint-plugin-gamut/package.json | 1 - .../src/gamut-import-paths.ts | 2 +- .../src/require-styled-target-for-selector.ts | 3 ++- packages/eslint-plugin-gamut/src/utils.ts | 3 ++- packages/gamut-icons/icon-template.js | 3 ++- packages/gamut-icons/src/props.ts | 3 ++- .../gamut-illustrations/src/AIBuilder.tsx | 4 ++-- .../src/AIBuilderLanding.tsx | 4 ++-- .../gamut-illustrations/src/Achievement.tsx | 4 ++-- .../gamut-illustrations/src/Announcement.tsx | 4 ++-- packages/gamut-illustrations/src/Bee.tsx | 4 ++-- packages/gamut-illustrations/src/Bell.tsx | 4 ++-- .../gamut-illustrations/src/BinaryBlocks.tsx | 4 ++-- .../gamut-illustrations/src/BinaryStairs.tsx | 4 ++-- packages/gamut-illustrations/src/Blocks.tsx | 4 ++-- .../gamut-illustrations/src/Blueprint.tsx | 4 ++-- .../src/BlueprintWhite.tsx | 4 ++-- .../src/BookAndNotepad.tsx | 4 ++-- packages/gamut-illustrations/src/Browser.tsx | 4 ++-- .../gamut-illustrations/src/BrowserLock.tsx | 4 ++-- .../gamut-illustrations/src/BrowserPuzzle.tsx | 4 ++-- packages/gamut-illustrations/src/ChatBox.tsx | 4 ++-- .../src/CodeCelebration.tsx | 4 ++-- packages/gamut-illustrations/src/Coffee.tsx | 4 ++-- packages/gamut-illustrations/src/Confetti.tsx | 4 ++-- .../gamut-illustrations/src/Conversation.tsx | 4 ++-- .../src/CubeIllustration.tsx | 4 ++-- .../gamut-illustrations/src/CustomProject.tsx | 4 ++-- packages/gamut-illustrations/src/EmailAt.tsx | 4 ++-- packages/gamut-illustrations/src/Envelope.tsx | 4 ++-- .../gamut-illustrations/src/ErrorWindow.tsx | 4 ++-- packages/gamut-illustrations/src/Events.tsx | 4 ++-- .../gamut-illustrations/src/ExplodedCube.tsx | 4 ++-- .../src/ExplodedCubeLight.tsx | 4 ++-- packages/gamut-illustrations/src/Heart.tsx | 4 ++-- packages/gamut-illustrations/src/Hills.tsx | 4 ++-- .../gamut-illustrations/src/HomeOffice.tsx | 4 ++-- .../src/InnovationBuildingBlocks.tsx | 4 ++-- packages/gamut-illustrations/src/Interest.tsx | 4 ++-- .../gamut-illustrations/src/Interview.tsx | 4 ++-- packages/gamut-illustrations/src/Keyhole.tsx | 4 ++-- .../gamut-illustrations/src/Knowledge.tsx | 4 ++-- .../src/LightBulbAndGears.tsx | 4 ++-- .../src/MagnifyingGlass.tsx | 4 ++-- packages/gamut-illustrations/src/Maze.tsx | 4 ++-- .../gamut-illustrations/src/Megaphone.tsx | 4 ++-- .../gamut-illustrations/src/MobilePhone.tsx | 4 ++-- .../gamut-illustrations/src/MoneyBack.tsx | 4 ++-- packages/gamut-illustrations/src/New.tsx | 4 ++-- .../gamut-illustrations/src/NumberBlocks.tsx | 4 ++-- .../src/OfficeAnnouncement.tsx | 2 +- .../gamut-illustrations/src/Onboarding.tsx | 4 ++-- packages/gamut-illustrations/src/Plant.tsx | 4 ++-- .../src/PortfolioProject.tsx | 4 ++-- .../src/PracticeProject.tsx | 4 ++-- .../src/PracticeTarget.tsx | 4 ++-- .../src/ProgressCharts.tsx | 4 ++-- .../src/ProgressChartsLight.tsx | 4 ++-- .../gamut-illustrations/src/ProjectReview.tsx | 4 ++-- packages/gamut-illustrations/src/Purpose.tsx | 4 ++-- packages/gamut-illustrations/src/Puzzle.tsx | 4 ++-- packages/gamut-illustrations/src/Python.tsx | 4 ++-- .../gamut-illustrations/src/SevenDayTrial.tsx | 4 ++-- .../gamut-illustrations/src/StackedFruits.tsx | 4 ++-- .../src/StackedFruitsLight.tsx | 4 ++-- .../gamut-illustrations/src/StackedPages.tsx | 4 ++-- .../src/StackedPagesVariant.tsx | 4 ++-- .../src/StairsToWindow.tsx | 4 ++-- .../src/StairsToWindowLight.tsx | 4 ++-- packages/gamut-illustrations/src/Sun.tsx | 4 ++-- packages/gamut-illustrations/src/Syllabus.tsx | 4 ++-- .../src/Tag25PercentOff.tsx | 4 ++-- .../src/Tag30PercentOff.tsx | 4 ++-- .../src/Tag50PercentOff.tsx | 4 ++-- .../src/TagCelebration.tsx | 4 ++-- packages/gamut-illustrations/src/Target.tsx | 4 ++-- .../gamut-illustrations/src/TinyBlocks.tsx | 4 ++-- packages/gamut-illustrations/src/Warning.tsx | 4 ++-- packages/gamut-patterns/pattern-template.js | 3 ++- packages/gamut-patterns/src/props.tsx | 6 +++-- .../gamut-patterns/tests/patterns.test.tsx | 2 +- packages/gamut-styles/src/AssetProvider.tsx | 7 +++--- packages/gamut-styles/src/Background.tsx | 10 +++++---- packages/gamut-styles/src/ColorMode.tsx | 13 ++++++----- packages/gamut-styles/src/GamutProvider.tsx | 7 +++--- .../src/__tests__/Background.test.tsx | 2 +- .../gamut-styles/src/__tests__/testUtils.tsx | 2 +- .../src/cache/createEmotionCache.ts | 3 ++- .../src/cache/stylisPlugins/focusVisible.ts | 2 +- packages/gamut-styles/src/globals/Reboot.tsx | 5 +++-- .../gamut-styles/src/globals/Typography.tsx | 7 +++--- .../gamut-styles/src/globals/Variables.tsx | 4 ++-- .../gamut-styles/src/styles/responsive.ts | 6 +++-- .../src/styles/transitionConcat.ts | 2 +- .../__tests__/useLogicalProperties.test.tsx | 5 +++-- .../gamut-styles/src/utilities/fontUtils.ts | 4 ++-- packages/gamut-styles/src/utilities/themed.ts | 4 ++-- packages/gamut-styles/src/variance/utils.ts | 2 +- packages/gamut-tests/src/index.tsx | 2 +- packages/gamut/src/Alert/Alert.tsx | 7 +++--- packages/gamut/src/Alert/elements.tsx | 5 +++-- packages/gamut/src/Anchor/index.tsx | 13 ++++++----- .../src/Animation/ExpandInCollapseOut.tsx | 2 +- .../gamut/src/Animation/FadeInSlideOut.tsx | 4 ++-- packages/gamut/src/Animation/Rotation.tsx | 4 ++-- packages/gamut/src/Badge/index.tsx | 8 ++++--- .../gamut/src/BarChart/BarChartProvider.tsx | 5 +++-- .../BarChart/BarRow/ValueLabelsContent.tsx | 2 +- packages/gamut/src/BarChart/BarRow/index.tsx | 7 +++--- .../src/BarChart/__tests__/BarChart.test.tsx | 7 +++--- packages/gamut/src/BarChart/index.tsx | 6 ++--- .../gamut/src/BarChart/layout/GridLines.tsx | 5 +++-- .../gamut/src/BarChart/layout/LabelSpacer.tsx | 2 +- .../src/BarChart/layout/ScaleChartHeader.tsx | 5 +++-- packages/gamut/src/BarChart/shared/types.tsx | 16 +++++++------- packages/gamut/src/BarChart/utils/hooks.ts | 12 +++++----- packages/gamut/src/BarChart/utils/index.tsx | 5 +++-- packages/gamut/src/BodyPortal/index.tsx | 2 +- packages/gamut/src/Box/Box.tsx | 3 ++- packages/gamut/src/Box/FlexBox.tsx | 3 ++- packages/gamut/src/Box/GridBox.tsx | 3 ++- packages/gamut/src/Box/props.ts | 5 +++-- packages/gamut/src/Breadcrumbs/index.tsx | 2 +- packages/gamut/src/Button/FillButton.tsx | 5 +++-- packages/gamut/src/Button/IconButton.tsx | 10 +++++---- packages/gamut/src/Button/StrokeButton.tsx | 5 +++-- packages/gamut/src/Button/TextButton.tsx | 5 +++-- packages/gamut/src/Button/__tests__/mocks.tsx | 3 ++- .../src/Button/shared/InlineIconButton.tsx | 8 +++---- packages/gamut/src/Button/shared/styles.ts | 5 +++-- packages/gamut/src/Button/shared/types.ts | 22 +++++++++---------- packages/gamut/src/ButtonBase/ButtonBase.tsx | 3 ++- packages/gamut/src/Card/elements.tsx | 2 +- packages/gamut/src/Card/index.tsx | 7 +++--- packages/gamut/src/Card/styles.tsx | 8 ++++--- packages/gamut/src/Card/types.tsx | 14 ++++++------ packages/gamut/src/Coachmark/index.tsx | 9 ++++---- .../gamut/src/ConnectedForm/ConnectedForm.tsx | 13 ++++++----- .../src/ConnectedForm/ConnectedFormGroup.tsx | 11 +++++----- .../ConnectedInputs/ConnectedCheckbox.tsx | 4 ++-- .../ConnectedInputs/ConnectedInput.tsx | 4 ++-- .../ConnectedNestedCheckboxes.test.tsx | 2 +- .../ConnectedNestedCheckboxes/index.tsx | 4 ++-- .../ConnectedNestedCheckboxes/utils.tsx | 7 +++--- .../ConnectedInputs/ConnectedRadio.tsx | 4 ++-- .../ConnectedInputs/ConnectedRadioGroup.tsx | 4 ++-- .../ConnectedRadioGroupInput.tsx | 4 ++-- .../ConnectedInputs/ConnectedSelect.tsx | 4 ++-- .../ConnectedInputs/ConnectedTextArea.tsx | 4 ++-- .../ConnectedForm/ConnectedInputs/types.tsx | 6 ++--- .../gamut/src/ConnectedForm/SubmitButton.tsx | 9 ++++---- .../ConnectedForm/__fixtures__/helpers.tsx | 2 +- .../__tests__/ConnectedForm.test.tsx | 8 ++++--- .../__tests__/SubmitButton.test.tsx | 3 ++- .../__tests__/useDebouncedField.test.tsx | 4 ++-- packages/gamut/src/ConnectedForm/types.ts | 2 +- packages/gamut/src/ConnectedForm/utils.tsx | 18 +++++++++------ .../src/DataList/Controls/ExpandControl.tsx | 4 ++-- .../src/DataList/Controls/FilterControl.tsx | 4 ++-- .../src/DataList/Controls/SelectControl.tsx | 4 ++-- .../src/DataList/Controls/SortControl.tsx | 4 ++-- packages/gamut/src/DataList/DataGrid.tsx | 12 +++++----- packages/gamut/src/DataList/DataList.tsx | 7 +++--- packages/gamut/src/DataList/DataTable.tsx | 7 +++--- .../DataList/Tables/Rows/TableHeaderRow.tsx | 5 +++-- .../src/DataList/Tables/Rows/TableRow.tsx | 7 +++--- .../src/DataList/__tests__/DataGrid.test.tsx | 8 ++++--- .../src/DataList/hooks/useListControls.tsx | 2 +- .../gamut/src/DataList/hooks/useListState.tsx | 2 +- .../src/DataList/hooks/useLocalQuery.tsx | 2 +- packages/gamut/src/DataList/types.ts | 4 ++-- .../Calendar/CalendarBody.tsx | 4 ++-- .../Calendar/CalendarFooter.tsx | 4 ++-- .../Calendar/CalendarHeader.tsx | 4 ++-- .../Calendar/CalendarNavLastMonth.tsx | 2 +- .../Calendar/CalendarNavNextMonth.tsx | 2 +- .../Calendar/CalendarWrapper.tsx | 4 ++-- .../utils/__tests__/keyHandler.test.tsx | 3 ++- .../Calendar/utils/elements.tsx | 2 +- .../DatePicker/DatePickerCalendar/index.tsx | 2 +- .../DatePickerCalendar/utils/dateSelect.ts | 2 +- .../DatePickerCalendar/utils/quickActions.ts | 4 ++-- .../DatePicker/DatePickerContext/index.tsx | 3 ++- .../src/DatePicker/DatePickerContext/types.ts | 2 +- .../DatePickerInput/Segment/elements.tsx | 2 +- .../DatePickerInput/Segment/index.tsx | 3 ++- .../DatePicker/DatePickerInput/elements.tsx | 2 +- packages/gamut/src/DatePicker/types.ts | 8 +++---- .../DelayedRenderWrapper.tsx | 3 ++- .../src/Disclosure/DisclosureBody/index.tsx | 4 ++-- .../src/Disclosure/DisclosureButton/index.tsx | 4 ++-- packages/gamut/src/Disclosure/elements.tsx | 2 +- packages/gamut/src/Disclosure/index.tsx | 4 ++-- packages/gamut/src/Disclosure/types.ts | 2 +- .../src/Drawer/__tests__/Drawer.test.tsx | 3 ++- packages/gamut/src/Drawer/index.tsx | 3 ++- packages/gamut/src/FeatureShimmer/index.tsx | 3 ++- .../src/Flyout/__tests__/Flyout.test.tsx | 3 ++- packages/gamut/src/Flyout/index.tsx | 7 +++--- .../FocusTrap/__tests__/FocusTrap.test.tsx | 5 +++-- packages/gamut/src/FocusTrap/index.tsx | 6 ++--- .../Form/SelectDropdown/SelectDropdown.tsx | 6 ++--- .../SelectDropdown/__tests__/utils.test.tsx | 4 ++-- .../src/Form/SelectDropdown/core/constants.ts | 2 +- .../src/Form/SelectDropdown/core/styles.ts | 9 ++++---- .../Form/SelectDropdown/core/translations.ts | 4 ++-- .../src/Form/SelectDropdown/core/utils.ts | 8 +++---- .../SelectDropdown/elements/containers.tsx | 12 +++++----- .../Form/SelectDropdown/elements/controls.tsx | 2 +- .../SelectDropdown/elements/multi-value.tsx | 12 +++++----- .../Form/SelectDropdown/elements/options.tsx | 7 +++--- .../useNoOptionsAnnouncement.test.tsx | 2 +- .../hooks/useNoOptionsAnnouncement.ts | 5 +++-- .../SelectDropdown/hooks/useSelectHandlers.ts | 11 +++++----- .../SelectDropdown/hooks/useSelectOptions.ts | 5 +++-- .../SelectDropdown/types/component-props.ts | 12 +++++----- .../src/Form/SelectDropdown/types/internal.ts | 12 +++++----- .../src/Form/SelectDropdown/types/options.ts | 10 ++++----- .../src/Form/SelectDropdown/types/styles.ts | 6 ++--- .../gamut/src/Form/__tests__/testUtils.ts | 2 +- packages/gamut/src/Form/elements/Form.tsx | 5 +++-- .../gamut/src/Form/elements/FormError.tsx | 6 ++--- .../gamut/src/Form/elements/FormGroup.tsx | 11 +++++----- .../src/Form/elements/FormGroupLabel.tsx | 11 +++++----- .../src/Form/elements/FormRequiredText.tsx | 2 +- packages/gamut/src/Form/inputs/Checkbox.tsx | 12 +++++----- packages/gamut/src/Form/inputs/Input.tsx | 20 ++++++++++------- packages/gamut/src/Form/inputs/Radio.tsx | 12 +++++----- packages/gamut/src/Form/inputs/RadioGroup.tsx | 5 +++-- packages/gamut/src/Form/inputs/Select.tsx | 9 ++++---- packages/gamut/src/Form/inputs/TextArea.tsx | 9 ++++---- packages/gamut/src/Form/inputs/types.tsx | 2 +- packages/gamut/src/Form/utils.tsx | 2 +- packages/gamut/src/GridForm/GridForm.tsx | 19 +++++++++------- .../src/GridForm/GridFormButtons/index.tsx | 12 +++++----- .../GridFormCheckboxInput/index.tsx | 4 ++-- .../GridFormCustomInput/index.tsx | 6 ++--- .../GridFormFileInput/index.tsx | 6 ++--- .../GridFormHiddenInput/index.tsx | 6 ++--- .../GridFormNestedCheckboxInput/index.tsx | 6 ++--- .../GridFormRadioGroupInput/index.tsx | 6 ++--- .../GridFormSelectInput/index.tsx | 6 ++--- .../GridFormSweetContainerInput/index.tsx | 6 ++--- .../GridFormTextArea/index.tsx | 6 ++--- .../GridFormTextInput/index.tsx | 6 ++--- .../__fixtures__/assertions.tsx | 4 ++-- .../__fixtures__/renderers.tsx | 5 +++-- .../src/GridForm/GridFormInputGroup/index.tsx | 6 ++--- .../GridFormSections/GridFormContent.tsx | 4 ++-- .../GridFormSections/GridFormSection.tsx | 4 ++-- .../GridFormSections/GridFormSectionBreak.tsx | 5 +++-- .../GridFormSections/GridFormSectionTitle.tsx | 4 ++-- .../__fixtures__/renderers.tsx | 8 ++++--- .../__tests__/GridFormSection.test.tsx | 2 +- .../src/GridForm/__fixtures__/helpers.tsx | 4 ++-- .../src/GridForm/__tests__/GridForm.test.tsx | 8 ++++--- .../gamut/src/GridForm/__tests__/stubs.ts | 2 +- packages/gamut/src/GridForm/types.ts | 20 ++++++++--------- packages/gamut/src/GridForm/utils.ts | 2 +- packages/gamut/src/Layout/Column.tsx | 6 +++-- packages/gamut/src/Layout/LayoutGrid.tsx | 3 ++- .../gamut/src/List/Header/ListHeaderCol.tsx | 5 +++-- packages/gamut/src/List/List.tsx | 10 +++++---- packages/gamut/src/List/ListCol.tsx | 5 +++-- packages/gamut/src/List/ListProvider.tsx | 2 +- packages/gamut/src/List/ListRow.tsx | 9 ++++---- packages/gamut/src/List/TableHeader.tsx | 5 +++-- .../gamut/src/List/__tests__/List.test.tsx | 3 ++- packages/gamut/src/List/elements.tsx | 3 ++- packages/gamut/src/List/types.ts | 2 +- packages/gamut/src/Loading/Shimmer.tsx | 5 +++-- packages/gamut/src/Loading/Spinner.tsx | 2 +- .../src/Markdown/__tests__/Markdown.test.tsx | 2 +- packages/gamut/src/Markdown/index.tsx | 10 +++++---- .../libs/overrides/Checkbox/index.tsx | 5 +++-- .../Markdown/libs/overrides/Details/index.tsx | 7 +++--- .../Markdown/libs/overrides/Iframe/index.tsx | 2 +- .../libs/overrides/MarkdownAnchor/index.tsx | 4 ++-- .../Markdown/libs/overrides/Table/index.tsx | 4 ++-- .../Markdown/libs/overrides/Video/index.tsx | 4 ++-- .../src/Markdown/libs/overrides/index.tsx | 2 +- .../src/Markdown/libs/overrides/utils.tsx | 2 +- .../gamut/src/Markdown/libs/preprocessing.ts | 2 +- packages/gamut/src/Markdown/styles.ts | 3 ++- packages/gamut/src/Menu/Menu.tsx | 3 ++- packages/gamut/src/Menu/MenuContext.tsx | 2 +- packages/gamut/src/Menu/MenuItem.tsx | 16 ++++++++------ packages/gamut/src/Menu/MenuSeparator.tsx | 4 ++-- packages/gamut/src/Menu/elements.tsx | 11 ++++++---- packages/gamut/src/Modals/Dialog.tsx | 10 +++++---- packages/gamut/src/Modals/ImageContainer.tsx | 6 ++--- packages/gamut/src/Modals/Modal.tsx | 10 +++++---- packages/gamut/src/Modals/elements.tsx | 2 +- packages/gamut/src/Modals/types.ts | 10 ++++----- .../src/Overlay/__tests__/Overlay.test.tsx | 3 ++- packages/gamut/src/Overlay/index.tsx | 2 +- .../gamut/src/Pagination/EllipsisButton.tsx | 5 +++-- .../gamut/src/Pagination/PaginationButton.tsx | 9 ++++---- .../Pagination/__tests__/Pagination.test.tsx | 3 ++- packages/gamut/src/Pagination/index.tsx | 2 +- packages/gamut/src/Pagination/utils.tsx | 6 ++--- .../src/PatternBackdrop/PatternBackdrop.tsx | 6 +++-- packages/gamut/src/Popover/Popover.tsx | 2 +- .../src/Popover/__tests__/Popover.test.tsx | 3 ++- packages/gamut/src/Popover/elements.tsx | 9 ++++---- packages/gamut/src/Popover/styles/beak.ts | 2 +- packages/gamut/src/Popover/types.tsx | 7 +++--- packages/gamut/src/Popover/utils.ts | 2 +- .../src/PopoverContainer/PopoverContainer.tsx | 4 ++-- .../__tests__/PopoverContainer.test.tsx | 2 +- packages/gamut/src/PopoverContainer/types.ts | 6 ++--- packages/gamut/src/PopoverContainer/utils.ts | 5 +++-- .../__tests__/ProgressBar.test.tsx | 3 ++- packages/gamut/src/ProgressBar/index.tsx | 2 +- packages/gamut/src/RadialProgress/index.tsx | 4 ++-- packages/gamut/src/SkipToContent/index.tsx | 2 +- packages/gamut/src/Tabs/Tab.tsx | 10 +++++---- packages/gamut/src/Tabs/TabButton.tsx | 5 +++-- packages/gamut/src/Tabs/TabList.tsx | 14 +++++++----- packages/gamut/src/Tabs/TabNav.tsx | 5 +++-- packages/gamut/src/Tabs/TabNavLink.tsx | 2 +- packages/gamut/src/Tabs/TabPanel.tsx | 10 +++++---- packages/gamut/src/Tabs/TabPanels.tsx | 3 ++- packages/gamut/src/Tabs/Tabs.tsx | 14 +++++++----- .../gamut/src/Tabs/__tests__/Tabs.test.tsx | 3 ++- packages/gamut/src/Tabs/props.tsx | 3 ++- packages/gamut/src/Tag/elements.tsx | 7 +++--- packages/gamut/src/Tag/index.tsx | 4 ++-- packages/gamut/src/Tag/types.tsx | 11 +++++----- .../gamut/src/Tip/InfoTip/InfoTipButton.tsx | 10 +++++---- packages/gamut/src/Tip/InfoTip/index.tsx | 5 +++-- packages/gamut/src/Tip/InfoTip/styles.tsx | 4 ++-- .../gamut/src/Tip/PreviewTip/elements.tsx | 2 +- packages/gamut/src/Tip/PreviewTip/index.tsx | 13 ++++++----- packages/gamut/src/Tip/PreviewTip/utils.ts | 2 +- packages/gamut/src/Tip/ToolTip/elements.tsx | 2 +- packages/gamut/src/Tip/ToolTip/index.tsx | 7 +++--- packages/gamut/src/Tip/__tests__/helpers.tsx | 7 +++--- packages/gamut/src/Tip/__tests__/mocks.tsx | 9 +++++--- packages/gamut/src/Tip/shared/FloatingTip.tsx | 4 ++-- packages/gamut/src/Tip/shared/InlineTip.tsx | 2 +- packages/gamut/src/Tip/shared/elements.tsx | 2 +- .../src/Tip/shared/popoverAlignmentUtils.ts | 4 ++-- .../gamut/src/Tip/shared/styles/styles.tsx | 2 +- packages/gamut/src/Tip/shared/types.tsx | 4 ++-- packages/gamut/src/Toast/Toast.tsx | 9 ++++---- packages/gamut/src/Toaster/index.tsx | 9 ++++---- packages/gamut/src/Toggle/elements.tsx | 3 ++- packages/gamut/src/Toggle/index.tsx | 2 +- packages/gamut/src/Toggle/types.tsx | 4 ++-- packages/gamut/src/Toggle/utils.tsx | 2 +- packages/gamut/src/Typography/Text.tsx | 6 +++-- .../gamut/src/Video/__tests__/Video.test.tsx | 2 +- packages/gamut/src/Video/index.tsx | 8 +++---- packages/gamut/src/Video/lib/VideoLayout.tsx | 2 +- .../src/Video/lib/VidstackPlayer/index.tsx | 13 ++++++----- .../src/Video/lib/slotOverrides/index.tsx | 2 +- .../gamut/src/Video/lib/utils/constants.ts | 4 ++-- packages/gamut/src/Video/lib/utils/icons.tsx | 5 +++-- .../gamut/src/helpers/appendIconToContent.tsx | 2 +- .../src/utils/generateResponsiveClassnames.ts | 2 +- packages/gamut/src/utils/types.ts | 2 +- .../ExpandInCollapseOut.stories.tsx | 3 ++- .../Animations/Rotation/Rotation.stories.tsx | 3 ++- .../src/lib/Atoms/Badge/examples.tsx | 3 ++- .../src/lib/Atoms/Drawer/Drawer.stories.tsx | 3 ++- .../FormInputs/Checkbox/Checkbox.stories.tsx | 3 ++- .../Atoms/FormInputs/Radio/Radio.stories.tsx | 4 +++- .../src/lib/Atoms/Icons/Mini/Mini.stories.tsx | 4 ++-- .../Atoms/Icons/Regular/Regular.stories.tsx | 2 +- .../PopoverContainer.stories.tsx | 3 ++- .../DelayedRenderWrapper.stories.tsx | 3 ++- .../FocusTrap/FocusTrap.stories.tsx | 3 ++- .../lib/Foundations/ColorMode/examples.tsx | 8 ++++--- .../lib/Foundations/Utilities/boxShadow.tsx | 2 +- .../src/lib/Foundations/shared/elements.tsx | 6 +++-- .../src/lib/Layouts/LayoutGrid/examples.tsx | 3 ++- .../Molecules/Coachmark/Coachmark.stories.tsx | 3 ++- .../Disclosure/Disclosure.stories.tsx | 6 +++-- .../lib/Molecules/Flyout/Flyout.stories.tsx | 3 ++- .../Modals/Dialog/Dialog.stories.tsx | 3 ++- .../Molecules/Modals/Modal/Modal.stories.tsx | 4 +++- .../Pagination/Pagination.stories.tsx | 5 +++-- .../lib/Molecules/Popover/Popover.stories.tsx | 7 +++--- .../Organisms/BarChart/BarChart.stories.tsx | 7 +++--- .../ConnectedFormGroup.stories.tsx | 3 ++- .../ConnectedFormInputsTable.tsx | 2 +- .../DataTable/DataTable.stories.tsx | 1 + .../lib/Organisms/ListsAndTables/examples.tsx | 6 +++-- .../Organisms/Markdown/Markdown.stories.tsx | 3 ++- .../lib/Typography/Anchor/Anchor.examples.tsx | 3 ++- .../integration/__tests__/component.test.tsx | 4 ++-- .../integration/__tests__/variance.test.ts | 2 +- packages/variance/integration/index.ts | 2 +- packages/variance/src/core.ts | 6 ++--- .../variance/src/createTheme/createTheme.ts | 12 +++++----- packages/variance/src/createTheme/types.ts | 4 ++-- .../src/getPropertyMode/getPropertyMode.ts | 2 +- .../variance/src/scales/createScaleLookup.ts | 4 ++-- packages/variance/src/types/config.ts | 8 +++---- packages/variance/src/types/properties.ts | 2 +- packages/variance/src/types/props.ts | 6 ++--- packages/variance/src/utils/propNames.ts | 4 ++-- packages/variance/src/utils/responsive.ts | 6 ++--- .../variance/src/utils/serializeTokens.ts | 4 ++-- 406 files changed, 1135 insertions(+), 903 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index db3353a851..dcae958e29 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -50,6 +50,19 @@ module.exports = { // being applied to subsequent plugin imports/extensions. Wild. files: ['*.tsx', '*.ts'], rules: { + // Bundlers (esbuild/Vite dev, tsdown/rolldown) elide type-only + // imports based on per-file usage heuristics, not full type info. + // A value-imported type re-exported via `export type {}` can look + // used to the heuristic, get preserved as a runtime import, and + // crash at runtime since the source has no matching runtime export. + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + prefer: 'type-imports', + fixStyle: 'separate-type-imports', + disallowTypeAnnotations: false, + }, + ], '@typescript-eslint/no-empty-object-type': [ 'error', { diff --git a/packages/eslint-plugin-gamut/package.json b/packages/eslint-plugin-gamut/package.json index 38d46280ba..a9fb434e9b 100644 --- a/packages/eslint-plugin-gamut/package.json +++ b/packages/eslint-plugin-gamut/package.json @@ -17,7 +17,6 @@ ], "license": "MIT", "main": "./dist/index.js", - "module": "dist/index.js", "publishConfig": { "access": "public" }, diff --git a/packages/eslint-plugin-gamut/src/gamut-import-paths.ts b/packages/eslint-plugin-gamut/src/gamut-import-paths.ts index ae14db6fb9..fdbc1b7572 100644 --- a/packages/eslint-plugin-gamut/src/gamut-import-paths.ts +++ b/packages/eslint-plugin-gamut/src/gamut-import-paths.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import { createRule } from './createRule'; diff --git a/packages/eslint-plugin-gamut/src/require-styled-target-for-selector.ts b/packages/eslint-plugin-gamut/src/require-styled-target-for-selector.ts index f9bda7e38c..3a0cac9319 100644 --- a/packages/eslint-plugin-gamut/src/require-styled-target-for-selector.ts +++ b/packages/eslint-plugin-gamut/src/require-styled-target-for-selector.ts @@ -1,4 +1,5 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { createRule } from './createRule'; diff --git a/packages/eslint-plugin-gamut/src/utils.ts b/packages/eslint-plugin-gamut/src/utils.ts index 25d81ad4c2..1786db4080 100644 --- a/packages/eslint-plugin-gamut/src/utils.ts +++ b/packages/eslint-plugin-gamut/src/utils.ts @@ -1,4 +1,5 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; export const isNamedVariableTheme = ( arrowExpression: TSESTree.ArrowFunctionExpression diff --git a/packages/gamut-icons/icon-template.js b/packages/gamut-icons/icon-template.js index b6a970f77e..8a16cfa28f 100644 --- a/packages/gamut-icons/icon-template.js +++ b/packages/gamut-icons/icon-template.js @@ -5,7 +5,8 @@ function iconTemplate(api, opts, { jsx }) { return template.ast` import * as React from 'react'; - import { Svg, GamutIconProps } from '../../props'; + import { Svg } from '../../props'; + import type { GamutIconProps } from '../../props'; import { useIconId } from '../../useIconId'; export const ${exportName} = React.forwardRef(({ diff --git a/packages/gamut-icons/src/props.ts b/packages/gamut-icons/src/props.ts index d28e2a7c41..20feb8364f 100644 --- a/packages/gamut-icons/src/props.ts +++ b/packages/gamut-icons/src/props.ts @@ -1,6 +1,7 @@ import styled from '@emotion/styled'; import { styledOptions, system } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; export interface IconStyleProps extends StyleProps { /** diff --git a/packages/gamut-illustrations/src/AIBuilder.tsx b/packages/gamut-illustrations/src/AIBuilder.tsx index 0878d7f0a8..02383b0419 100644 --- a/packages/gamut-illustrations/src/AIBuilder.tsx +++ b/packages/gamut-illustrations/src/AIBuilder.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const AIBuilder: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/AIBuilderLanding.tsx b/packages/gamut-illustrations/src/AIBuilderLanding.tsx index fd57faf2af..7840a60a7b 100644 --- a/packages/gamut-illustrations/src/AIBuilderLanding.tsx +++ b/packages/gamut-illustrations/src/AIBuilderLanding.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const AIBuilderLanding: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Achievement.tsx b/packages/gamut-illustrations/src/Achievement.tsx index 9324c0d5e6..d0e2027e0a 100644 --- a/packages/gamut-illustrations/src/Achievement.tsx +++ b/packages/gamut-illustrations/src/Achievement.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Achievement: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Announcement.tsx b/packages/gamut-illustrations/src/Announcement.tsx index 6884910fb4..c39052a1a2 100644 --- a/packages/gamut-illustrations/src/Announcement.tsx +++ b/packages/gamut-illustrations/src/Announcement.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Announcement: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Bee.tsx b/packages/gamut-illustrations/src/Bee.tsx index ea27cf1c16..2947f26e83 100644 --- a/packages/gamut-illustrations/src/Bee.tsx +++ b/packages/gamut-illustrations/src/Bee.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Bee: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Bell.tsx b/packages/gamut-illustrations/src/Bell.tsx index 242fa42a46..96d915e281 100644 --- a/packages/gamut-illustrations/src/Bell.tsx +++ b/packages/gamut-illustrations/src/Bell.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Bell: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/BinaryBlocks.tsx b/packages/gamut-illustrations/src/BinaryBlocks.tsx index 421018bc60..b3b2e4ea53 100644 --- a/packages/gamut-illustrations/src/BinaryBlocks.tsx +++ b/packages/gamut-illustrations/src/BinaryBlocks.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const BinaryBlocks: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/BinaryStairs.tsx b/packages/gamut-illustrations/src/BinaryStairs.tsx index 596b5e701e..003831d9b7 100644 --- a/packages/gamut-illustrations/src/BinaryStairs.tsx +++ b/packages/gamut-illustrations/src/BinaryStairs.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const BinaryStairs: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Blocks.tsx b/packages/gamut-illustrations/src/Blocks.tsx index 3cc2877bac..1f6cc04fdf 100644 --- a/packages/gamut-illustrations/src/Blocks.tsx +++ b/packages/gamut-illustrations/src/Blocks.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from '.'; +import type { IllustrationProps } from '.'; export const Blocks: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Blueprint.tsx b/packages/gamut-illustrations/src/Blueprint.tsx index 855d96f8b1..4111c94df9 100644 --- a/packages/gamut-illustrations/src/Blueprint.tsx +++ b/packages/gamut-illustrations/src/Blueprint.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Blueprint: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/BlueprintWhite.tsx b/packages/gamut-illustrations/src/BlueprintWhite.tsx index afde25ea25..eaaabd06c5 100644 --- a/packages/gamut-illustrations/src/BlueprintWhite.tsx +++ b/packages/gamut-illustrations/src/BlueprintWhite.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const BlueprintWhite: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/BookAndNotepad.tsx b/packages/gamut-illustrations/src/BookAndNotepad.tsx index c20ff57c21..67518d15e7 100644 --- a/packages/gamut-illustrations/src/BookAndNotepad.tsx +++ b/packages/gamut-illustrations/src/BookAndNotepad.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const BookAndNotepad: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Browser.tsx b/packages/gamut-illustrations/src/Browser.tsx index e92e4ccaed..030541a87d 100644 --- a/packages/gamut-illustrations/src/Browser.tsx +++ b/packages/gamut-illustrations/src/Browser.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Browser: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/BrowserLock.tsx b/packages/gamut-illustrations/src/BrowserLock.tsx index 80c99d35ff..dca570e2d2 100644 --- a/packages/gamut-illustrations/src/BrowserLock.tsx +++ b/packages/gamut-illustrations/src/BrowserLock.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const BrowserLock: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/BrowserPuzzle.tsx b/packages/gamut-illustrations/src/BrowserPuzzle.tsx index 30842d7e73..91a382bfb4 100644 --- a/packages/gamut-illustrations/src/BrowserPuzzle.tsx +++ b/packages/gamut-illustrations/src/BrowserPuzzle.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const BrowserPuzzle: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/ChatBox.tsx b/packages/gamut-illustrations/src/ChatBox.tsx index fac39a2a67..9c23d32a1e 100644 --- a/packages/gamut-illustrations/src/ChatBox.tsx +++ b/packages/gamut-illustrations/src/ChatBox.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const ChatBox: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/CodeCelebration.tsx b/packages/gamut-illustrations/src/CodeCelebration.tsx index 785b2cdc7e..2a3a8458ac 100644 --- a/packages/gamut-illustrations/src/CodeCelebration.tsx +++ b/packages/gamut-illustrations/src/CodeCelebration.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const CodeCelebration: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Coffee.tsx b/packages/gamut-illustrations/src/Coffee.tsx index 9aabd674e8..b66e1f28f0 100644 --- a/packages/gamut-illustrations/src/Coffee.tsx +++ b/packages/gamut-illustrations/src/Coffee.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Coffee: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Confetti.tsx b/packages/gamut-illustrations/src/Confetti.tsx index 0a1ad5fbe5..5db425fca3 100644 --- a/packages/gamut-illustrations/src/Confetti.tsx +++ b/packages/gamut-illustrations/src/Confetti.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Confetti: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Conversation.tsx b/packages/gamut-illustrations/src/Conversation.tsx index cbf0827d8c..c9b0c98635 100644 --- a/packages/gamut-illustrations/src/Conversation.tsx +++ b/packages/gamut-illustrations/src/Conversation.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Conversation: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/CubeIllustration.tsx b/packages/gamut-illustrations/src/CubeIllustration.tsx index 16359f945d..63004b4ecb 100644 --- a/packages/gamut-illustrations/src/CubeIllustration.tsx +++ b/packages/gamut-illustrations/src/CubeIllustration.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const CubeIllustration: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/CustomProject.tsx b/packages/gamut-illustrations/src/CustomProject.tsx index d5835981b2..aba2f96137 100644 --- a/packages/gamut-illustrations/src/CustomProject.tsx +++ b/packages/gamut-illustrations/src/CustomProject.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const CustomProject: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/EmailAt.tsx b/packages/gamut-illustrations/src/EmailAt.tsx index 15ccc2ab4c..e79e216b46 100644 --- a/packages/gamut-illustrations/src/EmailAt.tsx +++ b/packages/gamut-illustrations/src/EmailAt.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const EmailAt: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Envelope.tsx b/packages/gamut-illustrations/src/Envelope.tsx index b1edb00dc0..fd9c1bf192 100644 --- a/packages/gamut-illustrations/src/Envelope.tsx +++ b/packages/gamut-illustrations/src/Envelope.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Envelope: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/ErrorWindow.tsx b/packages/gamut-illustrations/src/ErrorWindow.tsx index e8f3f856f2..67b601df71 100644 --- a/packages/gamut-illustrations/src/ErrorWindow.tsx +++ b/packages/gamut-illustrations/src/ErrorWindow.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const ErrorWindow: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Events.tsx b/packages/gamut-illustrations/src/Events.tsx index ab09ede378..bc861b6090 100644 --- a/packages/gamut-illustrations/src/Events.tsx +++ b/packages/gamut-illustrations/src/Events.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Events: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/ExplodedCube.tsx b/packages/gamut-illustrations/src/ExplodedCube.tsx index 226e92c963..952bfc0157 100644 --- a/packages/gamut-illustrations/src/ExplodedCube.tsx +++ b/packages/gamut-illustrations/src/ExplodedCube.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const ExplodedCube: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/ExplodedCubeLight.tsx b/packages/gamut-illustrations/src/ExplodedCubeLight.tsx index 1829739ca4..1c610eb703 100644 --- a/packages/gamut-illustrations/src/ExplodedCubeLight.tsx +++ b/packages/gamut-illustrations/src/ExplodedCubeLight.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const ExplodedCubeLight: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Heart.tsx b/packages/gamut-illustrations/src/Heart.tsx index 6ac582e90c..a679137f81 100644 --- a/packages/gamut-illustrations/src/Heart.tsx +++ b/packages/gamut-illustrations/src/Heart.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Heart: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Hills.tsx b/packages/gamut-illustrations/src/Hills.tsx index 2a001479b9..ebd6a7d23a 100644 --- a/packages/gamut-illustrations/src/Hills.tsx +++ b/packages/gamut-illustrations/src/Hills.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Hills: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/HomeOffice.tsx b/packages/gamut-illustrations/src/HomeOffice.tsx index e092aeebf8..6a0dcce506 100644 --- a/packages/gamut-illustrations/src/HomeOffice.tsx +++ b/packages/gamut-illustrations/src/HomeOffice.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const HomeOffice: React.FC = ({ className, diff --git a/packages/gamut-illustrations/src/InnovationBuildingBlocks.tsx b/packages/gamut-illustrations/src/InnovationBuildingBlocks.tsx index 5f5bb84146..fd2fd70d1a 100644 --- a/packages/gamut-illustrations/src/InnovationBuildingBlocks.tsx +++ b/packages/gamut-illustrations/src/InnovationBuildingBlocks.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const InnovationBuildingBlocks: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Interest.tsx b/packages/gamut-illustrations/src/Interest.tsx index a4b05bf044..9fe66637c8 100644 --- a/packages/gamut-illustrations/src/Interest.tsx +++ b/packages/gamut-illustrations/src/Interest.tsx @@ -1,6 +1,6 @@ -import React from 'react'; +import type React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Interest: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Interview.tsx b/packages/gamut-illustrations/src/Interview.tsx index 60c5868554..8f7c285d8c 100644 --- a/packages/gamut-illustrations/src/Interview.tsx +++ b/packages/gamut-illustrations/src/Interview.tsx @@ -1,6 +1,6 @@ -import React from 'react'; +import type React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Interview: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Keyhole.tsx b/packages/gamut-illustrations/src/Keyhole.tsx index 09881a424b..c418dea375 100644 --- a/packages/gamut-illustrations/src/Keyhole.tsx +++ b/packages/gamut-illustrations/src/Keyhole.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Keyhole: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Knowledge.tsx b/packages/gamut-illustrations/src/Knowledge.tsx index f4045f641a..839cce8558 100644 --- a/packages/gamut-illustrations/src/Knowledge.tsx +++ b/packages/gamut-illustrations/src/Knowledge.tsx @@ -1,6 +1,6 @@ -import React from 'react'; +import type React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Knowledge: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/LightBulbAndGears.tsx b/packages/gamut-illustrations/src/LightBulbAndGears.tsx index cadae5d52d..f90f0a02df 100644 --- a/packages/gamut-illustrations/src/LightBulbAndGears.tsx +++ b/packages/gamut-illustrations/src/LightBulbAndGears.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const LightBulbAndGears: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/MagnifyingGlass.tsx b/packages/gamut-illustrations/src/MagnifyingGlass.tsx index 7048ceef8e..6700d09612 100644 --- a/packages/gamut-illustrations/src/MagnifyingGlass.tsx +++ b/packages/gamut-illustrations/src/MagnifyingGlass.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const MagnifyingGlass: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Maze.tsx b/packages/gamut-illustrations/src/Maze.tsx index 9a7fe3add7..dd432cd0fe 100644 --- a/packages/gamut-illustrations/src/Maze.tsx +++ b/packages/gamut-illustrations/src/Maze.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Maze: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Megaphone.tsx b/packages/gamut-illustrations/src/Megaphone.tsx index 864b04a0d6..868a69e731 100644 --- a/packages/gamut-illustrations/src/Megaphone.tsx +++ b/packages/gamut-illustrations/src/Megaphone.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Megaphone: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/MobilePhone.tsx b/packages/gamut-illustrations/src/MobilePhone.tsx index 7db7beb5a8..7627eff45a 100644 --- a/packages/gamut-illustrations/src/MobilePhone.tsx +++ b/packages/gamut-illustrations/src/MobilePhone.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const MobilePhone: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/MoneyBack.tsx b/packages/gamut-illustrations/src/MoneyBack.tsx index cfc67109c0..603f486e4b 100644 --- a/packages/gamut-illustrations/src/MoneyBack.tsx +++ b/packages/gamut-illustrations/src/MoneyBack.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const MoneyBack: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/New.tsx b/packages/gamut-illustrations/src/New.tsx index ec7c5d229a..84ca6d612f 100644 --- a/packages/gamut-illustrations/src/New.tsx +++ b/packages/gamut-illustrations/src/New.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const New: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/NumberBlocks.tsx b/packages/gamut-illustrations/src/NumberBlocks.tsx index d4ec991fb7..cb5611ca13 100644 --- a/packages/gamut-illustrations/src/NumberBlocks.tsx +++ b/packages/gamut-illustrations/src/NumberBlocks.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const NumberBlocks: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/OfficeAnnouncement.tsx b/packages/gamut-illustrations/src/OfficeAnnouncement.tsx index ad6948a13f..d4b2144e16 100644 --- a/packages/gamut-illustrations/src/OfficeAnnouncement.tsx +++ b/packages/gamut-illustrations/src/OfficeAnnouncement.tsx @@ -1,4 +1,4 @@ -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const OfficeAnnouncement: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Onboarding.tsx b/packages/gamut-illustrations/src/Onboarding.tsx index 1e79ee75fa..11a17d84cf 100644 --- a/packages/gamut-illustrations/src/Onboarding.tsx +++ b/packages/gamut-illustrations/src/Onboarding.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Onboarding: React.FC = (props) => ( = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/PortfolioProject.tsx b/packages/gamut-illustrations/src/PortfolioProject.tsx index fd0f138587..70419bd3a6 100644 --- a/packages/gamut-illustrations/src/PortfolioProject.tsx +++ b/packages/gamut-illustrations/src/PortfolioProject.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const PortfolioProject: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/PracticeProject.tsx b/packages/gamut-illustrations/src/PracticeProject.tsx index 684cce3fbf..ac928a3efc 100644 --- a/packages/gamut-illustrations/src/PracticeProject.tsx +++ b/packages/gamut-illustrations/src/PracticeProject.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const PracticeProject: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/PracticeTarget.tsx b/packages/gamut-illustrations/src/PracticeTarget.tsx index 646af2be3b..cefe8f67a8 100644 --- a/packages/gamut-illustrations/src/PracticeTarget.tsx +++ b/packages/gamut-illustrations/src/PracticeTarget.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const PracticeTarget: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/ProgressCharts.tsx b/packages/gamut-illustrations/src/ProgressCharts.tsx index bced08c1bb..9aef76977c 100644 --- a/packages/gamut-illustrations/src/ProgressCharts.tsx +++ b/packages/gamut-illustrations/src/ProgressCharts.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const ProgressCharts: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/ProgressChartsLight.tsx b/packages/gamut-illustrations/src/ProgressChartsLight.tsx index 2bd8778cd7..4911f91512 100644 --- a/packages/gamut-illustrations/src/ProgressChartsLight.tsx +++ b/packages/gamut-illustrations/src/ProgressChartsLight.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const ProgressChartsLight: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/ProjectReview.tsx b/packages/gamut-illustrations/src/ProjectReview.tsx index efc099ac91..6adc507a43 100644 --- a/packages/gamut-illustrations/src/ProjectReview.tsx +++ b/packages/gamut-illustrations/src/ProjectReview.tsx @@ -1,6 +1,6 @@ -import React from 'react'; +import type React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const ProjectReview: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Purpose.tsx b/packages/gamut-illustrations/src/Purpose.tsx index 7ee3806438..17efcd3042 100644 --- a/packages/gamut-illustrations/src/Purpose.tsx +++ b/packages/gamut-illustrations/src/Purpose.tsx @@ -1,6 +1,6 @@ -import React from 'react'; +import type React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Purpose: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Puzzle.tsx b/packages/gamut-illustrations/src/Puzzle.tsx index e6843da5bb..8a86342544 100644 --- a/packages/gamut-illustrations/src/Puzzle.tsx +++ b/packages/gamut-illustrations/src/Puzzle.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Puzzle: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Python.tsx b/packages/gamut-illustrations/src/Python.tsx index febc5356a4..96444ec356 100644 --- a/packages/gamut-illustrations/src/Python.tsx +++ b/packages/gamut-illustrations/src/Python.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Python: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/SevenDayTrial.tsx b/packages/gamut-illustrations/src/SevenDayTrial.tsx index 38ba718144..ffb4fb801a 100644 --- a/packages/gamut-illustrations/src/SevenDayTrial.tsx +++ b/packages/gamut-illustrations/src/SevenDayTrial.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const SevenDayTrial: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/StackedFruits.tsx b/packages/gamut-illustrations/src/StackedFruits.tsx index ff7da105b9..391e89b532 100644 --- a/packages/gamut-illustrations/src/StackedFruits.tsx +++ b/packages/gamut-illustrations/src/StackedFruits.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const StackedFruits: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/StackedFruitsLight.tsx b/packages/gamut-illustrations/src/StackedFruitsLight.tsx index 55a7971b9b..39005f01a2 100644 --- a/packages/gamut-illustrations/src/StackedFruitsLight.tsx +++ b/packages/gamut-illustrations/src/StackedFruitsLight.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const StackedFruitsLight: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/StackedPages.tsx b/packages/gamut-illustrations/src/StackedPages.tsx index a5a50ed624..fcf2f55552 100644 --- a/packages/gamut-illustrations/src/StackedPages.tsx +++ b/packages/gamut-illustrations/src/StackedPages.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const StackedPages: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/StackedPagesVariant.tsx b/packages/gamut-illustrations/src/StackedPagesVariant.tsx index 7561b6546d..ac642a4b3b 100644 --- a/packages/gamut-illustrations/src/StackedPagesVariant.tsx +++ b/packages/gamut-illustrations/src/StackedPagesVariant.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const StackedPagesVariant: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/StairsToWindow.tsx b/packages/gamut-illustrations/src/StairsToWindow.tsx index 4e8943f422..a8be4bf89f 100644 --- a/packages/gamut-illustrations/src/StairsToWindow.tsx +++ b/packages/gamut-illustrations/src/StairsToWindow.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const StairsToWindow: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/StairsToWindowLight.tsx b/packages/gamut-illustrations/src/StairsToWindowLight.tsx index 86ff0b4ae8..13d08f99ae 100644 --- a/packages/gamut-illustrations/src/StairsToWindowLight.tsx +++ b/packages/gamut-illustrations/src/StairsToWindowLight.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const StairsToWindowLight: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Sun.tsx b/packages/gamut-illustrations/src/Sun.tsx index 90e1fa4479..de47cc0c52 100644 --- a/packages/gamut-illustrations/src/Sun.tsx +++ b/packages/gamut-illustrations/src/Sun.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Sun: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Syllabus.tsx b/packages/gamut-illustrations/src/Syllabus.tsx index f322a893bd..cf958e6fc3 100644 --- a/packages/gamut-illustrations/src/Syllabus.tsx +++ b/packages/gamut-illustrations/src/Syllabus.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Syllabus: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Tag25PercentOff.tsx b/packages/gamut-illustrations/src/Tag25PercentOff.tsx index 6782d2f821..d0c093190b 100644 --- a/packages/gamut-illustrations/src/Tag25PercentOff.tsx +++ b/packages/gamut-illustrations/src/Tag25PercentOff.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Tag25PercentOff: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Tag30PercentOff.tsx b/packages/gamut-illustrations/src/Tag30PercentOff.tsx index 612bc1588b..780b02d977 100644 --- a/packages/gamut-illustrations/src/Tag30PercentOff.tsx +++ b/packages/gamut-illustrations/src/Tag30PercentOff.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Tag30PercentOff: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Tag50PercentOff.tsx b/packages/gamut-illustrations/src/Tag50PercentOff.tsx index 1c6d32f7a3..0277c1bb66 100644 --- a/packages/gamut-illustrations/src/Tag50PercentOff.tsx +++ b/packages/gamut-illustrations/src/Tag50PercentOff.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Tag50PercentOff: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/TagCelebration.tsx b/packages/gamut-illustrations/src/TagCelebration.tsx index a56d3b3425..6b53b7ddb7 100644 --- a/packages/gamut-illustrations/src/TagCelebration.tsx +++ b/packages/gamut-illustrations/src/TagCelebration.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const TagCelebration: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Target.tsx b/packages/gamut-illustrations/src/Target.tsx index f5e6a7948f..656df84dab 100644 --- a/packages/gamut-illustrations/src/Target.tsx +++ b/packages/gamut-illustrations/src/Target.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Target: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/TinyBlocks.tsx b/packages/gamut-illustrations/src/TinyBlocks.tsx index b41ef0e3da..b22a8ed3ac 100644 --- a/packages/gamut-illustrations/src/TinyBlocks.tsx +++ b/packages/gamut-illustrations/src/TinyBlocks.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const TinyBlocks: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-illustrations/src/Warning.tsx b/packages/gamut-illustrations/src/Warning.tsx index 9ecbc2b882..85c24f4586 100644 --- a/packages/gamut-illustrations/src/Warning.tsx +++ b/packages/gamut-illustrations/src/Warning.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { IllustrationProps } from './types'; +import type { IllustrationProps } from './types'; export const Warning: React.FC = ({ 'aria-hidden': ariaHidden, diff --git a/packages/gamut-patterns/pattern-template.js b/packages/gamut-patterns/pattern-template.js index bd432679f9..fea336da2d 100644 --- a/packages/gamut-patterns/pattern-template.js +++ b/packages/gamut-patterns/pattern-template.js @@ -9,7 +9,8 @@ function patternTemplate(api, opts, { jsx }) { return template.ast` import * as React from 'react'; - import { Svg, PatternProps } from '../props'; + import { Svg } from '../props'; + import type { PatternProps } from '../props'; import { usePatternId } from '../usePatternId'; export const ${exportName} = React.forwardRef(({ diff --git a/packages/gamut-patterns/src/props.tsx b/packages/gamut-patterns/src/props.tsx index 459280e23d..9caed7710e 100644 --- a/packages/gamut-patterns/src/props.tsx +++ b/packages/gamut-patterns/src/props.tsx @@ -1,7 +1,9 @@ import styled from '@emotion/styled'; import { styledOptions, system } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; -import { ComponentProps, forwardRef } from 'react'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; const patternStyles = variance.compose( system.layout, diff --git a/packages/gamut-patterns/tests/patterns.test.tsx b/packages/gamut-patterns/tests/patterns.test.tsx index 3f45a00df5..a15252f2a7 100644 --- a/packages/gamut-patterns/tests/patterns.test.tsx +++ b/packages/gamut-patterns/tests/patterns.test.tsx @@ -1,7 +1,7 @@ import { render } from '@testing-library/react'; import * as patterns from '../src/patterns'; -import { CheckerDense as GenericPatternComponent } from '../src/patterns/CheckerDense'; +import type { CheckerDense as GenericPatternComponent } from '../src/patterns/CheckerDense'; const patternComponents = patterns as Record< string, diff --git a/packages/gamut-styles/src/AssetProvider.tsx b/packages/gamut-styles/src/AssetProvider.tsx index fa409070dc..1378192e03 100644 --- a/packages/gamut-styles/src/AssetProvider.tsx +++ b/packages/gamut-styles/src/AssetProvider.tsx @@ -1,9 +1,10 @@ -import { Theme } from '@emotion/react'; -import * as React from 'react'; +import type { Theme } from '@emotion/react'; +import type * as React from 'react'; import { webFonts } from './remoteAssets/fonts'; import { coreTheme } from './themes'; -import { FontConfig, getFonts } from './utilities/fontUtils'; +import type { FontConfig} from './utilities/fontUtils'; +import { getFonts } from './utilities/fontUtils'; /* * Only preload woff2 fonts, since woff1 are only included as fallbacks. diff --git a/packages/gamut-styles/src/Background.tsx b/packages/gamut-styles/src/Background.tsx index c9a0b4c9f4..aa49db1e60 100644 --- a/packages/gamut-styles/src/Background.tsx +++ b/packages/gamut-styles/src/Background.tsx @@ -1,12 +1,14 @@ import { getContrast } from 'polished'; -import { ComponentProps, forwardRef, useCallback, useMemo } from 'react'; +import type { ComponentProps} from 'react'; +import { forwardRef, useCallback, useMemo } from 'react'; -import { +import type { ColorAlias, - ColorMode, ColorModes, ColorModeShape, - Colors, + Colors} from './ColorMode'; +import { + ColorMode, useColorModes, } from './ColorMode'; diff --git a/packages/gamut-styles/src/ColorMode.tsx b/packages/gamut-styles/src/ColorMode.tsx index f9ea6f8db9..74eab91ed9 100644 --- a/packages/gamut-styles/src/ColorMode.tsx +++ b/packages/gamut-styles/src/ColorMode.tsx @@ -1,15 +1,18 @@ -import { CSSObject, Theme, ThemeProvider, useTheme } from '@emotion/react'; +import type { CSSObject, Theme} from '@emotion/react'; +import { ThemeProvider, useTheme } from '@emotion/react'; import styled from '@emotion/styled'; +import type { + StyleProps, + ThemeProps} from '@skillsoft/variance'; import { serializeTokens, - StyleProps, - ThemeProps, variance, } from '@skillsoft/variance'; import mapValues from 'lodash/mapValues'; import pick from 'lodash/pick'; +import type { + ComponentProps} from 'react'; import { - ComponentProps, createContext, forwardRef, useContext, @@ -18,7 +21,7 @@ import { useState, } from 'react'; -import { theme as GamutTheme } from '.'; +import type { theme as GamutTheme } from '.'; import { background, border, diff --git a/packages/gamut-styles/src/GamutProvider.tsx b/packages/gamut-styles/src/GamutProvider.tsx index 28d6c71741..1b21d37350 100644 --- a/packages/gamut-styles/src/GamutProvider.tsx +++ b/packages/gamut-styles/src/GamutProvider.tsx @@ -1,10 +1,11 @@ +import type { + EmotionCache, + Theme} from '@emotion/react'; import { CacheProvider, - EmotionCache, - Theme, ThemeProvider, } from '@emotion/react'; -import { CSSObject } from '@skillsoft/variance'; +import type { CSSObject } from '@skillsoft/variance'; import { MotionConfig } from 'framer-motion'; import { setNonce } from 'get-nonce'; import { useContext, useEffect, useMemo, useRef } from 'react'; diff --git a/packages/gamut-styles/src/__tests__/Background.test.tsx b/packages/gamut-styles/src/__tests__/Background.test.tsx index fd86e7e6aa..69a84b9f2e 100644 --- a/packages/gamut-styles/src/__tests__/Background.test.tsx +++ b/packages/gamut-styles/src/__tests__/Background.test.tsx @@ -2,7 +2,7 @@ import { matchers } from '@emotion/jest'; import { ThemeProvider, useTheme } from '@emotion/react'; import { setupRtl as setupRtlBase } from 'component-test-setup'; import overArgs from 'lodash/overArgs'; -import * as React from 'react'; +import type * as React from 'react'; import { Background } from '../Background'; import { coreTheme as theme } from '../themes'; diff --git a/packages/gamut-styles/src/__tests__/testUtils.tsx b/packages/gamut-styles/src/__tests__/testUtils.tsx index 0a2b521d06..318e136f44 100644 --- a/packages/gamut-styles/src/__tests__/testUtils.tsx +++ b/packages/gamut-styles/src/__tests__/testUtils.tsx @@ -1,6 +1,6 @@ import { setupRtl as setupRtlBase } from 'component-test-setup'; import overArgs from 'lodash/overArgs'; -import * as React from 'react'; +import type * as React from 'react'; import { GamutProvider } from '../GamutProvider'; import { coreTheme as theme } from '../themes'; diff --git a/packages/gamut-styles/src/cache/createEmotionCache.ts b/packages/gamut-styles/src/cache/createEmotionCache.ts index 234dc8a0b4..806285015d 100644 --- a/packages/gamut-styles/src/cache/createEmotionCache.ts +++ b/packages/gamut-styles/src/cache/createEmotionCache.ts @@ -1,4 +1,5 @@ -import createCache, { Options, StylisPlugin } from '@emotion/cache'; +import type { Options, StylisPlugin } from '@emotion/cache'; +import createCache from '@emotion/cache'; import { prefixer } from 'stylis'; import { focusVisible } from './stylisPlugins'; diff --git a/packages/gamut-styles/src/cache/stylisPlugins/focusVisible.ts b/packages/gamut-styles/src/cache/stylisPlugins/focusVisible.ts index 2cd50d8a99..2d6f278fb8 100644 --- a/packages/gamut-styles/src/cache/stylisPlugins/focusVisible.ts +++ b/packages/gamut-styles/src/cache/stylisPlugins/focusVisible.ts @@ -1,4 +1,4 @@ -import { StylisPlugin } from '@emotion/cache'; +import type { StylisPlugin } from '@emotion/cache'; export const focusVisible: StylisPlugin = (element) => { if (element.type === 'rule' && element.value.includes(':focus-visible')) { diff --git a/packages/gamut-styles/src/globals/Reboot.tsx b/packages/gamut-styles/src/globals/Reboot.tsx index b149315868..511d19d8c7 100644 --- a/packages/gamut-styles/src/globals/Reboot.tsx +++ b/packages/gamut-styles/src/globals/Reboot.tsx @@ -1,5 +1,6 @@ -import { css, Global, Theme } from '@emotion/react'; -import * as React from 'react'; +import type { Theme } from '@emotion/react'; +import { css, Global } from '@emotion/react'; +import type * as React from 'react'; export const Reboot: React.FC<{ theme: Theme }> = ({ theme }) => { const { useLogicalProperties } = theme; diff --git a/packages/gamut-styles/src/globals/Typography.tsx b/packages/gamut-styles/src/globals/Typography.tsx index eb4cb09b8a..5d5328e73b 100644 --- a/packages/gamut-styles/src/globals/Typography.tsx +++ b/packages/gamut-styles/src/globals/Typography.tsx @@ -1,8 +1,9 @@ import { css, Global } from '@emotion/react'; -import * as React from 'react'; +import type * as React from 'react'; -import { coreTheme } from '../themes'; -import { FontConfig, getFonts } from '../utilities/fontUtils'; +import type { coreTheme } from '../themes'; +import type { FontConfig} from '../utilities/fontUtils'; +import { getFonts } from '../utilities/fontUtils'; /** * Typography component that applies global typography styles to the application. diff --git a/packages/gamut-styles/src/globals/Variables.tsx b/packages/gamut-styles/src/globals/Variables.tsx index a1308ca7be..a44616c0db 100644 --- a/packages/gamut-styles/src/globals/Variables.tsx +++ b/packages/gamut-styles/src/globals/Variables.tsx @@ -1,6 +1,6 @@ import { css, Global } from '@emotion/react'; -import { CSSObject } from '@skillsoft/variance'; -import * as React from 'react'; +import type { CSSObject } from '@skillsoft/variance'; +import type * as React from 'react'; const scopeVariables = (vars: CSSObject, scope = ':root') => css({ [scope]: vars }); diff --git a/packages/gamut-styles/src/styles/responsive.ts b/packages/gamut-styles/src/styles/responsive.ts index ab1ffd6894..2f4d481dbb 100644 --- a/packages/gamut-styles/src/styles/responsive.ts +++ b/packages/gamut-styles/src/styles/responsive.ts @@ -1,6 +1,8 @@ -import { css, SerializedStyles } from '@emotion/react'; +import type { SerializedStyles } from '@emotion/react'; +import { css } from '@emotion/react'; -import { mediaQueries, MediaSize } from '../variables/responsive'; +import type { MediaSize } from '../variables/responsive'; +import { mediaQueries } from '../variables/responsive'; export const atViewport = ( size: MediaSize, diff --git a/packages/gamut-styles/src/styles/transitionConcat.ts b/packages/gamut-styles/src/styles/transitionConcat.ts index b95f12d305..a6cfea7674 100644 --- a/packages/gamut-styles/src/styles/transitionConcat.ts +++ b/packages/gamut-styles/src/styles/transitionConcat.ts @@ -1,4 +1,4 @@ -import { Property, StandardPropertiesHyphen } from 'csstype'; +import type { Property, StandardPropertiesHyphen } from 'csstype'; import { timing } from '../variables'; diff --git a/packages/gamut-styles/src/utilities/__tests__/useLogicalProperties.test.tsx b/packages/gamut-styles/src/utilities/__tests__/useLogicalProperties.test.tsx index 7b00e42d5e..db5193c601 100644 --- a/packages/gamut-styles/src/utilities/__tests__/useLogicalProperties.test.tsx +++ b/packages/gamut-styles/src/utilities/__tests__/useLogicalProperties.test.tsx @@ -1,5 +1,6 @@ -import { Theme, ThemeProvider } from '@emotion/react'; -import * as React from 'react'; +import type { Theme} from '@emotion/react'; +import { ThemeProvider } from '@emotion/react'; +import type * as React from 'react'; import { setupRtl } from '../../__tests__/testUtils'; import { coreTheme as theme } from '../../themes'; diff --git a/packages/gamut-styles/src/utilities/fontUtils.ts b/packages/gamut-styles/src/utilities/fontUtils.ts index 11d3fe9a56..3dcb15171b 100644 --- a/packages/gamut-styles/src/utilities/fontUtils.ts +++ b/packages/gamut-styles/src/utilities/fontUtils.ts @@ -1,5 +1,5 @@ -import { Theme } from '@emotion/react'; -import * as React from 'react'; +import type { Theme } from '@emotion/react'; +import type * as React from 'react'; import { webFonts } from '../remoteAssets/fonts'; diff --git a/packages/gamut-styles/src/utilities/themed.ts b/packages/gamut-styles/src/utilities/themed.ts index ded2152593..48601cc4f4 100644 --- a/packages/gamut-styles/src/utilities/themed.ts +++ b/packages/gamut-styles/src/utilities/themed.ts @@ -1,5 +1,5 @@ -import { Theme } from '@emotion/react'; -import { Path, PathValue } from '@skillsoft/variance'; +import type { Theme } from '@emotion/react'; +import type { Path, PathValue } from '@skillsoft/variance'; import get from 'lodash/get'; /** diff --git a/packages/gamut-styles/src/variance/utils.ts b/packages/gamut-styles/src/variance/utils.ts index f29b7bef66..c6cf8a1033 100644 --- a/packages/gamut-styles/src/variance/utils.ts +++ b/packages/gamut-styles/src/variance/utils.ts @@ -1,5 +1,5 @@ import isPropValid from '@emotion/is-prop-valid'; -import { ThemeProps } from '@skillsoft/variance'; +import type { ThemeProps } from '@skillsoft/variance'; import type React from 'react'; import { all as allProps } from './config'; diff --git a/packages/gamut-tests/src/index.tsx b/packages/gamut-tests/src/index.tsx index 7fcf520fc4..bc5de7283f 100644 --- a/packages/gamut-tests/src/index.tsx +++ b/packages/gamut-tests/src/index.tsx @@ -1,7 +1,7 @@ import { GamutProvider, theme } from '@skillsoft/gamut-styles'; import { setupRtl as setupRtlBase } from 'component-test-setup'; import overArgs from 'lodash/overArgs'; -import * as React from 'react'; +import type * as React from 'react'; // See https://skillsoftdev.atlassian.net/wiki/spaces/779a16d9c7ea452eab11b39cbbe771ce/pages/4441315387/Frontend+Unit+Tests for more info diff --git a/packages/gamut/src/Alert/Alert.tsx b/packages/gamut/src/Alert/Alert.tsx index b6c8497255..0cb86923cd 100644 --- a/packages/gamut/src/Alert/Alert.tsx +++ b/packages/gamut/src/Alert/Alert.tsx @@ -6,10 +6,11 @@ import { useMeasure } from 'react-use'; import { Rotation } from '../Animation'; import { Box } from '../Box'; -import { FillButton, IconButton, TextButton } from '../Button'; -import { CloseButtonProps } from '../Modals/types'; +import type { FillButton} from '../Button'; +import { IconButton, TextButton } from '../Button'; +import type { CloseButtonProps } from '../Modals/types'; import { ToolTip } from '../Tip/ToolTip'; -import { WithChildrenProp } from '../utils'; +import type { WithChildrenProp } from '../utils'; import { AlertBanner, AlertBox, diff --git a/packages/gamut/src/Alert/elements.tsx b/packages/gamut/src/Alert/elements.tsx index 570a30b9e1..f2fe963455 100644 --- a/packages/gamut/src/Alert/elements.tsx +++ b/packages/gamut/src/Alert/elements.tsx @@ -1,11 +1,12 @@ import styled from '@emotion/styled'; import { Background, css } from '@skillsoft/gamut-styles'; import { motion } from 'framer-motion'; -import { ComponentProps, forwardRef } from 'react'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; import { Box } from '../Box'; import { FillButton } from '../Button'; -import { AlertProps } from './Alert'; +import type { AlertProps } from './Alert'; import { placementVariants } from './variants'; const StyledAlertBanner = diff --git a/packages/gamut/src/Anchor/index.tsx b/packages/gamut/src/Anchor/index.tsx index 44c61cf84a..c5e1ba22ed 100644 --- a/packages/gamut/src/Anchor/index.tsx +++ b/packages/gamut/src/Anchor/index.tsx @@ -1,12 +1,14 @@ import styled from '@emotion/styled'; import { styledOptions, system, variant } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; -import { +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; +import type { ComponentProps, ComponentType, - forwardRef, HTMLProps, - Ref, + Ref} from 'react'; +import { + forwardRef } from 'react'; import { @@ -14,7 +16,8 @@ import { InteractiveSelectors, narrowButtonBaseRef, } from '../ButtonBase/ButtonBase'; -import { AppendedIconProps, appendIconToContent } from '../helpers'; +import type { AppendedIconProps} from '../helpers'; +import { appendIconToContent } from '../helpers'; export interface AnchorProps extends StyleProps, diff --git a/packages/gamut/src/Animation/ExpandInCollapseOut.tsx b/packages/gamut/src/Animation/ExpandInCollapseOut.tsx index 7d86666b85..c0c49a741d 100644 --- a/packages/gamut/src/Animation/ExpandInCollapseOut.tsx +++ b/packages/gamut/src/Animation/ExpandInCollapseOut.tsx @@ -1,7 +1,7 @@ import { timingValues } from '@skillsoft/gamut-styles'; import { motion } from 'framer-motion'; -import { WithChildrenProp } from '../utils'; +import type { WithChildrenProp } from '../utils'; export const ExpandInCollapseOut: React.FC = ({ children, diff --git a/packages/gamut/src/Animation/FadeInSlideOut.tsx b/packages/gamut/src/Animation/FadeInSlideOut.tsx index 4c8bb7ab4b..36a5098d2c 100644 --- a/packages/gamut/src/Animation/FadeInSlideOut.tsx +++ b/packages/gamut/src/Animation/FadeInSlideOut.tsx @@ -1,9 +1,9 @@ import { timingValues } from '@skillsoft/gamut-styles'; import { motion } from 'framer-motion'; -import * as React from 'react'; +import type * as React from 'react'; import { Box } from '../Box'; -import { WithChildrenProp } from '../utils'; +import type { WithChildrenProp } from '../utils'; const exitDuration = timingValues.fast / 1000; diff --git a/packages/gamut/src/Animation/Rotation.tsx b/packages/gamut/src/Animation/Rotation.tsx index 0bef1f06dd..8681cc13a2 100644 --- a/packages/gamut/src/Animation/Rotation.tsx +++ b/packages/gamut/src/Animation/Rotation.tsx @@ -1,8 +1,8 @@ import { timingValues } from '@skillsoft/gamut-styles'; import { motion } from 'framer-motion'; -import * as React from 'react'; +import type * as React from 'react'; -import { WithChildrenProp } from '../utils'; +import type { WithChildrenProp } from '../utils'; export interface RotationProps extends WithChildrenProp { /** diff --git a/packages/gamut/src/Badge/index.tsx b/packages/gamut/src/Badge/index.tsx index 17f602f57c..9afbace810 100644 --- a/packages/gamut/src/Badge/index.tsx +++ b/packages/gamut/src/Badge/index.tsx @@ -1,14 +1,16 @@ import styled from '@emotion/styled'; +import type { + Colors} from '@skillsoft/gamut-styles'; import { - Colors, styledOptions, system, variant, } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; import { appendIconToContent } from '../helpers'; -import { IconComponentType, WithChildrenProp } from '../utils'; +import type { IconComponentType, WithChildrenProp } from '../utils'; import { determineIconSize, determineIconSpacing } from './helpers'; const colorVariants = variant({ diff --git a/packages/gamut/src/BarChart/BarChartProvider.tsx b/packages/gamut/src/BarChart/BarChartProvider.tsx index d557a94149..99bae2a865 100644 --- a/packages/gamut/src/BarChart/BarChartProvider.tsx +++ b/packages/gamut/src/BarChart/BarChartProvider.tsx @@ -1,10 +1,11 @@ import { createContext } from 'react'; +import type { + BarChartTranslations} from './shared/translations'; import { - BarChartTranslations, defaultBarChartTranslations, } from './shared/translations'; -import { BarChartStyles, MaxScaleValue } from './shared/types'; +import type { BarChartStyles, MaxScaleValue } from './shared/types'; export interface BarChartContextProps { maxScaleValue: MaxScaleValue; diff --git a/packages/gamut/src/BarChart/BarRow/ValueLabelsContent.tsx b/packages/gamut/src/BarChart/BarRow/ValueLabelsContent.tsx index 8d14d6c357..7dcc081a21 100644 --- a/packages/gamut/src/BarChart/BarRow/ValueLabelsContent.tsx +++ b/packages/gamut/src/BarChart/BarRow/ValueLabelsContent.tsx @@ -2,7 +2,7 @@ import { MiniArrowRightIcon } from '@skillsoft/gamut-icons'; import { Text } from '../../Typography'; import { iconPadding } from '../shared/styles'; -import { BarChartStyles } from '../shared/types'; +import type { BarChartStyles } from '../shared/types'; export type ValueLabelsContentProps = { seriesOneFormatted: string; diff --git a/packages/gamut/src/BarChart/BarRow/index.tsx b/packages/gamut/src/BarChart/BarRow/index.tsx index c7a41c0841..081a31eef7 100644 --- a/packages/gamut/src/BarChart/BarRow/index.tsx +++ b/packages/gamut/src/BarChart/BarRow/index.tsx @@ -1,7 +1,8 @@ +import type { + MouseEventHandler, + MutableRefObject} from 'react'; import { forwardRef, - MouseEventHandler, - MutableRefObject, useMemo, useRef, } from 'react'; @@ -9,7 +10,7 @@ import { import { Box, FlexBox } from '../../Box'; import { Text } from '../../Typography'; import { iconPadding, iconWidth, minBarWidth } from '../shared/styles'; -import { BarProps } from '../shared/types'; +import type { BarProps } from '../shared/types'; import { calculateBarWidth, formatValueWithUnit, diff --git a/packages/gamut/src/BarChart/__tests__/BarChart.test.tsx b/packages/gamut/src/BarChart/__tests__/BarChart.test.tsx index d14d16b381..c792d0f30c 100644 --- a/packages/gamut/src/BarChart/__tests__/BarChart.test.tsx +++ b/packages/gamut/src/BarChart/__tests__/BarChart.test.tsx @@ -1,11 +1,12 @@ import { TerminalIcon } from '@skillsoft/gamut-icons'; import { setupRtl } from '@skillsoft/gamut-tests'; import userEvent from '@testing-library/user-event'; -import { act, HTMLProps } from 'react'; +import type { HTMLProps } from 'react'; +import { act } from 'react'; -import { ButtonProps } from '../../Button'; +import type { ButtonProps } from '../../Button'; import { BarChart } from '..'; -import { BarProps } from '../shared/types'; +import type { BarProps } from '../shared/types'; const defaultBarValues = [ { categoryLabel: 'Python', seriesOneValue: 100 }, diff --git a/packages/gamut/src/BarChart/index.tsx b/packages/gamut/src/BarChart/index.tsx index c8dbbf18a6..9175420228 100644 --- a/packages/gamut/src/BarChart/index.tsx +++ b/packages/gamut/src/BarChart/index.tsx @@ -7,14 +7,14 @@ import { BarRow } from './BarRow'; import { GridLines } from './layout/GridLines'; import { ScaleChartHeader } from './layout/ScaleChartHeader'; import { BarsList } from './shared/elements'; -import { +import type { BarChartSingleValueBarSummaryContext, BarChartStackedSummaryContext, BarChartTranslations, - defaultBarChartTranslations, PartialBarChartTranslations, } from './shared/translations'; -import { BarChartProps, BarProps, InferBarType } from './shared/types'; +import { defaultBarChartTranslations } from './shared/translations'; +import type { BarChartProps, BarProps, InferBarType } from './shared/types'; import { StyledFormGroupLabel, WidthSelect } from './SortSelect'; import { getBarRowKey } from './utils'; import { useBarChart, useBarChartSort } from './utils/hooks'; diff --git a/packages/gamut/src/BarChart/layout/GridLines.tsx b/packages/gamut/src/BarChart/layout/GridLines.tsx index b10e3c1470..030fe50aa7 100644 --- a/packages/gamut/src/BarChart/layout/GridLines.tsx +++ b/packages/gamut/src/BarChart/layout/GridLines.tsx @@ -1,9 +1,10 @@ import styled from '@emotion/styled'; import { css } from '@skillsoft/gamut-styles'; -import React, { useMemo } from 'react'; +import type React from 'react'; +import { useMemo } from 'react'; import { Box } from '../../Box'; -import { ScaleAxisLayoutProps } from '../shared/types'; +import type { ScaleAxisLayoutProps } from '../shared/types'; import { useLabelPositions } from '../utils/hooks'; import { LabelSpacer } from './LabelSpacer'; diff --git a/packages/gamut/src/BarChart/layout/LabelSpacer.tsx b/packages/gamut/src/BarChart/layout/LabelSpacer.tsx index edaaedb199..24be3404c0 100644 --- a/packages/gamut/src/BarChart/layout/LabelSpacer.tsx +++ b/packages/gamut/src/BarChart/layout/LabelSpacer.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { css } from '@skillsoft/gamut-styles'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import { Box } from '../../Box'; import { barListItemPadding } from '../shared/styles'; diff --git a/packages/gamut/src/BarChart/layout/ScaleChartHeader.tsx b/packages/gamut/src/BarChart/layout/ScaleChartHeader.tsx index d76870d7da..15129175ad 100644 --- a/packages/gamut/src/BarChart/layout/ScaleChartHeader.tsx +++ b/packages/gamut/src/BarChart/layout/ScaleChartHeader.tsx @@ -1,10 +1,11 @@ import styled from '@emotion/styled'; import { css } from '@skillsoft/gamut-styles'; -import React, { useMemo } from 'react'; +import type React from 'react'; +import { useMemo } from 'react'; import { Box, FlexBox } from '../../Box'; import { Text } from '../../Typography'; -import { ScaleAxisLayoutProps } from '../shared/types'; +import type { ScaleAxisLayoutProps } from '../shared/types'; import { formatNumberUnitCompact } from '../utils'; import { useBarChartContext, useLabelPositions } from '../utils/hooks'; import { LabelSpacer } from './LabelSpacer'; diff --git a/packages/gamut/src/BarChart/shared/types.tsx b/packages/gamut/src/BarChart/shared/types.tsx index c98c17a65e..e7e0dd7108 100644 --- a/packages/gamut/src/BarChart/shared/types.tsx +++ b/packages/gamut/src/BarChart/shared/types.tsx @@ -1,12 +1,12 @@ -import { GamutIconProps } from '@skillsoft/gamut-icons'; -import { ColorAlias } from '@skillsoft/gamut-styles'; -import { ComponentProps, HTMLProps } from 'react'; +import type { GamutIconProps } from '@skillsoft/gamut-icons'; +import type { ColorAlias } from '@skillsoft/gamut-styles'; +import type { ComponentProps, HTMLProps } from 'react'; -import { ButtonProps } from '../../Button'; -import { Text } from '../../Typography/Text'; -import { HeadingTags } from '../../Typography/types'; -import { CustomSortOption } from '../utils/hooks'; -import { PartialBarChartTranslations } from './translations'; +import type { ButtonProps } from '../../Button'; +import type { Text } from '../../Typography/Text'; +import type { HeadingTags } from '../../Typography/types'; +import type { CustomSortOption } from '../utils/hooks'; +import type { PartialBarChartTranslations } from './translations'; type titleType = | string diff --git a/packages/gamut/src/BarChart/utils/hooks.ts b/packages/gamut/src/BarChart/utils/hooks.ts index 12348ef0a3..c5b6d07cd5 100644 --- a/packages/gamut/src/BarChart/utils/hooks.ts +++ b/packages/gamut/src/BarChart/utils/hooks.ts @@ -1,4 +1,5 @@ -import { Colors, isColorAlias, useColorModes } from '@skillsoft/gamut-styles'; +import type { Colors} from '@skillsoft/gamut-styles'; +import { isColorAlias, useColorModes } from '@skillsoft/gamut-styles'; import { getContrast } from 'polished'; import { useCallback, @@ -10,14 +11,15 @@ import { useState, } from 'react'; -import { SelectOptions } from '../../Form/inputs/Select'; +import type { SelectOptions } from '../../Form/inputs/Select'; +import type { + BarChartContextProps} from '../BarChartProvider'; import { BarChartContext, - BarChartContextProps, defaultStyleConfig, } from '../BarChartProvider'; -import { BarChartTranslations } from '../shared/translations'; -import { +import type { BarChartTranslations } from '../shared/translations'; +import type { BarChartStyles, BarProps, InferBarType, diff --git a/packages/gamut/src/BarChart/utils/index.tsx b/packages/gamut/src/BarChart/utils/index.tsx index c98b3f3c49..283743fb44 100644 --- a/packages/gamut/src/BarChart/utils/index.tsx +++ b/packages/gamut/src/BarChart/utils/index.tsx @@ -1,9 +1,10 @@ +import type { + BarChartTranslations} from '../shared/translations'; import { - BarChartTranslations, getDefaultSingleValueBarSummary, getDefaultStackedBarSummary, } from '../shared/translations'; -import { +import type { BarChartUnit, BarProps, MaxScaleValue, diff --git a/packages/gamut/src/BodyPortal/index.tsx b/packages/gamut/src/BodyPortal/index.tsx index 1b31b9bf60..6eb3f59994 100644 --- a/packages/gamut/src/BodyPortal/index.tsx +++ b/packages/gamut/src/BodyPortal/index.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { ColorMode, system, useCurrentMode } from '@skillsoft/gamut-styles'; +import type * as React from 'react'; import { useState } from 'react'; -import * as React from 'react'; import ReactDOM from 'react-dom'; import { useIsomorphicLayoutEffect } from 'react-use'; diff --git a/packages/gamut/src/Box/Box.tsx b/packages/gamut/src/Box/Box.tsx index 12d85e387f..45bc2dfe2b 100644 --- a/packages/gamut/src/Box/Box.tsx +++ b/packages/gamut/src/Box/Box.tsx @@ -1,7 +1,8 @@ import styled from '@emotion/styled'; import { styledOptions } from '@skillsoft/gamut-styles'; -import { BoxProps, boxProps, sharedStates } from './props'; +import type { BoxProps} from './props'; +import { boxProps, sharedStates } from './props'; export const Box = styled('div', styledOptions(['fit']))( sharedStates, diff --git a/packages/gamut/src/Box/FlexBox.tsx b/packages/gamut/src/Box/FlexBox.tsx index e6ccc4b410..2a6c261e3d 100644 --- a/packages/gamut/src/Box/FlexBox.tsx +++ b/packages/gamut/src/Box/FlexBox.tsx @@ -1,7 +1,8 @@ import styled from '@emotion/styled'; import { css, styledOptions } from '@skillsoft/gamut-styles'; -import { boxProps, FlexBoxProps, flexStates, sharedStates } from './props'; +import type { FlexBoxProps} from './props'; +import { boxProps, flexStates, sharedStates } from './props'; export const FlexBox = styled( 'div', diff --git a/packages/gamut/src/Box/GridBox.tsx b/packages/gamut/src/Box/GridBox.tsx index 6ba4cf869d..c512392eea 100644 --- a/packages/gamut/src/Box/GridBox.tsx +++ b/packages/gamut/src/Box/GridBox.tsx @@ -1,7 +1,8 @@ import styled from '@emotion/styled'; import { styledOptions, system } from '@skillsoft/gamut-styles'; -import { boxProps, GridBoxProps, gridStates, sharedStates } from './props'; +import type { GridBoxProps} from './props'; +import { boxProps, gridStates, sharedStates } from './props'; export const GridBox = styled( 'div', diff --git a/packages/gamut/src/Box/props.ts b/packages/gamut/src/Box/props.ts index e7cde50c5d..199a7b20e3 100644 --- a/packages/gamut/src/Box/props.ts +++ b/packages/gamut/src/Box/props.ts @@ -1,7 +1,8 @@ import { system } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; -import { WithChildrenProp } from '../utils'; +import type { WithChildrenProp } from '../utils'; export const boxProps = variance.compose( system.space, diff --git a/packages/gamut/src/Breadcrumbs/index.tsx b/packages/gamut/src/Breadcrumbs/index.tsx index abc791d996..4d204cbe0f 100644 --- a/packages/gamut/src/Breadcrumbs/index.tsx +++ b/packages/gamut/src/Breadcrumbs/index.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { css } from '@skillsoft/gamut-styles'; -import * as React from 'react'; +import type * as React from 'react'; import { Anchor } from '../Anchor'; import { Box, FlexBox } from '../Box'; diff --git a/packages/gamut/src/Button/FillButton.tsx b/packages/gamut/src/Button/FillButton.tsx index f88710127a..462a76d768 100644 --- a/packages/gamut/src/Button/FillButton.tsx +++ b/packages/gamut/src/Button/FillButton.tsx @@ -1,11 +1,12 @@ import { forwardRef } from 'react'; -import { ButtonBaseElements } from '../ButtonBase/ButtonBase'; +import type { ButtonBaseElements } from '../ButtonBase/ButtonBase'; +import type { + InlineIconButtonProps} from './shared'; import { createButtonComponent, fillButtonVariants, InlineIconButton, - InlineIconButtonProps, sizeVariants, } from './shared'; diff --git a/packages/gamut/src/Button/IconButton.tsx b/packages/gamut/src/Button/IconButton.tsx index 1e20022921..dfa5b5070a 100644 --- a/packages/gamut/src/Button/IconButton.tsx +++ b/packages/gamut/src/Button/IconButton.tsx @@ -1,8 +1,10 @@ -import { ComponentProps, forwardRef } from 'react'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; -import { ButtonBaseElements } from '../ButtonBase/ButtonBase'; -import { ToolTip, ToolTipProps } from '../Tip/ToolTip'; -import { IconComponentType } from '../utils'; +import type { ButtonBaseElements } from '../ButtonBase/ButtonBase'; +import type { ToolTipProps } from '../Tip/ToolTip'; +import { ToolTip } from '../Tip/ToolTip'; +import type { IconComponentType } from '../utils'; import { createButtonComponent, iconSizeMapping, diff --git a/packages/gamut/src/Button/StrokeButton.tsx b/packages/gamut/src/Button/StrokeButton.tsx index bd4c8b5a2f..67c5bc289f 100644 --- a/packages/gamut/src/Button/StrokeButton.tsx +++ b/packages/gamut/src/Button/StrokeButton.tsx @@ -1,10 +1,11 @@ import { forwardRef } from 'react'; -import { ButtonBaseElements } from '../ButtonBase/ButtonBase'; +import type { ButtonBaseElements } from '../ButtonBase/ButtonBase'; +import type { + InlineIconButtonProps} from './shared'; import { createButtonComponent, InlineIconButton, - InlineIconButtonProps, sizeVariants, strokeButtonVariants, } from './shared'; diff --git a/packages/gamut/src/Button/TextButton.tsx b/packages/gamut/src/Button/TextButton.tsx index 49bafaa1d4..7a8b14642f 100644 --- a/packages/gamut/src/Button/TextButton.tsx +++ b/packages/gamut/src/Button/TextButton.tsx @@ -1,10 +1,11 @@ import { forwardRef } from 'react'; -import { ButtonBaseElements } from '../ButtonBase/ButtonBase'; +import type { ButtonBaseElements } from '../ButtonBase/ButtonBase'; +import type { + InlineIconButtonProps} from './shared'; import { createButtonComponent, InlineIconButton, - InlineIconButtonProps, sizeVariants, textButtonVariants, } from './shared'; diff --git a/packages/gamut/src/Button/__tests__/mocks.tsx b/packages/gamut/src/Button/__tests__/mocks.tsx index 849ad5bcd4..df7e2c0b5d 100644 --- a/packages/gamut/src/Button/__tests__/mocks.tsx +++ b/packages/gamut/src/Button/__tests__/mocks.tsx @@ -1,6 +1,7 @@ import { ColorMode } from '@skillsoft/gamut-styles'; import { MockGamutProvider } from '@skillsoft/gamut-tests'; -import React, { ComponentProps } from 'react'; +import type { ComponentProps } from 'react'; +import type React from 'react'; import { Box } from '../../Box'; import { IconButton } from '..'; diff --git a/packages/gamut/src/Button/shared/InlineIconButton.tsx b/packages/gamut/src/Button/shared/InlineIconButton.tsx index 7425b89a5f..cf3ae6d82c 100644 --- a/packages/gamut/src/Button/shared/InlineIconButton.tsx +++ b/packages/gamut/src/Button/shared/InlineIconButton.tsx @@ -1,10 +1,10 @@ import { forwardRef } from 'react'; -import { ButtonBaseElements } from '../../ButtonBase/ButtonBase'; +import type { ButtonBaseElements } from '../../ButtonBase/ButtonBase'; import { appendIconToContent } from '../../helpers'; -import { FillButtonProps } from '../FillButton'; -import { StrokeButtonProps } from '../StrokeButton'; -import { TextButtonProps } from '../TextButton'; +import type { FillButtonProps } from '../FillButton'; +import type { StrokeButtonProps } from '../StrokeButton'; +import type { TextButtonProps } from '../TextButton'; type InlineIconButtonComponents = | FillButtonProps diff --git a/packages/gamut/src/Button/shared/styles.ts b/packages/gamut/src/Button/shared/styles.ts index fe68ba1fc4..f1c44c1df0 100644 --- a/packages/gamut/src/Button/shared/styles.ts +++ b/packages/gamut/src/Button/shared/styles.ts @@ -6,10 +6,11 @@ import { system, transitionConcat, } from '@skillsoft/gamut-styles'; -import { CSSObject, ThemeProps, variance } from '@skillsoft/variance'; +import type { CSSObject, ThemeProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; import { ButtonBase, InteractiveSelectors } from '../../ButtonBase/ButtonBase'; -import { ButtonBaseProps } from './types'; +import type { ButtonBaseProps } from './types'; export const config = styledOptions<'button', 'size'>(['size']); diff --git a/packages/gamut/src/Button/shared/types.ts b/packages/gamut/src/Button/shared/types.ts index ce180c7a21..4a946a63a5 100644 --- a/packages/gamut/src/Button/shared/types.ts +++ b/packages/gamut/src/Button/shared/types.ts @@ -1,15 +1,15 @@ -import { ColorModes } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import { ComponentProps, HTMLProps } from 'react'; +import type { ColorModes } from '@skillsoft/gamut-styles'; +import type { StyleProps } from '@skillsoft/variance'; +import type { ComponentProps, HTMLProps } from 'react'; -import { ButtonBase } from '../../ButtonBase'; -import { IconComponentType } from '../../utils'; -import { CTAButton } from '../CTAButton'; -import { FillButton } from '../FillButton'; -import { IconButton } from '../IconButton'; -import { StrokeButton } from '../StrokeButton'; -import { TextButton } from '../TextButton'; -import { buttonProps, buttonVariants } from './styles'; +import type { ButtonBase } from '../../ButtonBase'; +import type { IconComponentType } from '../../utils'; +import type { CTAButton } from '../CTAButton'; +import type { FillButton } from '../FillButton'; +import type { IconButton } from '../IconButton'; +import type { StrokeButton } from '../StrokeButton'; +import type { TextButton } from '../TextButton'; +import type { buttonProps, buttonVariants } from './styles'; export interface ButtonBaseProps extends StyleProps { onClick?: HTMLProps['onClick']; diff --git a/packages/gamut/src/ButtonBase/ButtonBase.tsx b/packages/gamut/src/ButtonBase/ButtonBase.tsx index 418ce142f1..bfc40c21ae 100644 --- a/packages/gamut/src/ButtonBase/ButtonBase.tsx +++ b/packages/gamut/src/ButtonBase/ButtonBase.tsx @@ -1,6 +1,7 @@ import styled from '@emotion/styled'; import { css, styledOptions } from '@skillsoft/gamut-styles'; -import { ComponentProps, forwardRef, HTMLProps, Ref } from 'react'; +import type { ComponentProps, HTMLProps, Ref } from 'react'; +import { forwardRef } from 'react'; export type ButtonBaseElements = HTMLAnchorElement | HTMLButtonElement; export type ButtonBaseRef = Ref; diff --git a/packages/gamut/src/Card/elements.tsx b/packages/gamut/src/Card/elements.tsx index d38a348968..8b2280db61 100644 --- a/packages/gamut/src/Card/elements.tsx +++ b/packages/gamut/src/Card/elements.tsx @@ -4,7 +4,7 @@ import { motion } from 'framer-motion'; import { Box } from '../Box'; import { cardVariants, shadowVariants } from './styles'; -import { CardWrapperProps } from './types'; +import type { CardWrapperProps } from './types'; export const MotionBox = motion.create(Box); diff --git a/packages/gamut/src/Card/index.tsx b/packages/gamut/src/Card/index.tsx index c2642d01db..ed9db004d9 100644 --- a/packages/gamut/src/Card/index.tsx +++ b/packages/gamut/src/Card/index.tsx @@ -1,10 +1,11 @@ import { CheckerDense } from '@skillsoft/gamut-patterns'; -import { borderRadii, Colors } from '@skillsoft/gamut-styles'; -import * as React from 'react'; +import type { Colors } from '@skillsoft/gamut-styles'; +import { borderRadii } from '@skillsoft/gamut-styles'; +import type * as React from 'react'; import { DynamicCardWrapper, MotionBox, StaticCardWrapper } from './elements'; import { patternFadeInOut, useCardElevation } from './styles'; -import { CardProps } from './types'; +import type { CardProps } from './types'; type BorderRadiusToken = keyof typeof borderRadii; diff --git a/packages/gamut/src/Card/styles.tsx b/packages/gamut/src/Card/styles.tsx index a64a616ca2..5509aacc7f 100644 --- a/packages/gamut/src/Card/styles.tsx +++ b/packages/gamut/src/Card/styles.tsx @@ -1,11 +1,13 @@ -import { Theme, useTheme } from '@emotion/react'; +import type { Theme} from '@emotion/react'; +import { useTheme } from '@emotion/react'; +import type { + ElevationState} from '@skillsoft/gamut-styles'; import { - ElevationState, theme, timingValues, variant, } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; /** * The theme's elevation scale is flattened to dashcase tokens (`rest-shadow`, diff --git a/packages/gamut/src/Card/types.tsx b/packages/gamut/src/Card/types.tsx index df6f39d7f6..37007ed308 100644 --- a/packages/gamut/src/Card/types.tsx +++ b/packages/gamut/src/Card/types.tsx @@ -1,11 +1,11 @@ -import { PatternProps } from '@skillsoft/gamut-patterns'; -import { StyleProps } from '@skillsoft/variance'; -import { ComponentProps } from 'react'; +import type { PatternProps } from '@skillsoft/gamut-patterns'; +import type { StyleProps } from '@skillsoft/variance'; +import type { ComponentProps } from 'react'; -import { Box } from '../Box'; -import { WithChildrenProp } from '../utils'; -import { DynamicCardWrapper } from './elements'; -import { cardVariants, shadowVariants } from './styles'; +import type { Box } from '../Box'; +import type { WithChildrenProp } from '../utils'; +import type { DynamicCardWrapper } from './elements'; +import type { cardVariants, shadowVariants } from './styles'; export interface CardWrapperProps extends StyleProps, diff --git a/packages/gamut/src/Coachmark/index.tsx b/packages/gamut/src/Coachmark/index.tsx index 999c3c0a11..d31a62662b 100644 --- a/packages/gamut/src/Coachmark/index.tsx +++ b/packages/gamut/src/Coachmark/index.tsx @@ -1,12 +1,13 @@ +import type * as React from 'react'; import { useRef } from 'react'; -import * as React from 'react'; import { DelayedRenderWrapper } from '../DelayedRenderWrapper'; -import { - Popover, +import type { PopoverFocusProps, PopoverProps, - PopoverYPositionType, + PopoverYPositionType} from '../Popover'; +import { + Popover } from '../Popover'; export type CoachmarkProps = PopoverFocusProps & { diff --git a/packages/gamut/src/ConnectedForm/ConnectedForm.tsx b/packages/gamut/src/ConnectedForm/ConnectedForm.tsx index f9fa259d0a..5294a3783c 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedForm.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedForm.tsx @@ -1,21 +1,22 @@ import { forwardRef, useEffect, useMemo } from 'react'; import * as React from 'react'; -import { +import type { FieldValues, - FormProvider, FormProviderProps, Mode, Path, RegisterOptions, SubmitErrorHandler, SubmitHandler, - useForm, - UseFormProps, + UseFormProps} from 'react-hook-form'; +import { + FormProvider, + useForm } from 'react-hook-form'; import { Form } from '../Form'; -import { FormProps } from '../Form/elements/Form'; -import { FormValues } from '../Form/types'; +import type { FormProps } from '../Form/elements/Form'; +import type { FormValues } from '../Form/types'; import { submitSuccessStatus } from './utils'; export interface FormContextProps { diff --git a/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx b/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx index 1b791e9400..5b2318c2c7 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedFormGroup.tsx @@ -1,15 +1,16 @@ import styled from '@emotion/styled'; import { css } from '@skillsoft/gamut-styles'; +import type * as React from 'react'; import { useEffect, useId } from 'react'; -import * as React from 'react'; -import { RegisterOptions } from 'react-hook-form'; +import type { RegisterOptions } from 'react-hook-form'; import { Anchor } from '../Anchor'; -import { FormError, FormGroup, FormGroupLabel, FormGroupProps } from '../Form'; +import type { FormGroupProps } from '../Form'; +import { FormError, FormGroup, FormGroupLabel } from '../Form'; import { Markdown } from '../Markdown'; -import { InfoTipSubComponentProps } from '../Tip/InfoTip/type-utils'; +import type { InfoTipSubComponentProps } from '../Tip/InfoTip/type-utils'; import { Text } from '../Typography'; -import { ConnectedField, FieldProps, SubmitContextProps } from './types'; +import type { ConnectedField, FieldProps, SubmitContextProps } from './types'; import { getErrorMessage, useField } from './utils'; const ErrorAnchor = styled(Anchor)( diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedCheckbox.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedCheckbox.tsx index 79e7282d75..2255750d29 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedCheckbox.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedCheckbox.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; +import type * as React from 'react'; import { useId } from 'react'; import { Controller } from 'react-hook-form'; import { Checkbox } from '../../Form'; import { useField } from '../utils'; -import { ConnectedCheckboxProps } from './types'; +import type { ConnectedCheckboxProps } from './types'; export const ConnectedCheckbox: React.FC = ({ className, diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx index 4976755904..ad40cc01a0 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedInput.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; +import type * as React from 'react'; import { Input } from '../../Form'; import { useField } from '../utils'; -import { ConnectedInputProps } from './types'; +import type { ConnectedInputProps } from './types'; export const ConnectedInput: React.FC = ({ disabled, diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/__tests__/ConnectedNestedCheckboxes.test.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/__tests__/ConnectedNestedCheckboxes.test.tsx index c38502bbd3..52cf06dd39 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/__tests__/ConnectedNestedCheckboxes.test.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/__tests__/ConnectedNestedCheckboxes.test.tsx @@ -4,7 +4,7 @@ import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { ConnectedForm, ConnectedFormGroup, SubmitButton } from '../../..'; -import { NestedConnectedCheckboxOption } from '../../types'; +import type { NestedConnectedCheckboxOption } from '../../types'; import { ConnectedNestedCheckboxes } from '../index'; const mockOptions: NestedConnectedCheckboxOption[] = [ diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/index.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/index.tsx index d67c8c0fb2..e393187b85 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/index.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/index.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; +import type * as React from 'react'; import { useEffect, useMemo, useState } from 'react'; import { Controller } from 'react-hook-form'; import { Box } from '../../../Box'; import { useField } from '../../utils'; -import { ConnectedNestedCheckboxesProps } from '../types'; +import type { ConnectedNestedCheckboxesProps } from '../types'; import { calculateStates, flattenOptions, diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx index a9f816194f..4cf7368e61 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx @@ -1,7 +1,8 @@ import { Box } from '../../../Box'; -import { Checkbox, CheckboxLabelUnion } from '../../../Form'; -import { NestedGridFormCheckboxOption } from '../../../GridForm/types'; -import { MinimalCheckboxProps, NestedConnectedCheckboxOption } from '../types'; +import type { CheckboxLabelUnion } from '../../../Form'; +import { Checkbox } from '../../../Form'; +import type { NestedGridFormCheckboxOption } from '../../../GridForm/types'; +import type { MinimalCheckboxProps, NestedConnectedCheckboxOption } from '../types'; type FlatCheckbox = Omit & CheckboxLabelUnion & { diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadio.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadio.tsx index 4e86ab45a5..654dbb3957 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadio.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadio.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; +import type * as React from 'react'; import { Radio } from '../../Form'; import { useField } from '../utils'; -import { ConnectedRadioProps } from './types'; +import type { ConnectedRadioProps } from './types'; export const ConnectedRadio: React.FC = ({ disabled, diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroup.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroup.tsx index 824203c6bf..73f7f16f44 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroup.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroup.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; +import type * as React from 'react'; import { RadioGroup } from '../../Form'; import { useField } from '../utils'; -import { ConnectedRadioGroupProps } from './types'; +import type { ConnectedRadioGroupProps } from './types'; export const ConnectedRadioGroup: React.FC = ({ name, diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroupInput.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroupInput.tsx index 6656cf4c71..567ff07926 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroupInput.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedRadioGroupInput.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import type * as React from 'react'; import { ConnectedRadio, ConnectedRadioGroup } from '.'; -import { ConnectedRadioGroupInputProps } from './types'; +import type { ConnectedRadioGroupInputProps } from './types'; export const ConnectedRadioGroupInput: React.FC< ConnectedRadioGroupInputProps diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx index f609593cf0..1967820b84 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedSelect.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; +import type * as React from 'react'; import { Select } from '../../Form'; import { useField } from '../utils'; -import { ConnectedSelectProps } from './types'; +import type { ConnectedSelectProps } from './types'; export const ConnectedSelect: React.FC = ({ disabled, diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedTextArea.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedTextArea.tsx index fa2e9c32b1..15328b96ed 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedTextArea.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedTextArea.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; +import type * as React from 'react'; import { TextArea } from '../../Form'; import { useField } from '../utils'; -import { ConnectedTextAreaProps } from './types'; +import type { ConnectedTextAreaProps } from './types'; export const ConnectedTextArea: React.FC = ({ disabled, diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/types.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/types.tsx index 71b4f5f6a4..0ececfa0c5 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/types.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/types.tsx @@ -1,7 +1,7 @@ -import { ReactNode } from 'react'; -import { RegisterOptions } from 'react-hook-form'; +import type { ReactNode } from 'react'; +import type { RegisterOptions } from 'react-hook-form'; -import { +import type { CheckboxLabelUnion, CheckboxProps, InputWrapperProps, diff --git a/packages/gamut/src/ConnectedForm/SubmitButton.tsx b/packages/gamut/src/ConnectedForm/SubmitButton.tsx index dc33a67b21..ba20467d17 100644 --- a/packages/gamut/src/ConnectedForm/SubmitButton.tsx +++ b/packages/gamut/src/ConnectedForm/SubmitButton.tsx @@ -1,9 +1,10 @@ -import { ComponentType } from 'react'; -import * as React from 'react'; -import { FieldValues, FormState } from 'react-hook-form'; +import type { ComponentType } from 'react'; +import type * as React from 'react'; +import type { FieldValues, FormState } from 'react-hook-form'; import { Box, FlexBox } from '../Box'; -import { ButtonProps, FillButton } from '../Button'; +import type { ButtonProps} from '../Button'; +import { FillButton } from '../Button'; import { Spinner } from '../Loading/Spinner'; import { Text } from '../Typography'; import { useSubmitState } from './utils'; diff --git a/packages/gamut/src/ConnectedForm/__fixtures__/helpers.tsx b/packages/gamut/src/ConnectedForm/__fixtures__/helpers.tsx index e1db0a7b28..404ca38528 100644 --- a/packages/gamut/src/ConnectedForm/__fixtures__/helpers.tsx +++ b/packages/gamut/src/ConnectedForm/__fixtures__/helpers.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import type * as React from 'react'; import { ConnectedCheckbox, diff --git a/packages/gamut/src/ConnectedForm/__tests__/ConnectedForm.test.tsx b/packages/gamut/src/ConnectedForm/__tests__/ConnectedForm.test.tsx index cedf29a603..ad1a69d387 100644 --- a/packages/gamut/src/ConnectedForm/__tests__/ConnectedForm.test.tsx +++ b/packages/gamut/src/ConnectedForm/__tests__/ConnectedForm.test.tsx @@ -1,8 +1,10 @@ import { setupRtl } from '@skillsoft/gamut-tests'; -import { fireEvent, queries } from '@testing-library/dom'; -import { act, RenderResult, waitFor } from '@testing-library/react'; +import type { queries } from '@testing-library/dom'; +import { fireEvent } from '@testing-library/dom'; +import type { RenderResult} from '@testing-library/react'; +import { act, waitFor } from '@testing-library/react'; -import { InfoTipProps } from '../../Tip/InfoTip'; +import type { InfoTipProps } from '../../Tip/InfoTip'; import { createPromise } from '../../utils'; import { ConnectedForm, diff --git a/packages/gamut/src/ConnectedForm/__tests__/SubmitButton.test.tsx b/packages/gamut/src/ConnectedForm/__tests__/SubmitButton.test.tsx index a883821314..de5ee19f62 100644 --- a/packages/gamut/src/ConnectedForm/__tests__/SubmitButton.test.tsx +++ b/packages/gamut/src/ConnectedForm/__tests__/SubmitButton.test.tsx @@ -1,6 +1,7 @@ import { theme } from '@skillsoft/gamut-styles'; import { setupRtl } from '@skillsoft/gamut-tests'; -import hookform, { FormState } from 'react-hook-form'; +import type { FormState } from 'react-hook-form'; +import hookform from 'react-hook-form'; import { CTAButton } from '../../Button'; import { SubmitButton } from '../SubmitButton'; diff --git a/packages/gamut/src/ConnectedForm/__tests__/useDebouncedField.test.tsx b/packages/gamut/src/ConnectedForm/__tests__/useDebouncedField.test.tsx index 6e18e32ed7..2b42cae829 100644 --- a/packages/gamut/src/ConnectedForm/__tests__/useDebouncedField.test.tsx +++ b/packages/gamut/src/ConnectedForm/__tests__/useDebouncedField.test.tsx @@ -1,10 +1,10 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import { fireEvent } from '@testing-library/dom'; import { act } from '@testing-library/react'; -import * as React from 'react'; +import type * as React from 'react'; import { Checkbox, Input } from '../../Form'; -import { WithChildrenProp } from '../../utils'; +import type { WithChildrenProp } from '../../utils'; import { ConnectedForm } from '../ConnectedForm'; import { useDebouncedField, useFormState } from '../utils'; diff --git a/packages/gamut/src/ConnectedForm/types.ts b/packages/gamut/src/ConnectedForm/types.ts index 07d1c5c3b8..2aebcc1542 100644 --- a/packages/gamut/src/ConnectedForm/types.ts +++ b/packages/gamut/src/ConnectedForm/types.ts @@ -1,4 +1,4 @@ -import { FieldValues, FormState } from 'react-hook-form'; +import type { FieldValues, FormState } from 'react-hook-form'; import type { ConnectedCheckbox, diff --git a/packages/gamut/src/ConnectedForm/utils.tsx b/packages/gamut/src/ConnectedForm/utils.tsx index c0ddf9aadd..b16732b8d3 100644 --- a/packages/gamut/src/ConnectedForm/utils.tsx +++ b/packages/gamut/src/ConnectedForm/utils.tsx @@ -1,34 +1,38 @@ import isNull from 'lodash/isNull'; import isUndefined from 'lodash/isUndefined'; import omit from 'lodash/omit'; -import { +import type { ChangeEvent, ChangeEventHandler, - HTMLInputTypeAttribute, + HTMLInputTypeAttribute} from 'react'; +import { useContext, useEffect, useMemo, useState, } from 'react'; -import { +import type { FieldError, FieldErrorsImpl, Merge, Path, - RegisterOptions, + RegisterOptions} from 'react-hook-form'; +import { useFieldArray, useFormContext, } from 'react-hook-form'; import { FormRequiredText } from '../Form'; +import type { + ConnectedFormProps} from './ConnectedForm'; import { ConnectedForm, - ConnectedFormProps, FormPropsContext, } from './ConnectedForm'; +import type { + ConnectedFormGroupProps} from './ConnectedFormGroup'; import { - ConnectedFormGroup, - ConnectedFormGroupProps, + ConnectedFormGroup } from './ConnectedFormGroup'; import type { ConnectedField, SubmitContextProps } from './types'; diff --git a/packages/gamut/src/DataList/Controls/ExpandControl.tsx b/packages/gamut/src/DataList/Controls/ExpandControl.tsx index f8cbefdc60..215feef550 100644 --- a/packages/gamut/src/DataList/Controls/ExpandControl.tsx +++ b/packages/gamut/src/DataList/Controls/ExpandControl.tsx @@ -1,10 +1,10 @@ import { MiniChevronDownIcon } from '@skillsoft/gamut-icons'; -import * as React from 'react'; +import type * as React from 'react'; import { Rotation } from '../../Animation'; import { FlexBox } from '../../Box/FlexBox'; import { TextButton } from '../../Button/TextButton'; -import { RowChange } from '../types'; +import type { RowChange } from '../types'; export interface ExpandColProps { expanded?: boolean; diff --git a/packages/gamut/src/DataList/Controls/FilterControl.tsx b/packages/gamut/src/DataList/Controls/FilterControl.tsx index cfcdd09982..a6811066e4 100644 --- a/packages/gamut/src/DataList/Controls/FilterControl.tsx +++ b/packages/gamut/src/DataList/Controls/FilterControl.tsx @@ -2,15 +2,15 @@ import styled from '@emotion/styled'; import { FilterIcon } from '@skillsoft/gamut-icons'; import { states } from '@skillsoft/gamut-styles'; import kebabCase from 'lodash/kebabCase'; +import type * as React from 'react'; import { useRef, useState } from 'react'; -import * as React from 'react'; import { Checkbox, FlexBox, Menu, MenuItem, Text } from '../..'; import { Anchor } from '../../Anchor'; import { PopoverContainer } from '../../PopoverContainer'; import { useControlContext } from '../hooks/useListControls'; import { useListState } from '../hooks/useListState'; -import { FilterOption, OnFilter } from '../types'; +import type { FilterOption, OnFilter } from '../types'; export interface FilterProps { columnKey: string; diff --git a/packages/gamut/src/DataList/Controls/SelectControl.tsx b/packages/gamut/src/DataList/Controls/SelectControl.tsx index c3a1be3d39..b7cad89dec 100644 --- a/packages/gamut/src/DataList/Controls/SelectControl.tsx +++ b/packages/gamut/src/DataList/Controls/SelectControl.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; +import type * as React from 'react'; import { Checkbox } from '../../Form/inputs/Checkbox'; import { Text } from '../../Typography/Text'; -import { RowChange } from '../types'; +import type { RowChange } from '../types'; export const SelectControl: React.FC<{ disabled?: boolean; diff --git a/packages/gamut/src/DataList/Controls/SortControl.tsx b/packages/gamut/src/DataList/Controls/SortControl.tsx index e847f5b6fd..201bd06e1e 100644 --- a/packages/gamut/src/DataList/Controls/SortControl.tsx +++ b/packages/gamut/src/DataList/Controls/SortControl.tsx @@ -1,12 +1,12 @@ import styled from '@emotion/styled'; import { ArrowChevronDownFilledIcon } from '@skillsoft/gamut-icons'; import { css, states } from '@skillsoft/gamut-styles'; -import * as React from 'react'; +import type * as React from 'react'; import { Anchor } from '../..'; import { FlexBox } from '../../Box'; import { useListState } from '../hooks/useListState'; -import { OnSort, SortDirection, SortOrder } from '../types'; +import type { OnSort, SortDirection, SortOrder } from '../types'; const SortAnchor = styled(Anchor)( css({ diff --git a/packages/gamut/src/DataList/DataGrid.tsx b/packages/gamut/src/DataList/DataGrid.tsx index 81ed85b27c..101836afc5 100644 --- a/packages/gamut/src/DataList/DataGrid.tsx +++ b/packages/gamut/src/DataList/DataGrid.tsx @@ -1,14 +1,16 @@ -import { system } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import { ComponentProps, useMemo } from 'react'; +import type { system } from '@skillsoft/gamut-styles'; +import type { StyleProps } from '@skillsoft/variance'; +import type { ComponentProps} from 'react'; +import { useMemo } from 'react'; import { List } from '../List'; import { EmptyRows } from './EmptyRows'; import { ListControlContext, useListControls } from './hooks/useListControls'; import { ListStateContext } from './hooks/useListState'; import { HeaderRow } from './Tables/Rows/TableHeaderRow'; -import { DataRow, MarshaledColProps } from './Tables/Rows/TableRow'; -import { ColumnConfig, DataListControls, IdentifiableKeys } from './types'; +import type { MarshaledColProps } from './Tables/Rows/TableRow'; +import { DataRow } from './Tables/Rows/TableRow'; +import type { ColumnConfig, DataListControls, IdentifiableKeys } from './types'; export interface DataGridProps< Row, diff --git a/packages/gamut/src/DataList/DataList.tsx b/packages/gamut/src/DataList/DataList.tsx index cdda4f9e9a..744657b313 100644 --- a/packages/gamut/src/DataList/DataList.tsx +++ b/packages/gamut/src/DataList/DataList.tsx @@ -1,7 +1,8 @@ -import { ReactElement } from 'react'; +import type { ReactElement } from 'react'; -import { DataGrid, DataGridProps } from './DataGrid'; -import { ColumnConfig, IdentifiableKeys } from './types'; +import type { DataGridProps } from './DataGrid'; +import { DataGrid } from './DataGrid'; +import type { ColumnConfig, IdentifiableKeys } from './types'; export interface DataList { , Cols extends ColumnConfig[]>( diff --git a/packages/gamut/src/DataList/DataTable.tsx b/packages/gamut/src/DataList/DataTable.tsx index feb7e5778c..27c34ea3a3 100644 --- a/packages/gamut/src/DataList/DataTable.tsx +++ b/packages/gamut/src/DataList/DataTable.tsx @@ -1,7 +1,8 @@ -import { ReactElement } from 'react'; +import type { ReactElement } from 'react'; -import { DataGrid, DataGridProps } from './DataGrid'; -import { ColumnConfig, IdentifiableKeys } from './types'; +import type { DataGridProps } from './DataGrid'; +import { DataGrid } from './DataGrid'; +import type { ColumnConfig, IdentifiableKeys } from './types'; export interface DataTable { , Cols extends ColumnConfig[]>( diff --git a/packages/gamut/src/DataList/Tables/Rows/TableHeaderRow.tsx b/packages/gamut/src/DataList/Tables/Rows/TableHeaderRow.tsx index 705c0705c4..8c74d3c3af 100644 --- a/packages/gamut/src/DataList/Tables/Rows/TableHeaderRow.tsx +++ b/packages/gamut/src/DataList/Tables/Rows/TableHeaderRow.tsx @@ -1,4 +1,5 @@ -import { memo, ReactElement } from 'react'; +import type { ReactElement } from 'react'; +import { memo } from 'react'; import { FlexBox } from '../../..'; import { ListCol } from '../../../List'; @@ -11,7 +12,7 @@ import { } from '../../Controls'; import { useControlContext } from '../../hooks/useListControls'; import { useListState } from '../../hooks/useListState'; -import { ColumnConfig, Query } from '../../types'; +import type { ColumnConfig, Query } from '../../types'; import { StyledHeaderRow } from './elements'; interface HeaderComponent { diff --git a/packages/gamut/src/DataList/Tables/Rows/TableRow.tsx b/packages/gamut/src/DataList/Tables/Rows/TableRow.tsx index 599e85ff86..d3e0a6bb05 100644 --- a/packages/gamut/src/DataList/Tables/Rows/TableRow.tsx +++ b/packages/gamut/src/DataList/Tables/Rows/TableRow.tsx @@ -1,19 +1,20 @@ +import type { + ReactElement} from 'react'; import { isValidElement, memo, - ReactElement, useCallback, useMemo, } from 'react'; import { Text } from '../../..'; import { ListCol, ListRow } from '../../../List'; -import { ColProps } from '../../../List/elements'; +import type { ColProps } from '../../../List/elements'; import { useListContext } from '../../../List/ListProvider'; import { Shimmer } from '../../../Loading/Shimmer'; import { ExpandControl, SelectControl } from '../../Controls'; import { useControlContext } from '../../hooks/useListControls'; -import { ColumnConfig, IdentifiableKeys } from '../../types'; +import type { ColumnConfig, IdentifiableKeys } from '../../types'; export type MarshaledColProps = Partial>; diff --git a/packages/gamut/src/DataList/__tests__/DataGrid.test.tsx b/packages/gamut/src/DataList/__tests__/DataGrid.test.tsx index b59e8d9ad1..d6de82fea0 100644 --- a/packages/gamut/src/DataList/__tests__/DataGrid.test.tsx +++ b/packages/gamut/src/DataList/__tests__/DataGrid.test.tsx @@ -1,15 +1,17 @@ import { matchers } from '@emotion/jest'; import { MockGamutProvider, setupRtl } from '@skillsoft/gamut-tests'; +import type { + RenderResult} from '@testing-library/react'; import { act, fireEvent, render, - RenderResult, screen, } from '@testing-library/react'; -import { DataGrid, DataGridProps } from '../DataGrid'; -import { ColumnConfig } from '../types'; +import type { DataGridProps } from '../DataGrid'; +import { DataGrid } from '../DataGrid'; +import type { ColumnConfig } from '../types'; // Add the custom matchers provided by '@emotion/jest' expect.extend(matchers); diff --git a/packages/gamut/src/DataList/hooks/useListControls.tsx b/packages/gamut/src/DataList/hooks/useListControls.tsx index 41bc145201..54db9639cd 100644 --- a/packages/gamut/src/DataList/hooks/useListControls.tsx +++ b/packages/gamut/src/DataList/hooks/useListControls.tsx @@ -1,7 +1,7 @@ import kebabCase from 'lodash/kebabCase'; import { createContext, useCallback, useContext, useMemo } from 'react'; -import { +import type { ColumnConfig, DataListControls, ExpandRow, diff --git a/packages/gamut/src/DataList/hooks/useListState.tsx b/packages/gamut/src/DataList/hooks/useListState.tsx index 0159001de2..c783112b40 100644 --- a/packages/gamut/src/DataList/hooks/useListState.tsx +++ b/packages/gamut/src/DataList/hooks/useListState.tsx @@ -1,6 +1,6 @@ import { createContext, useContext } from 'react'; -import { Query } from '../types'; +import type { Query } from '../types'; interface ListState { query?: Query; diff --git a/packages/gamut/src/DataList/hooks/useLocalQuery.tsx b/packages/gamut/src/DataList/hooks/useLocalQuery.tsx index 8bba85ac24..21b4b64645 100644 --- a/packages/gamut/src/DataList/hooks/useLocalQuery.tsx +++ b/packages/gamut/src/DataList/hooks/useLocalQuery.tsx @@ -1,7 +1,7 @@ import orderBy from 'lodash/orderBy'; import { useCallback, useMemo, useState } from 'react'; -import { ColumnConfig, IdentifiableKeys, OnQueryChange, Query } from '../types'; +import type { ColumnConfig, IdentifiableKeys, OnQueryChange, Query } from '../types'; export interface LocalQueryShape< Row, diff --git a/packages/gamut/src/DataList/types.ts b/packages/gamut/src/DataList/types.ts index ccfa239a32..50e9375bf0 100644 --- a/packages/gamut/src/DataList/types.ts +++ b/packages/gamut/src/DataList/types.ts @@ -1,6 +1,6 @@ -import { ReactElement } from 'react'; +import type { ReactElement } from 'react'; -import { ListColProps } from '..'; +import type { ListColProps } from '..'; export type SortDirection = 'asc' | 'desc' | 'none'; diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarBody.tsx b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarBody.tsx index 334e3dd3c3..a397af2242 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarBody.tsx +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarBody.tsx @@ -1,8 +1,8 @@ +import type * as React from 'react'; import { useCallback, useLayoutEffect, useMemo, useRef } from 'react'; -import * as React from 'react'; import { useIsoFirstWeekday, useResolvedLocale } from '../../utils/locale'; -import { CalendarBodyProps } from './types'; +import type { CalendarBodyProps } from './types'; import { getDatesWithRow, getMonthGrid, diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarFooter.tsx b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarFooter.tsx index fc6591ae3f..714a123b26 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarFooter.tsx +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarFooter.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import type * as React from 'react'; import { FlexBox } from '../../../Box'; import { TextButton } from '../../../Button'; import { DEFAULT_DATE_PICKER_TRANSLATIONS } from '../../utils/translations'; -import { CalendarFooterProps } from './types'; +import type { CalendarFooterProps } from './types'; export const CalendarFooter: React.FC = ({ clearButton, diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarHeader.tsx b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarHeader.tsx index 9b7e03011b..229029f7a4 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarHeader.tsx +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarHeader.tsx @@ -1,11 +1,11 @@ -import * as React from 'react'; +import type * as React from 'react'; import { FlexBox } from '../../../Box'; import { Text } from '../../../Typography'; import { useResolvedLocale } from '../../utils/locale'; import { CalendarNavLastMonth } from './CalendarNavLastMonth'; import { CalendarNavNextMonth } from './CalendarNavNextMonth'; -import { CalendarHeaderProps } from './types'; +import type { CalendarHeaderProps } from './types'; import { formatMonthYear } from './utils/format'; export const CalendarHeader: React.FC = ({ diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarNavLastMonth.tsx b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarNavLastMonth.tsx index fc1f709fe9..77bb0f2bc0 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarNavLastMonth.tsx +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarNavLastMonth.tsx @@ -7,7 +7,7 @@ import * as React from 'react'; import { IconButton } from '../../../Button'; import { useResolvedLocale } from '../../utils/locale'; -import { CalendarNavProps } from './types'; +import type { CalendarNavProps } from './types'; import { getRelativeMonthLabels } from './utils/format'; export const CalendarNavLastMonth: React.FC = ({ diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarNavNextMonth.tsx b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarNavNextMonth.tsx index d816b95af5..bffa716d82 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarNavNextMonth.tsx +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarNavNextMonth.tsx @@ -7,7 +7,7 @@ import * as React from 'react'; import { IconButton } from '../../../Button'; import { useResolvedLocale } from '../../utils/locale'; -import { CalendarNavProps } from './types'; +import type { CalendarNavProps } from './types'; import { getRelativeMonthLabels } from './utils/format'; export const CalendarNavNextMonth: React.FC = ({ diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarWrapper.tsx b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarWrapper.tsx index 2ce9a2153a..a5a07d6578 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarWrapper.tsx +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/CalendarWrapper.tsx @@ -1,8 +1,8 @@ import { CheckerDense } from '@skillsoft/gamut-patterns'; -import * as React from 'react'; +import type * as React from 'react'; import { Box } from '../../../Box'; -import { WithChildrenProp } from '../../../utils'; +import type { WithChildrenProp } from '../../../utils'; export const CalendarWrapper: React.FC = ({ children }) => ( diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/utils/__tests__/keyHandler.test.tsx b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/utils/__tests__/keyHandler.test.tsx index a404686ec5..fc3c5ecea3 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/utils/__tests__/keyHandler.test.tsx +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/utils/__tests__/keyHandler.test.tsx @@ -1,7 +1,8 @@ import type { KeyboardEvent } from 'react'; import { getDatesWithRow, getMonthGrid, matchDisabledDates } from '../dateGrid'; -import { keyHandler, KeyHandlerParams } from '../keyHandler'; +import type { KeyHandlerParams } from '../keyHandler'; +import { keyHandler } from '../keyHandler'; const makeEvent = ( key: string, diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/utils/elements.tsx b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/utils/elements.tsx index 30eebe67f0..af3adcea1c 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/utils/elements.tsx +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/Calendar/utils/elements.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { css, states, transitionConcat } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; export const CalendarTable = styled.table( css({ diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/index.tsx b/packages/gamut/src/DatePicker/DatePickerCalendar/index.tsx index 0355791694..2b93ea3189 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/index.tsx +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/index.tsx @@ -11,7 +11,7 @@ import { useMedia } from 'react-use'; import { Box, FlexBox } from '../../Box'; import { useDatePicker } from '../DatePickerContext'; -import { CalendarQuickAction } from '../sharedTypes'; +import type { CalendarQuickAction } from '../sharedTypes'; import { CalendarBody, CalendarFooter, diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/utils/dateSelect.ts b/packages/gamut/src/DatePicker/DatePickerCalendar/utils/dateSelect.ts index 77425c45b0..ffc9904be8 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/utils/dateSelect.ts +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/utils/dateSelect.ts @@ -2,7 +2,7 @@ import type { DatePickerRangeContextValue, DatePickerSingleContextValue, } from '../../DatePickerContext/types'; -import { DatePickerSharedProps } from '../../sharedTypes'; +import type { DatePickerSharedProps } from '../../sharedTypes'; import type { DatePickerProps, DatePickerRangeProps } from '../../types'; import { getOrderedCalendarEndpoints, diff --git a/packages/gamut/src/DatePicker/DatePickerCalendar/utils/quickActions.ts b/packages/gamut/src/DatePicker/DatePickerCalendar/utils/quickActions.ts index 9cb87101ea..befec4304d 100644 --- a/packages/gamut/src/DatePicker/DatePickerCalendar/utils/quickActions.ts +++ b/packages/gamut/src/DatePicker/DatePickerCalendar/utils/quickActions.ts @@ -1,6 +1,6 @@ -import { CalendarQuickAction } from '../../sharedTypes'; +import type { CalendarQuickAction } from '../../sharedTypes'; import { stringifyLocale } from '../../utils/locale'; -import { DatePickerTranslations } from '../../utils/translations'; +import type { DatePickerTranslations } from '../../utils/translations'; import { capitalizeFirst } from '../Calendar/utils/format'; const getRelativeDisplayText = ({ diff --git a/packages/gamut/src/DatePicker/DatePickerContext/index.tsx b/packages/gamut/src/DatePicker/DatePickerContext/index.tsx index 725c4badd1..d0fc0b92dc 100644 --- a/packages/gamut/src/DatePicker/DatePickerContext/index.tsx +++ b/packages/gamut/src/DatePicker/DatePickerContext/index.tsx @@ -1,6 +1,7 @@ import { useContext } from 'react'; -import { DatePickerContext, DatePickerContextValue } from './types'; +import type { DatePickerContextValue } from './types'; +import { DatePickerContext } from './types'; export const DatePickerProvider = DatePickerContext.Provider; diff --git a/packages/gamut/src/DatePicker/DatePickerContext/types.ts b/packages/gamut/src/DatePicker/DatePickerContext/types.ts index b9eabec0d1..3296256600 100644 --- a/packages/gamut/src/DatePicker/DatePickerContext/types.ts +++ b/packages/gamut/src/DatePicker/DatePickerContext/types.ts @@ -1,6 +1,6 @@ import { createContext } from 'react'; -import { CalendarQuickAction, DatePickerSharedProps } from '../sharedTypes'; +import type { CalendarQuickAction, DatePickerSharedProps } from '../sharedTypes'; import type { DatePickerTranslations } from '../utils/translations'; interface DatePickerBaseContextValue diff --git a/packages/gamut/src/DatePicker/DatePickerInput/Segment/elements.tsx b/packages/gamut/src/DatePicker/DatePickerInput/Segment/elements.tsx index 3318384870..58aa753f94 100644 --- a/packages/gamut/src/DatePicker/DatePickerInput/Segment/elements.tsx +++ b/packages/gamut/src/DatePicker/DatePickerInput/Segment/elements.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { css, states } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; const segmentStyles = states({ isEmpty: { diff --git a/packages/gamut/src/DatePicker/DatePickerInput/Segment/index.tsx b/packages/gamut/src/DatePicker/DatePickerInput/Segment/index.tsx index eeef657ac0..0775590141 100644 --- a/packages/gamut/src/DatePicker/DatePickerInput/Segment/index.tsx +++ b/packages/gamut/src/DatePicker/DatePickerInput/Segment/index.tsx @@ -2,13 +2,14 @@ import { type Dispatch, type SetStateAction, useCallback, useId } from 'react'; import type { DatePartKind } from '../utils'; import { Segment } from './elements'; +import type { + SegmentValues} from './utils'; import { appendSegmentDigit, getSegmentPlaceholder, getSegmentSpinBounds, parseSegmentNumericString, segmentMaxLength, - SegmentValues, spinSegment, } from './utils'; diff --git a/packages/gamut/src/DatePicker/DatePickerInput/elements.tsx b/packages/gamut/src/DatePicker/DatePickerInput/elements.tsx index c5541258af..317860b4a4 100644 --- a/packages/gamut/src/DatePicker/DatePickerInput/elements.tsx +++ b/packages/gamut/src/DatePicker/DatePickerInput/elements.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { variant } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { FlexBox } from '../../Box'; import { diff --git a/packages/gamut/src/DatePicker/types.ts b/packages/gamut/src/DatePicker/types.ts index c35cf19d35..26aa533355 100644 --- a/packages/gamut/src/DatePicker/types.ts +++ b/packages/gamut/src/DatePicker/types.ts @@ -1,8 +1,8 @@ -import { ComponentProps } from 'react'; +import type { ComponentProps } from 'react'; -import { Input } from '../Form/inputs/Input'; -import { CalendarQuickAction, DatePickerSharedProps } from './sharedTypes'; -import { DatePickerTranslations } from './utils/translations'; +import type { Input } from '../Form/inputs/Input'; +import type { CalendarQuickAction, DatePickerSharedProps } from './sharedTypes'; +import type { DatePickerTranslations } from './utils/translations'; interface DatePickerBaseProps extends DatePickerSharedProps { diff --git a/packages/gamut/src/DelayedRenderWrapper/DelayedRenderWrapper.tsx b/packages/gamut/src/DelayedRenderWrapper/DelayedRenderWrapper.tsx index d78daf4f7b..03a45f3cdd 100644 --- a/packages/gamut/src/DelayedRenderWrapper/DelayedRenderWrapper.tsx +++ b/packages/gamut/src/DelayedRenderWrapper/DelayedRenderWrapper.tsx @@ -1,4 +1,5 @@ -import React, { useEffect, useState } from 'react'; +import type React from 'react'; +import { useEffect, useState } from 'react'; interface DelayedRenderWrapperProps { delay: number; diff --git a/packages/gamut/src/Disclosure/DisclosureBody/index.tsx b/packages/gamut/src/Disclosure/DisclosureBody/index.tsx index 11015c4015..81786105e0 100644 --- a/packages/gamut/src/Disclosure/DisclosureBody/index.tsx +++ b/packages/gamut/src/Disclosure/DisclosureBody/index.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; +import type * as React from 'react'; import { Text } from '../../Typography'; import { DisclosureBodyWrapper } from '../elements'; import { getSpacing, renderButton } from '../helpers'; -import { DisclosureBodyProps } from '../types'; +import type { DisclosureBodyProps } from '../types'; export const DisclosureBody: React.FC = ({ body, diff --git a/packages/gamut/src/Disclosure/DisclosureButton/index.tsx b/packages/gamut/src/Disclosure/DisclosureButton/index.tsx index 9dbbc89501..573041e75c 100644 --- a/packages/gamut/src/Disclosure/DisclosureButton/index.tsx +++ b/packages/gamut/src/Disclosure/DisclosureButton/index.tsx @@ -2,14 +2,14 @@ import { ArrowChevronDownIcon, MiniChevronDownIcon, } from '@skillsoft/gamut-icons'; -import * as React from 'react'; +import type * as React from 'react'; import { Rotation } from '../../Animation'; import { Box, FlexBox } from '../../Box'; import { Text } from '../../Typography'; import { DisclosureButtonWrapper } from '../elements'; import { getRotationSize, getSpacing, getTitleSize } from '../helpers'; -import { DisclosureButtonProps } from '../types'; +import type { DisclosureButtonProps } from '../types'; export const DisclosureButton: React.FC = ({ disabled = false, diff --git a/packages/gamut/src/Disclosure/elements.tsx b/packages/gamut/src/Disclosure/elements.tsx index da8e64c5dc..4903d7a234 100644 --- a/packages/gamut/src/Disclosure/elements.tsx +++ b/packages/gamut/src/Disclosure/elements.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { states, variant } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { Anchor } from '../Anchor'; import { FlexBox } from '../Box'; diff --git a/packages/gamut/src/Disclosure/index.tsx b/packages/gamut/src/Disclosure/index.tsx index 599dc611a9..e817b006e5 100644 --- a/packages/gamut/src/Disclosure/index.tsx +++ b/packages/gamut/src/Disclosure/index.tsx @@ -1,12 +1,12 @@ import { AnimatePresence } from 'framer-motion'; +import type * as React from 'react'; import { useState } from 'react'; -import * as React from 'react'; import { ExpandInCollapseOut } from '../Animation'; import { DisclosureBody } from './DisclosureBody'; import { DisclosureButton } from './DisclosureButton'; import { DisclosureWrapper } from './elements'; -import { DisclosureProps } from './types'; +import type { DisclosureProps } from './types'; export const Disclosure: React.FC = ({ body, diff --git a/packages/gamut/src/Disclosure/types.ts b/packages/gamut/src/Disclosure/types.ts index 9083bad688..68abaaa7ee 100644 --- a/packages/gamut/src/Disclosure/types.ts +++ b/packages/gamut/src/Disclosure/types.ts @@ -1,4 +1,4 @@ -import { +import type { DisclosureBodyWrapperStyles, DisclosureWrapperStyles, } from './elements'; diff --git a/packages/gamut/src/Drawer/__tests__/Drawer.test.tsx b/packages/gamut/src/Drawer/__tests__/Drawer.test.tsx index db1b54f388..1841f86477 100644 --- a/packages/gamut/src/Drawer/__tests__/Drawer.test.tsx +++ b/packages/gamut/src/Drawer/__tests__/Drawer.test.tsx @@ -1,5 +1,6 @@ import { setupRtl } from '@skillsoft/gamut-tests'; -import { RenderResult, waitFor } from '@testing-library/react'; +import type { RenderResult} from '@testing-library/react'; +import { waitFor } from '@testing-library/react'; import { Drawer } from '..'; diff --git a/packages/gamut/src/Drawer/index.tsx b/packages/gamut/src/Drawer/index.tsx index 52b7cac713..663fac6081 100644 --- a/packages/gamut/src/Drawer/index.tsx +++ b/packages/gamut/src/Drawer/index.tsx @@ -4,7 +4,8 @@ import { AnimatePresence, motion } from 'framer-motion'; import { useEffect, useRef } from 'react'; import { useMedia } from 'react-use'; -import { Box, BoxProps } from '../Box'; +import type { BoxProps } from '../Box'; +import { Box } from '../Box'; import { focusVisibleStyle } from '../utils'; const drawerVisibleStyle = focusVisibleStyle('-3px'); diff --git a/packages/gamut/src/FeatureShimmer/index.tsx b/packages/gamut/src/FeatureShimmer/index.tsx index efd20dea23..9c295d02a7 100644 --- a/packages/gamut/src/FeatureShimmer/index.tsx +++ b/packages/gamut/src/FeatureShimmer/index.tsx @@ -2,7 +2,8 @@ import styled from '@emotion/styled'; import { css } from '@skillsoft/gamut-styles'; import { motion, useReducedMotion } from 'framer-motion'; -import { Box, BoxProps } from '../Box'; +import type { BoxProps } from '../Box'; +import { Box } from '../Box'; const BaseContainer = motion.create(Box); const Shimmer = styled(BaseContainer)( diff --git a/packages/gamut/src/Flyout/__tests__/Flyout.test.tsx b/packages/gamut/src/Flyout/__tests__/Flyout.test.tsx index d899136e10..0d954129e6 100644 --- a/packages/gamut/src/Flyout/__tests__/Flyout.test.tsx +++ b/packages/gamut/src/Flyout/__tests__/Flyout.test.tsx @@ -1,6 +1,7 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import { fireEvent } from '@testing-library/dom'; -import { act, RenderResult, waitFor } from '@testing-library/react'; +import type { RenderResult} from '@testing-library/react'; +import { act, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { Flyout } from '..'; diff --git a/packages/gamut/src/Flyout/index.tsx b/packages/gamut/src/Flyout/index.tsx index f58c973746..efd317410e 100644 --- a/packages/gamut/src/Flyout/index.tsx +++ b/packages/gamut/src/Flyout/index.tsx @@ -1,13 +1,14 @@ import { MiniDeleteIcon } from '@skillsoft/gamut-icons'; -import { Background, Colors } from '@skillsoft/gamut-styles'; -import * as React from 'react'; +import type { Colors } from '@skillsoft/gamut-styles'; +import { Background } from '@skillsoft/gamut-styles'; +import type * as React from 'react'; import { FlexBox } from '../Box'; import { IconButton } from '../Button'; import { Drawer } from '../Drawer'; import { Overlay } from '../Overlay'; import { Text } from '../Typography'; -import { WithChildrenProp } from '../utils'; +import type { WithChildrenProp } from '../utils'; export interface FlyoutProps extends WithChildrenProp { /** diff --git a/packages/gamut/src/FocusTrap/__tests__/FocusTrap.test.tsx b/packages/gamut/src/FocusTrap/__tests__/FocusTrap.test.tsx index 07044fcb9a..2ea07b9c2a 100644 --- a/packages/gamut/src/FocusTrap/__tests__/FocusTrap.test.tsx +++ b/packages/gamut/src/FocusTrap/__tests__/FocusTrap.test.tsx @@ -1,8 +1,9 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import { fireEvent, screen } from '@testing-library/react'; -import * as React from 'react'; +import type * as React from 'react'; -import { FocusTrap, FocusTrapProps } from '..'; +import type { FocusTrapProps } from '..'; +import { FocusTrap } from '..'; const FocusTrapContainer: React.FC> = (props) => { return ( diff --git a/packages/gamut/src/FocusTrap/index.tsx b/packages/gamut/src/FocusTrap/index.tsx index 8449357039..c56839818d 100644 --- a/packages/gamut/src/FocusTrap/index.tsx +++ b/packages/gamut/src/FocusTrap/index.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; +import type * as React from 'react'; import { FocusOn } from 'react-focus-on'; -import { ReactFocusOnProps } from 'react-focus-on/dist/es5/types'; +import type { ReactFocusOnProps } from 'react-focus-on/dist/es5/types'; -import { WithChildrenProp } from '../utils'; +import type { WithChildrenProp } from '../utils'; const focusOnStyles = { /** diff --git a/packages/gamut/src/Form/SelectDropdown/SelectDropdown.tsx b/packages/gamut/src/Form/SelectDropdown/SelectDropdown.tsx index c2c9ff0d90..81d490af23 100644 --- a/packages/gamut/src/Form/SelectDropdown/SelectDropdown.tsx +++ b/packages/gamut/src/Form/SelectDropdown/SelectDropdown.tsx @@ -1,9 +1,9 @@ import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { screenReaderOnly } from '@skillsoft/gamut-styles'; +import type * as React from 'react'; import { useId, useMemo, useRef, useState } from 'react'; -import * as React from 'react'; -import { StylesConfig } from 'react-select'; +import type { StylesConfig } from 'react-select'; import { getDefaultComponents } from './core/constants'; import { getMemoizedStyles } from './core/styles'; @@ -18,7 +18,7 @@ import { import { useNoOptionsAnnouncement } from './hooks/useNoOptionsAnnouncement'; import { useSelectHandlers } from './hooks/useSelectHandlers'; import { useSelectOptions } from './hooks/useSelectOptions'; -import { OptionStrict, SelectDropdownProps } from './types'; +import type { OptionStrict, SelectDropdownProps } from './types'; /** Announces the custom `validationMessage` menu text - see `useNoOptionsAnnouncement`. */ const NoOptionsLiveRegion = styled.div(screenReaderOnly); diff --git a/packages/gamut/src/Form/SelectDropdown/__tests__/utils.test.tsx b/packages/gamut/src/Form/SelectDropdown/__tests__/utils.test.tsx index dcc9f3270d..4c1a357fe1 100644 --- a/packages/gamut/src/Form/SelectDropdown/__tests__/utils.test.tsx +++ b/packages/gamut/src/Form/SelectDropdown/__tests__/utils.test.tsx @@ -1,4 +1,4 @@ -import { SelectOptionBase } from '../../utils'; +import type { SelectOptionBase } from '../../utils'; import { filterValueFromOptions, getCreatedOptionValue, @@ -6,7 +6,7 @@ import { isOptionsGrouped, removeValueFromSelectedOptions, } from '../core/utils'; -import { ExtendedOption, SelectDropdownGroup } from '../types'; +import type { ExtendedOption, SelectDropdownGroup } from '../types'; describe('SelectDropdown Utils', () => { describe('getCreatedOptionValue', () => { diff --git a/packages/gamut/src/Form/SelectDropdown/core/constants.ts b/packages/gamut/src/Form/SelectDropdown/core/constants.ts index c095fd8fb7..a5629613a2 100644 --- a/packages/gamut/src/Form/SelectDropdown/core/constants.ts +++ b/packages/gamut/src/Form/SelectDropdown/core/constants.ts @@ -1,4 +1,4 @@ -import { ComponentType } from 'react'; +import type { ComponentType } from 'react'; import { AbbreviatedSingleValue, diff --git a/packages/gamut/src/Form/SelectDropdown/core/styles.ts b/packages/gamut/src/Form/SelectDropdown/core/styles.ts index 7194c5b7a9..aa9c6cd05d 100644 --- a/packages/gamut/src/Form/SelectDropdown/core/styles.ts +++ b/packages/gamut/src/Form/SelectDropdown/core/styles.ts @@ -1,10 +1,11 @@ +import type { + theme as GamutTheme} from '@skillsoft/gamut-styles'; import { css, states, - theme as GamutTheme, variant, } from '@skillsoft/gamut-styles'; -import { StylesConfig } from 'react-select'; +import type { StylesConfig } from 'react-select'; import { dismissSharedStyles, @@ -19,8 +20,8 @@ import { formFieldPaddingStyles, InputSelectors, } from '../../styles'; -import { ControlState, OptionState } from '../types'; -import { BaseSelectComponentProps } from '../types/styles'; +import type { ControlState, OptionState } from '../types'; +import type { BaseSelectComponentProps } from '../types/styles'; const selectDropdownStyles = css({ ...formBaseFieldStylesObject, diff --git a/packages/gamut/src/Form/SelectDropdown/core/translations.ts b/packages/gamut/src/Form/SelectDropdown/core/translations.ts index ded062ebd6..0ae06f37bc 100644 --- a/packages/gamut/src/Form/SelectDropdown/core/translations.ts +++ b/packages/gamut/src/Form/SelectDropdown/core/translations.ts @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { ExtendedOption } from '../types/options'; +import type { ExtendedOption } from '../types/options'; /** * Function form of the no-options message: receives the current input value diff --git a/packages/gamut/src/Form/SelectDropdown/core/utils.ts b/packages/gamut/src/Form/SelectDropdown/core/utils.ts index 3317279c87..16b273ae2d 100644 --- a/packages/gamut/src/Form/SelectDropdown/core/utils.ts +++ b/packages/gamut/src/Form/SelectDropdown/core/utils.ts @@ -1,8 +1,8 @@ -import { ActionMeta, Options as OptionsType } from 'react-select'; +import type { ActionMeta, Options as OptionsType } from 'react-select'; import { isDefined } from '../../../utils/nullish'; -import { SelectOptionBase } from '../../utils'; -import { +import type { SelectOptionBase } from '../../utils'; +import type { BaseOnChangeProps, ExtendedOption, MultiSelectDropdownProps, @@ -12,7 +12,7 @@ import { SelectDropdownProps, SingleSelectDropdownProps, } from '../types'; -import { ValidationMessage, ValidationMessageFn } from './translations'; +import type { ValidationMessage, ValidationMessageFn } from './translations'; export const isMultipleSelectProps = ( props: BaseOnChangeProps diff --git a/packages/gamut/src/Form/SelectDropdown/elements/containers.tsx b/packages/gamut/src/Form/SelectDropdown/elements/containers.tsx index bd22addd06..dfb5ddf8a6 100644 --- a/packages/gamut/src/Form/SelectDropdown/elements/containers.tsx +++ b/packages/gamut/src/Form/SelectDropdown/elements/containers.tsx @@ -1,13 +1,15 @@ -import { createContext, ReactNode, useEffect, useLayoutEffect } from 'react'; -import ReactSelect, { - components as SelectDropdownElements, +import type { ReactNode} from 'react'; +import { createContext, useEffect, useLayoutEffect } from 'react'; +import type { GroupBase, - Props, + Props} from 'react-select'; +import ReactSelect, { + components as SelectDropdownElements } from 'react-select'; import CreatableSelect from 'react-select/creatable'; import { DEFAULT_SELECT_DROPDOWN_TRANSLATIONS } from '../core/translations'; -import { +import type { CustomSelectComponentProps, SelectDropdownContextValueTypes, TypedReactSelectProps, diff --git a/packages/gamut/src/Form/SelectDropdown/elements/controls.tsx b/packages/gamut/src/Form/SelectDropdown/elements/controls.tsx index e2985b60b3..1575e0ac7b 100644 --- a/packages/gamut/src/Form/SelectDropdown/elements/controls.tsx +++ b/packages/gamut/src/Form/SelectDropdown/elements/controls.tsx @@ -1,6 +1,6 @@ import { components as SelectDropdownElements } from 'react-select'; -import { SizedIndicatorProps } from '../types'; +import type { SizedIndicatorProps } from '../types'; import { indicatorIcons } from './constants'; const { DropdownIndicator } = SelectDropdownElements; diff --git a/packages/gamut/src/Form/SelectDropdown/elements/multi-value.tsx b/packages/gamut/src/Form/SelectDropdown/elements/multi-value.tsx index 9a81ec16e5..7e2dfbe5b7 100644 --- a/packages/gamut/src/Form/SelectDropdown/elements/multi-value.tsx +++ b/packages/gamut/src/Form/SelectDropdown/elements/multi-value.tsx @@ -2,15 +2,17 @@ import { css } from '@emotion/react'; import styled from '@emotion/styled'; import { MiniDeleteIcon } from '@skillsoft/gamut-icons'; import { theme } from '@skillsoft/gamut-styles'; -import { KeyboardEvent, useContext } from 'react'; -import { - components as SelectDropdownElements, +import type { KeyboardEvent} from 'react'; +import { useContext } from 'react'; +import type { GroupBase, MultiValueProps, - MultiValueRemoveProps, + MultiValueRemoveProps} from 'react-select'; +import { + components as SelectDropdownElements } from 'react-select'; -import { ExtendedOption, SizedIndicatorProps } from '../types'; +import type { ExtendedOption, SizedIndicatorProps } from '../types'; import { indicatorIcons } from './constants'; import { SelectDropdownContext } from './containers'; diff --git a/packages/gamut/src/Form/SelectDropdown/elements/options.tsx b/packages/gamut/src/Form/SelectDropdown/elements/options.tsx index 8cbb70e32e..d48964a790 100644 --- a/packages/gamut/src/Form/SelectDropdown/elements/options.tsx +++ b/packages/gamut/src/Form/SelectDropdown/elements/options.tsx @@ -1,11 +1,12 @@ import { CheckIcon } from '@skillsoft/gamut-icons'; +import type { + SingleValueProps} from 'react-select'; import { - components as SelectDropdownElements, - SingleValueProps, + components as SelectDropdownElements } from 'react-select'; import { Box, FlexBox } from '../../../Box'; -import { +import type { CustomSelectComponentProps, ExtendedOption, SelectDropdownGroup, diff --git a/packages/gamut/src/Form/SelectDropdown/hooks/__tests__/useNoOptionsAnnouncement.test.tsx b/packages/gamut/src/Form/SelectDropdown/hooks/__tests__/useNoOptionsAnnouncement.test.tsx index 93f6749661..56260c508e 100644 --- a/packages/gamut/src/Form/SelectDropdown/hooks/__tests__/useNoOptionsAnnouncement.test.tsx +++ b/packages/gamut/src/Form/SelectDropdown/hooks/__tests__/useNoOptionsAnnouncement.test.tsx @@ -1,5 +1,5 @@ import { act, render, renderHook } from '@testing-library/react'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import { useNoOptionsAnnouncement } from '../useNoOptionsAnnouncement'; diff --git a/packages/gamut/src/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.ts b/packages/gamut/src/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.ts index cb64c86564..65203431a0 100644 --- a/packages/gamut/src/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.ts +++ b/packages/gamut/src/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.ts @@ -1,6 +1,7 @@ -import { +import type { ComponentType, - ReactNode, + ReactNode} from 'react'; +import { useCallback, useEffect, useMemo, diff --git a/packages/gamut/src/Form/SelectDropdown/hooks/useSelectHandlers.ts b/packages/gamut/src/Form/SelectDropdown/hooks/useSelectHandlers.ts index ff779df7ce..21c285b666 100644 --- a/packages/gamut/src/Form/SelectDropdown/hooks/useSelectHandlers.ts +++ b/packages/gamut/src/Form/SelectDropdown/hooks/useSelectHandlers.ts @@ -1,8 +1,9 @@ -import { KeyboardEvent, useCallback, useEffect, useState } from 'react'; -import * as React from 'react'; -import { ActionMeta, Options as OptionsType } from 'react-select'; +import type { KeyboardEvent} from 'react'; +import type * as React from 'react'; +import { useCallback, useEffect, useState } from 'react'; +import type { ActionMeta, Options as OptionsType } from 'react-select'; -import { SelectOptionBase } from '../../utils'; +import type { SelectOptionBase } from '../../utils'; import { ON_CHANGE_ACTION } from '../core/constants'; import { filterValueFromOptions, @@ -12,7 +13,7 @@ import { isSingleSelectProps, removeValueFromSelectedOptions, } from '../core/utils'; -import { +import type { MultiSelectDropdownProps, OptionStrict, SelectDropdownGroup, diff --git a/packages/gamut/src/Form/SelectDropdown/hooks/useSelectOptions.ts b/packages/gamut/src/Form/SelectDropdown/hooks/useSelectOptions.ts index 200bcb4074..368283841e 100644 --- a/packages/gamut/src/Form/SelectDropdown/hooks/useSelectOptions.ts +++ b/packages/gamut/src/Form/SelectDropdown/hooks/useSelectOptions.ts @@ -1,8 +1,9 @@ import { useMemo } from 'react'; -import { parseOptions, SelectOptionBase } from '../../utils'; +import type { SelectOptionBase } from '../../utils'; +import { parseOptions } from '../../utils'; import { isOptionsGrouped } from '../core/utils'; -import { +import type { SelectDropdownGroup, SelectDropdownOptions, SelectDropdownSizes, diff --git a/packages/gamut/src/Form/SelectDropdown/types/component-props.ts b/packages/gamut/src/Form/SelectDropdown/types/component-props.ts index 0266aa8e73..c331b3ca78 100644 --- a/packages/gamut/src/Form/SelectDropdown/types/component-props.ts +++ b/packages/gamut/src/Form/SelectDropdown/types/component-props.ts @@ -1,17 +1,17 @@ -import { Ref, SelectHTMLAttributes } from 'react'; -import { Options as OptionsType, Props as NamedProps } from 'react-select'; +import type { Ref, SelectHTMLAttributes } from 'react'; +import type { Options as OptionsType, Props as NamedProps } from 'react-select'; -import { SelectComponentProps } from '../../inputs/Select'; -import { +import type { SelectComponentProps } from '../../inputs/Select'; +import type { SelectDropdownTranslations, ValidationMessage, } from '../core/translations'; -import { +import type { OptionStrict, SelectDropdownGroup, SelectDropdownOptions, } from './options'; -import { +import type { ReactSelectAdditionalProps, SelectDropdownSizes, SharedProps, diff --git a/packages/gamut/src/Form/SelectDropdown/types/internal.ts b/packages/gamut/src/Form/SelectDropdown/types/internal.ts index e6e9229ad1..8d3ef4bf9f 100644 --- a/packages/gamut/src/Form/SelectDropdown/types/internal.ts +++ b/packages/gamut/src/Form/SelectDropdown/types/internal.ts @@ -1,10 +1,10 @@ -import * as React from 'react'; -import { DropdownIndicatorProps, GroupBase } from 'react-select'; +import type * as React from 'react'; +import type { DropdownIndicatorProps, GroupBase } from 'react-select'; -import { SelectOptionBase } from '../../utils'; -import { SelectDropdownTranslations } from '../core/translations'; -import { OptionStrict } from './options'; -import { SelectDropdownSizes, SharedProps } from './styles'; +import type { SelectOptionBase } from '../../utils'; +import type { SelectDropdownTranslations } from '../core/translations'; +import type { OptionStrict } from './options'; +import type { SelectDropdownSizes, SharedProps } from './styles'; /** * Internal props passed to custom select components. diff --git a/packages/gamut/src/Form/SelectDropdown/types/options.ts b/packages/gamut/src/Form/SelectDropdown/types/options.ts index 2a2d4688f7..e8f1167f76 100644 --- a/packages/gamut/src/Form/SelectDropdown/types/options.ts +++ b/packages/gamut/src/Form/SelectDropdown/types/options.ts @@ -1,9 +1,9 @@ -import { GamutIconProps } from '@skillsoft/gamut-icons'; -import * as React from 'react'; -import { GroupBase } from 'react-select'; +import type { GamutIconProps } from '@skillsoft/gamut-icons'; +import type * as React from 'react'; +import type { GroupBase } from 'react-select'; -import { SelectOptions } from '../../inputs/Select'; -import { SelectDropdownSizes } from './styles'; +import type { SelectOptions } from '../../inputs/Select'; +import type { SelectDropdownSizes } from './styles'; /** * Basic option structure with required label and value properties. diff --git a/packages/gamut/src/Form/SelectDropdown/types/styles.ts b/packages/gamut/src/Form/SelectDropdown/types/styles.ts index c5b21c7bb8..d46fdeaea3 100644 --- a/packages/gamut/src/Form/SelectDropdown/types/styles.ts +++ b/packages/gamut/src/Form/SelectDropdown/types/styles.ts @@ -1,7 +1,7 @@ -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; -import { conditionalBorderStates } from '../core/styles'; -import { InternalInputsProps } from './component-props'; +import type { conditionalBorderStates } from '../core/styles'; +import type { InternalInputsProps } from './component-props'; /** * Size variants for the SelectDropdown component. diff --git a/packages/gamut/src/Form/__tests__/testUtils.ts b/packages/gamut/src/Form/__tests__/testUtils.ts index 4815f5a522..1cefd00096 100644 --- a/packages/gamut/src/Form/__tests__/testUtils.ts +++ b/packages/gamut/src/Form/__tests__/testUtils.ts @@ -1,4 +1,4 @@ -import { RenderResult } from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; /** * Creates and appends an external label element to the test container. diff --git a/packages/gamut/src/Form/elements/Form.tsx b/packages/gamut/src/Form/elements/Form.tsx index 2248b677e0..3666d7b99a 100644 --- a/packages/gamut/src/Form/elements/Form.tsx +++ b/packages/gamut/src/Form/elements/Form.tsx @@ -1,8 +1,9 @@ import styled from '@emotion/styled'; import { styledOptions, system } from '@skillsoft/gamut-styles'; import { variance } from '@skillsoft/variance'; -import { ComponentProps, forwardRef } from 'react'; -import * as React from 'react'; +import type { ComponentProps} from 'react'; +import type * as React from 'react'; +import { forwardRef } from 'react'; const formSystemProps = variance.compose( system.space, diff --git a/packages/gamut/src/Form/elements/FormError.tsx b/packages/gamut/src/Form/elements/FormError.tsx index c2611b1810..1e8037ba3f 100644 --- a/packages/gamut/src/Form/elements/FormError.tsx +++ b/packages/gamut/src/Form/elements/FormError.tsx @@ -1,8 +1,8 @@ import styled from '@emotion/styled'; import { theme, variant } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import { HTMLAttributes } from 'react'; -import * as React from 'react'; +import type { StyleProps } from '@skillsoft/variance'; +import type { HTMLAttributes } from 'react'; +import type * as React from 'react'; const errorSpanVariants = variant({ base: { diff --git a/packages/gamut/src/Form/elements/FormGroup.tsx b/packages/gamut/src/Form/elements/FormGroup.tsx index 23150e3578..8be8af9f49 100644 --- a/packages/gamut/src/Form/elements/FormGroup.tsx +++ b/packages/gamut/src/Form/elements/FormGroup.tsx @@ -1,14 +1,15 @@ import styled from '@emotion/styled'; import { variant } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import { ComponentProps } from 'react'; -import * as React from 'react'; +import type { StyleProps } from '@skillsoft/variance'; +import type { ComponentProps } from 'react'; +import type * as React from 'react'; import { Box } from '../../Box'; -import { BaseInputProps } from '../types'; +import type { BaseInputProps } from '../types'; import { FormError } from './FormError'; import { FormGroupDescription } from './FormGroupDescription'; -import { FormGroupLabel, FormGroupLabelProps } from './FormGroupLabel'; +import type { FormGroupLabelProps } from './FormGroupLabel'; +import { FormGroupLabel } from './FormGroupLabel'; export interface FormGroupProps extends ComponentProps, diff --git a/packages/gamut/src/Form/elements/FormGroupLabel.tsx b/packages/gamut/src/Form/elements/FormGroupLabel.tsx index 5888429ebf..317d56f022 100644 --- a/packages/gamut/src/Form/elements/FormGroupLabel.tsx +++ b/packages/gamut/src/Form/elements/FormGroupLabel.tsx @@ -1,18 +1,19 @@ import styled from '@emotion/styled'; import { states, variant } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import { HTMLAttributes } from 'react'; -import * as React from 'react'; +import type { StyleProps } from '@skillsoft/variance'; +import type { HTMLAttributes } from 'react'; +import type * as React from 'react'; import { FlexBox } from '../../Box'; import { InfoTip } from '../../Tip/InfoTip'; +import type { + InfoTipSubComponentProps} from '../../Tip/InfoTip/type-utils'; import { - InfoTipSubComponentProps, useInfotipProps, } from '../../Tip/InfoTip/type-utils'; import { Text } from '../../Typography/Text'; import { formBaseStyles, formFieldTextDisabledStyles } from '../styles'; -import { BaseInputProps } from '../types'; +import type { BaseInputProps } from '../types'; const labelSizeVariants = variant({ defaultVariant: 'small', diff --git a/packages/gamut/src/Form/elements/FormRequiredText.tsx b/packages/gamut/src/Form/elements/FormRequiredText.tsx index 71528ec3fd..b63b97ae14 100644 --- a/packages/gamut/src/Form/elements/FormRequiredText.tsx +++ b/packages/gamut/src/Form/elements/FormRequiredText.tsx @@ -1,4 +1,4 @@ -import { ComponentProps } from 'react'; +import type { ComponentProps } from 'react'; import { Text } from '../../Typography/Text'; diff --git a/packages/gamut/src/Form/inputs/Checkbox.tsx b/packages/gamut/src/Form/inputs/Checkbox.tsx index 9c28fd87a7..53bf1b850e 100644 --- a/packages/gamut/src/Form/inputs/Checkbox.tsx +++ b/packages/gamut/src/Form/inputs/Checkbox.tsx @@ -5,13 +5,15 @@ import { styledOptions, timing, } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import { forwardRef, InputHTMLAttributes, useEffect, useRef } from 'react'; +import type { StyleProps } from '@skillsoft/variance'; +import type { InputHTMLAttributes} from 'react'; +import { forwardRef, useEffect, useRef } from 'react'; import { FlexBox } from '../../Box'; import { InfoTip } from '../../Tip/InfoTip'; +import type { + InfoTipSubComponentProps} from '../../Tip/InfoTip/type-utils'; import { - InfoTipSubComponentProps, useInfotipProps, } from '../../Tip/InfoTip/type-utils'; import { @@ -25,8 +27,8 @@ import { InputWrapper, polyline, } from '../styles'; -import { BaseInputProps } from '../types'; -import { CheckboxCheckedUnion, CheckboxLabelUnion } from './types'; +import type { BaseInputProps } from '../types'; +import type { CheckboxCheckedUnion, CheckboxLabelUnion } from './types'; export type CheckboxTextProps = StyleProps; export type CheckboxPaddingProps = StyleProps; diff --git a/packages/gamut/src/Form/inputs/Input.tsx b/packages/gamut/src/Form/inputs/Input.tsx index 4ed1676e15..ee3927d704 100644 --- a/packages/gamut/src/Form/inputs/Input.tsx +++ b/packages/gamut/src/Form/inputs/Input.tsx @@ -1,17 +1,21 @@ -import styled, { StyledComponent } from '@emotion/styled'; +import type { StyledComponent } from '@emotion/styled'; +import styled from '@emotion/styled'; +import type { + GamutIconProps} from '@skillsoft/gamut-icons'; import { AlertIcon, - CheckCircledIcon, - GamutIconProps, + CheckCircledIcon } from '@skillsoft/gamut-icons'; import { css } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import { ChangeEvent, forwardRef, InputHTMLAttributes, useState } from 'react'; -import * as React from 'react'; +import type { StyleProps } from '@skillsoft/variance'; +import type { ChangeEvent, InputHTMLAttributes} from 'react'; +import type * as React from 'react'; +import { forwardRef, useState } from 'react'; import { Box, FlexBox } from '../../Box'; +import type { + conditionalStyleProps} from '../styles'; import { - conditionalStyleProps, conditionalStyles, conditionalStyleState, formBaseFieldStyles, @@ -20,7 +24,7 @@ import { formFieldStyles, inputSizeStyles, } from '../styles'; -import { BaseInputProps } from '../types'; +import type { BaseInputProps } from '../types'; export type InputProps = Omit, 'size'> & BaseInputProps & { diff --git a/packages/gamut/src/Form/inputs/Radio.tsx b/packages/gamut/src/Form/inputs/Radio.tsx index 90db904e8f..5fbc02f76e 100644 --- a/packages/gamut/src/Form/inputs/Radio.tsx +++ b/packages/gamut/src/Form/inputs/Radio.tsx @@ -1,13 +1,15 @@ import styled from '@emotion/styled'; import { screenReaderOnly } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import { forwardRef, InputHTMLAttributes, ReactNode } from 'react'; -import * as React from 'react'; +import type { StyleProps } from '@skillsoft/variance'; +import type { InputHTMLAttributes, ReactNode } from 'react'; +import type * as React from 'react'; +import { forwardRef } from 'react'; import { FlexBox } from '../../Box'; import { InfoTip } from '../../Tip/InfoTip'; +import type { + InfoTipSubComponentProps} from '../../Tip/InfoTip/type-utils'; import { - InfoTipSubComponentProps, useInfotipProps, } from '../../Tip/InfoTip/type-utils'; import { @@ -17,7 +19,7 @@ import { radioInput, radioLabel, } from '../styles'; -import { BaseInputProps } from '../types'; +import type { BaseInputProps } from '../types'; export type RadioProps = InputHTMLAttributes & Omit & { diff --git a/packages/gamut/src/Form/inputs/RadioGroup.tsx b/packages/gamut/src/Form/inputs/RadioGroup.tsx index ea0b706f9b..fc8c983466 100644 --- a/packages/gamut/src/Form/inputs/RadioGroup.tsx +++ b/packages/gamut/src/Form/inputs/RadioGroup.tsx @@ -1,7 +1,8 @@ -import { cloneElement, HTMLAttributes, InputHTMLAttributes } from 'react'; +import type { HTMLAttributes, InputHTMLAttributes } from 'react'; +import { cloneElement } from 'react'; import * as React from 'react'; -import { BaseInputProps } from '../types'; +import type { BaseInputProps } from '../types'; export type RadioGroupProps = Omit, 'onChange'> & Pick, 'onChange' | 'disabled'> & diff --git a/packages/gamut/src/Form/inputs/Select.tsx b/packages/gamut/src/Form/inputs/Select.tsx index 7fb5cb905b..d53f1dcece 100644 --- a/packages/gamut/src/Form/inputs/Select.tsx +++ b/packages/gamut/src/Form/inputs/Select.tsx @@ -5,11 +5,12 @@ import { MiniChevronDownIcon, } from '@skillsoft/gamut-icons'; import { variant } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import { +import type { StyleProps } from '@skillsoft/variance'; +import type { ChangeEvent, + SelectHTMLAttributes} from 'react'; +import { forwardRef, - SelectHTMLAttributes, useMemo, useState, } from 'react'; @@ -20,7 +21,7 @@ import { conditionalStyleState, formFieldStyles, } from '../styles'; -import { BaseInputProps } from '../types'; +import type { BaseInputProps } from '../types'; import { parseSelectOptions } from '../utils'; export type SelectOptions = string[] | Record; diff --git a/packages/gamut/src/Form/inputs/TextArea.tsx b/packages/gamut/src/Form/inputs/TextArea.tsx index 91bec9d162..6fabfc4712 100644 --- a/packages/gamut/src/Form/inputs/TextArea.tsx +++ b/packages/gamut/src/Form/inputs/TextArea.tsx @@ -1,9 +1,10 @@ import styled from '@emotion/styled'; -import { StyleProps } from '@skillsoft/variance'; -import { +import type { StyleProps } from '@skillsoft/variance'; +import type { ChangeEvent, + TextareaHTMLAttributes} from 'react'; +import { forwardRef, - TextareaHTMLAttributes, useState, } from 'react'; @@ -12,7 +13,7 @@ import { conditionalStyleState, formFieldStyles, } from '../styles'; -import { BaseInputProps } from '../types'; +import type { BaseInputProps } from '../types'; export type TextWrapperProps = TextareaHTMLAttributes & Omit & { diff --git a/packages/gamut/src/Form/inputs/types.tsx b/packages/gamut/src/Form/inputs/types.tsx index 6da0a0b8d2..4ce8f4d99e 100644 --- a/packages/gamut/src/Form/inputs/types.tsx +++ b/packages/gamut/src/Form/inputs/types.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; export type CheckboxStringLabelProps = { label: string; diff --git a/packages/gamut/src/Form/utils.tsx b/packages/gamut/src/Form/utils.tsx index 77f1881374..683e2247c4 100644 --- a/packages/gamut/src/Form/utils.tsx +++ b/packages/gamut/src/Form/utils.tsx @@ -1,7 +1,7 @@ import each from 'lodash/each'; import isObject from 'lodash/isObject'; -import { +import type { ExtendedOption, IconOption, OptionStrict, diff --git a/packages/gamut/src/GridForm/GridForm.tsx b/packages/gamut/src/GridForm/GridForm.tsx index d1d74d6df1..bdcb61296f 100644 --- a/packages/gamut/src/GridForm/GridForm.tsx +++ b/packages/gamut/src/GridForm/GridForm.tsx @@ -1,25 +1,28 @@ +import type * as React from 'react'; import { Fragment, useMemo } from 'react'; -import * as React from 'react'; -import { +import type { DeepPartial, DefaultValues, Mode, SubmitHandler, } from 'react-hook-form'; -import { ButtonProps } from '../Button'; -import { ConnectedForm, FormContextProps } from '../ConnectedForm'; +import type { ButtonProps } from '../Button'; +import type { FormContextProps } from '../ConnectedForm'; +import { ConnectedForm } from '../ConnectedForm'; import { FormRequiredText } from '../Form/elements/FormRequiredText'; -import { FormValues } from '../Form/types'; -import { Column, LayoutGrid, LayoutGridProps } from '../Layout'; -import { GridFormButtons, GridFormSubmitProps } from './GridFormButtons'; +import type { FormValues } from '../Form/types'; +import type { LayoutGridProps } from '../Layout'; +import { Column, LayoutGrid } from '../Layout'; +import type { GridFormSubmitProps } from './GridFormButtons'; +import { GridFormButtons } from './GridFormButtons'; import { GridFormContent, GridFormSection, GridFormSectionBreak, GridFormSectionTitle, } from './GridFormSections'; -import { +import type { GridFormField, GridFormFieldsProps, GridFormRequiredTextProps, diff --git a/packages/gamut/src/GridForm/GridFormButtons/index.tsx b/packages/gamut/src/GridForm/GridFormButtons/index.tsx index 71933b25f9..2839cdf989 100644 --- a/packages/gamut/src/GridForm/GridFormButtons/index.tsx +++ b/packages/gamut/src/GridForm/GridFormButtons/index.tsx @@ -1,10 +1,12 @@ -import { ColorModes } from '@skillsoft/gamut-styles'; -import { ComponentProps } from 'react'; -import * as React from 'react'; +import type { ColorModes } from '@skillsoft/gamut-styles'; +import type { ComponentProps } from 'react'; +import type * as React from 'react'; import { GridBox } from '../../Box'; -import { ButtonProps, CTAButton, FillButton, TextButton } from '../../Button'; -import { SubmitButton, SubmitButtonProps } from '../../ConnectedForm'; +import type { ButtonProps} from '../../Button'; +import { CTAButton, FillButton, TextButton } from '../../Button'; +import type { SubmitButtonProps } from '../../ConnectedForm'; +import { SubmitButton } from '../../ConnectedForm'; import { Column } from '../../Layout'; export type GridFormButtonsPosition = keyof typeof positions; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCheckboxInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCheckboxInput/index.tsx index 769a1ac07c..bc09ff4584 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCheckboxInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCheckboxInput/index.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; +import type * as React from 'react'; import { Controller } from 'react-hook-form'; import { Checkbox } from '../../../Form'; -import { BaseFormInputProps, GridFormCheckboxField } from '../../types'; +import type { BaseFormInputProps, GridFormCheckboxField } from '../../types'; export interface GridFormCheckboxInputProps extends BaseFormInputProps { field: GridFormCheckboxField; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCustomInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCustomInput/index.tsx index e974824322..504f446d70 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCustomInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCustomInput/index.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; -import { UseFormReturn } from 'react-hook-form'; +import type * as React from 'react'; +import type { UseFormReturn } from 'react-hook-form'; -import { GridFormCustomField, GridFormCustomGroupField } from '../../types'; +import type { GridFormCustomField, GridFormCustomGroupField } from '../../types'; export type GridFormCustomInputProps = { className?: string; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormFileInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormFileInput/index.tsx index cf07ec4a1d..b9dc5225e3 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormFileInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormFileInput/index.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; -import { UseFormReturn } from 'react-hook-form'; +import type * as React from 'react'; +import type { UseFormReturn } from 'react-hook-form'; import { Input } from '../../../Form'; -import { BaseFormInputProps, GridFormFileField } from '../../types'; +import type { BaseFormInputProps, GridFormFileField } from '../../types'; export interface GridFormFileInputProps extends BaseFormInputProps { field: Omit; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormHiddenInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormHiddenInput/index.tsx index 7098330db7..b5b4f4b3eb 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormHiddenInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormHiddenInput/index.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; -import { UseFormReturn } from 'react-hook-form'; +import type * as React from 'react'; +import type { UseFormReturn } from 'react-hook-form'; import { Input } from '../../../Form'; -import { GridFormHiddenField } from '../../types'; +import type { GridFormHiddenField } from '../../types'; export type GridFormHiddenInputProps = { field: GridFormHiddenField; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormNestedCheckboxInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormNestedCheckboxInput/index.tsx index 954b6179ba..41dbf2babb 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormNestedCheckboxInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormNestedCheckboxInput/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import type * as React from 'react'; import { useEffect, useMemo, useState } from 'react'; import { Controller } from 'react-hook-form'; @@ -10,8 +10,8 @@ import { handleCheckboxChange, renderCheckbox, } from '../../../ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils'; -import { BaseFormInputProps, GridFormNestedCheckboxField } from '../../types'; -import { GridFormInputGroupProps } from '..'; +import type { BaseFormInputProps, GridFormNestedCheckboxField } from '../../types'; +import type { GridFormInputGroupProps } from '..'; export interface GridFormNestedCheckboxInputProps extends BaseFormInputProps { field: GridFormNestedCheckboxField; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormRadioGroupInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormRadioGroupInput/index.tsx index 4a510a190b..d9789af3dc 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormRadioGroupInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormRadioGroupInput/index.tsx @@ -1,9 +1,9 @@ import isString from 'lodash/isString'; -import * as React from 'react'; -import { UseFormReturn } from 'react-hook-form'; +import type * as React from 'react'; +import type { UseFormReturn } from 'react-hook-form'; import { Radio, RadioGroup } from '../../../Form'; -import { BaseFormInputProps, GridFormRadioGroupField } from '../../types'; +import type { BaseFormInputProps, GridFormRadioGroupField } from '../../types'; export interface GridFormRadioGroupInputProps extends BaseFormInputProps { field: GridFormRadioGroupField; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormSelectInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormSelectInput/index.tsx index ff12fe2b37..1188405df5 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormSelectInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormSelectInput/index.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; -import { UseFormReturn } from 'react-hook-form'; +import type * as React from 'react'; +import type { UseFormReturn } from 'react-hook-form'; import { Select } from '../../../Form'; -import { BaseFormInputProps, GridFormSelectField } from '../../types'; +import type { BaseFormInputProps, GridFormSelectField } from '../../types'; export interface GridFormSelectInputProps extends BaseFormInputProps { field: Omit; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormSweetContainerInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormSweetContainerInput/index.tsx index 05afd55f29..f8755bbabd 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormSweetContainerInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormSweetContainerInput/index.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; -import { UseFormReturn } from 'react-hook-form'; +import type * as React from 'react'; +import type { UseFormReturn } from 'react-hook-form'; import { Box } from '../../..'; import { Input } from '../../../Form'; -import { GridFormSweetContainerField } from '../../types'; +import type { GridFormSweetContainerField } from '../../types'; export type GridFormSweetContainerInputProps = { field: GridFormSweetContainerField; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormTextArea/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormTextArea/index.tsx index 4bfd81c5d2..e0b226ec69 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormTextArea/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormTextArea/index.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; -import { UseFormReturn } from 'react-hook-form'; +import type * as React from 'react'; +import type { UseFormReturn } from 'react-hook-form'; import { TextArea } from '../../../Form'; -import { BaseFormInputProps, GridFormTextAreaField } from '../../types'; +import type { BaseFormInputProps, GridFormTextAreaField } from '../../types'; export interface GridFormTextAreaProps extends BaseFormInputProps { field: Omit; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormTextInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormTextInput/index.tsx index b9b2ceb11c..28aca7acc3 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormTextInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormTextInput/index.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; -import { UseFormReturn } from 'react-hook-form'; +import type * as React from 'react'; +import type { UseFormReturn } from 'react-hook-form'; import { Input } from '../../../Form'; -import { BaseFormInputProps, GridFormTextField } from '../../types'; +import type { BaseFormInputProps, GridFormTextField } from '../../types'; export interface GridFormTextInputProps extends BaseFormInputProps { field: Omit; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/__fixtures__/assertions.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/__fixtures__/assertions.tsx index 385abbc55a..ce61f13806 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/__fixtures__/assertions.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/__fixtures__/assertions.tsx @@ -1,11 +1,11 @@ import '@testing-library/jest-dom'; -import { setupRtl } from '@skillsoft/gamut-tests'; +import type { setupRtl } from '@skillsoft/gamut-tests'; import { queryByAttribute } from '@testing-library/dom'; import { act } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { getComponent } from './renderers'; +import type { getComponent } from './renderers'; const getById = queryByAttribute.bind(null, 'id'); diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/__fixtures__/renderers.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/__fixtures__/renderers.tsx index 709d737d75..c599779fc8 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/__fixtures__/renderers.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/__fixtures__/renderers.tsx @@ -1,5 +1,5 @@ import { setupRtl } from '@skillsoft/gamut-tests'; -import * as React from 'react'; +import type * as React from 'react'; import { FormContext } from '../../__fixtures__/helpers'; import { @@ -10,7 +10,8 @@ import { stubTextareaField, stubTextField, } from '../../__tests__/stubs'; -import { GridFormInputGroup, GridFormInputGroupProps } from '..'; +import type { GridFormInputGroupProps } from '..'; +import { GridFormInputGroup } from '..'; import { GridFormCheckboxInput } from '../GridFormCheckboxInput'; import { GridFormFileInput } from '../GridFormFileInput'; import { GridFormRadioGroupInput } from '../GridFormRadioGroupInput'; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/index.tsx index 5d8214fe65..3db7062200 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/index.tsx @@ -1,14 +1,14 @@ import styled from '@emotion/styled'; import { css } from '@skillsoft/gamut-styles'; -import * as React from 'react'; -import { UseFormReturn } from 'react-hook-form'; +import type * as React from 'react'; +import type { UseFormReturn } from 'react-hook-form'; import { Anchor } from '../../Anchor'; import { FormError, FormGroup, FormGroupLabel } from '../../Form'; import { Column } from '../../Layout'; import { Markdown } from '../../Markdown'; import { Text } from '../../Typography'; -import { +import type { GridFormField, GridFormHiddenField, GridFormSweetContainerField, diff --git a/packages/gamut/src/GridForm/GridFormSections/GridFormContent.tsx b/packages/gamut/src/GridForm/GridFormSections/GridFormContent.tsx index 12b55aa70d..14e597bb9f 100644 --- a/packages/gamut/src/GridForm/GridFormSections/GridFormContent.tsx +++ b/packages/gamut/src/GridForm/GridFormSections/GridFormContent.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; +import type * as React from 'react'; import { getErrorMessage, useField } from '../../ConnectedForm/utils'; import { GridFormInputGroup } from '../GridFormInputGroup'; -import { GridFormField } from '../types'; +import type { GridFormField } from '../types'; export type GridFormContentProps = { field: GridFormField; diff --git a/packages/gamut/src/GridForm/GridFormSections/GridFormSection.tsx b/packages/gamut/src/GridForm/GridFormSections/GridFormSection.tsx index 77952fa28b..fe0c2d948a 100644 --- a/packages/gamut/src/GridForm/GridFormSections/GridFormSection.tsx +++ b/packages/gamut/src/GridForm/GridFormSections/GridFormSection.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { GridFormField } from '../types'; +import type { GridFormField } from '../types'; import { GridFormContent } from './GridFormContent'; export type GridFormSectionProps = { diff --git a/packages/gamut/src/GridForm/GridFormSections/GridFormSectionBreak.tsx b/packages/gamut/src/GridForm/GridFormSections/GridFormSectionBreak.tsx index 76081fc0ba..c02bd2fe8e 100644 --- a/packages/gamut/src/GridForm/GridFormSections/GridFormSectionBreak.tsx +++ b/packages/gamut/src/GridForm/GridFormSections/GridFormSectionBreak.tsx @@ -1,7 +1,8 @@ import styled from '@emotion/styled'; import { system } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; -import * as React from 'react'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; +import type * as React from 'react'; import { Column } from '../../Layout/Column'; diff --git a/packages/gamut/src/GridForm/GridFormSections/GridFormSectionTitle.tsx b/packages/gamut/src/GridForm/GridFormSections/GridFormSectionTitle.tsx index a2278efe39..e36fe97555 100644 --- a/packages/gamut/src/GridForm/GridFormSections/GridFormSectionTitle.tsx +++ b/packages/gamut/src/GridForm/GridFormSections/GridFormSectionTitle.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; +import type * as React from 'react'; import { Box } from '../../Box'; import { FormRequiredText } from '../../Form'; import { Column } from '../../Layout/Column'; import { Text } from '../../Typography/Text'; -import { +import type { GridFormRequiredTextProps, GridFormSectionTitleBaseProps, } from '../types'; diff --git a/packages/gamut/src/GridForm/GridFormSections/__fixtures__/renderers.tsx b/packages/gamut/src/GridForm/GridFormSections/__fixtures__/renderers.tsx index 69b26f41f5..6e14ef471d 100644 --- a/packages/gamut/src/GridForm/GridFormSections/__fixtures__/renderers.tsx +++ b/packages/gamut/src/GridForm/GridFormSections/__fixtures__/renderers.tsx @@ -1,8 +1,10 @@ -import * as React from 'react'; +import type * as React from 'react'; import { FormContext } from '../../__fixtures__/helpers'; -import { GridFormContent, GridFormContentProps } from '../GridFormContent'; -import { GridFormSection, GridFormSectionProps } from '../GridFormSection'; +import type { GridFormContentProps } from '../GridFormContent'; +import { GridFormContent } from '../GridFormContent'; +import type { GridFormSectionProps } from '../GridFormSection'; +import { GridFormSection } from '../GridFormSection'; type GridFormContentTestComponentProps = GridFormContentProps & { mode?: 'onSubmit' | 'onChange'; diff --git a/packages/gamut/src/GridForm/GridFormSections/__tests__/GridFormSection.test.tsx b/packages/gamut/src/GridForm/GridFormSections/__tests__/GridFormSection.test.tsx index ac5f699e7b..00d9d9f498 100644 --- a/packages/gamut/src/GridForm/GridFormSections/__tests__/GridFormSection.test.tsx +++ b/packages/gamut/src/GridForm/GridFormSections/__tests__/GridFormSection.test.tsx @@ -7,7 +7,7 @@ import { stubSelectField, stubTextField, } from '../../__tests__/stubs'; -import { GridFormTextField } from '../../types'; +import type { GridFormTextField } from '../../types'; import { GridFormSectionTestComponent } from '../__fixtures__/renderers'; const fields = [stubTextField, stubSelectField, stubFileField]; diff --git a/packages/gamut/src/GridForm/__fixtures__/helpers.tsx b/packages/gamut/src/GridForm/__fixtures__/helpers.tsx index e644eecd34..3e731a6b7a 100644 --- a/packages/gamut/src/GridForm/__fixtures__/helpers.tsx +++ b/packages/gamut/src/GridForm/__fixtures__/helpers.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import type * as React from 'react'; import { ConnectedForm } from '../../ConnectedForm'; -import { WithChildrenProp } from '../../utils'; +import type { WithChildrenProp } from '../../utils'; interface FormContextProps extends WithChildrenProp { mode?: 'onChange' | 'onSubmit'; diff --git a/packages/gamut/src/GridForm/__tests__/GridForm.test.tsx b/packages/gamut/src/GridForm/__tests__/GridForm.test.tsx index e9dabd582d..77824b3ec3 100644 --- a/packages/gamut/src/GridForm/__tests__/GridForm.test.tsx +++ b/packages/gamut/src/GridForm/__tests__/GridForm.test.tsx @@ -1,10 +1,12 @@ import { setupRtl } from '@skillsoft/gamut-tests'; -import { fireEvent, queries } from '@testing-library/dom'; -import { act, RenderResult, waitFor } from '@testing-library/react'; +import type { queries } from '@testing-library/dom'; +import { fireEvent } from '@testing-library/dom'; +import type { RenderResult} from '@testing-library/react'; +import { act, waitFor } from '@testing-library/react'; import { createPromise } from '../../utils'; import { GridForm } from '../GridForm'; -import { GridFormField } from '../types'; +import type { GridFormField } from '../types'; import { stubCheckboxField, stubFieldCases, diff --git a/packages/gamut/src/GridForm/__tests__/stubs.ts b/packages/gamut/src/GridForm/__tests__/stubs.ts index 2bf63c713f..d1c4e5ef37 100644 --- a/packages/gamut/src/GridForm/__tests__/stubs.ts +++ b/packages/gamut/src/GridForm/__tests__/stubs.ts @@ -1,4 +1,4 @@ -import { +import type { GridFormCheckboxField, GridFormFileField, GridFormHiddenField, diff --git a/packages/gamut/src/GridForm/types.ts b/packages/gamut/src/GridForm/types.ts index e7b004edbc..c1af82feef 100644 --- a/packages/gamut/src/GridForm/types.ts +++ b/packages/gamut/src/GridForm/types.ts @@ -1,13 +1,13 @@ -import { ReactNode } from 'react'; -import { RegisterOptions, UseFormReturn } from 'react-hook-form'; - -import { BoxProps } from '../Box'; -import { MinimalCheckboxProps } from '../ConnectedForm'; -import { CheckboxLabelUnion, TextAreaProps } from '../Form'; -import { CheckboxPaddingProps } from '../Form/types'; -import { ColumnProps } from '../Layout'; -import { InfoTipSubComponentProps } from '../Tip/InfoTip/type-utils'; -import { Text, TextProps } from '../Typography/Text'; +import type { ReactNode } from 'react'; +import type { RegisterOptions, UseFormReturn } from 'react-hook-form'; + +import type { BoxProps } from '../Box'; +import type { MinimalCheckboxProps } from '../ConnectedForm'; +import type { CheckboxLabelUnion, TextAreaProps } from '../Form'; +import type { CheckboxPaddingProps } from '../Form/types'; +import type { ColumnProps } from '../Layout'; +import type { InfoTipSubComponentProps } from '../Tip/InfoTip/type-utils'; +import type { Text, TextProps } from '../Typography/Text'; export interface BaseFormInputProps { className?: string; diff --git a/packages/gamut/src/GridForm/utils.ts b/packages/gamut/src/GridForm/utils.ts index 3f30cb2f73..d0c06213cb 100644 --- a/packages/gamut/src/GridForm/utils.ts +++ b/packages/gamut/src/GridForm/utils.ts @@ -1,6 +1,6 @@ import isArray from 'lodash/isArray'; -import { GridFormField } from './types'; +import type { GridFormField } from './types'; export const assignDefaultValue = (field: GridFormField) => { switch (field.type) { diff --git a/packages/gamut/src/Layout/Column.tsx b/packages/gamut/src/Layout/Column.tsx index 6060286e6f..7c153cec77 100644 --- a/packages/gamut/src/Layout/Column.tsx +++ b/packages/gamut/src/Layout/Column.tsx @@ -1,7 +1,9 @@ import styled from '@emotion/styled'; import { styledOptions, system, variant } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; -import { ComponentProps, forwardRef } from 'react'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; const rows = { 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6 }; diff --git a/packages/gamut/src/Layout/LayoutGrid.tsx b/packages/gamut/src/Layout/LayoutGrid.tsx index 326464da4f..252b64bddc 100644 --- a/packages/gamut/src/Layout/LayoutGrid.tsx +++ b/packages/gamut/src/Layout/LayoutGrid.tsx @@ -1,6 +1,7 @@ import styled from '@emotion/styled'; import { pxRem, styledOptions, system, theme } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; import pick from 'lodash/pick'; const columns = 12; diff --git a/packages/gamut/src/List/Header/ListHeaderCol.tsx b/packages/gamut/src/List/Header/ListHeaderCol.tsx index 1b06be3550..115da641f2 100644 --- a/packages/gamut/src/List/Header/ListHeaderCol.tsx +++ b/packages/gamut/src/List/Header/ListHeaderCol.tsx @@ -1,8 +1,9 @@ -import { ComponentProps, forwardRef } from 'react'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; import { ColEl } from '../elements'; import { useListContext } from '../ListProvider'; -import { PublicListProps } from '../types'; +import type { PublicListProps } from '../types'; export interface ListColProps extends PublicListProps> {} diff --git a/packages/gamut/src/List/List.tsx b/packages/gamut/src/List/List.tsx index 0fbd926f23..087356fef5 100644 --- a/packages/gamut/src/List/List.tsx +++ b/packages/gamut/src/List/List.tsx @@ -1,10 +1,12 @@ import { DotLoose } from '@skillsoft/gamut-patterns'; import { timingValues } from '@skillsoft/gamut-styles'; import isArray from 'lodash/isArray'; -import { ComponentProps, forwardRef, useEffect } from 'react'; -import * as React from 'react'; +import type { ComponentProps} from 'react'; +import type * as React from 'react'; +import { forwardRef, useEffect } from 'react'; -import { Box, BoxProps, FlexBox } from '../Box'; +import type { BoxProps} from '../Box'; +import { Box, FlexBox } from '../Box'; import { AnimatedListWrapper, hiddenVariant, @@ -14,7 +16,7 @@ import { } from './elements'; import { useScrollabilityCheck } from './hooks'; import { ListProvider, useList } from './ListProvider'; -import { AllListProps } from './types'; +import type { AllListProps } from './types'; export interface ListProps extends AllListProps> { /** Whether List should be an ol, ul element, or table */ diff --git a/packages/gamut/src/List/ListCol.tsx b/packages/gamut/src/List/ListCol.tsx index 0aa54bcedc..bc888e113b 100644 --- a/packages/gamut/src/List/ListCol.tsx +++ b/packages/gamut/src/List/ListCol.tsx @@ -1,8 +1,9 @@ -import { ComponentProps, forwardRef } from 'react'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; import { ColEl, StickyHeaderColWrapper } from './elements'; import { useListContext } from './ListProvider'; -import { PublicListProps } from './types'; +import type { PublicListProps } from './types'; export interface ListColProps extends PublicListProps> {} diff --git a/packages/gamut/src/List/ListProvider.tsx b/packages/gamut/src/List/ListProvider.tsx index 0d7c2d8fdd..de5cb3c5a3 100644 --- a/packages/gamut/src/List/ListProvider.tsx +++ b/packages/gamut/src/List/ListProvider.tsx @@ -1,6 +1,6 @@ import { createContext, useContext, useMemo } from 'react'; -import { PrivateListProps } from './types'; +import type { PrivateListProps } from './types'; export interface ListContextProps extends PrivateListProps { depth: number; diff --git a/packages/gamut/src/List/ListRow.tsx b/packages/gamut/src/List/ListRow.tsx index f64b2edd86..4d7ec923f2 100644 --- a/packages/gamut/src/List/ListRow.tsx +++ b/packages/gamut/src/List/ListRow.tsx @@ -1,14 +1,15 @@ import styled from '@emotion/styled'; import { css } from '@skillsoft/gamut-styles'; import { AnimatePresence, motion } from 'framer-motion'; -import { ComponentProps, forwardRef, MouseEvent } from 'react'; -import * as React from 'react'; +import type { ComponentProps, MouseEvent } from 'react'; +import type * as React from 'react'; +import { forwardRef } from 'react'; import { Box } from '../Box'; -import { WithChildrenProp } from '../utils'; +import type { WithChildrenProp } from '../utils'; import { RowEl } from './elements'; import { useListContext } from './ListProvider'; -import { PublicListProps } from './types'; +import type { PublicListProps } from './types'; export interface RowProps extends Partial>> { diff --git a/packages/gamut/src/List/TableHeader.tsx b/packages/gamut/src/List/TableHeader.tsx index 60810da9c9..6dc56c46ef 100644 --- a/packages/gamut/src/List/TableHeader.tsx +++ b/packages/gamut/src/List/TableHeader.tsx @@ -1,9 +1,10 @@ -import { ComponentProps, forwardRef } from 'react'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; import { Box } from '../Box'; import { HeaderRowEl } from './elements'; import { useListContext } from './ListProvider'; -import { PublicListProps } from './types'; +import type { PublicListProps } from './types'; export interface TableHeaderProps extends Partial>> {} diff --git a/packages/gamut/src/List/__tests__/List.test.tsx b/packages/gamut/src/List/__tests__/List.test.tsx index 382edfed25..834c5f0cc3 100644 --- a/packages/gamut/src/List/__tests__/List.test.tsx +++ b/packages/gamut/src/List/__tests__/List.test.tsx @@ -3,7 +3,8 @@ import { theme } from '@skillsoft/gamut-styles'; import { MockGamutProvider, setupRtl } from '@skillsoft/gamut-tests'; import { render } from '@testing-library/react'; -import { List, ListProps } from '../List'; +import type { ListProps } from '../List'; +import { List } from '../List'; import { ListCol } from '../ListCol'; import { ListRow } from '../ListRow'; diff --git a/packages/gamut/src/List/elements.tsx b/packages/gamut/src/List/elements.tsx index c6351612e5..1d79b2914c 100644 --- a/packages/gamut/src/List/elements.tsx +++ b/packages/gamut/src/List/elements.tsx @@ -7,7 +7,8 @@ import { theme, variant, } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; import { motion } from 'framer-motion'; import { Box } from '../Box'; diff --git a/packages/gamut/src/List/types.ts b/packages/gamut/src/List/types.ts index 90a9ca3856..e36f3a31f2 100644 --- a/packages/gamut/src/List/types.ts +++ b/packages/gamut/src/List/types.ts @@ -1,4 +1,4 @@ -import { ListProps } from './List'; +import type { ListProps } from './List'; export interface PrivateListProps { listType?: ListProps['as']; diff --git a/packages/gamut/src/Loading/Shimmer.tsx b/packages/gamut/src/Loading/Shimmer.tsx index 9a5fb69098..09448d8274 100644 --- a/packages/gamut/src/Loading/Shimmer.tsx +++ b/packages/gamut/src/Loading/Shimmer.tsx @@ -1,9 +1,10 @@ import { keyframes } from '@emotion/react'; import styled from '@emotion/styled'; import { css, useCurrentMode } from '@skillsoft/gamut-styles'; -import * as React from 'react'; +import type * as React from 'react'; -import { Box, BoxProps } from '../Box'; +import type { BoxProps } from '../Box'; +import { Box } from '../Box'; const slide = keyframes({ from: { left: -500 }, diff --git a/packages/gamut/src/Loading/Spinner.tsx b/packages/gamut/src/Loading/Spinner.tsx index 1f6f1924ac..7f2571f3a1 100644 --- a/packages/gamut/src/Loading/Spinner.tsx +++ b/packages/gamut/src/Loading/Spinner.tsx @@ -1,4 +1,4 @@ -import { FunctionComponent, SVGProps } from 'react'; +import type { FunctionComponent, SVGProps } from 'react'; export type SpinnerProps = SVGProps & { size?: number | string; diff --git a/packages/gamut/src/Markdown/__tests__/Markdown.test.tsx b/packages/gamut/src/Markdown/__tests__/Markdown.test.tsx index 5b1b7b9074..a45da1ed70 100644 --- a/packages/gamut/src/Markdown/__tests__/Markdown.test.tsx +++ b/packages/gamut/src/Markdown/__tests__/Markdown.test.tsx @@ -3,7 +3,7 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import * as React from 'react'; +import type * as React from 'react'; import { Markdown } from '../index'; diff --git a/packages/gamut/src/Markdown/index.tsx b/packages/gamut/src/Markdown/index.tsx index bd17f489d4..fb95303c4f 100644 --- a/packages/gamut/src/Markdown/index.tsx +++ b/packages/gamut/src/Markdown/index.tsx @@ -2,25 +2,27 @@ import styled from '@emotion/styled'; import cx from 'classnames'; import HtmlToReact from 'html-to-react'; import { marked } from 'marked'; +import type * as React from 'react'; import { PureComponent } from 'react'; -import * as React from 'react'; import sanitizeMarkdown from 'sanitize-markdown'; import { omitProps } from '../utils/omitProps'; +import type { + MarkdownOverrideSettings} from './libs/overrides'; import { createCodeBlockOverride, createInputOverride, createTagOverride, createVideoOverride, - MarkdownOverrideSettings, standardOverrides, } from './libs/overrides'; import { MarkdownCheckbox } from './libs/overrides/Checkbox'; import { Details } from './libs/overrides/Details'; import { Iframe } from './libs/overrides/Iframe'; +import type { + MarkdownAnchorProps} from './libs/overrides/MarkdownAnchor'; import { - MarkdownAnchor, - MarkdownAnchorProps, + MarkdownAnchor } from './libs/overrides/MarkdownAnchor'; import { Table } from './libs/overrides/Table'; import { MarkdownVideo } from './libs/overrides/Video'; diff --git a/packages/gamut/src/Markdown/libs/overrides/Checkbox/index.tsx b/packages/gamut/src/Markdown/libs/overrides/Checkbox/index.tsx index 93fae49581..cb81f9249a 100644 --- a/packages/gamut/src/Markdown/libs/overrides/Checkbox/index.tsx +++ b/packages/gamut/src/Markdown/libs/overrides/Checkbox/index.tsx @@ -1,7 +1,8 @@ +import type * as React from 'react'; import { useState } from 'react'; -import * as React from 'react'; -import { Checkbox, CheckboxProps } from '../../../../Form'; +import type { CheckboxProps } from '../../../../Form'; +import { Checkbox } from '../../../../Form'; export type MarkdownCheckboxProps = Pick & { label: string; diff --git a/packages/gamut/src/Markdown/libs/overrides/Details/index.tsx b/packages/gamut/src/Markdown/libs/overrides/Details/index.tsx index 8bfda8c3a8..87afb6f80f 100644 --- a/packages/gamut/src/Markdown/libs/overrides/Details/index.tsx +++ b/packages/gamut/src/Markdown/libs/overrides/Details/index.tsx @@ -1,8 +1,9 @@ -import { HTMLAttributes, useMemo } from 'react'; -import * as React from 'react'; +import type { HTMLAttributes} from 'react'; +import type * as React from 'react'; +import { useMemo } from 'react'; import { Box } from '../../../../Box'; -import { HTMLToReactNode } from '..'; +import type { HTMLToReactNode } from '..'; // import styles from '../../../styles/_' interface MarkdownHTMLDetailsAttributes diff --git a/packages/gamut/src/Markdown/libs/overrides/Iframe/index.tsx b/packages/gamut/src/Markdown/libs/overrides/Iframe/index.tsx index 6f472f5e88..0bf24dac45 100644 --- a/packages/gamut/src/Markdown/libs/overrides/Iframe/index.tsx +++ b/packages/gamut/src/Markdown/libs/overrides/Iframe/index.tsx @@ -1,5 +1,5 @@ /* eslint-disable jsx-a11y/iframe-has-title */ -import { FunctionComponent, HTMLAttributes } from 'react'; +import type { FunctionComponent, HTMLAttributes } from 'react'; import { Video } from '../../../../Video'; diff --git a/packages/gamut/src/Markdown/libs/overrides/MarkdownAnchor/index.tsx b/packages/gamut/src/Markdown/libs/overrides/MarkdownAnchor/index.tsx index 0a515dae4b..d9df69ec08 100644 --- a/packages/gamut/src/Markdown/libs/overrides/MarkdownAnchor/index.tsx +++ b/packages/gamut/src/Markdown/libs/overrides/MarkdownAnchor/index.tsx @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/anchor-has-content */ -import { ComponentProps } from 'react'; -import * as React from 'react'; +import type { ComponentProps } from 'react'; +import type * as React from 'react'; import { AnchorBase } from '../../../../Anchor'; diff --git a/packages/gamut/src/Markdown/libs/overrides/Table/index.tsx b/packages/gamut/src/Markdown/libs/overrides/Table/index.tsx index ed41f2a89a..f3fdfe9943 100644 --- a/packages/gamut/src/Markdown/libs/overrides/Table/index.tsx +++ b/packages/gamut/src/Markdown/libs/overrides/Table/index.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { pxRem } from '@skillsoft/gamut-styles'; -import { HTMLAttributes } from 'react'; -import * as React from 'react'; +import type { HTMLAttributes } from 'react'; +import type * as React from 'react'; const TableWrapper = styled.div` border: 1px solid ${({ theme }) => theme.colors['gray-300']}; diff --git a/packages/gamut/src/Markdown/libs/overrides/Video/index.tsx b/packages/gamut/src/Markdown/libs/overrides/Video/index.tsx index a9fefa8046..75cf568422 100644 --- a/packages/gamut/src/Markdown/libs/overrides/Video/index.tsx +++ b/packages/gamut/src/Markdown/libs/overrides/Video/index.tsx @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/iframe-has-title */ -import { TrackProps } from '@vidstack/react'; -import { DetailedHTMLProps, VideoHTMLAttributes } from 'react'; +import type { TrackProps } from '@vidstack/react'; +import type { DetailedHTMLProps, VideoHTMLAttributes } from 'react'; import { Video } from '../../../../Video'; // eslint-disable-next-line @skillsoft/gamut/no-css-standalone diff --git a/packages/gamut/src/Markdown/libs/overrides/index.tsx b/packages/gamut/src/Markdown/libs/overrides/index.tsx index a4f85a5970..982fc59020 100644 --- a/packages/gamut/src/Markdown/libs/overrides/index.tsx +++ b/packages/gamut/src/Markdown/libs/overrides/index.tsx @@ -2,7 +2,7 @@ import styled from '@emotion/styled'; import HtmlToReact from 'html-to-react'; import camelCaseMap from 'html-to-react/lib/camel-case-attribute-names'; import get from 'lodash/get'; -import * as React from 'react'; +import type * as React from 'react'; import { getLabel, isCheckboxParent, isInput, isLabelText } from './utils'; diff --git a/packages/gamut/src/Markdown/libs/overrides/utils.tsx b/packages/gamut/src/Markdown/libs/overrides/utils.tsx index 4e359e2333..228279b2c9 100644 --- a/packages/gamut/src/Markdown/libs/overrides/utils.tsx +++ b/packages/gamut/src/Markdown/libs/overrides/utils.tsx @@ -1,6 +1,6 @@ import find from 'lodash/find'; -import { HTMLToReactNode } from '.'; +import type { HTMLToReactNode } from '.'; export const isCheckboxParent = (node: HTMLToReactNode, type: string) => Boolean( diff --git a/packages/gamut/src/Markdown/libs/preprocessing.ts b/packages/gamut/src/Markdown/libs/preprocessing.ts index 3a398de122..df1ff5aef2 100644 --- a/packages/gamut/src/Markdown/libs/preprocessing.ts +++ b/packages/gamut/src/Markdown/libs/preprocessing.ts @@ -1,6 +1,6 @@ import cx from 'classnames'; -import { HTMLToReactNode } from './overrides'; +import type { HTMLToReactNode } from './overrides'; /** * Preprocessing Instructions: diff --git a/packages/gamut/src/Markdown/styles.ts b/packages/gamut/src/Markdown/styles.ts index 72a592b938..0160958f5d 100644 --- a/packages/gamut/src/Markdown/styles.ts +++ b/packages/gamut/src/Markdown/styles.ts @@ -1,4 +1,5 @@ -import { css, Theme } from '@emotion/react'; +import type { Theme } from '@emotion/react'; +import { css } from '@emotion/react'; // Base markdown styles mixin equivalent const markdownStyle = ( diff --git a/packages/gamut/src/Menu/Menu.tsx b/packages/gamut/src/Menu/Menu.tsx index 279b4d1920..2b69b94635 100644 --- a/packages/gamut/src/Menu/Menu.tsx +++ b/packages/gamut/src/Menu/Menu.tsx @@ -1,4 +1,5 @@ -import { ComponentProps, forwardRef } from 'react'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; import { List } from './elements'; import { MenuProvider, useMenu } from './MenuContext'; diff --git a/packages/gamut/src/Menu/MenuContext.tsx b/packages/gamut/src/Menu/MenuContext.tsx index c96c0c9ddf..175e50a1d8 100644 --- a/packages/gamut/src/Menu/MenuContext.tsx +++ b/packages/gamut/src/Menu/MenuContext.tsx @@ -1,6 +1,6 @@ import { createContext, useContext } from 'react'; -import { ListProps } from '../List'; +import type { ListProps } from '../List'; export interface MenuContextProps { spacing: 'normal' | 'condensed'; diff --git a/packages/gamut/src/Menu/MenuItem.tsx b/packages/gamut/src/Menu/MenuItem.tsx index 35c278168d..21c52811fe 100644 --- a/packages/gamut/src/Menu/MenuItem.tsx +++ b/packages/gamut/src/Menu/MenuItem.tsx @@ -1,22 +1,24 @@ -import { GamutIconProps } from '@skillsoft/gamut-icons'; +import type { GamutIconProps } from '@skillsoft/gamut-icons'; import isString from 'lodash/isString'; -import { +import type { ComponentProps, - forwardRef, MouseEventHandler, - Ref, + Ref} from 'react'; +import { + forwardRef, useId, } from 'react'; import { FlexBox } from '../Box'; -import { ToolTipProps } from '../Tip/ToolTip'; +import type { ToolTipProps } from '../Tip/ToolTip'; import { Text } from '../Typography'; +import type { + ListItemProps, + ListLinkProps} from './elements'; import { ListButton, ListItem, - ListItemProps, ListLink, - ListLinkProps, MenuToolTipWrapper, } from './elements'; import { useMenuContext } from './MenuContext'; diff --git a/packages/gamut/src/Menu/MenuSeparator.tsx b/packages/gamut/src/Menu/MenuSeparator.tsx index 01bbf7ab99..4e65f790ad 100644 --- a/packages/gamut/src/Menu/MenuSeparator.tsx +++ b/packages/gamut/src/Menu/MenuSeparator.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import type * as React from 'react'; import { Box, FlexBox } from '../Box'; -import { FlexBoxProps } from '../Box/props'; +import type { FlexBoxProps } from '../Box/props'; interface MenuSeperatorProps extends FlexBoxProps { children?: never; diff --git a/packages/gamut/src/Menu/elements.tsx b/packages/gamut/src/Menu/elements.tsx index 87ecba632f..f4b106a5f0 100644 --- a/packages/gamut/src/Menu/elements.tsx +++ b/packages/gamut/src/Menu/elements.tsx @@ -4,14 +4,17 @@ import { system, transitionConcat, } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; import isObject from 'lodash/isObject'; -import { ComponentProps, forwardRef } from 'react'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; import { sharedStates } from '../Box/props'; import { resetStyles, Selectors } from '../ButtonBase/ButtonBase'; -import { ToolTip, ToolTipProps } from '../Tip/ToolTip'; -import { MenuItem } from './MenuItem'; +import type { ToolTipProps } from '../Tip/ToolTip'; +import { ToolTip } from '../Tip/ToolTip'; +import type { MenuItem } from './MenuItem'; enum MenuItemSelectors { OUTLINE = '&:after', diff --git a/packages/gamut/src/Modals/Dialog.tsx b/packages/gamut/src/Modals/Dialog.tsx index e6167982a7..abbbe47244 100644 --- a/packages/gamut/src/Modals/Dialog.tsx +++ b/packages/gamut/src/Modals/Dialog.tsx @@ -1,15 +1,17 @@ import { MiniDeleteIcon } from '@skillsoft/gamut-icons'; -import { ComponentProps, useId } from 'react'; -import * as React from 'react'; +import type { ComponentProps} from 'react'; +import type * as React from 'react'; +import { useId } from 'react'; import { Box } from '../Box'; import { FillButton, IconButton, TextButton } from '../Button'; import { Overlay } from '../Overlay'; import { Text } from '../Typography'; import { isNullish } from '../utils/nullish'; -import { ModalContainer, ModalContainerProps } from './elements'; +import type { ModalContainerProps } from './elements'; +import { ModalContainer } from './elements'; import { ImageContainer } from './ImageContainer'; -import { CloseButtonProps, ModalBaseProps } from './types'; +import type { CloseButtonProps, ModalBaseProps } from './types'; interface DialogButtonProps { children: React.ReactNode; diff --git a/packages/gamut/src/Modals/ImageContainer.tsx b/packages/gamut/src/Modals/ImageContainer.tsx index 2eba825ecf..c6bc3321ea 100644 --- a/packages/gamut/src/Modals/ImageContainer.tsx +++ b/packages/gamut/src/Modals/ImageContainer.tsx @@ -1,8 +1,8 @@ -import { ComponentProps } from 'react'; +import type { ComponentProps } from 'react'; import { Box } from '../Box'; -import { ModalContainer } from './elements'; -import { ModalBaseProps } from './types'; +import type { ModalContainer } from './elements'; +import type { ModalBaseProps } from './types'; interface ImageProps extends Pick { size: Exclude< diff --git a/packages/gamut/src/Modals/Modal.tsx b/packages/gamut/src/Modals/Modal.tsx index 8312dfdf45..a2d333c4d7 100644 --- a/packages/gamut/src/Modals/Modal.tsx +++ b/packages/gamut/src/Modals/Modal.tsx @@ -1,14 +1,16 @@ import { MiniDeleteIcon } from '@skillsoft/gamut-icons'; -import { ComponentProps, useId, useState } from 'react'; -import * as React from 'react'; +import type { ComponentProps} from 'react'; +import type * as React from 'react'; +import { useId, useState } from 'react'; import { Box } from '../Box'; -import { ButtonProps, FillButton, IconButton, TextButton } from '../Button'; +import type { ButtonProps} from '../Button'; +import { FillButton, IconButton, TextButton } from '../Button'; import { Overlay } from '../Overlay'; import { Text } from '../Typography'; import { ModalContainer } from './elements'; import { ImageContainer } from './ImageContainer'; -import { CloseButtonProps, ModalBaseProps } from './types'; +import type { CloseButtonProps, ModalBaseProps } from './types'; interface DialogButtonProps { children: React.ReactNode; diff --git a/packages/gamut/src/Modals/elements.tsx b/packages/gamut/src/Modals/elements.tsx index 012dddf97e..eb04199cb8 100644 --- a/packages/gamut/src/Modals/elements.tsx +++ b/packages/gamut/src/Modals/elements.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { variant } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { PatternBackdrop } from '../PatternBackdrop/PatternBackdrop'; import { focusVisibleStyle } from '../utils'; diff --git a/packages/gamut/src/Modals/types.ts b/packages/gamut/src/Modals/types.ts index a7c5ed4b2f..c968924712 100644 --- a/packages/gamut/src/Modals/types.ts +++ b/packages/gamut/src/Modals/types.ts @@ -1,9 +1,9 @@ -import { ComponentProps, Ref } from 'react'; -import * as React from 'react'; +import type { ComponentProps, Ref } from 'react'; +import type * as React from 'react'; -import { OverlayProps } from '../Overlay'; -import { TipCenterAlignment } from '../Tip/shared/types'; -import { ModalContainer } from './elements'; +import type { OverlayProps } from '../Overlay'; +import type { TipCenterAlignment } from '../Tip/shared/types'; +import type { ModalContainer } from './elements'; export interface ModalOverlayProps extends Pick< diff --git a/packages/gamut/src/Overlay/__tests__/Overlay.test.tsx b/packages/gamut/src/Overlay/__tests__/Overlay.test.tsx index bcfc440206..95dcdab451 100644 --- a/packages/gamut/src/Overlay/__tests__/Overlay.test.tsx +++ b/packages/gamut/src/Overlay/__tests__/Overlay.test.tsx @@ -1,7 +1,8 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import { fireEvent } from '@testing-library/react'; -import { Overlay, OverlayProps } from '..'; +import type { OverlayProps } from '..'; +import { Overlay } from '..'; const OverlayTest = (props?: Partial) => { return ( diff --git a/packages/gamut/src/Overlay/index.tsx b/packages/gamut/src/Overlay/index.tsx index 4c25d49d59..886d94a7d5 100644 --- a/packages/gamut/src/Overlay/index.tsx +++ b/packages/gamut/src/Overlay/index.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { states } from '@skillsoft/gamut-styles'; +import type * as React from 'react'; import { useCallback } from 'react'; -import * as React from 'react'; import { BodyPortal } from '../BodyPortal'; import { FlexBox } from '../Box'; diff --git a/packages/gamut/src/Pagination/EllipsisButton.tsx b/packages/gamut/src/Pagination/EllipsisButton.tsx index bb3e4f3693..e2e75c9531 100644 --- a/packages/gamut/src/Pagination/EllipsisButton.tsx +++ b/packages/gamut/src/Pagination/EllipsisButton.tsx @@ -1,7 +1,8 @@ import { forwardRef, useState } from 'react'; -import { ButtonBaseElements } from '../ButtonBase/ButtonBase'; -import { PaginationButton, PaginationButtonProps } from './PaginationButton'; +import type { ButtonBaseElements } from '../ButtonBase/ButtonBase'; +import type { PaginationButtonProps } from './PaginationButton'; +import { PaginationButton } from './PaginationButton'; import { wrapWithSlideAnimation } from './utils'; export type EllipsisButtonProps = PaginationButtonProps & { diff --git a/packages/gamut/src/Pagination/PaginationButton.tsx b/packages/gamut/src/Pagination/PaginationButton.tsx index c71ec30930..e4297477d1 100644 --- a/packages/gamut/src/Pagination/PaginationButton.tsx +++ b/packages/gamut/src/Pagination/PaginationButton.tsx @@ -1,9 +1,10 @@ -import { GamutIconProps } from '@skillsoft/gamut-icons'; -import { StyleProps } from '@skillsoft/variance'; -import { ComponentProps, ComponentType, forwardRef, useMemo } from 'react'; +import type { GamutIconProps } from '@skillsoft/gamut-icons'; +import type { StyleProps } from '@skillsoft/variance'; +import type { ComponentProps, ComponentType} from 'react'; +import { forwardRef, useMemo } from 'react'; import { createButtonComponent } from '../Button/shared'; -import { ButtonBaseElements } from '../ButtonBase/ButtonBase'; +import type { ButtonBaseElements } from '../ButtonBase/ButtonBase'; import { paginationStrokeButtonStates, paginationStrokeVariant, diff --git a/packages/gamut/src/Pagination/__tests__/Pagination.test.tsx b/packages/gamut/src/Pagination/__tests__/Pagination.test.tsx index 7b0c8d75f6..c951f3608c 100644 --- a/packages/gamut/src/Pagination/__tests__/Pagination.test.tsx +++ b/packages/gamut/src/Pagination/__tests__/Pagination.test.tsx @@ -1,5 +1,6 @@ import { setupRtl } from '@skillsoft/gamut-tests'; -import { fireEvent, queries, RenderResult } from '@testing-library/react'; +import type { queries, RenderResult } from '@testing-library/react'; +import { fireEvent } from '@testing-library/react'; import { Pagination } from '..'; diff --git a/packages/gamut/src/Pagination/index.tsx b/packages/gamut/src/Pagination/index.tsx index 64007dac44..2f1afbebc0 100644 --- a/packages/gamut/src/Pagination/index.tsx +++ b/packages/gamut/src/Pagination/index.tsx @@ -3,8 +3,8 @@ import { MiniChevronRightIcon, } from '@skillsoft/gamut-icons'; import { useElementDir } from '@skillsoft/gamut-styles'; +import type * as React from 'react'; import { useMemo, useRef, useState } from 'react'; -import * as React from 'react'; import { Text } from '..'; import { FlexBox } from '../Box'; diff --git a/packages/gamut/src/Pagination/utils.tsx b/packages/gamut/src/Pagination/utils.tsx index e70f9dfd45..d9d24f5083 100644 --- a/packages/gamut/src/Pagination/utils.tsx +++ b/packages/gamut/src/Pagination/utils.tsx @@ -1,10 +1,10 @@ import { timingValues } from '@skillsoft/gamut-styles'; import { AnimatePresence, motion } from 'framer-motion'; +import type * as React from 'react'; import { useEffect, useRef } from 'react'; -import * as React from 'react'; -import { BaseEllipsisButton } from './EllipsisButton'; -import { PaginationButton } from './PaginationButton'; +import type { BaseEllipsisButton } from './EllipsisButton'; +import type { PaginationButton } from './PaginationButton'; const FADE_DURATION_SECONDS = timingValues.base / 1000; diff --git a/packages/gamut/src/PatternBackdrop/PatternBackdrop.tsx b/packages/gamut/src/PatternBackdrop/PatternBackdrop.tsx index 799bf78153..ee8408ffd5 100644 --- a/packages/gamut/src/PatternBackdrop/PatternBackdrop.tsx +++ b/packages/gamut/src/PatternBackdrop/PatternBackdrop.tsx @@ -1,8 +1,10 @@ import styled from '@emotion/styled'; import { CheckerDense } from '@skillsoft/gamut-patterns'; import { styledOptions, system } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; -import { ComponentProps, forwardRef } from 'react'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; import { Box } from '../Box'; diff --git a/packages/gamut/src/Popover/Popover.tsx b/packages/gamut/src/Popover/Popover.tsx index 73b32c96b3..40aa6e48a5 100755 --- a/packages/gamut/src/Popover/Popover.tsx +++ b/packages/gamut/src/Popover/Popover.tsx @@ -17,7 +17,7 @@ import { RaisedDiv, } from './elements'; import { getBeakVariant } from './styles/beak'; -import { PopoverProps } from './types'; +import type { PopoverProps } from './types'; import { getDefaultOffset, resolveHorizontalSideForRtl } from './utils'; export const Popover: React.FC = ({ diff --git a/packages/gamut/src/Popover/__tests__/Popover.test.tsx b/packages/gamut/src/Popover/__tests__/Popover.test.tsx index d5245084a8..ad0eb72a7a 100644 --- a/packages/gamut/src/Popover/__tests__/Popover.test.tsx +++ b/packages/gamut/src/Popover/__tests__/Popover.test.tsx @@ -5,7 +5,8 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import React from 'react'; -import { Popover, PopoverProps } from '..'; +import type { PopoverProps } from '..'; +import { Popover } from '..'; const targetRefObj = { current: { diff --git a/packages/gamut/src/Popover/elements.tsx b/packages/gamut/src/Popover/elements.tsx index 73db70213b..ae0364dcc5 100644 --- a/packages/gamut/src/Popover/elements.tsx +++ b/packages/gamut/src/Popover/elements.tsx @@ -1,14 +1,15 @@ import styled from '@emotion/styled'; import { timingValues, variant } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { AnimatePresence, motion } from 'framer-motion'; import { BodyPortal } from '../BodyPortal'; import { Box, FlexBox } from '../Box'; import { popoverToolTipBodyAlignments } from '../Tip/shared/styles/styles'; -import { WithChildrenProp } from '../utils'; +import type { WithChildrenProp } from '../utils'; +import type { + popoverStates} from './styles/base'; import { - popoverStates, raisedDivVariants, transformValues, } from './styles/base'; @@ -20,7 +21,7 @@ import { patternVariantStyles, widthStates, } from './styles/variants'; -import { PopoverProps } from './types'; +import type { PopoverProps } from './types'; export type PopoverVariants = StyleProps & { widthRestricted?: boolean; diff --git a/packages/gamut/src/Popover/styles/beak.ts b/packages/gamut/src/Popover/styles/beak.ts index 4ed3d4df99..66a219419b 100644 --- a/packages/gamut/src/Popover/styles/beak.ts +++ b/packages/gamut/src/Popover/styles/beak.ts @@ -8,7 +8,7 @@ import { horizontalCenterBeakRtlPopover, tooltipBgColor, } from '../../Tip/shared/styles/styles'; -import { PopoverProps } from '../types'; +import type { PopoverProps } from '../types'; import { popoverPrimaryBgColor } from './base'; const rtlBeakBoxRight = horizontalCenterBeakRtlPopover('right'); diff --git a/packages/gamut/src/Popover/types.tsx b/packages/gamut/src/Popover/types.tsx index 9176cda9d6..4a47715462 100755 --- a/packages/gamut/src/Popover/types.tsx +++ b/packages/gamut/src/Popover/types.tsx @@ -1,7 +1,8 @@ -import { PatternProps } from '@skillsoft/gamut-patterns'; -import { HTMLAttributes, type RefObject } from 'react'; +import type { PatternProps } from '@skillsoft/gamut-patterns'; +import type { HTMLAttributes} from 'react'; +import { type RefObject } from 'react'; -import { PopoverVariants } from './elements'; +import type { PopoverVariants } from './elements'; export type FocusTrapPopoverProps = { /** diff --git a/packages/gamut/src/Popover/utils.ts b/packages/gamut/src/Popover/utils.ts index 1e9d45e408..9e0c593c3e 100644 --- a/packages/gamut/src/Popover/utils.ts +++ b/packages/gamut/src/Popover/utils.ts @@ -1,4 +1,4 @@ -import { PopoverProps } from './types'; +import type { PopoverProps } from './types'; /** * Mirrors horizontal `left` / `right` in RTL when `useLogicalProperties` is enabled diff --git a/packages/gamut/src/PopoverContainer/PopoverContainer.tsx b/packages/gamut/src/PopoverContainer/PopoverContainer.tsx index 7eb30aabd9..b19811c7e2 100644 --- a/packages/gamut/src/PopoverContainer/PopoverContainer.tsx +++ b/packages/gamut/src/PopoverContainer/PopoverContainer.tsx @@ -1,8 +1,8 @@ import styled from '@emotion/styled'; import { elementDir, system, useElementDir } from '@skillsoft/gamut-styles'; import { variance } from '@skillsoft/variance'; +import type * as React from 'react'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import * as React from 'react'; import { useWindowScroll, useWindowSize } from 'react-use'; import { BodyPortal } from '../BodyPortal'; @@ -14,7 +14,7 @@ import { useScrollingParents, useScrollingParentsEffect, } from './hooks'; -import { +import type { PopoverContainerProps, PopoverContainerState, TargetRef, diff --git a/packages/gamut/src/PopoverContainer/__tests__/PopoverContainer.test.tsx b/packages/gamut/src/PopoverContainer/__tests__/PopoverContainer.test.tsx index 9b20843083..3ef6dfb9b5 100644 --- a/packages/gamut/src/PopoverContainer/__tests__/PopoverContainer.test.tsx +++ b/packages/gamut/src/PopoverContainer/__tests__/PopoverContainer.test.tsx @@ -3,7 +3,7 @@ import { cleanup, fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; import { PopoverContainer } from '..'; -import { PopoverContainerProps } from '../types'; +import type { PopoverContainerProps } from '../types'; import * as utils from '../utils'; import { createMockDOMRect, diff --git a/packages/gamut/src/PopoverContainer/types.ts b/packages/gamut/src/PopoverContainer/types.ts index d70994aca8..3d5db77685 100644 --- a/packages/gamut/src/PopoverContainer/types.ts +++ b/packages/gamut/src/PopoverContainer/types.ts @@ -1,7 +1,7 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; -import { FocusTrapProps } from '../FocusTrap'; -import { WithChildrenProp } from '../utils'; +import type { FocusTrapProps } from '../FocusTrap'; +import type { WithChildrenProp } from '../utils'; export type PopoverContainerAlignment = | 'top-left' diff --git a/packages/gamut/src/PopoverContainer/utils.ts b/packages/gamut/src/PopoverContainer/utils.ts index de12fbc155..55bdd50189 100644 --- a/packages/gamut/src/PopoverContainer/utils.ts +++ b/packages/gamut/src/PopoverContainer/utils.ts @@ -1,9 +1,10 @@ +import type { + CSSObject} from '@skillsoft/variance'; import { - CSSObject, percentageOrAbsolute as percent, } from '@skillsoft/variance'; -import { PopoverContainerAlignment, PopoverPositionConfig } from './types'; +import type { PopoverContainerAlignment, PopoverPositionConfig } from './types'; export interface PopoverPositionResult { /** Edge insets pinning the popover to the container (`left` / `right` / `top` / `bottom`). */ diff --git a/packages/gamut/src/ProgressBar/__tests__/ProgressBar.test.tsx b/packages/gamut/src/ProgressBar/__tests__/ProgressBar.test.tsx index 95a58ec683..8f2ebce3b9 100644 --- a/packages/gamut/src/ProgressBar/__tests__/ProgressBar.test.tsx +++ b/packages/gamut/src/ProgressBar/__tests__/ProgressBar.test.tsx @@ -2,7 +2,8 @@ import { DiagonalADense } from '@skillsoft/gamut-patterns'; import { MockGamutProvider, setupRtl } from '@skillsoft/gamut-tests'; import { render, screen } from '@testing-library/react'; -import { ProgressBar, ProgressBarProps } from '..'; +import type { ProgressBarProps } from '..'; +import { ProgressBar } from '..'; const renderView = setupRtl(ProgressBar, { percent: 50, diff --git a/packages/gamut/src/ProgressBar/index.tsx b/packages/gamut/src/ProgressBar/index.tsx index 0158335333..05c0edb710 100644 --- a/packages/gamut/src/ProgressBar/index.tsx +++ b/packages/gamut/src/ProgressBar/index.tsx @@ -1,5 +1,5 @@ import styled from '@emotion/styled'; -import { PatternProps } from '@skillsoft/gamut-patterns'; +import type { PatternProps } from '@skillsoft/gamut-patterns'; import { theme, variant } from '@skillsoft/gamut-styles'; import * as React from 'react'; diff --git a/packages/gamut/src/RadialProgress/index.tsx b/packages/gamut/src/RadialProgress/index.tsx index 6a1b8d6405..8e41ea3374 100644 --- a/packages/gamut/src/RadialProgress/index.tsx +++ b/packages/gamut/src/RadialProgress/index.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { css, theme } from '@skillsoft/gamut-styles'; -import { SVGProps } from 'react'; -import * as React from 'react'; +import type { SVGProps } from 'react'; +import type * as React from 'react'; import { FlexBox } from '../Box'; import { Text } from '../Typography'; diff --git a/packages/gamut/src/SkipToContent/index.tsx b/packages/gamut/src/SkipToContent/index.tsx index ec3a6682b1..27ac58ddb1 100644 --- a/packages/gamut/src/SkipToContent/index.tsx +++ b/packages/gamut/src/SkipToContent/index.tsx @@ -2,7 +2,7 @@ import { css } from '@emotion/react'; import styled from '@emotion/styled'; import { MiniArrowDownIcon } from '@skillsoft/gamut-icons'; import { themed, timing } from '@skillsoft/gamut-styles'; -import * as React from 'react'; +import type * as React from 'react'; import { Box } from '../Box'; diff --git a/packages/gamut/src/Tabs/Tab.tsx b/packages/gamut/src/Tabs/Tab.tsx index ae0baa30f6..5cf76a0d56 100644 --- a/packages/gamut/src/Tabs/Tab.tsx +++ b/packages/gamut/src/Tabs/Tab.tsx @@ -1,12 +1,14 @@ import styled from '@emotion/styled'; -import * as React from 'react'; +import type * as React from 'react'; +import type { + TabProps as ReactAriaTabProps} from 'react-aria-components'; import { - Tab as ReactAriaTab, - TabProps as ReactAriaTabProps, + Tab as ReactAriaTab } from 'react-aria-components'; import { tabElementBaseProps } from './props'; -import { TabButtonProps, tabStates, tabVariants } from './TabButton'; +import type { TabButtonProps} from './TabButton'; +import { tabStates, tabVariants } from './TabButton'; import { useTab } from './TabProvider'; interface TabBaseProps extends TabButtonProps, ReactAriaTabProps {} diff --git a/packages/gamut/src/Tabs/TabButton.tsx b/packages/gamut/src/Tabs/TabButton.tsx index 96cc4ada8b..567930d132 100644 --- a/packages/gamut/src/Tabs/TabButton.tsx +++ b/packages/gamut/src/Tabs/TabButton.tsx @@ -1,11 +1,12 @@ import styled from '@emotion/styled'; import { states, variant } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { ButtonBase } from '../ButtonBase'; +import type { + TabElementStyleProps} from './props'; import { tabElementBaseProps, - TabElementStyleProps, TabSelectors, } from './props'; diff --git a/packages/gamut/src/Tabs/TabList.tsx b/packages/gamut/src/Tabs/TabList.tsx index c49226c644..0337c8f895 100644 --- a/packages/gamut/src/Tabs/TabList.tsx +++ b/packages/gamut/src/Tabs/TabList.tsx @@ -1,13 +1,15 @@ import styled from '@emotion/styled'; -import { StyleProps } from '@skillsoft/variance'; -import * as React from 'react'; -import { - TabList as ReactAriaTabList, +import type { StyleProps } from '@skillsoft/variance'; +import type * as React from 'react'; +import type { TabListProps as ReactAriaTabListProps, - TabProps, + TabProps} from 'react-aria-components'; +import { + TabList as ReactAriaTabList } from 'react-aria-components'; -import { tabElementBaseProps, TabElementStyleProps } from './props'; +import type { TabElementStyleProps } from './props'; +import { tabElementBaseProps } from './props'; import { tabContainerStates, tabContainerVariants } from './styles'; import { useTab } from './TabProvider'; diff --git a/packages/gamut/src/Tabs/TabNav.tsx b/packages/gamut/src/Tabs/TabNav.tsx index a4dfbeaf0e..9298b8d7ee 100644 --- a/packages/gamut/src/Tabs/TabNav.tsx +++ b/packages/gamut/src/Tabs/TabNav.tsx @@ -1,8 +1,9 @@ import styled from '@emotion/styled'; import { styledOptions } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; -import { tabElementBaseProps, TabElementStyleProps } from './props'; +import type { TabElementStyleProps } from './props'; +import { tabElementBaseProps } from './props'; import { tabContainerStates, tabContainerVariants } from './styles'; export interface TabNavProps diff --git a/packages/gamut/src/Tabs/TabNavLink.tsx b/packages/gamut/src/Tabs/TabNavLink.tsx index d0e401d902..f202efa31a 100644 --- a/packages/gamut/src/Tabs/TabNavLink.tsx +++ b/packages/gamut/src/Tabs/TabNavLink.tsx @@ -1,5 +1,5 @@ import styled from '@emotion/styled'; -import { ComponentProps } from 'react'; +import type { ComponentProps } from 'react'; import { TabButton } from './TabButton'; diff --git a/packages/gamut/src/Tabs/TabPanel.tsx b/packages/gamut/src/Tabs/TabPanel.tsx index 07f8d3909d..28e83f3055 100644 --- a/packages/gamut/src/Tabs/TabPanel.tsx +++ b/packages/gamut/src/Tabs/TabPanel.tsx @@ -1,12 +1,14 @@ import styled from '@emotion/styled'; import { system } from '@skillsoft/gamut-styles'; -import * as React from 'react'; +import type * as React from 'react'; +import type { + TabPanelProps as ReactAriaTabPanelProps} from 'react-aria-components'; import { - TabPanel as ReactAriaTabPanel, - TabPanelProps as ReactAriaTabPanelProps, + TabPanel as ReactAriaTabPanel } from 'react-aria-components'; -import { tabElementBaseProps, TabElementStyleProps } from './props'; +import type { TabElementStyleProps } from './props'; +import { tabElementBaseProps } from './props'; interface TabPanelBaseProps extends TabElementStyleProps, diff --git a/packages/gamut/src/Tabs/TabPanels.tsx b/packages/gamut/src/Tabs/TabPanels.tsx index 3965270e3a..f25bafc98a 100644 --- a/packages/gamut/src/Tabs/TabPanels.tsx +++ b/packages/gamut/src/Tabs/TabPanels.tsx @@ -1,6 +1,7 @@ import styled from '@emotion/styled'; -import { tabElementBaseProps, TabElementStyleProps } from './props'; +import type { TabElementStyleProps } from './props'; +import { tabElementBaseProps } from './props'; export interface TabPanelsProps extends TabElementStyleProps {} diff --git a/packages/gamut/src/Tabs/Tabs.tsx b/packages/gamut/src/Tabs/Tabs.tsx index 57773654c3..e8344571b8 100644 --- a/packages/gamut/src/Tabs/Tabs.tsx +++ b/packages/gamut/src/Tabs/Tabs.tsx @@ -1,14 +1,16 @@ import styled from '@emotion/styled'; import { Background } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import * as React from 'react'; +import type { StyleProps } from '@skillsoft/variance'; +import type * as React from 'react'; +import type { + TabsProps as ReactAriaTabsProps} from 'react-aria-components'; import { - Tabs as ReactAriaTabs, - TabsProps as ReactAriaTabsProps, + Tabs as ReactAriaTabs } from 'react-aria-components'; -import { tabElementBaseProps, TabElementStyleProps } from './props'; -import { tabContainerVariants } from './styles'; +import type { TabElementStyleProps } from './props'; +import { tabElementBaseProps } from './props'; +import type { tabContainerVariants } from './styles'; import { TabProvider } from './TabProvider'; export interface TabsBaseProps diff --git a/packages/gamut/src/Tabs/__tests__/Tabs.test.tsx b/packages/gamut/src/Tabs/__tests__/Tabs.test.tsx index 98bd0ee4b3..760059316b 100644 --- a/packages/gamut/src/Tabs/__tests__/Tabs.test.tsx +++ b/packages/gamut/src/Tabs/__tests__/Tabs.test.tsx @@ -2,7 +2,8 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import userEvent from '@testing-library/user-event'; import { act, useState } from 'react'; -import { Tab, TabList, TabPanel, TabPanels, Tabs, TabsProps } from '../index'; +import type { TabsProps } from '../index'; +import { Tab, TabList, TabPanel, TabPanels, Tabs } from '../index'; const FullTabs = (props: TabsProps) => ( diff --git a/packages/gamut/src/Tabs/props.tsx b/packages/gamut/src/Tabs/props.tsx index fa1fa4d979..e33f03e133 100644 --- a/packages/gamut/src/Tabs/props.tsx +++ b/packages/gamut/src/Tabs/props.tsx @@ -1,5 +1,6 @@ import { system } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; export enum TabSelectors { SELECTED = '&[data-selected]', diff --git a/packages/gamut/src/Tag/elements.tsx b/packages/gamut/src/Tag/elements.tsx index 1a3a834d12..2c8b224e42 100644 --- a/packages/gamut/src/Tag/elements.tsx +++ b/packages/gamut/src/Tag/elements.tsx @@ -19,12 +19,13 @@ import { tagWrapperStates, textSizeVariants, } from './styles'; -import { +import type { BaseTagProps, DismissButtonProps, TagAnchorProps, - tagProps, - TagTextProps, + TagTextProps} from './types'; +import { + tagProps } from './types'; export const Outline = styled(FlexBox)(outlineStyling, outlineStates); diff --git a/packages/gamut/src/Tag/index.tsx b/packages/gamut/src/Tag/index.tsx index f08e035963..220f17c6ac 100644 --- a/packages/gamut/src/Tag/index.tsx +++ b/packages/gamut/src/Tag/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import type * as React from 'react'; import { appendIconToContent } from '../helpers'; import { @@ -10,7 +10,7 @@ import { TagLabelWrapper, TagText, } from './elements'; -import { TagProps } from './types'; +import type { TagProps } from './types'; export const Tag: React.FC = ({ children, diff --git a/packages/gamut/src/Tag/types.tsx b/packages/gamut/src/Tag/types.tsx index def135855e..ffbfeae589 100644 --- a/packages/gamut/src/Tag/types.tsx +++ b/packages/gamut/src/Tag/types.tsx @@ -1,10 +1,11 @@ import { system } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; -import { ComponentProps, HTMLProps } from 'react'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; +import type { ComponentProps, HTMLProps } from 'react'; -import { IconComponentType, WithChildrenProp } from '../utils'; -import { DismissButton } from './elements'; -import { +import type { IconComponentType, WithChildrenProp } from '../utils'; +import type { DismissButton } from './elements'; +import type { anchorSizeVariants, anchorVariants, dismissButtonLargeStyling, diff --git a/packages/gamut/src/Tip/InfoTip/InfoTipButton.tsx b/packages/gamut/src/Tip/InfoTip/InfoTipButton.tsx index fc5e3ae4f0..7ae90659cf 100644 --- a/packages/gamut/src/Tip/InfoTip/InfoTipButton.tsx +++ b/packages/gamut/src/Tip/InfoTip/InfoTipButton.tsx @@ -2,14 +2,16 @@ import { MiniInfoCircleIcon, MiniInfoOutlineIcon, } from '@skillsoft/gamut-icons'; -import { ComponentProps, forwardRef } from 'react'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; import { createButtonComponent } from '../../Button/shared'; -import { ButtonBaseElements } from '../../ButtonBase/ButtonBase'; -import { InfoTipProps } from '.'; +import type { ButtonBaseElements } from '../../ButtonBase/ButtonBase'; +import type { InfoTipProps } from '.'; +import type { + InfoButtonStatesProps} from './styles'; import { infoButtonStates, - InfoButtonStatesProps, infoButtonStyles, } from './styles'; diff --git a/packages/gamut/src/Tip/InfoTip/index.tsx b/packages/gamut/src/Tip/InfoTip/index.tsx index 9762e31708..35b28eaa2b 100644 --- a/packages/gamut/src/Tip/InfoTip/index.tsx +++ b/packages/gamut/src/Tip/InfoTip/index.tsx @@ -10,9 +10,10 @@ import { import { getFocusableElements as getFocusableElementsUtil } from '../../utils/focus'; import { FloatingTip } from '../shared/FloatingTip'; import { InlineTip } from '../shared/InlineTip'; -import { +import type { TipBaseAlignment, - TipBaseProps, + TipBaseProps} from '../shared/types'; +import { tipDefaultProps, } from '../shared/types'; import { isFloatingElementOpen } from '../shared/utils'; diff --git a/packages/gamut/src/Tip/InfoTip/styles.tsx b/packages/gamut/src/Tip/InfoTip/styles.tsx index 6afe55bc00..e26bc66475 100644 --- a/packages/gamut/src/Tip/InfoTip/styles.tsx +++ b/packages/gamut/src/Tip/InfoTip/styles.tsx @@ -6,7 +6,7 @@ import { timing, variant, } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { Box } from '../../Box'; import { InteractiveSelectors } from '../../ButtonBase/ButtonBase'; @@ -15,7 +15,7 @@ import { tooltipBgColor, tooltipVariantStyles, } from '../shared/styles/styles'; -import { TipPlacementComponentProps } from '../shared/types'; +import type { TipPlacementComponentProps } from '../shared/types'; const textColor = 'secondary'; diff --git a/packages/gamut/src/Tip/PreviewTip/elements.tsx b/packages/gamut/src/Tip/PreviewTip/elements.tsx index c8adbb4a07..4b68576755 100644 --- a/packages/gamut/src/Tip/PreviewTip/elements.tsx +++ b/packages/gamut/src/Tip/PreviewTip/elements.tsx @@ -9,7 +9,7 @@ import { InteractiveSelectors } from '../../ButtonBase/ButtonBase'; import { Shimmer } from '../../Loading/Shimmer'; import { patternContainerBaseStyles } from '../../Popover/styles/pattern'; import { Text } from '../../Typography'; -import { PreviewTipContent, TipPlacementComponentProps } from '../shared/types'; +import type { PreviewTipContent, TipPlacementComponentProps } from '../shared/types'; import { avatarColumnTemplate, avatarGridTemplate, diff --git a/packages/gamut/src/Tip/PreviewTip/index.tsx b/packages/gamut/src/Tip/PreviewTip/index.tsx index 88421963e2..bf3591d579 100644 --- a/packages/gamut/src/Tip/PreviewTip/index.tsx +++ b/packages/gamut/src/Tip/PreviewTip/index.tsx @@ -1,6 +1,7 @@ -import { +import type { ComponentProps, - FocusEvent, + FocusEvent} from 'react'; +import { useEffect, useId, useMemo, @@ -8,13 +9,15 @@ import { useState, } from 'react'; -import { Anchor, Text } from '../..'; +import type { Anchor} from '../..'; +import { Text } from '../..'; import { FloatingTip } from '../shared/FloatingTip'; import { InlineTip } from '../shared/InlineTip'; -import { +import type { PreviewTipContent, TipBaseAlignment, - TipBaseProps, + TipBaseProps} from '../shared/types'; +import { tipDefaultProps, } from '../shared/types'; import { PreviewTipAnchor } from './elements'; diff --git a/packages/gamut/src/Tip/PreviewTip/utils.ts b/packages/gamut/src/Tip/PreviewTip/utils.ts index c02204ff29..6f3dacbfac 100644 --- a/packages/gamut/src/Tip/PreviewTip/utils.ts +++ b/packages/gamut/src/Tip/PreviewTip/utils.ts @@ -1,4 +1,4 @@ -import { PreviewTipProps } from '.'; +import type { PreviewTipProps } from '.'; export const getPreviewDescription = ({ linkDescription, diff --git a/packages/gamut/src/Tip/ToolTip/elements.tsx b/packages/gamut/src/Tip/ToolTip/elements.tsx index 260d88b208..664e9e78c1 100644 --- a/packages/gamut/src/Tip/ToolTip/elements.tsx +++ b/packages/gamut/src/Tip/ToolTip/elements.tsx @@ -1,5 +1,5 @@ import styled from '@emotion/styled'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { Box } from '../../Box'; import { toolTipAlignmentVariants } from '../shared/styles/styles'; diff --git a/packages/gamut/src/Tip/ToolTip/index.tsx b/packages/gamut/src/Tip/ToolTip/index.tsx index 9b5ef32213..9c7c7e284b 100644 --- a/packages/gamut/src/Tip/ToolTip/index.tsx +++ b/packages/gamut/src/Tip/ToolTip/index.tsx @@ -1,12 +1,13 @@ import { useEffect, useRef, useState } from 'react'; import { Text } from '../../Typography'; -import { WithChildrenProp } from '../../utils'; +import type { WithChildrenProp } from '../../utils'; import { FloatingTip } from '../shared/FloatingTip'; import { InlineTip } from '../shared/InlineTip'; -import { +import type { TipBaseProps, - TipCenterAlignment, + TipCenterAlignment} from '../shared/types'; +import { tipDefaultProps, } from '../shared/types'; diff --git a/packages/gamut/src/Tip/__tests__/helpers.tsx b/packages/gamut/src/Tip/__tests__/helpers.tsx index 441745adc5..d4e776f7b6 100644 --- a/packages/gamut/src/Tip/__tests__/helpers.tsx +++ b/packages/gamut/src/Tip/__tests__/helpers.tsx @@ -1,12 +1,13 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import { act, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { createRef, RefObject } from 'react'; +import type { RefObject } from 'react'; +import { createRef } from 'react'; import { Anchor } from '../../Anchor'; import { Text } from '../../Typography'; -import { InfoTip } from '../InfoTip'; -import { TipPlacements } from '../shared/types'; +import type { InfoTip } from '../InfoTip'; +import type { TipPlacements } from '../shared/types'; type InfoTipView = ReturnType< ReturnType> diff --git a/packages/gamut/src/Tip/__tests__/mocks.tsx b/packages/gamut/src/Tip/__tests__/mocks.tsx index 9ccc2b2811..a06e6800d4 100644 --- a/packages/gamut/src/Tip/__tests__/mocks.tsx +++ b/packages/gamut/src/Tip/__tests__/mocks.tsx @@ -1,9 +1,12 @@ -import { ComponentProps, useState } from 'react'; +import type { ComponentProps} from 'react'; +import { useState } from 'react'; import { FillButton } from '../../Button'; import { Modal } from '../../Modals'; -import { InfoTip, InfoTipProps } from '../InfoTip'; -import { ToolTip, ToolTipProps } from '../ToolTip'; +import type { InfoTipProps } from '../InfoTip'; +import { InfoTip } from '../InfoTip'; +import type { ToolTipProps } from '../ToolTip'; +import { ToolTip } from '../ToolTip'; export const ToolTipMock: React.FC< ToolTipProps & ComponentProps diff --git a/packages/gamut/src/Tip/shared/FloatingTip.tsx b/packages/gamut/src/Tip/shared/FloatingTip.tsx index 3a02df77d8..9fcc92a215 100644 --- a/packages/gamut/src/Tip/shared/FloatingTip.tsx +++ b/packages/gamut/src/Tip/shared/FloatingTip.tsx @@ -1,5 +1,5 @@ +import type * as React from 'react'; import { useCallback, useLayoutEffect, useRef, useState } from 'react'; -import * as React from 'react'; import { useMeasure } from 'react-use'; import { Box } from '../../Box'; @@ -13,7 +13,7 @@ import { getAlignmentStyles, getPopoverAlignmentAndPattern, } from './styles/composeVariantsUtils'; -import { TipWrapperProps } from './types'; +import type { TipWrapperProps } from './types'; import { runWithDelay } from './utils'; type FocusOrMouseEvent = diff --git a/packages/gamut/src/Tip/shared/InlineTip.tsx b/packages/gamut/src/Tip/shared/InlineTip.tsx index 5b3ad0c648..35338001a8 100644 --- a/packages/gamut/src/Tip/shared/InlineTip.tsx +++ b/packages/gamut/src/Tip/shared/InlineTip.tsx @@ -11,7 +11,7 @@ import { } from './elements'; import { getAlignmentStyles } from './styles/composeVariantsUtils'; import { narrowWidth } from './styles/styles'; -import { TipWrapperProps } from './types'; +import type { TipWrapperProps } from './types'; export const InlineTip: React.FC = ({ alignment, diff --git a/packages/gamut/src/Tip/shared/elements.tsx b/packages/gamut/src/Tip/shared/elements.tsx index a45d076fe5..6e5493e92b 100644 --- a/packages/gamut/src/Tip/shared/elements.tsx +++ b/packages/gamut/src/Tip/shared/elements.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { css, states, timing } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { Box, FlexBox } from '../../Box'; import { Selectors } from '../../ButtonBase/ButtonBase'; diff --git a/packages/gamut/src/Tip/shared/popoverAlignmentUtils.ts b/packages/gamut/src/Tip/shared/popoverAlignmentUtils.ts index e0430fef97..3b982cf7b3 100644 --- a/packages/gamut/src/Tip/shared/popoverAlignmentUtils.ts +++ b/packages/gamut/src/Tip/shared/popoverAlignmentUtils.ts @@ -1,11 +1,11 @@ import { CheckerDense } from '@skillsoft/gamut-patterns'; -import { +import type { PopoverProps, PopoverXPositionType, PopoverYPositionType, } from '../../Popover'; -import { TipPlacementComponentProps, TipWrapperProps } from './types'; +import type { TipPlacementComponentProps, TipWrapperProps } from './types'; export const getAlignmentStyles = ({ alignment, diff --git a/packages/gamut/src/Tip/shared/styles/styles.tsx b/packages/gamut/src/Tip/shared/styles/styles.tsx index 7b0ef097c4..2d32e7391f 100644 --- a/packages/gamut/src/Tip/shared/styles/styles.tsx +++ b/packages/gamut/src/Tip/shared/styles/styles.tsx @@ -1,6 +1,6 @@ import { fontSmoothPixel, theme, variant } from '@skillsoft/gamut-styles'; -import { popoverPrimaryBgColor } from '../../../Popover/styles/base'; +import type { popoverPrimaryBgColor } from '../../../Popover/styles/base'; import { tipAlignmentArray } from '../types'; import { createToolTipVariantFromAlignment } from './composeVariantsUtils'; import { createVariantsFromAlignments } from './createVariantsUtils'; diff --git a/packages/gamut/src/Tip/shared/types.tsx b/packages/gamut/src/Tip/shared/types.tsx index 74a075f681..8bffa36b83 100644 --- a/packages/gamut/src/Tip/shared/types.tsx +++ b/packages/gamut/src/Tip/shared/types.tsx @@ -1,6 +1,6 @@ -import { ComponentProps, ReactNode } from 'react'; +import type { ComponentProps, ReactNode } from 'react'; -import { Text } from '../../Typography'; +import type { Text } from '../../Typography'; export const tipBaseAlignmentArray = [ 'bottom-left', diff --git a/packages/gamut/src/Toast/Toast.tsx b/packages/gamut/src/Toast/Toast.tsx index 76a0924655..ff2914a74a 100644 --- a/packages/gamut/src/Toast/Toast.tsx +++ b/packages/gamut/src/Toast/Toast.tsx @@ -1,15 +1,16 @@ import styled from '@emotion/styled'; import { MiniDeleteIcon } from '@skillsoft/gamut-icons'; import { system } from '@skillsoft/gamut-styles'; -import { StyleProps } from '@skillsoft/variance'; -import { ReactNode, useMemo } from 'react'; -import * as React from 'react'; +import type { StyleProps } from '@skillsoft/variance'; +import type { ReactNode} from 'react'; +import type * as React from 'react'; +import { useMemo } from 'react'; import { Box, FlexBox } from '../Box'; import { IconButton } from '../Button/IconButton'; import { PatternBackdrop } from '../PatternBackdrop/PatternBackdrop'; import { Text } from '../Typography'; -import { WithChildrenProp } from '../utils'; +import type { WithChildrenProp } from '../utils'; const layoutVariants = system.variant({ prop: 'layout', diff --git a/packages/gamut/src/Toaster/index.tsx b/packages/gamut/src/Toaster/index.tsx index 84d6090d1f..5d06477b24 100644 --- a/packages/gamut/src/Toaster/index.tsx +++ b/packages/gamut/src/Toaster/index.tsx @@ -1,9 +1,10 @@ -import { ColorMode, ColorModes } from '@skillsoft/gamut-styles'; +import type { ColorModes } from '@skillsoft/gamut-styles'; +import { ColorMode } from '@skillsoft/gamut-styles'; import { AnimatePresence } from 'framer-motion'; -import { ReactNode } from 'react'; -import * as React from 'react'; +import type { ReactNode } from 'react'; +import type * as React from 'react'; -import { ToastProps } from '..'; +import type { ToastProps } from '..'; import { FadeInSlideOut } from '../Animation/FadeInSlideOut'; import { BodyPortal } from '../BodyPortal'; import { Box } from '../Box'; diff --git a/packages/gamut/src/Toggle/elements.tsx b/packages/gamut/src/Toggle/elements.tsx index 2568efeb65..30aaeae5b4 100644 --- a/packages/gamut/src/Toggle/elements.tsx +++ b/packages/gamut/src/Toggle/elements.tsx @@ -7,7 +7,8 @@ import { theme, variant, } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; import { Box } from '../Box'; diff --git a/packages/gamut/src/Toggle/index.tsx b/packages/gamut/src/Toggle/index.tsx index c5e5272652..ed82fee81e 100644 --- a/packages/gamut/src/Toggle/index.tsx +++ b/packages/gamut/src/Toggle/index.tsx @@ -1,5 +1,5 @@ import { Circle, ToggleInput, ToggleLabel, ToggleTrack } from './elements'; -import { ToggleProps } from './types'; +import type { ToggleProps } from './types'; import { getToggleElementProps } from './utils'; export const Toggle = ({ diff --git a/packages/gamut/src/Toggle/types.tsx b/packages/gamut/src/Toggle/types.tsx index 204183fe23..286f63c4bc 100644 --- a/packages/gamut/src/Toggle/types.tsx +++ b/packages/gamut/src/Toggle/types.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import type * as React from 'react'; -import { sizes, ToggleInput, ToggleStyleProps } from './elements'; +import type { sizes, ToggleInput, ToggleStyleProps } from './elements'; export type ToggleSizes = keyof typeof sizes; diff --git a/packages/gamut/src/Toggle/utils.tsx b/packages/gamut/src/Toggle/utils.tsx index cd75f31eb2..0131f14381 100644 --- a/packages/gamut/src/Toggle/utils.tsx +++ b/packages/gamut/src/Toggle/utils.tsx @@ -1,4 +1,4 @@ -import { ToggleInputStyledProps, ToggleProps } from './types'; +import type { ToggleInputStyledProps, ToggleProps } from './types'; export const getToggleElementProps = ({ ariaLabel, diff --git a/packages/gamut/src/Typography/Text.tsx b/packages/gamut/src/Typography/Text.tsx index 793908d389..f96b6bb092 100644 --- a/packages/gamut/src/Typography/Text.tsx +++ b/packages/gamut/src/Typography/Text.tsx @@ -5,8 +5,10 @@ import { system, variant, } from '@skillsoft/gamut-styles'; -import { StyleProps, variance } from '@skillsoft/variance'; -import { ComponentProps, forwardRef } from 'react'; +import type { StyleProps} from '@skillsoft/variance'; +import { variance } from '@skillsoft/variance'; +import type { ComponentProps} from 'react'; +import { forwardRef } from 'react'; import { typographyElementVariants, typographyStyleVariants } from './variants'; diff --git a/packages/gamut/src/Video/__tests__/Video.test.tsx b/packages/gamut/src/Video/__tests__/Video.test.tsx index 5538671566..ea93f1ef44 100644 --- a/packages/gamut/src/Video/__tests__/Video.test.tsx +++ b/packages/gamut/src/Video/__tests__/Video.test.tsx @@ -1,5 +1,5 @@ import { setupRtl } from '@skillsoft/gamut-tests'; -import * as React from 'react'; +import type * as React from 'react'; import { Video } from '..'; diff --git a/packages/gamut/src/Video/index.tsx b/packages/gamut/src/Video/index.tsx index 718a9e83bd..aa3dffba5f 100644 --- a/packages/gamut/src/Video/index.tsx +++ b/packages/gamut/src/Video/index.tsx @@ -1,11 +1,11 @@ -import { PlayerSrc, TrackProps } from '@vidstack/react'; -import { +import type { PlayerSrc, TrackProps } from '@vidstack/react'; +import type { DefaultLayoutTranslations, ThumbnailSrc, } from '@vidstack/react/types/vidstack'; -import * as React from 'react'; +import type * as React from 'react'; import { useState } from 'react'; -import { BaseReactPlayerProps } from 'react-player/base'; +import type { BaseReactPlayerProps } from 'react-player/base'; import { Box } from '../Box'; import { useIsMounted } from '../utils'; diff --git a/packages/gamut/src/Video/lib/VideoLayout.tsx b/packages/gamut/src/Video/lib/VideoLayout.tsx index 684a81ea70..24fcf94989 100644 --- a/packages/gamut/src/Video/lib/VideoLayout.tsx +++ b/packages/gamut/src/Video/lib/VideoLayout.tsx @@ -1,6 +1,6 @@ import { useCurrentMode } from '@skillsoft/gamut-styles'; import { DefaultVideoLayout } from '@vidstack/react/player/layouts/default'; -import { +import type { DefaultLayoutTranslations, ThumbnailSrc, } from '@vidstack/react/types/vidstack'; diff --git a/packages/gamut/src/Video/lib/VidstackPlayer/index.tsx b/packages/gamut/src/Video/lib/VidstackPlayer/index.tsx index 82e465f7a3..55a6f927d9 100644 --- a/packages/gamut/src/Video/lib/VidstackPlayer/index.tsx +++ b/packages/gamut/src/Video/lib/VidstackPlayer/index.tsx @@ -2,23 +2,26 @@ /* eslint-disable @skillsoft/gamut/no-css-standalone */ import './vidstack-styles.css'; -import styled, { CSSObject } from '@emotion/styled'; +import type { CSSObject } from '@emotion/styled'; +import styled from '@emotion/styled'; import { styledOptions } from '@skillsoft/gamut-styles'; +import type { + MediaPlayerInstance, + MediaProviderAdapter} from '@vidstack/react'; import { isYouTubeProvider, MediaPlayer, - MediaPlayerInstance, MediaProvider, - MediaProviderAdapter, Poster, Track, useMediaRemote, useMediaState, } from '@vidstack/react'; -import React, { useRef } from 'react'; +import type React from 'react'; +import { useRef } from 'react'; import { Box } from '../../../Box'; -import { VideoProps } from '../..'; +import type { VideoProps } from '../..'; import { keyboardShortcuts } from '../utils/constants'; import { VideoLayout } from '../VideoLayout'; import { vdsVariables } from './variables'; diff --git a/packages/gamut/src/Video/lib/slotOverrides/index.tsx b/packages/gamut/src/Video/lib/slotOverrides/index.tsx index bab5620c53..5197147bf7 100644 --- a/packages/gamut/src/Video/lib/slotOverrides/index.tsx +++ b/packages/gamut/src/Video/lib/slotOverrides/index.tsx @@ -1,4 +1,4 @@ -import { +import type { DefaultVideoLayoutProps, DefaultVideoLayoutSlots, } from '@vidstack/react/player/layouts/default'; diff --git a/packages/gamut/src/Video/lib/utils/constants.ts b/packages/gamut/src/Video/lib/utils/constants.ts index 8023f3cbee..c4b9f7f0c8 100644 --- a/packages/gamut/src/Video/lib/utils/constants.ts +++ b/packages/gamut/src/Video/lib/utils/constants.ts @@ -1,5 +1,5 @@ -import { MediaKeyShortcuts } from '@vidstack/react'; -import { DefaultLayoutTranslations } from '@vidstack/react/types/vidstack'; +import type { MediaKeyShortcuts } from '@vidstack/react'; +import type { DefaultLayoutTranslations } from '@vidstack/react/types/vidstack'; export const keyboardShortcuts: MediaKeyShortcuts = { togglePaused: 'k Space', diff --git a/packages/gamut/src/Video/lib/utils/icons.tsx b/packages/gamut/src/Video/lib/utils/icons.tsx index f78216b8f2..4f2c94b9aa 100644 --- a/packages/gamut/src/Video/lib/utils/icons.tsx +++ b/packages/gamut/src/Video/lib/utils/icons.tsx @@ -17,9 +17,10 @@ import { VolumeControlMediumIcon, VolumeControlMuteIcon, } from '@skillsoft/gamut-icons'; -import { +import type { DefaultLayoutIcon, - DefaultLayoutIcons, + DefaultLayoutIcons} from '@vidstack/react/player/layouts/default'; +import { defaultLayoutIcons, } from '@vidstack/react/player/layouts/default'; diff --git a/packages/gamut/src/helpers/appendIconToContent.tsx b/packages/gamut/src/helpers/appendIconToContent.tsx index 77d5be48e1..8f4bb32e4f 100644 --- a/packages/gamut/src/helpers/appendIconToContent.tsx +++ b/packages/gamut/src/helpers/appendIconToContent.tsx @@ -1,5 +1,5 @@ import { Box, FlexBox } from '../Box'; -import { IconComponentType, WithChildrenProp } from '../utils'; +import type { IconComponentType, WithChildrenProp } from '../utils'; import { pixelToEm } from './pixelToEmCalc'; export interface AppendedIconProps diff --git a/packages/gamut/src/utils/generateResponsiveClassnames.ts b/packages/gamut/src/utils/generateResponsiveClassnames.ts index 33049fe3ed..476dd52651 100644 --- a/packages/gamut/src/utils/generateResponsiveClassnames.ts +++ b/packages/gamut/src/utils/generateResponsiveClassnames.ts @@ -3,7 +3,7 @@ * to match the styleMaps classes returning a concatenated classname string */ -import { +import type { OptionalResponsiveProperty, ResponsiveProperty, } from '../typings/responsive-properties'; diff --git a/packages/gamut/src/utils/types.ts b/packages/gamut/src/utils/types.ts index 3942465d17..8d87a58b18 100644 --- a/packages/gamut/src/utils/types.ts +++ b/packages/gamut/src/utils/types.ts @@ -1,4 +1,4 @@ -import { GamutIconProps } from '@skillsoft/gamut-icons'; +import type { GamutIconProps } from '@skillsoft/gamut-icons'; export interface WithChildrenProp { children?: React.ReactNode | React.ReactNode[]; diff --git a/packages/styleguide/src/lib/Atoms/Animations/ExpandInCollapseOut/ExpandInCollapseOut.stories.tsx b/packages/styleguide/src/lib/Atoms/Animations/ExpandInCollapseOut/ExpandInCollapseOut.stories.tsx index bd8a911cc2..6b85de2417 100644 --- a/packages/styleguide/src/lib/Atoms/Animations/ExpandInCollapseOut/ExpandInCollapseOut.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/Animations/ExpandInCollapseOut/ExpandInCollapseOut.stories.tsx @@ -6,7 +6,8 @@ import { } from '@skillsoft/gamut'; import type { Meta } from '@storybook/react'; import { AnimatePresence } from 'framer-motion'; -import { PropsWithChildren, useState } from 'react'; +import type { PropsWithChildren} from 'react'; +import { useState } from 'react'; const meta: Meta = { component: ExpandInCollapseOut, diff --git a/packages/styleguide/src/lib/Atoms/Animations/Rotation/Rotation.stories.tsx b/packages/styleguide/src/lib/Atoms/Animations/Rotation/Rotation.stories.tsx index 11aa89d009..ba132f3c10 100644 --- a/packages/styleguide/src/lib/Atoms/Animations/Rotation/Rotation.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/Animations/Rotation/Rotation.stories.tsx @@ -1,7 +1,8 @@ import { Rotation, StrokeButton } from '@skillsoft/gamut'; import { MiniChevronDownIcon } from '@skillsoft/gamut-icons'; import type { Meta } from '@storybook/react'; -import { ComponentProps, useEffect, useState } from 'react'; +import type { ComponentProps} from 'react'; +import { useEffect, useState } from 'react'; const meta: Meta = { component: Rotation, diff --git a/packages/styleguide/src/lib/Atoms/Badge/examples.tsx b/packages/styleguide/src/lib/Atoms/Badge/examples.tsx index 3c2c13f269..1fa5b2d320 100644 --- a/packages/styleguide/src/lib/Atoms/Badge/examples.tsx +++ b/packages/styleguide/src/lib/Atoms/Badge/examples.tsx @@ -1,5 +1,6 @@ import styled from '@emotion/styled'; -import { Badge, BadgeProps, Box } from '@skillsoft/gamut'; +import type { BadgeProps} from '@skillsoft/gamut'; +import { Badge, Box } from '@skillsoft/gamut'; import { MiniStarIcon } from '@skillsoft/gamut-icons'; import { css } from '@skillsoft/gamut-styles'; diff --git a/packages/styleguide/src/lib/Atoms/Drawer/Drawer.stories.tsx b/packages/styleguide/src/lib/Atoms/Drawer/Drawer.stories.tsx index 752c96adf7..aabc580630 100644 --- a/packages/styleguide/src/lib/Atoms/Drawer/Drawer.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/Drawer/Drawer.stories.tsx @@ -1,6 +1,7 @@ import { Drawer, FlexBox, StrokeButton } from '@skillsoft/gamut'; import type { Meta } from '@storybook/react'; -import { ComponentProps, useEffect, useState } from 'react'; +import type { ComponentProps} from 'react'; +import { useEffect, useState } from 'react'; const meta: Meta = { component: Drawer, diff --git a/packages/styleguide/src/lib/Atoms/FormInputs/Checkbox/Checkbox.stories.tsx b/packages/styleguide/src/lib/Atoms/FormInputs/Checkbox/Checkbox.stories.tsx index 239c05a3b1..fce0fc04ad 100644 --- a/packages/styleguide/src/lib/Atoms/FormInputs/Checkbox/Checkbox.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/FormInputs/Checkbox/Checkbox.stories.tsx @@ -1,8 +1,9 @@ +import type { + CheckboxProps} from '@skillsoft/gamut'; import { Anchor, Box, Checkbox, - CheckboxProps, Column, FlexBox, LayoutGrid, diff --git a/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx b/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx index 8cfb3c712d..db9b0ec5b7 100644 --- a/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx @@ -1,6 +1,8 @@ import { FormGroup, Radio, RadioGroup } from '@skillsoft/gamut'; import type { Meta, StoryObj } from '@storybook/react'; -import React, { ChangeEvent, useState } from 'react'; +import type { ChangeEvent} from 'react'; +import type React from 'react'; +import { useState } from 'react'; import type { TypeWithDeepControls } from 'storybook-addon-deep-controls'; import { infotipNestedArgTypes } from '~styleguide/argTypes'; diff --git a/packages/styleguide/src/lib/Atoms/Icons/Mini/Mini.stories.tsx b/packages/styleguide/src/lib/Atoms/Icons/Mini/Mini.stories.tsx index 478d023c4e..dee3f3318a 100644 --- a/packages/styleguide/src/lib/Atoms/Icons/Mini/Mini.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/Icons/Mini/Mini.stories.tsx @@ -1,8 +1,8 @@ -import { GamutIconProps } from '@skillsoft/gamut-icons'; +import type { GamutIconProps } from '@skillsoft/gamut-icons'; // eslint-disable-next-line @skillsoft/gamut/import-paths import * as miniIcons from '@skillsoft/gamut-icons/src/icons/mini'; import type { Meta, StoryObj } from '@storybook/react'; -import React from 'react'; +import type React from 'react'; import { ImageGallery } from '~styleguide/blocks'; diff --git a/packages/styleguide/src/lib/Atoms/Icons/Regular/Regular.stories.tsx b/packages/styleguide/src/lib/Atoms/Icons/Regular/Regular.stories.tsx index e9c0fce632..560081fb4c 100644 --- a/packages/styleguide/src/lib/Atoms/Icons/Regular/Regular.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/Icons/Regular/Regular.stories.tsx @@ -1,4 +1,4 @@ -import { GamutIconProps } from '@skillsoft/gamut-icons'; +import type { GamutIconProps } from '@skillsoft/gamut-icons'; // eslint-disable-next-line @skillsoft/gamut/import-paths import * as icons from '@skillsoft/gamut-icons/src/icons/regular'; import type { Meta, StoryObj } from '@storybook/react'; diff --git a/packages/styleguide/src/lib/Atoms/PopoverContainer/PopoverContainer.stories.tsx b/packages/styleguide/src/lib/Atoms/PopoverContainer/PopoverContainer.stories.tsx index 09158a8e3c..06893f35ee 100644 --- a/packages/styleguide/src/lib/Atoms/PopoverContainer/PopoverContainer.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/PopoverContainer/PopoverContainer.stories.tsx @@ -1,7 +1,8 @@ import { FlexBox, PopoverContainer, Text } from '@skillsoft/gamut'; import { Background } from '@skillsoft/gamut-styles'; import type { Meta } from '@storybook/react'; -import { ComponentProps, useRef } from 'react'; +import type { ComponentProps} from 'react'; +import { useRef } from 'react'; const meta: Meta = { component: PopoverContainer, diff --git a/packages/styleguide/src/lib/Atoms/UtilityComponents/DelayedRenderWrapper/DelayedRenderWrapper.stories.tsx b/packages/styleguide/src/lib/Atoms/UtilityComponents/DelayedRenderWrapper/DelayedRenderWrapper.stories.tsx index 6f2990040b..59e674f0ac 100644 --- a/packages/styleguide/src/lib/Atoms/UtilityComponents/DelayedRenderWrapper/DelayedRenderWrapper.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/UtilityComponents/DelayedRenderWrapper/DelayedRenderWrapper.stories.tsx @@ -6,7 +6,8 @@ import { Text, } from '@skillsoft/gamut'; import type { Meta } from '@storybook/react'; -import { ComponentProps, useState } from 'react'; +import type { ComponentProps} from 'react'; +import { useState } from 'react'; const meta: Meta = { component: DelayedRenderWrapper, diff --git a/packages/styleguide/src/lib/Atoms/UtilityComponents/FocusTrap/FocusTrap.stories.tsx b/packages/styleguide/src/lib/Atoms/UtilityComponents/FocusTrap/FocusTrap.stories.tsx index 0d7fccf331..62056ad9e2 100644 --- a/packages/styleguide/src/lib/Atoms/UtilityComponents/FocusTrap/FocusTrap.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/UtilityComponents/FocusTrap/FocusTrap.stories.tsx @@ -1,6 +1,7 @@ import { Box, FillButton, FocusTrap, GridForm } from '@skillsoft/gamut'; import type { Meta } from '@storybook/react'; -import { ComponentProps, useEffect, useState } from 'react'; +import type { ComponentProps} from 'react'; +import { useEffect, useState } from 'react'; const meta: Meta = { component: FocusTrap, diff --git a/packages/styleguide/src/lib/Foundations/ColorMode/examples.tsx b/packages/styleguide/src/lib/Foundations/ColorMode/examples.tsx index af7df6c32b..7a6d53f1a5 100644 --- a/packages/styleguide/src/lib/Foundations/ColorMode/examples.tsx +++ b/packages/styleguide/src/lib/Foundations/ColorMode/examples.tsx @@ -1,7 +1,8 @@ +import type { + ButtonProps} from '@skillsoft/gamut'; import { Anchor, Box, - ButtonProps, Checkbox, CTAButton, FillButton, @@ -28,8 +29,9 @@ import { ColorMode, usePrefersDarkMode, } from '@skillsoft/gamut-styles'; -import { ComponentProps, useState } from 'react'; -import * as React from 'react'; +import type { ComponentProps} from 'react'; +import type * as React from 'react'; +import { useState } from 'react'; const renderText = () => ( diff --git a/packages/styleguide/src/lib/Foundations/Utilities/boxShadow.tsx b/packages/styleguide/src/lib/Foundations/Utilities/boxShadow.tsx index ecbec1c725..45f7e44f43 100644 --- a/packages/styleguide/src/lib/Foundations/Utilities/boxShadow.tsx +++ b/packages/styleguide/src/lib/Foundations/Utilities/boxShadow.tsx @@ -1,4 +1,4 @@ -import { SerializedStyles } from '@emotion/react'; +import type { SerializedStyles } from '@emotion/react'; import styled from '@emotion/styled'; import { GridBox } from '@skillsoft/gamut'; import { boxShadow } from '@skillsoft/gamut-styles'; diff --git a/packages/styleguide/src/lib/Foundations/shared/elements.tsx b/packages/styleguide/src/lib/Foundations/shared/elements.tsx index 1aea47762d..d5e9eb0370 100644 --- a/packages/styleguide/src/lib/Foundations/shared/elements.tsx +++ b/packages/styleguide/src/lib/Foundations/shared/elements.tsx @@ -1,11 +1,13 @@ -import { Theme, useTheme } from '@emotion/react'; +import type { Theme} from '@emotion/react'; +import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { Anchor, Box } from '@skillsoft/gamut'; +import type { + ElevationState} from '@skillsoft/gamut-styles'; import { Background, coreSwatches, css, - ElevationState, lxStudioColors, theme, trueColors, diff --git a/packages/styleguide/src/lib/Layouts/LayoutGrid/examples.tsx b/packages/styleguide/src/lib/Layouts/LayoutGrid/examples.tsx index 71eb0adb32..1a54ad5c77 100644 --- a/packages/styleguide/src/lib/Layouts/LayoutGrid/examples.tsx +++ b/packages/styleguide/src/lib/Layouts/LayoutGrid/examples.tsx @@ -1,5 +1,6 @@ import styled from '@emotion/styled'; -import { Column, ColumnProps } from '@skillsoft/gamut'; +import type { ColumnProps } from '@skillsoft/gamut'; +import { Column } from '@skillsoft/gamut'; import { css } from '@skillsoft/gamut-styles'; export const columns = [ diff --git a/packages/styleguide/src/lib/Molecules/Coachmark/Coachmark.stories.tsx b/packages/styleguide/src/lib/Molecules/Coachmark/Coachmark.stories.tsx index 7c60d6e959..92ac244113 100644 --- a/packages/styleguide/src/lib/Molecules/Coachmark/Coachmark.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Coachmark/Coachmark.stories.tsx @@ -1,7 +1,8 @@ import { Coachmark, FillButton, FlexBox, Text } from '@skillsoft/gamut'; import * as patterns from '@skillsoft/gamut-patterns'; import type { Meta, StoryObj } from '@storybook/react'; -import { ComponentProps, useEffect, useState } from 'react'; +import type { ComponentProps} from 'react'; +import { useEffect, useState } from 'react'; import type { TypeWithDeepControls } from 'storybook-addon-deep-controls'; const meta: TypeWithDeepControls> = { diff --git a/packages/styleguide/src/lib/Molecules/Disclosure/Disclosure.stories.tsx b/packages/styleguide/src/lib/Molecules/Disclosure/Disclosure.stories.tsx index cbac8d4008..0ddc44a32c 100644 --- a/packages/styleguide/src/lib/Molecules/Disclosure/Disclosure.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Disclosure/Disclosure.stories.tsx @@ -1,5 +1,7 @@ -import { Disclosure, FlexBox, Text, WithChildrenProp } from '@skillsoft/gamut'; -import { Background, BackgroundProps } from '@skillsoft/gamut-styles'; +import type { WithChildrenProp } from '@skillsoft/gamut'; +import { Disclosure, FlexBox, Text } from '@skillsoft/gamut'; +import type { BackgroundProps } from '@skillsoft/gamut-styles'; +import { Background } from '@skillsoft/gamut-styles'; import type { Meta, StoryObj } from '@storybook/react'; const meta: Meta = { diff --git a/packages/styleguide/src/lib/Molecules/Flyout/Flyout.stories.tsx b/packages/styleguide/src/lib/Molecules/Flyout/Flyout.stories.tsx index 58a3c30040..3055073a4a 100644 --- a/packages/styleguide/src/lib/Molecules/Flyout/Flyout.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Flyout/Flyout.stories.tsx @@ -1,6 +1,7 @@ import { Box, FlexBox, Flyout, StrokeButton } from '@skillsoft/gamut'; import type { Meta } from '@storybook/react'; -import { ComponentProps, useEffect, useState } from 'react'; +import type { ComponentProps} from 'react'; +import { useEffect, useState } from 'react'; const meta: Meta = { component: Flyout, diff --git a/packages/styleguide/src/lib/Molecules/Modals/Dialog/Dialog.stories.tsx b/packages/styleguide/src/lib/Molecules/Modals/Dialog/Dialog.stories.tsx index d8df8de910..448abd5e9c 100644 --- a/packages/styleguide/src/lib/Molecules/Modals/Dialog/Dialog.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Modals/Dialog/Dialog.stories.tsx @@ -8,7 +8,8 @@ import { } from '@skillsoft/gamut'; import { ColorMode } from '@skillsoft/gamut-styles'; import type { Meta } from '@storybook/react'; -import { ComponentProps, useEffect, useRef, useState } from 'react'; +import type { ComponentProps} from 'react'; +import { useEffect, useRef, useState } from 'react'; import type { TypeWithDeepControls } from 'storybook-addon-deep-controls'; import { closeButtonPropsArgTypes } from '~styleguide/argTypes'; diff --git a/packages/styleguide/src/lib/Molecules/Modals/Modal/Modal.stories.tsx b/packages/styleguide/src/lib/Molecules/Modals/Modal/Modal.stories.tsx index ee64a538c1..37831ec2aa 100644 --- a/packages/styleguide/src/lib/Molecules/Modals/Modal/Modal.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Modals/Modal/Modal.stories.tsx @@ -9,7 +9,9 @@ import { } from '@skillsoft/gamut'; import { CodeCelebration } from '@skillsoft/gamut-illustrations'; import type { Meta } from '@storybook/react'; -import React, { ComponentProps, useEffect, useRef, useState } from 'react'; +import type { ComponentProps} from 'react'; +import type React from 'react'; +import { useEffect, useRef, useState } from 'react'; import type { TypeWithDeepControls } from 'storybook-addon-deep-controls'; import { closeButtonPropsArgTypes } from '~styleguide/argTypes'; diff --git a/packages/styleguide/src/lib/Molecules/Pagination/Pagination.stories.tsx b/packages/styleguide/src/lib/Molecules/Pagination/Pagination.stories.tsx index d9530c5c7e..f7075a09ab 100644 --- a/packages/styleguide/src/lib/Molecules/Pagination/Pagination.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Pagination/Pagination.stories.tsx @@ -1,9 +1,10 @@ +import type { + PaginationProps} from '@skillsoft/gamut'; import { FlexBox, FormGroup, Input, - Pagination, - PaginationProps, + Pagination } from '@skillsoft/gamut'; import type { Meta, StoryObj } from '@storybook/react'; import { useCallback, useState } from 'react'; diff --git a/packages/styleguide/src/lib/Molecules/Popover/Popover.stories.tsx b/packages/styleguide/src/lib/Molecules/Popover/Popover.stories.tsx index 3b57ee9abc..1ee66fbfa1 100644 --- a/packages/styleguide/src/lib/Molecules/Popover/Popover.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Popover/Popover.stories.tsx @@ -1,10 +1,11 @@ +import type { + FlexBoxProps, + PopoverProps} from '@skillsoft/gamut'; import { Box, FillButton, FlexBox, - FlexBoxProps, - Popover, - PopoverProps, + Popover } from '@skillsoft/gamut'; import * as patterns from '@skillsoft/gamut-patterns'; import type { Meta, StoryObj } from '@storybook/react'; diff --git a/packages/styleguide/src/lib/Organisms/BarChart/BarChart.stories.tsx b/packages/styleguide/src/lib/Organisms/BarChart/BarChart.stories.tsx index 8bfb81ab20..f833e14aa1 100644 --- a/packages/styleguide/src/lib/Organisms/BarChart/BarChart.stories.tsx +++ b/packages/styleguide/src/lib/Organisms/BarChart/BarChart.stories.tsx @@ -1,8 +1,9 @@ +import type { + BarProps, + PartialBarChartTranslations} from '@skillsoft/gamut'; import { BarChart, - BarProps, - Box, - PartialBarChartTranslations, + Box } from '@skillsoft/gamut'; import { BookFlipPageIcon, diff --git a/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.stories.tsx b/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.stories.tsx index eb3e661f61..a05077c07f 100644 --- a/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.stories.tsx +++ b/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.stories.tsx @@ -1,7 +1,8 @@ +import type { + ConnectedFormGroupProps} from '@skillsoft/gamut'; import { ConnectedForm, ConnectedFormGroup, - ConnectedFormGroupProps, ConnectedInput, ConnectedRadioGroupInput, Text, diff --git a/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormInputs/ConnectedFormInputsTable.tsx b/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormInputs/ConnectedFormInputsTable.tsx index 5047686c33..3ec8138adb 100644 --- a/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormInputs/ConnectedFormInputsTable.tsx +++ b/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormInputs/ConnectedFormInputsTable.tsx @@ -1,5 +1,5 @@ import { Box, List, ListCol, ListRow, Text } from '@skillsoft/gamut'; -import * as React from 'react'; +import type * as React from 'react'; import { LinkTo } from '~styleguide/blocks'; diff --git a/packages/styleguide/src/lib/Organisms/ListsAndTables/DataTable/DataTable.stories.tsx b/packages/styleguide/src/lib/Organisms/ListsAndTables/DataTable/DataTable.stories.tsx index 16e7da8fac..b66735c094 100644 --- a/packages/styleguide/src/lib/Organisms/ListsAndTables/DataTable/DataTable.stories.tsx +++ b/packages/styleguide/src/lib/Organisms/ListsAndTables/DataTable/DataTable.stories.tsx @@ -167,6 +167,7 @@ export const EmptyStateCustom: Story = { export const LoadingRows: Story = { args: { loading: true, shadow: true }, + tags: ['skip'], }; export const Scrollable: Story = { diff --git a/packages/styleguide/src/lib/Organisms/ListsAndTables/examples.tsx b/packages/styleguide/src/lib/Organisms/ListsAndTables/examples.tsx index 54e2f6d8eb..58836b4334 100644 --- a/packages/styleguide/src/lib/Organisms/ListsAndTables/examples.tsx +++ b/packages/styleguide/src/lib/Organisms/ListsAndTables/examples.tsx @@ -1,6 +1,7 @@ +import type { + ColumnConfig} from '@skillsoft/gamut'; import { Box, - ColumnConfig, DataList, DataTable, FillButton, @@ -20,7 +21,8 @@ import { } from '@skillsoft/gamut-icons'; import { BlueprintWhite } from '@skillsoft/gamut-illustrations'; import uniq from 'lodash/uniq'; -import React, { useCallback, useMemo, useRef, useState } from 'react'; +import type React from 'react'; +import { useCallback, useMemo, useRef, useState } from 'react'; interface MenuItemConfig { action: string; diff --git a/packages/styleguide/src/lib/Organisms/Markdown/Markdown.stories.tsx b/packages/styleguide/src/lib/Organisms/Markdown/Markdown.stories.tsx index be82158090..a766753eba 100644 --- a/packages/styleguide/src/lib/Organisms/Markdown/Markdown.stories.tsx +++ b/packages/styleguide/src/lib/Organisms/Markdown/Markdown.stories.tsx @@ -1,4 +1,5 @@ -import { Markdown, Text, TextProps } from '@skillsoft/gamut'; +import type { TextProps } from '@skillsoft/gamut'; +import { Markdown, Text } from '@skillsoft/gamut'; import type { Meta, StoryObj } from '@storybook/react'; // `?raw` (Vite built-in) imports the file's contents as a string to feed the diff --git a/packages/styleguide/src/lib/Typography/Anchor/Anchor.examples.tsx b/packages/styleguide/src/lib/Typography/Anchor/Anchor.examples.tsx index e403556e14..a7091ddb80 100644 --- a/packages/styleguide/src/lib/Typography/Anchor/Anchor.examples.tsx +++ b/packages/styleguide/src/lib/Typography/Anchor/Anchor.examples.tsx @@ -1,6 +1,7 @@ +import type { + AnchorProps} from '@skillsoft/gamut'; import { Anchor, - AnchorProps, Box, Column, FlexBox, diff --git a/packages/variance/integration/__tests__/component.test.tsx b/packages/variance/integration/__tests__/component.test.tsx index e335548462..ba8d0f77c3 100644 --- a/packages/variance/integration/__tests__/component.test.tsx +++ b/packages/variance/integration/__tests__/component.test.tsx @@ -2,8 +2,8 @@ import { matchers } from '@emotion/jest'; import { ThemeProvider } from '@emotion/react'; import styled from '@emotion/styled'; import { render } from '@testing-library/react'; -import { ComponentProps } from 'react'; -import * as React from 'react'; +import type { ComponentProps } from 'react'; +import type * as React from 'react'; import { variance } from '../../src/core'; import { theme } from '../__fixtures__/theme'; diff --git a/packages/variance/integration/__tests__/variance.test.ts b/packages/variance/integration/__tests__/variance.test.ts index e7cfbed6cb..8b14c488cd 100644 --- a/packages/variance/integration/__tests__/variance.test.ts +++ b/packages/variance/integration/__tests__/variance.test.ts @@ -1,4 +1,4 @@ -import { Theme } from '@emotion/react'; +import type { Theme } from '@emotion/react'; import { variance } from '../../src/core'; import { createScale } from '../../src/scales/createScale'; diff --git a/packages/variance/integration/index.ts b/packages/variance/integration/index.ts index 7f5d5ed440..21924cd7c7 100644 --- a/packages/variance/integration/index.ts +++ b/packages/variance/integration/index.ts @@ -1,4 +1,4 @@ -import { theme } from './__fixtures__/theme'; +import type { theme } from './__fixtures__/theme'; type LocalTheme = typeof theme; diff --git a/packages/variance/src/core.ts b/packages/variance/src/core.ts index db6debbffa..82aa32a2fd 100644 --- a/packages/variance/src/core.ts +++ b/packages/variance/src/core.ts @@ -6,7 +6,7 @@ import isUndefined from 'lodash/isUndefined'; import merge from 'lodash/merge'; import { createScaleLookup } from './scales/createScaleLookup'; -import { +import type { AbstractParser, AbstractPropTransformer, Compose, @@ -18,8 +18,8 @@ import { TransformerMap, Variant, } from './types/config'; -import { DirectionalProperties } from './types/properties'; -import { BreakpointCache, CSSObject, ThemeProps } from './types/props'; +import type { DirectionalProperties } from './types/properties'; +import type { BreakpointCache, CSSObject, ThemeProps } from './types/props'; import { getStaticCss } from './utils/getStaticProperties'; import { orderPropNames } from './utils/propNames'; import { diff --git a/packages/variance/src/createTheme/createTheme.ts b/packages/variance/src/createTheme/createTheme.ts index d588d06b3e..f308fd41e2 100644 --- a/packages/variance/src/createTheme/createTheme.ts +++ b/packages/variance/src/createTheme/createTheme.ts @@ -1,11 +1,13 @@ import mapValues from 'lodash/mapValues'; import merge from 'lodash/merge'; -import { CSSObject } from '../types/props'; -import { AbstractTheme } from '../types/theme'; -import { flattenScale, LiteralPaths } from '../utils/flattenScale'; -import { KeyAsVariable, serializeTokens } from '../utils/serializeTokens'; -import { ColorModeConfig, Merge, MergeTheme, PrivateThemeKeys } from './types'; +import type { CSSObject } from '../types/props'; +import type { AbstractTheme } from '../types/theme'; +import type { LiteralPaths } from '../utils/flattenScale'; +import { flattenScale } from '../utils/flattenScale'; +import type { KeyAsVariable} from '../utils/serializeTokens'; +import { serializeTokens } from '../utils/serializeTokens'; +import type { ColorModeConfig, Merge, MergeTheme, PrivateThemeKeys } from './types'; class ThemeBuilder { #theme = {} as T; diff --git a/packages/variance/src/createTheme/types.ts b/packages/variance/src/createTheme/types.ts index 9a8c2c5fa4..b71a46727c 100644 --- a/packages/variance/src/createTheme/types.ts +++ b/packages/variance/src/createTheme/types.ts @@ -1,5 +1,5 @@ -import { CSSObject } from '../types/props'; -import { AbstractTheme } from '../types/theme'; +import type { CSSObject } from '../types/props'; +import type { AbstractTheme } from '../types/theme'; /** * This is a custom generic that ensures the safety of adding additional values to a theme object without accidentally wiping out diff --git a/packages/variance/src/getPropertyMode/getPropertyMode.ts b/packages/variance/src/getPropertyMode/getPropertyMode.ts index 6b2507fc99..473ee6146a 100644 --- a/packages/variance/src/getPropertyMode/getPropertyMode.ts +++ b/packages/variance/src/getPropertyMode/getPropertyMode.ts @@ -1,4 +1,4 @@ -import { PropertyMode } from '../types/properties'; +import type { PropertyMode } from '../types/properties'; export const getPropertyMode = ( useLogicalProperties: boolean diff --git a/packages/variance/src/scales/createScaleLookup.ts b/packages/variance/src/scales/createScaleLookup.ts index f551d51002..4467de3041 100644 --- a/packages/variance/src/scales/createScaleLookup.ts +++ b/packages/variance/src/scales/createScaleLookup.ts @@ -3,8 +3,8 @@ import isArray from 'lodash/isArray'; import isObject from 'lodash/isObject'; import isString from 'lodash/isString'; -import { Prop } from '../types/config'; -import { ThemeProps } from '../types/props'; +import type { Prop } from '../types/config'; +import type { ThemeProps } from '../types/props'; type GetScaleValue = ( val: string | number, diff --git a/packages/variance/src/types/config.ts b/packages/variance/src/types/config.ts index a6193bc9ec..4bb972a75b 100644 --- a/packages/variance/src/types/config.ts +++ b/packages/variance/src/types/config.ts @@ -1,13 +1,13 @@ -import { Theme } from '@emotion/react'; +import type { Theme } from '@emotion/react'; -import { +import type { DefaultCSSPropertyValue, DirectionalProperties, DirectionalProperty, PropertyMode, PropertyTypes, } from './properties'; -import { +import type { AbstractProps, CSSObject, CSSPropMap, @@ -15,7 +15,7 @@ import { ResponsiveProp, ThemeProps, } from './props'; -import { AllUnionKeys, Key, KeyFromUnion } from './utils'; +import type { AllUnionKeys, Key, KeyFromUnion } from './utils'; export type MapScale = Record; export type ArrayScale = readonly (string | number)[] & { length: 0 }; diff --git a/packages/variance/src/types/properties.ts b/packages/variance/src/types/properties.ts index 61131257ff..bf15e8497b 100644 --- a/packages/variance/src/types/properties.ts +++ b/packages/variance/src/types/properties.ts @@ -1,4 +1,4 @@ -import { Globals, StandardProperties, VendorProperties } from 'csstype'; +import type { Globals, StandardProperties, VendorProperties } from 'csstype'; type ColorProperties = 'color' | `${string}Color`; diff --git a/packages/variance/src/types/props.ts b/packages/variance/src/types/props.ts index 8bf0ed6799..914536ef0e 100644 --- a/packages/variance/src/types/props.ts +++ b/packages/variance/src/types/props.ts @@ -1,7 +1,7 @@ -import { Theme } from '@emotion/react'; +import type { Theme } from '@emotion/react'; -import { AbstractParser, Scale } from './config'; -import { CSSPropertyTypes } from './properties'; +import type { AbstractParser, Scale } from './config'; +import type { CSSPropertyTypes } from './properties'; export type AbstractProps = ThemeProps>; diff --git a/packages/variance/src/utils/propNames.ts b/packages/variance/src/utils/propNames.ts index 3450bdb4f1..96c7b213e8 100644 --- a/packages/variance/src/utils/propNames.ts +++ b/packages/variance/src/utils/propNames.ts @@ -1,5 +1,5 @@ -import { BaseProperty, PropertyValue } from '../types/config'; -import { DirectionalProperties } from '../types/properties'; +import type { BaseProperty, PropertyValue } from '../types/config'; +import type { DirectionalProperties } from '../types/properties'; const SHORTHAND_PROPERTIES = [ 'border', diff --git a/packages/variance/src/utils/responsive.ts b/packages/variance/src/utils/responsive.ts index 69cdbb518f..1525abccc5 100644 --- a/packages/variance/src/utils/responsive.ts +++ b/packages/variance/src/utils/responsive.ts @@ -1,14 +1,14 @@ import intersection from 'lodash/intersection'; import omit from 'lodash/omit'; -import { AbstractPropTransformer } from '../types/config'; -import { +import type { AbstractPropTransformer } from '../types/config'; +import type { BreakpointCache, BreakpointMap, CSSObject, ThemeProps, } from '../types/props'; -import { Breakpoints } from '../types/theme'; +import type { Breakpoints } from '../types/theme'; const BREAKPOINT_KEYS = [ '_', diff --git a/packages/variance/src/utils/serializeTokens.ts b/packages/variance/src/utils/serializeTokens.ts index beb9cb557b..76e1f0b4c3 100644 --- a/packages/variance/src/utils/serializeTokens.ts +++ b/packages/variance/src/utils/serializeTokens.ts @@ -1,8 +1,8 @@ -import { Theme } from '@emotion/react'; +import type { Theme } from '@emotion/react'; import isObject from 'lodash/isObject'; import merge from 'lodash/merge'; -import { CSSObject } from '../types/props'; +import type { CSSObject } from '../types/props'; /** * Returns an type of any object with { key: 'var(--key) } From 5c278d5911db37ce685c4cabb3e5b70eec7ba6b7 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 24 Sep 2026 10:25:49 -0400 Subject: [PATCH 20/47] formatting --- packages/gamut-icons/src/props.ts | 2 +- packages/gamut-patterns/src/props.tsx | 4 +-- packages/gamut-styles/src/AssetProvider.tsx | 2 +- packages/gamut-styles/src/Background.tsx | 8 ++--- packages/gamut-styles/src/ColorMode.tsx | 14 +++------ packages/gamut-styles/src/GamutProvider.tsx | 9 ++---- .../gamut-styles/src/globals/Typography.tsx | 2 +- .../__tests__/useLogicalProperties.test.tsx | 2 +- packages/gamut/src/Alert/Alert.tsx | 2 +- packages/gamut/src/Alert/elements.tsx | 2 +- packages/gamut/src/Anchor/index.tsx | 14 +++------ packages/gamut/src/Badge/index.tsx | 11 ++----- .../gamut/src/BarChart/BarChartProvider.tsx | 7 ++--- packages/gamut/src/BarChart/BarRow/index.tsx | 10 ++----- packages/gamut/src/BarChart/utils/hooks.ts | 10 ++----- packages/gamut/src/BarChart/utils/index.tsx | 3 +- packages/gamut/src/Box/Box.tsx | 2 +- packages/gamut/src/Box/FlexBox.tsx | 2 +- packages/gamut/src/Box/GridBox.tsx | 2 +- packages/gamut/src/Box/props.ts | 2 +- packages/gamut/src/Button/FillButton.tsx | 3 +- packages/gamut/src/Button/IconButton.tsx | 2 +- packages/gamut/src/Button/StrokeButton.tsx | 3 +- packages/gamut/src/Button/TextButton.tsx | 3 +- packages/gamut/src/Button/shared/styles.ts | 2 +- packages/gamut/src/Card/styles.tsx | 11 ++----- packages/gamut/src/Coachmark/index.tsx | 5 ++-- .../gamut/src/ConnectedForm/ConnectedForm.tsx | 6 ++-- .../ConnectedNestedCheckboxes/utils.tsx | 5 +++- .../gamut/src/ConnectedForm/SubmitButton.tsx | 2 +- .../__tests__/ConnectedForm.test.tsx | 2 +- packages/gamut/src/ConnectedForm/utils.tsx | 29 +++++-------------- packages/gamut/src/DataList/DataGrid.tsx | 2 +- .../src/DataList/Tables/Rows/TableRow.tsx | 10 ++----- .../src/DataList/__tests__/DataGrid.test.tsx | 10 ++----- .../src/DataList/hooks/useLocalQuery.tsx | 7 ++++- .../src/DatePicker/DatePickerContext/types.ts | 5 +++- .../DatePickerInput/Segment/index.tsx | 3 +- .../src/Drawer/__tests__/Drawer.test.tsx | 2 +- .../src/Flyout/__tests__/Flyout.test.tsx | 2 +- .../src/Form/SelectDropdown/core/styles.ts | 9 ++---- .../SelectDropdown/elements/containers.tsx | 8 ++--- .../SelectDropdown/elements/multi-value.tsx | 7 ++--- .../Form/SelectDropdown/elements/options.tsx | 7 ++--- .../hooks/useNoOptionsAnnouncement.ts | 11 ++----- .../SelectDropdown/hooks/useSelectHandlers.ts | 2 +- packages/gamut/src/Form/elements/Form.tsx | 2 +- .../src/Form/elements/FormGroupLabel.tsx | 7 ++--- packages/gamut/src/Form/inputs/Checkbox.tsx | 9 ++---- packages/gamut/src/Form/inputs/Input.tsx | 13 +++------ packages/gamut/src/Form/inputs/Radio.tsx | 7 ++--- packages/gamut/src/Form/inputs/Select.tsx | 10 ++----- packages/gamut/src/Form/inputs/TextArea.tsx | 9 ++---- .../src/GridForm/GridFormButtons/index.tsx | 2 +- .../GridFormCustomInput/index.tsx | 5 +++- .../GridFormNestedCheckboxInput/index.tsx | 5 +++- .../GridFormSections/GridFormSectionBreak.tsx | 2 +- .../src/GridForm/__tests__/GridForm.test.tsx | 2 +- packages/gamut/src/Layout/Column.tsx | 4 +-- packages/gamut/src/Layout/LayoutGrid.tsx | 2 +- .../gamut/src/List/Header/ListHeaderCol.tsx | 2 +- packages/gamut/src/List/List.tsx | 4 +-- packages/gamut/src/List/ListCol.tsx | 2 +- packages/gamut/src/List/TableHeader.tsx | 2 +- packages/gamut/src/List/elements.tsx | 2 +- packages/gamut/src/Markdown/index.tsx | 10 ++----- .../Markdown/libs/overrides/Details/index.tsx | 2 +- packages/gamut/src/Menu/Menu.tsx | 2 +- packages/gamut/src/Menu/MenuItem.tsx | 21 +++----------- packages/gamut/src/Menu/elements.tsx | 4 +-- packages/gamut/src/Modals/Dialog.tsx | 2 +- packages/gamut/src/Modals/Modal.tsx | 4 +-- .../gamut/src/Pagination/PaginationButton.tsx | 2 +- .../src/PatternBackdrop/PatternBackdrop.tsx | 4 +-- packages/gamut/src/Popover/elements.tsx | 8 ++--- packages/gamut/src/Popover/types.tsx | 2 +- packages/gamut/src/PopoverContainer/utils.ts | 7 ++--- packages/gamut/src/Tabs/Tab.tsx | 9 ++---- packages/gamut/src/Tabs/TabButton.tsx | 8 ++--- packages/gamut/src/Tabs/TabList.tsx | 5 ++-- packages/gamut/src/Tabs/TabPanel.tsx | 7 ++--- packages/gamut/src/Tabs/Tabs.tsx | 7 ++--- packages/gamut/src/Tabs/props.tsx | 2 +- packages/gamut/src/Tag/elements.tsx | 5 ++-- packages/gamut/src/Tag/types.tsx | 2 +- .../gamut/src/Tip/InfoTip/InfoTipButton.tsx | 10 ++----- packages/gamut/src/Tip/InfoTip/index.tsx | 8 ++--- .../gamut/src/Tip/PreviewTip/elements.tsx | 5 +++- packages/gamut/src/Tip/PreviewTip/index.tsx | 19 ++++-------- packages/gamut/src/Tip/ToolTip/index.tsx | 8 ++--- packages/gamut/src/Tip/__tests__/mocks.tsx | 2 +- packages/gamut/src/Toast/Toast.tsx | 2 +- packages/gamut/src/Toggle/elements.tsx | 2 +- packages/gamut/src/Typography/Text.tsx | 4 +-- .../src/Video/lib/VidstackPlayer/index.tsx | 3 +- packages/gamut/src/Video/lib/utils/icons.tsx | 5 ++-- .../ExpandInCollapseOut.stories.tsx | 2 +- .../Animations/Rotation/Rotation.stories.tsx | 2 +- .../src/lib/Atoms/Badge/examples.tsx | 2 +- .../src/lib/Atoms/Drawer/Drawer.stories.tsx | 2 +- .../FormInputs/Checkbox/Checkbox.stories.tsx | 3 +- .../Atoms/FormInputs/Radio/Radio.stories.tsx | 2 +- .../PopoverContainer.stories.tsx | 2 +- .../DelayedRenderWrapper.stories.tsx | 2 +- .../FocusTrap/FocusTrap.stories.tsx | 2 +- .../lib/Foundations/ColorMode/examples.tsx | 5 ++-- .../src/lib/Foundations/shared/elements.tsx | 5 ++-- .../Molecules/Coachmark/Coachmark.stories.tsx | 2 +- .../lib/Molecules/Flyout/Flyout.stories.tsx | 2 +- .../Modals/Dialog/Dialog.stories.tsx | 2 +- .../Molecules/Modals/Modal/Modal.stories.tsx | 2 +- .../Pagination/Pagination.stories.tsx | 10 ++----- .../lib/Molecules/Popover/Popover.stories.tsx | 11 ++----- .../Organisms/BarChart/BarChart.stories.tsx | 9 ++---- .../ConnectedFormGroup.stories.tsx | 3 +- .../lib/Organisms/ListsAndTables/examples.tsx | 3 +- .../lib/Typography/Anchor/Anchor.examples.tsx | 3 +- .../variance/src/createTheme/createTheme.ts | 9 ++++-- 118 files changed, 224 insertions(+), 401 deletions(-) diff --git a/packages/gamut-icons/src/props.ts b/packages/gamut-icons/src/props.ts index 20feb8364f..47d65e8e87 100644 --- a/packages/gamut-icons/src/props.ts +++ b/packages/gamut-icons/src/props.ts @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { styledOptions, system } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; export interface IconStyleProps extends StyleProps { diff --git a/packages/gamut-patterns/src/props.tsx b/packages/gamut-patterns/src/props.tsx index 9caed7710e..9026f05a46 100644 --- a/packages/gamut-patterns/src/props.tsx +++ b/packages/gamut-patterns/src/props.tsx @@ -1,8 +1,8 @@ import styled from '@emotion/styled'; import { styledOptions, system } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; const patternStyles = variance.compose( diff --git a/packages/gamut-styles/src/AssetProvider.tsx b/packages/gamut-styles/src/AssetProvider.tsx index 1378192e03..479b2161eb 100644 --- a/packages/gamut-styles/src/AssetProvider.tsx +++ b/packages/gamut-styles/src/AssetProvider.tsx @@ -3,7 +3,7 @@ import type * as React from 'react'; import { webFonts } from './remoteAssets/fonts'; import { coreTheme } from './themes'; -import type { FontConfig} from './utilities/fontUtils'; +import type { FontConfig } from './utilities/fontUtils'; import { getFonts } from './utilities/fontUtils'; /* diff --git a/packages/gamut-styles/src/Background.tsx b/packages/gamut-styles/src/Background.tsx index aa49db1e60..73858c1d69 100644 --- a/packages/gamut-styles/src/Background.tsx +++ b/packages/gamut-styles/src/Background.tsx @@ -1,16 +1,14 @@ import { getContrast } from 'polished'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef, useCallback, useMemo } from 'react'; import type { ColorAlias, ColorModes, ColorModeShape, - Colors} from './ColorMode'; -import { - ColorMode, - useColorModes, + Colors, } from './ColorMode'; +import { ColorMode, useColorModes } from './ColorMode'; export interface BackgroundProps extends Omit< diff --git a/packages/gamut-styles/src/ColorMode.tsx b/packages/gamut-styles/src/ColorMode.tsx index 74eab91ed9..4231b83d97 100644 --- a/packages/gamut-styles/src/ColorMode.tsx +++ b/packages/gamut-styles/src/ColorMode.tsx @@ -1,17 +1,11 @@ -import type { CSSObject, Theme} from '@emotion/react'; +import type { CSSObject, Theme } from '@emotion/react'; import { ThemeProvider, useTheme } from '@emotion/react'; import styled from '@emotion/styled'; -import type { - StyleProps, - ThemeProps} from '@skillsoft/variance'; -import { - serializeTokens, - variance, -} from '@skillsoft/variance'; +import type { StyleProps, ThemeProps } from '@skillsoft/variance'; +import { serializeTokens, variance } from '@skillsoft/variance'; import mapValues from 'lodash/mapValues'; import pick from 'lodash/pick'; -import type { - ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { createContext, forwardRef, diff --git a/packages/gamut-styles/src/GamutProvider.tsx b/packages/gamut-styles/src/GamutProvider.tsx index 1b21d37350..39ab7a5544 100644 --- a/packages/gamut-styles/src/GamutProvider.tsx +++ b/packages/gamut-styles/src/GamutProvider.tsx @@ -1,10 +1,5 @@ -import type { - EmotionCache, - Theme} from '@emotion/react'; -import { - CacheProvider, - ThemeProvider, -} from '@emotion/react'; +import type { EmotionCache, Theme } from '@emotion/react'; +import { CacheProvider, ThemeProvider } from '@emotion/react'; import type { CSSObject } from '@skillsoft/variance'; import { MotionConfig } from 'framer-motion'; import { setNonce } from 'get-nonce'; diff --git a/packages/gamut-styles/src/globals/Typography.tsx b/packages/gamut-styles/src/globals/Typography.tsx index 5d5328e73b..f77f7fe9d4 100644 --- a/packages/gamut-styles/src/globals/Typography.tsx +++ b/packages/gamut-styles/src/globals/Typography.tsx @@ -2,7 +2,7 @@ import { css, Global } from '@emotion/react'; import type * as React from 'react'; import type { coreTheme } from '../themes'; -import type { FontConfig} from '../utilities/fontUtils'; +import type { FontConfig } from '../utilities/fontUtils'; import { getFonts } from '../utilities/fontUtils'; /** diff --git a/packages/gamut-styles/src/utilities/__tests__/useLogicalProperties.test.tsx b/packages/gamut-styles/src/utilities/__tests__/useLogicalProperties.test.tsx index db5193c601..7de837eed5 100644 --- a/packages/gamut-styles/src/utilities/__tests__/useLogicalProperties.test.tsx +++ b/packages/gamut-styles/src/utilities/__tests__/useLogicalProperties.test.tsx @@ -1,4 +1,4 @@ -import type { Theme} from '@emotion/react'; +import type { Theme } from '@emotion/react'; import { ThemeProvider } from '@emotion/react'; import type * as React from 'react'; diff --git a/packages/gamut/src/Alert/Alert.tsx b/packages/gamut/src/Alert/Alert.tsx index 0cb86923cd..d61feb3391 100644 --- a/packages/gamut/src/Alert/Alert.tsx +++ b/packages/gamut/src/Alert/Alert.tsx @@ -6,7 +6,7 @@ import { useMeasure } from 'react-use'; import { Rotation } from '../Animation'; import { Box } from '../Box'; -import type { FillButton} from '../Button'; +import type { FillButton } from '../Button'; import { IconButton, TextButton } from '../Button'; import type { CloseButtonProps } from '../Modals/types'; import { ToolTip } from '../Tip/ToolTip'; diff --git a/packages/gamut/src/Alert/elements.tsx b/packages/gamut/src/Alert/elements.tsx index f2fe963455..caae1f4d8b 100644 --- a/packages/gamut/src/Alert/elements.tsx +++ b/packages/gamut/src/Alert/elements.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { Background, css } from '@skillsoft/gamut-styles'; import { motion } from 'framer-motion'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; import { Box } from '../Box'; diff --git a/packages/gamut/src/Anchor/index.tsx b/packages/gamut/src/Anchor/index.tsx index c5e1ba22ed..34af1ecbb7 100644 --- a/packages/gamut/src/Anchor/index.tsx +++ b/packages/gamut/src/Anchor/index.tsx @@ -1,22 +1,16 @@ import styled from '@emotion/styled'; import { styledOptions, system, variant } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; -import type { - ComponentProps, - ComponentType, - HTMLProps, - Ref} from 'react'; -import { - forwardRef -} from 'react'; +import type { ComponentProps, ComponentType, HTMLProps, Ref } from 'react'; +import { forwardRef } from 'react'; import { ButtonBase, InteractiveSelectors, narrowButtonBaseRef, } from '../ButtonBase/ButtonBase'; -import type { AppendedIconProps} from '../helpers'; +import type { AppendedIconProps } from '../helpers'; import { appendIconToContent } from '../helpers'; export interface AnchorProps diff --git a/packages/gamut/src/Badge/index.tsx b/packages/gamut/src/Badge/index.tsx index 9afbace810..5a0da3b84a 100644 --- a/packages/gamut/src/Badge/index.tsx +++ b/packages/gamut/src/Badge/index.tsx @@ -1,12 +1,7 @@ import styled from '@emotion/styled'; -import type { - Colors} from '@skillsoft/gamut-styles'; -import { - styledOptions, - system, - variant, -} from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { Colors } from '@skillsoft/gamut-styles'; +import { styledOptions, system, variant } from '@skillsoft/gamut-styles'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; import { appendIconToContent } from '../helpers'; diff --git a/packages/gamut/src/BarChart/BarChartProvider.tsx b/packages/gamut/src/BarChart/BarChartProvider.tsx index 99bae2a865..37a540baf8 100644 --- a/packages/gamut/src/BarChart/BarChartProvider.tsx +++ b/packages/gamut/src/BarChart/BarChartProvider.tsx @@ -1,10 +1,7 @@ import { createContext } from 'react'; -import type { - BarChartTranslations} from './shared/translations'; -import { - defaultBarChartTranslations, -} from './shared/translations'; +import type { BarChartTranslations } from './shared/translations'; +import { defaultBarChartTranslations } from './shared/translations'; import type { BarChartStyles, MaxScaleValue } from './shared/types'; export interface BarChartContextProps { diff --git a/packages/gamut/src/BarChart/BarRow/index.tsx b/packages/gamut/src/BarChart/BarRow/index.tsx index 081a31eef7..0eb199c120 100644 --- a/packages/gamut/src/BarChart/BarRow/index.tsx +++ b/packages/gamut/src/BarChart/BarRow/index.tsx @@ -1,11 +1,5 @@ -import type { - MouseEventHandler, - MutableRefObject} from 'react'; -import { - forwardRef, - useMemo, - useRef, -} from 'react'; +import type { MouseEventHandler, MutableRefObject } from 'react'; +import { forwardRef, useMemo, useRef } from 'react'; import { Box, FlexBox } from '../../Box'; import { Text } from '../../Typography'; diff --git a/packages/gamut/src/BarChart/utils/hooks.ts b/packages/gamut/src/BarChart/utils/hooks.ts index c5b6d07cd5..0dade7e0d6 100644 --- a/packages/gamut/src/BarChart/utils/hooks.ts +++ b/packages/gamut/src/BarChart/utils/hooks.ts @@ -1,4 +1,4 @@ -import type { Colors} from '@skillsoft/gamut-styles'; +import type { Colors } from '@skillsoft/gamut-styles'; import { isColorAlias, useColorModes } from '@skillsoft/gamut-styles'; import { getContrast } from 'polished'; import { @@ -12,12 +12,8 @@ import { } from 'react'; import type { SelectOptions } from '../../Form/inputs/Select'; -import type { - BarChartContextProps} from '../BarChartProvider'; -import { - BarChartContext, - defaultStyleConfig, -} from '../BarChartProvider'; +import type { BarChartContextProps } from '../BarChartProvider'; +import { BarChartContext, defaultStyleConfig } from '../BarChartProvider'; import type { BarChartTranslations } from '../shared/translations'; import type { BarChartStyles, diff --git a/packages/gamut/src/BarChart/utils/index.tsx b/packages/gamut/src/BarChart/utils/index.tsx index 283743fb44..6dee493e27 100644 --- a/packages/gamut/src/BarChart/utils/index.tsx +++ b/packages/gamut/src/BarChart/utils/index.tsx @@ -1,5 +1,4 @@ -import type { - BarChartTranslations} from '../shared/translations'; +import type { BarChartTranslations } from '../shared/translations'; import { getDefaultSingleValueBarSummary, getDefaultStackedBarSummary, diff --git a/packages/gamut/src/Box/Box.tsx b/packages/gamut/src/Box/Box.tsx index 45bc2dfe2b..81b6c7ccee 100644 --- a/packages/gamut/src/Box/Box.tsx +++ b/packages/gamut/src/Box/Box.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { styledOptions } from '@skillsoft/gamut-styles'; -import type { BoxProps} from './props'; +import type { BoxProps } from './props'; import { boxProps, sharedStates } from './props'; export const Box = styled('div', styledOptions(['fit']))( diff --git a/packages/gamut/src/Box/FlexBox.tsx b/packages/gamut/src/Box/FlexBox.tsx index 2a6c261e3d..582d42dd64 100644 --- a/packages/gamut/src/Box/FlexBox.tsx +++ b/packages/gamut/src/Box/FlexBox.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { css, styledOptions } from '@skillsoft/gamut-styles'; -import type { FlexBoxProps} from './props'; +import type { FlexBoxProps } from './props'; import { boxProps, flexStates, sharedStates } from './props'; export const FlexBox = styled( diff --git a/packages/gamut/src/Box/GridBox.tsx b/packages/gamut/src/Box/GridBox.tsx index c512392eea..788c26995d 100644 --- a/packages/gamut/src/Box/GridBox.tsx +++ b/packages/gamut/src/Box/GridBox.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { styledOptions, system } from '@skillsoft/gamut-styles'; -import type { GridBoxProps} from './props'; +import type { GridBoxProps } from './props'; import { boxProps, gridStates, sharedStates } from './props'; export const GridBox = styled( diff --git a/packages/gamut/src/Box/props.ts b/packages/gamut/src/Box/props.ts index 199a7b20e3..1c21c4f69d 100644 --- a/packages/gamut/src/Box/props.ts +++ b/packages/gamut/src/Box/props.ts @@ -1,5 +1,5 @@ import { system } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; import type { WithChildrenProp } from '../utils'; diff --git a/packages/gamut/src/Button/FillButton.tsx b/packages/gamut/src/Button/FillButton.tsx index 462a76d768..a7d137a6f3 100644 --- a/packages/gamut/src/Button/FillButton.tsx +++ b/packages/gamut/src/Button/FillButton.tsx @@ -1,8 +1,7 @@ import { forwardRef } from 'react'; import type { ButtonBaseElements } from '../ButtonBase/ButtonBase'; -import type { - InlineIconButtonProps} from './shared'; +import type { InlineIconButtonProps } from './shared'; import { createButtonComponent, fillButtonVariants, diff --git a/packages/gamut/src/Button/IconButton.tsx b/packages/gamut/src/Button/IconButton.tsx index dfa5b5070a..d95f767b87 100644 --- a/packages/gamut/src/Button/IconButton.tsx +++ b/packages/gamut/src/Button/IconButton.tsx @@ -1,4 +1,4 @@ -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; import type { ButtonBaseElements } from '../ButtonBase/ButtonBase'; diff --git a/packages/gamut/src/Button/StrokeButton.tsx b/packages/gamut/src/Button/StrokeButton.tsx index 67c5bc289f..6427fd51a3 100644 --- a/packages/gamut/src/Button/StrokeButton.tsx +++ b/packages/gamut/src/Button/StrokeButton.tsx @@ -1,8 +1,7 @@ import { forwardRef } from 'react'; import type { ButtonBaseElements } from '../ButtonBase/ButtonBase'; -import type { - InlineIconButtonProps} from './shared'; +import type { InlineIconButtonProps } from './shared'; import { createButtonComponent, InlineIconButton, diff --git a/packages/gamut/src/Button/TextButton.tsx b/packages/gamut/src/Button/TextButton.tsx index 7a8b14642f..83b87b6c6e 100644 --- a/packages/gamut/src/Button/TextButton.tsx +++ b/packages/gamut/src/Button/TextButton.tsx @@ -1,8 +1,7 @@ import { forwardRef } from 'react'; import type { ButtonBaseElements } from '../ButtonBase/ButtonBase'; -import type { - InlineIconButtonProps} from './shared'; +import type { InlineIconButtonProps } from './shared'; import { createButtonComponent, InlineIconButton, diff --git a/packages/gamut/src/Button/shared/styles.ts b/packages/gamut/src/Button/shared/styles.ts index f1c44c1df0..28940519f8 100644 --- a/packages/gamut/src/Button/shared/styles.ts +++ b/packages/gamut/src/Button/shared/styles.ts @@ -6,7 +6,7 @@ import { system, transitionConcat, } from '@skillsoft/gamut-styles'; -import type { CSSObject, ThemeProps} from '@skillsoft/variance'; +import type { CSSObject, ThemeProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; import { ButtonBase, InteractiveSelectors } from '../../ButtonBase/ButtonBase'; diff --git a/packages/gamut/src/Card/styles.tsx b/packages/gamut/src/Card/styles.tsx index 5509aacc7f..c251251bbd 100644 --- a/packages/gamut/src/Card/styles.tsx +++ b/packages/gamut/src/Card/styles.tsx @@ -1,12 +1,7 @@ -import type { Theme} from '@emotion/react'; +import type { Theme } from '@emotion/react'; import { useTheme } from '@emotion/react'; -import type { - ElevationState} from '@skillsoft/gamut-styles'; -import { - theme, - timingValues, - variant, -} from '@skillsoft/gamut-styles'; +import type { ElevationState } from '@skillsoft/gamut-styles'; +import { theme, timingValues, variant } from '@skillsoft/gamut-styles'; import type { StyleProps } from '@skillsoft/variance'; /** diff --git a/packages/gamut/src/Coachmark/index.tsx b/packages/gamut/src/Coachmark/index.tsx index d31a62662b..d91283e1cd 100644 --- a/packages/gamut/src/Coachmark/index.tsx +++ b/packages/gamut/src/Coachmark/index.tsx @@ -5,10 +5,9 @@ import { DelayedRenderWrapper } from '../DelayedRenderWrapper'; import type { PopoverFocusProps, PopoverProps, - PopoverYPositionType} from '../Popover'; -import { - Popover + PopoverYPositionType, } from '../Popover'; +import { Popover } from '../Popover'; export type CoachmarkProps = PopoverFocusProps & { /** diff --git a/packages/gamut/src/ConnectedForm/ConnectedForm.tsx b/packages/gamut/src/ConnectedForm/ConnectedForm.tsx index 5294a3783c..bde26292f4 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedForm.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedForm.tsx @@ -8,11 +8,9 @@ import type { RegisterOptions, SubmitErrorHandler, SubmitHandler, - UseFormProps} from 'react-hook-form'; -import { - FormProvider, - useForm + UseFormProps, } from 'react-hook-form'; +import { FormProvider, useForm } from 'react-hook-form'; import { Form } from '../Form'; import type { FormProps } from '../Form/elements/Form'; diff --git a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx index 4cf7368e61..e7ed301a7b 100644 --- a/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx +++ b/packages/gamut/src/ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils.tsx @@ -2,7 +2,10 @@ import { Box } from '../../../Box'; import type { CheckboxLabelUnion } from '../../../Form'; import { Checkbox } from '../../../Form'; import type { NestedGridFormCheckboxOption } from '../../../GridForm/types'; -import type { MinimalCheckboxProps, NestedConnectedCheckboxOption } from '../types'; +import type { + MinimalCheckboxProps, + NestedConnectedCheckboxOption, +} from '../types'; type FlatCheckbox = Omit & CheckboxLabelUnion & { diff --git a/packages/gamut/src/ConnectedForm/SubmitButton.tsx b/packages/gamut/src/ConnectedForm/SubmitButton.tsx index ba20467d17..d5a0354bfb 100644 --- a/packages/gamut/src/ConnectedForm/SubmitButton.tsx +++ b/packages/gamut/src/ConnectedForm/SubmitButton.tsx @@ -3,7 +3,7 @@ import type * as React from 'react'; import type { FieldValues, FormState } from 'react-hook-form'; import { Box, FlexBox } from '../Box'; -import type { ButtonProps} from '../Button'; +import type { ButtonProps } from '../Button'; import { FillButton } from '../Button'; import { Spinner } from '../Loading/Spinner'; import { Text } from '../Typography'; diff --git a/packages/gamut/src/ConnectedForm/__tests__/ConnectedForm.test.tsx b/packages/gamut/src/ConnectedForm/__tests__/ConnectedForm.test.tsx index ad1a69d387..5357b93ba3 100644 --- a/packages/gamut/src/ConnectedForm/__tests__/ConnectedForm.test.tsx +++ b/packages/gamut/src/ConnectedForm/__tests__/ConnectedForm.test.tsx @@ -1,7 +1,7 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import type { queries } from '@testing-library/dom'; import { fireEvent } from '@testing-library/dom'; -import type { RenderResult} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; import { act, waitFor } from '@testing-library/react'; import type { InfoTipProps } from '../../Tip/InfoTip'; diff --git a/packages/gamut/src/ConnectedForm/utils.tsx b/packages/gamut/src/ConnectedForm/utils.tsx index b16732b8d3..a766e320bc 100644 --- a/packages/gamut/src/ConnectedForm/utils.tsx +++ b/packages/gamut/src/ConnectedForm/utils.tsx @@ -4,36 +4,23 @@ import omit from 'lodash/omit'; import type { ChangeEvent, ChangeEventHandler, - HTMLInputTypeAttribute} from 'react'; -import { - useContext, - useEffect, - useMemo, - useState, + HTMLInputTypeAttribute, } from 'react'; +import { useContext, useEffect, useMemo, useState } from 'react'; import type { FieldError, FieldErrorsImpl, Merge, Path, - RegisterOptions} from 'react-hook-form'; -import { - useFieldArray, - useFormContext, + RegisterOptions, } from 'react-hook-form'; +import { useFieldArray, useFormContext } from 'react-hook-form'; import { FormRequiredText } from '../Form'; -import type { - ConnectedFormProps} from './ConnectedForm'; -import { - ConnectedForm, - FormPropsContext, -} from './ConnectedForm'; -import type { - ConnectedFormGroupProps} from './ConnectedFormGroup'; -import { - ConnectedFormGroup -} from './ConnectedFormGroup'; +import type { ConnectedFormProps } from './ConnectedForm'; +import { ConnectedForm, FormPropsContext } from './ConnectedForm'; +import type { ConnectedFormGroupProps } from './ConnectedFormGroup'; +import { ConnectedFormGroup } from './ConnectedFormGroup'; import type { ConnectedField, SubmitContextProps } from './types'; interface ConnectedGroupStrictProps { diff --git a/packages/gamut/src/DataList/DataGrid.tsx b/packages/gamut/src/DataList/DataGrid.tsx index 101836afc5..42cda096af 100644 --- a/packages/gamut/src/DataList/DataGrid.tsx +++ b/packages/gamut/src/DataList/DataGrid.tsx @@ -1,6 +1,6 @@ import type { system } from '@skillsoft/gamut-styles'; import type { StyleProps } from '@skillsoft/variance'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { useMemo } from 'react'; import { List } from '../List'; diff --git a/packages/gamut/src/DataList/Tables/Rows/TableRow.tsx b/packages/gamut/src/DataList/Tables/Rows/TableRow.tsx index d3e0a6bb05..4d872d8642 100644 --- a/packages/gamut/src/DataList/Tables/Rows/TableRow.tsx +++ b/packages/gamut/src/DataList/Tables/Rows/TableRow.tsx @@ -1,11 +1,5 @@ -import type { - ReactElement} from 'react'; -import { - isValidElement, - memo, - useCallback, - useMemo, -} from 'react'; +import type { ReactElement } from 'react'; +import { isValidElement, memo, useCallback, useMemo } from 'react'; import { Text } from '../../..'; import { ListCol, ListRow } from '../../../List'; diff --git a/packages/gamut/src/DataList/__tests__/DataGrid.test.tsx b/packages/gamut/src/DataList/__tests__/DataGrid.test.tsx index d6de82fea0..7f8cc00328 100644 --- a/packages/gamut/src/DataList/__tests__/DataGrid.test.tsx +++ b/packages/gamut/src/DataList/__tests__/DataGrid.test.tsx @@ -1,13 +1,7 @@ import { matchers } from '@emotion/jest'; import { MockGamutProvider, setupRtl } from '@skillsoft/gamut-tests'; -import type { - RenderResult} from '@testing-library/react'; -import { - act, - fireEvent, - render, - screen, -} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; +import { act, fireEvent, render, screen } from '@testing-library/react'; import type { DataGridProps } from '../DataGrid'; import { DataGrid } from '../DataGrid'; diff --git a/packages/gamut/src/DataList/hooks/useLocalQuery.tsx b/packages/gamut/src/DataList/hooks/useLocalQuery.tsx index 21b4b64645..ddbb1cd58b 100644 --- a/packages/gamut/src/DataList/hooks/useLocalQuery.tsx +++ b/packages/gamut/src/DataList/hooks/useLocalQuery.tsx @@ -1,7 +1,12 @@ import orderBy from 'lodash/orderBy'; import { useCallback, useMemo, useState } from 'react'; -import type { ColumnConfig, IdentifiableKeys, OnQueryChange, Query } from '../types'; +import type { + ColumnConfig, + IdentifiableKeys, + OnQueryChange, + Query, +} from '../types'; export interface LocalQueryShape< Row, diff --git a/packages/gamut/src/DatePicker/DatePickerContext/types.ts b/packages/gamut/src/DatePicker/DatePickerContext/types.ts index 3296256600..5d6ef9368a 100644 --- a/packages/gamut/src/DatePicker/DatePickerContext/types.ts +++ b/packages/gamut/src/DatePicker/DatePickerContext/types.ts @@ -1,6 +1,9 @@ import { createContext } from 'react'; -import type { CalendarQuickAction, DatePickerSharedProps } from '../sharedTypes'; +import type { + CalendarQuickAction, + DatePickerSharedProps, +} from '../sharedTypes'; import type { DatePickerTranslations } from '../utils/translations'; interface DatePickerBaseContextValue diff --git a/packages/gamut/src/DatePicker/DatePickerInput/Segment/index.tsx b/packages/gamut/src/DatePicker/DatePickerInput/Segment/index.tsx index 0775590141..142f5110a0 100644 --- a/packages/gamut/src/DatePicker/DatePickerInput/Segment/index.tsx +++ b/packages/gamut/src/DatePicker/DatePickerInput/Segment/index.tsx @@ -2,8 +2,7 @@ import { type Dispatch, type SetStateAction, useCallback, useId } from 'react'; import type { DatePartKind } from '../utils'; import { Segment } from './elements'; -import type { - SegmentValues} from './utils'; +import type { SegmentValues } from './utils'; import { appendSegmentDigit, getSegmentPlaceholder, diff --git a/packages/gamut/src/Drawer/__tests__/Drawer.test.tsx b/packages/gamut/src/Drawer/__tests__/Drawer.test.tsx index 1841f86477..2b797d0913 100644 --- a/packages/gamut/src/Drawer/__tests__/Drawer.test.tsx +++ b/packages/gamut/src/Drawer/__tests__/Drawer.test.tsx @@ -1,5 +1,5 @@ import { setupRtl } from '@skillsoft/gamut-tests'; -import type { RenderResult} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; import { waitFor } from '@testing-library/react'; import { Drawer } from '..'; diff --git a/packages/gamut/src/Flyout/__tests__/Flyout.test.tsx b/packages/gamut/src/Flyout/__tests__/Flyout.test.tsx index 0d954129e6..6b5994de76 100644 --- a/packages/gamut/src/Flyout/__tests__/Flyout.test.tsx +++ b/packages/gamut/src/Flyout/__tests__/Flyout.test.tsx @@ -1,6 +1,6 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import { fireEvent } from '@testing-library/dom'; -import type { RenderResult} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; import { act, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; diff --git a/packages/gamut/src/Form/SelectDropdown/core/styles.ts b/packages/gamut/src/Form/SelectDropdown/core/styles.ts index aa9c6cd05d..c35c652766 100644 --- a/packages/gamut/src/Form/SelectDropdown/core/styles.ts +++ b/packages/gamut/src/Form/SelectDropdown/core/styles.ts @@ -1,10 +1,5 @@ -import type { - theme as GamutTheme} from '@skillsoft/gamut-styles'; -import { - css, - states, - variant, -} from '@skillsoft/gamut-styles'; +import type { theme as GamutTheme } from '@skillsoft/gamut-styles'; +import { css, states, variant } from '@skillsoft/gamut-styles'; import type { StylesConfig } from 'react-select'; import { diff --git a/packages/gamut/src/Form/SelectDropdown/elements/containers.tsx b/packages/gamut/src/Form/SelectDropdown/elements/containers.tsx index dfb5ddf8a6..135a4b7e28 100644 --- a/packages/gamut/src/Form/SelectDropdown/elements/containers.tsx +++ b/packages/gamut/src/Form/SelectDropdown/elements/containers.tsx @@ -1,10 +1,8 @@ -import type { ReactNode} from 'react'; +import type { ReactNode } from 'react'; import { createContext, useEffect, useLayoutEffect } from 'react'; -import type { - GroupBase, - Props} from 'react-select'; +import type { GroupBase, Props } from 'react-select'; import ReactSelect, { - components as SelectDropdownElements + components as SelectDropdownElements, } from 'react-select'; import CreatableSelect from 'react-select/creatable'; diff --git a/packages/gamut/src/Form/SelectDropdown/elements/multi-value.tsx b/packages/gamut/src/Form/SelectDropdown/elements/multi-value.tsx index 7e2dfbe5b7..e2c9dacdc7 100644 --- a/packages/gamut/src/Form/SelectDropdown/elements/multi-value.tsx +++ b/packages/gamut/src/Form/SelectDropdown/elements/multi-value.tsx @@ -2,15 +2,14 @@ import { css } from '@emotion/react'; import styled from '@emotion/styled'; import { MiniDeleteIcon } from '@skillsoft/gamut-icons'; import { theme } from '@skillsoft/gamut-styles'; -import type { KeyboardEvent} from 'react'; +import type { KeyboardEvent } from 'react'; import { useContext } from 'react'; import type { GroupBase, MultiValueProps, - MultiValueRemoveProps} from 'react-select'; -import { - components as SelectDropdownElements + MultiValueRemoveProps, } from 'react-select'; +import { components as SelectDropdownElements } from 'react-select'; import type { ExtendedOption, SizedIndicatorProps } from '../types'; import { indicatorIcons } from './constants'; diff --git a/packages/gamut/src/Form/SelectDropdown/elements/options.tsx b/packages/gamut/src/Form/SelectDropdown/elements/options.tsx index d48964a790..e91b25178a 100644 --- a/packages/gamut/src/Form/SelectDropdown/elements/options.tsx +++ b/packages/gamut/src/Form/SelectDropdown/elements/options.tsx @@ -1,9 +1,6 @@ import { CheckIcon } from '@skillsoft/gamut-icons'; -import type { - SingleValueProps} from 'react-select'; -import { - components as SelectDropdownElements -} from 'react-select'; +import type { SingleValueProps } from 'react-select'; +import { components as SelectDropdownElements } from 'react-select'; import { Box, FlexBox } from '../../../Box'; import type { diff --git a/packages/gamut/src/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.ts b/packages/gamut/src/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.ts index 65203431a0..bdc77db03e 100644 --- a/packages/gamut/src/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.ts +++ b/packages/gamut/src/Form/SelectDropdown/hooks/useNoOptionsAnnouncement.ts @@ -1,12 +1,5 @@ -import type { - ComponentType, - ReactNode} from 'react'; -import { - useCallback, - useEffect, - useMemo, - useState, -} from 'react'; +import type { ComponentType, ReactNode } from 'react'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { createNoOptionsMessage } from '../elements'; diff --git a/packages/gamut/src/Form/SelectDropdown/hooks/useSelectHandlers.ts b/packages/gamut/src/Form/SelectDropdown/hooks/useSelectHandlers.ts index 21c285b666..11f558726b 100644 --- a/packages/gamut/src/Form/SelectDropdown/hooks/useSelectHandlers.ts +++ b/packages/gamut/src/Form/SelectDropdown/hooks/useSelectHandlers.ts @@ -1,4 +1,4 @@ -import type { KeyboardEvent} from 'react'; +import type { KeyboardEvent } from 'react'; import type * as React from 'react'; import { useCallback, useEffect, useState } from 'react'; import type { ActionMeta, Options as OptionsType } from 'react-select'; diff --git a/packages/gamut/src/Form/elements/Form.tsx b/packages/gamut/src/Form/elements/Form.tsx index 3666d7b99a..119553f4ff 100644 --- a/packages/gamut/src/Form/elements/Form.tsx +++ b/packages/gamut/src/Form/elements/Form.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { styledOptions, system } from '@skillsoft/gamut-styles'; import { variance } from '@skillsoft/variance'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import type * as React from 'react'; import { forwardRef } from 'react'; diff --git a/packages/gamut/src/Form/elements/FormGroupLabel.tsx b/packages/gamut/src/Form/elements/FormGroupLabel.tsx index 317d56f022..cb40706d1f 100644 --- a/packages/gamut/src/Form/elements/FormGroupLabel.tsx +++ b/packages/gamut/src/Form/elements/FormGroupLabel.tsx @@ -6,11 +6,8 @@ import type * as React from 'react'; import { FlexBox } from '../../Box'; import { InfoTip } from '../../Tip/InfoTip'; -import type { - InfoTipSubComponentProps} from '../../Tip/InfoTip/type-utils'; -import { - useInfotipProps, -} from '../../Tip/InfoTip/type-utils'; +import type { InfoTipSubComponentProps } from '../../Tip/InfoTip/type-utils'; +import { useInfotipProps } from '../../Tip/InfoTip/type-utils'; import { Text } from '../../Typography/Text'; import { formBaseStyles, formFieldTextDisabledStyles } from '../styles'; import type { BaseInputProps } from '../types'; diff --git a/packages/gamut/src/Form/inputs/Checkbox.tsx b/packages/gamut/src/Form/inputs/Checkbox.tsx index 53bf1b850e..85def60b7e 100644 --- a/packages/gamut/src/Form/inputs/Checkbox.tsx +++ b/packages/gamut/src/Form/inputs/Checkbox.tsx @@ -6,16 +6,13 @@ import { timing, } from '@skillsoft/gamut-styles'; import type { StyleProps } from '@skillsoft/variance'; -import type { InputHTMLAttributes} from 'react'; +import type { InputHTMLAttributes } from 'react'; import { forwardRef, useEffect, useRef } from 'react'; import { FlexBox } from '../../Box'; import { InfoTip } from '../../Tip/InfoTip'; -import type { - InfoTipSubComponentProps} from '../../Tip/InfoTip/type-utils'; -import { - useInfotipProps, -} from '../../Tip/InfoTip/type-utils'; +import type { InfoTipSubComponentProps } from '../../Tip/InfoTip/type-utils'; +import { useInfotipProps } from '../../Tip/InfoTip/type-utils'; import { checkboxElement, checkboxElementStates, diff --git a/packages/gamut/src/Form/inputs/Input.tsx b/packages/gamut/src/Form/inputs/Input.tsx index ee3927d704..e6d00a0796 100644 --- a/packages/gamut/src/Form/inputs/Input.tsx +++ b/packages/gamut/src/Form/inputs/Input.tsx @@ -1,20 +1,15 @@ import type { StyledComponent } from '@emotion/styled'; import styled from '@emotion/styled'; -import type { - GamutIconProps} from '@skillsoft/gamut-icons'; -import { - AlertIcon, - CheckCircledIcon -} from '@skillsoft/gamut-icons'; +import type { GamutIconProps } from '@skillsoft/gamut-icons'; +import { AlertIcon, CheckCircledIcon } from '@skillsoft/gamut-icons'; import { css } from '@skillsoft/gamut-styles'; import type { StyleProps } from '@skillsoft/variance'; -import type { ChangeEvent, InputHTMLAttributes} from 'react'; +import type { ChangeEvent, InputHTMLAttributes } from 'react'; import type * as React from 'react'; import { forwardRef, useState } from 'react'; import { Box, FlexBox } from '../../Box'; -import type { - conditionalStyleProps} from '../styles'; +import type { conditionalStyleProps } from '../styles'; import { conditionalStyles, conditionalStyleState, diff --git a/packages/gamut/src/Form/inputs/Radio.tsx b/packages/gamut/src/Form/inputs/Radio.tsx index 5fbc02f76e..7c72d75130 100644 --- a/packages/gamut/src/Form/inputs/Radio.tsx +++ b/packages/gamut/src/Form/inputs/Radio.tsx @@ -7,11 +7,8 @@ import { forwardRef } from 'react'; import { FlexBox } from '../../Box'; import { InfoTip } from '../../Tip/InfoTip'; -import type { - InfoTipSubComponentProps} from '../../Tip/InfoTip/type-utils'; -import { - useInfotipProps, -} from '../../Tip/InfoTip/type-utils'; +import type { InfoTipSubComponentProps } from '../../Tip/InfoTip/type-utils'; +import { useInfotipProps } from '../../Tip/InfoTip/type-utils'; import { conditionalRadioInputStyles, conditionalRadioLabelStyles, diff --git a/packages/gamut/src/Form/inputs/Select.tsx b/packages/gamut/src/Form/inputs/Select.tsx index d53f1dcece..bf0d159ef4 100644 --- a/packages/gamut/src/Form/inputs/Select.tsx +++ b/packages/gamut/src/Form/inputs/Select.tsx @@ -6,14 +6,8 @@ import { } from '@skillsoft/gamut-icons'; import { variant } from '@skillsoft/gamut-styles'; import type { StyleProps } from '@skillsoft/variance'; -import type { - ChangeEvent, - SelectHTMLAttributes} from 'react'; -import { - forwardRef, - useMemo, - useState, -} from 'react'; +import type { ChangeEvent, SelectHTMLAttributes } from 'react'; +import { forwardRef, useMemo, useState } from 'react'; import { Box, FlexBox } from '../../Box'; import { diff --git a/packages/gamut/src/Form/inputs/TextArea.tsx b/packages/gamut/src/Form/inputs/TextArea.tsx index 6fabfc4712..f5207ecec1 100644 --- a/packages/gamut/src/Form/inputs/TextArea.tsx +++ b/packages/gamut/src/Form/inputs/TextArea.tsx @@ -1,12 +1,7 @@ import styled from '@emotion/styled'; import type { StyleProps } from '@skillsoft/variance'; -import type { - ChangeEvent, - TextareaHTMLAttributes} from 'react'; -import { - forwardRef, - useState, -} from 'react'; +import type { ChangeEvent, TextareaHTMLAttributes } from 'react'; +import { forwardRef, useState } from 'react'; import { conditionalStyles, diff --git a/packages/gamut/src/GridForm/GridFormButtons/index.tsx b/packages/gamut/src/GridForm/GridFormButtons/index.tsx index 2839cdf989..0eb89ddba5 100644 --- a/packages/gamut/src/GridForm/GridFormButtons/index.tsx +++ b/packages/gamut/src/GridForm/GridFormButtons/index.tsx @@ -3,7 +3,7 @@ import type { ComponentProps } from 'react'; import type * as React from 'react'; import { GridBox } from '../../Box'; -import type { ButtonProps} from '../../Button'; +import type { ButtonProps } from '../../Button'; import { CTAButton, FillButton, TextButton } from '../../Button'; import type { SubmitButtonProps } from '../../ConnectedForm'; import { SubmitButton } from '../../ConnectedForm'; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCustomInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCustomInput/index.tsx index 504f446d70..0448dec5f4 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCustomInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormCustomInput/index.tsx @@ -1,7 +1,10 @@ import type * as React from 'react'; import type { UseFormReturn } from 'react-hook-form'; -import type { GridFormCustomField, GridFormCustomGroupField } from '../../types'; +import type { + GridFormCustomField, + GridFormCustomGroupField, +} from '../../types'; export type GridFormCustomInputProps = { className?: string; diff --git a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormNestedCheckboxInput/index.tsx b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormNestedCheckboxInput/index.tsx index 41dbf2babb..8a2310c706 100644 --- a/packages/gamut/src/GridForm/GridFormInputGroup/GridFormNestedCheckboxInput/index.tsx +++ b/packages/gamut/src/GridForm/GridFormInputGroup/GridFormNestedCheckboxInput/index.tsx @@ -10,7 +10,10 @@ import { handleCheckboxChange, renderCheckbox, } from '../../../ConnectedForm/ConnectedInputs/ConnectedNestedCheckboxes/utils'; -import type { BaseFormInputProps, GridFormNestedCheckboxField } from '../../types'; +import type { + BaseFormInputProps, + GridFormNestedCheckboxField, +} from '../../types'; import type { GridFormInputGroupProps } from '..'; export interface GridFormNestedCheckboxInputProps extends BaseFormInputProps { diff --git a/packages/gamut/src/GridForm/GridFormSections/GridFormSectionBreak.tsx b/packages/gamut/src/GridForm/GridFormSections/GridFormSectionBreak.tsx index c02bd2fe8e..1184258c67 100644 --- a/packages/gamut/src/GridForm/GridFormSections/GridFormSectionBreak.tsx +++ b/packages/gamut/src/GridForm/GridFormSections/GridFormSectionBreak.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { system } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; import type * as React from 'react'; diff --git a/packages/gamut/src/GridForm/__tests__/GridForm.test.tsx b/packages/gamut/src/GridForm/__tests__/GridForm.test.tsx index 77824b3ec3..899278d5f3 100644 --- a/packages/gamut/src/GridForm/__tests__/GridForm.test.tsx +++ b/packages/gamut/src/GridForm/__tests__/GridForm.test.tsx @@ -1,7 +1,7 @@ import { setupRtl } from '@skillsoft/gamut-tests'; import type { queries } from '@testing-library/dom'; import { fireEvent } from '@testing-library/dom'; -import type { RenderResult} from '@testing-library/react'; +import type { RenderResult } from '@testing-library/react'; import { act, waitFor } from '@testing-library/react'; import { createPromise } from '../../utils'; diff --git a/packages/gamut/src/Layout/Column.tsx b/packages/gamut/src/Layout/Column.tsx index 7c153cec77..3918641e1b 100644 --- a/packages/gamut/src/Layout/Column.tsx +++ b/packages/gamut/src/Layout/Column.tsx @@ -1,8 +1,8 @@ import styled from '@emotion/styled'; import { styledOptions, system, variant } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; const rows = { 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6 }; diff --git a/packages/gamut/src/Layout/LayoutGrid.tsx b/packages/gamut/src/Layout/LayoutGrid.tsx index 252b64bddc..6f2e3ea621 100644 --- a/packages/gamut/src/Layout/LayoutGrid.tsx +++ b/packages/gamut/src/Layout/LayoutGrid.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; import { pxRem, styledOptions, system, theme } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; import pick from 'lodash/pick'; diff --git a/packages/gamut/src/List/Header/ListHeaderCol.tsx b/packages/gamut/src/List/Header/ListHeaderCol.tsx index 115da641f2..e7c4dd29df 100644 --- a/packages/gamut/src/List/Header/ListHeaderCol.tsx +++ b/packages/gamut/src/List/Header/ListHeaderCol.tsx @@ -1,4 +1,4 @@ -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; import { ColEl } from '../elements'; diff --git a/packages/gamut/src/List/List.tsx b/packages/gamut/src/List/List.tsx index 087356fef5..65d78d6103 100644 --- a/packages/gamut/src/List/List.tsx +++ b/packages/gamut/src/List/List.tsx @@ -1,11 +1,11 @@ import { DotLoose } from '@skillsoft/gamut-patterns'; import { timingValues } from '@skillsoft/gamut-styles'; import isArray from 'lodash/isArray'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import type * as React from 'react'; import { forwardRef, useEffect } from 'react'; -import type { BoxProps} from '../Box'; +import type { BoxProps } from '../Box'; import { Box, FlexBox } from '../Box'; import { AnimatedListWrapper, diff --git a/packages/gamut/src/List/ListCol.tsx b/packages/gamut/src/List/ListCol.tsx index bc888e113b..59c069ce2a 100644 --- a/packages/gamut/src/List/ListCol.tsx +++ b/packages/gamut/src/List/ListCol.tsx @@ -1,4 +1,4 @@ -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; import { ColEl, StickyHeaderColWrapper } from './elements'; diff --git a/packages/gamut/src/List/TableHeader.tsx b/packages/gamut/src/List/TableHeader.tsx index 6dc56c46ef..fd4d45adad 100644 --- a/packages/gamut/src/List/TableHeader.tsx +++ b/packages/gamut/src/List/TableHeader.tsx @@ -1,4 +1,4 @@ -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; import { Box } from '../Box'; diff --git a/packages/gamut/src/List/elements.tsx b/packages/gamut/src/List/elements.tsx index 1d79b2914c..73ebbfdb6b 100644 --- a/packages/gamut/src/List/elements.tsx +++ b/packages/gamut/src/List/elements.tsx @@ -7,7 +7,7 @@ import { theme, variant, } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; import { motion } from 'framer-motion'; diff --git a/packages/gamut/src/Markdown/index.tsx b/packages/gamut/src/Markdown/index.tsx index fb95303c4f..8b04affd7a 100644 --- a/packages/gamut/src/Markdown/index.tsx +++ b/packages/gamut/src/Markdown/index.tsx @@ -7,8 +7,7 @@ import { PureComponent } from 'react'; import sanitizeMarkdown from 'sanitize-markdown'; import { omitProps } from '../utils/omitProps'; -import type { - MarkdownOverrideSettings} from './libs/overrides'; +import type { MarkdownOverrideSettings } from './libs/overrides'; import { createCodeBlockOverride, createInputOverride, @@ -19,11 +18,8 @@ import { import { MarkdownCheckbox } from './libs/overrides/Checkbox'; import { Details } from './libs/overrides/Details'; import { Iframe } from './libs/overrides/Iframe'; -import type { - MarkdownAnchorProps} from './libs/overrides/MarkdownAnchor'; -import { - MarkdownAnchor -} from './libs/overrides/MarkdownAnchor'; +import type { MarkdownAnchorProps } from './libs/overrides/MarkdownAnchor'; +import { MarkdownAnchor } from './libs/overrides/MarkdownAnchor'; import { Table } from './libs/overrides/Table'; import { MarkdownVideo } from './libs/overrides/Video'; import { createPreprocessingInstructions } from './libs/preprocessing'; diff --git a/packages/gamut/src/Markdown/libs/overrides/Details/index.tsx b/packages/gamut/src/Markdown/libs/overrides/Details/index.tsx index 87afb6f80f..8ea6475e84 100644 --- a/packages/gamut/src/Markdown/libs/overrides/Details/index.tsx +++ b/packages/gamut/src/Markdown/libs/overrides/Details/index.tsx @@ -1,4 +1,4 @@ -import type { HTMLAttributes} from 'react'; +import type { HTMLAttributes } from 'react'; import type * as React from 'react'; import { useMemo } from 'react'; diff --git a/packages/gamut/src/Menu/Menu.tsx b/packages/gamut/src/Menu/Menu.tsx index 2b69b94635..83b6bd328d 100644 --- a/packages/gamut/src/Menu/Menu.tsx +++ b/packages/gamut/src/Menu/Menu.tsx @@ -1,4 +1,4 @@ -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; import { List } from './elements'; diff --git a/packages/gamut/src/Menu/MenuItem.tsx b/packages/gamut/src/Menu/MenuItem.tsx index 21c52811fe..04ca7efb7c 100644 --- a/packages/gamut/src/Menu/MenuItem.tsx +++ b/packages/gamut/src/Menu/MenuItem.tsx @@ -1,26 +1,13 @@ import type { GamutIconProps } from '@skillsoft/gamut-icons'; import isString from 'lodash/isString'; -import type { - ComponentProps, - MouseEventHandler, - Ref} from 'react'; -import { - forwardRef, - useId, -} from 'react'; +import type { ComponentProps, MouseEventHandler, Ref } from 'react'; +import { forwardRef, useId } from 'react'; import { FlexBox } from '../Box'; import type { ToolTipProps } from '../Tip/ToolTip'; import { Text } from '../Typography'; -import type { - ListItemProps, - ListLinkProps} from './elements'; -import { - ListButton, - ListItem, - ListLink, - MenuToolTipWrapper, -} from './elements'; +import type { ListItemProps, ListLinkProps } from './elements'; +import { ListButton, ListItem, ListLink, MenuToolTipWrapper } from './elements'; import { useMenuContext } from './MenuContext'; const getListItemType = (href: boolean, onClick: boolean) => diff --git a/packages/gamut/src/Menu/elements.tsx b/packages/gamut/src/Menu/elements.tsx index f4b106a5f0..d0f63d75cc 100644 --- a/packages/gamut/src/Menu/elements.tsx +++ b/packages/gamut/src/Menu/elements.tsx @@ -4,10 +4,10 @@ import { system, transitionConcat, } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; import isObject from 'lodash/isObject'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; import { sharedStates } from '../Box/props'; diff --git a/packages/gamut/src/Modals/Dialog.tsx b/packages/gamut/src/Modals/Dialog.tsx index abbbe47244..e0b21cb229 100644 --- a/packages/gamut/src/Modals/Dialog.tsx +++ b/packages/gamut/src/Modals/Dialog.tsx @@ -1,5 +1,5 @@ import { MiniDeleteIcon } from '@skillsoft/gamut-icons'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import type * as React from 'react'; import { useId } from 'react'; diff --git a/packages/gamut/src/Modals/Modal.tsx b/packages/gamut/src/Modals/Modal.tsx index a2d333c4d7..e23be25aaa 100644 --- a/packages/gamut/src/Modals/Modal.tsx +++ b/packages/gamut/src/Modals/Modal.tsx @@ -1,10 +1,10 @@ import { MiniDeleteIcon } from '@skillsoft/gamut-icons'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import type * as React from 'react'; import { useId, useState } from 'react'; import { Box } from '../Box'; -import type { ButtonProps} from '../Button'; +import type { ButtonProps } from '../Button'; import { FillButton, IconButton, TextButton } from '../Button'; import { Overlay } from '../Overlay'; import { Text } from '../Typography'; diff --git a/packages/gamut/src/Pagination/PaginationButton.tsx b/packages/gamut/src/Pagination/PaginationButton.tsx index e4297477d1..ebe8fe05ee 100644 --- a/packages/gamut/src/Pagination/PaginationButton.tsx +++ b/packages/gamut/src/Pagination/PaginationButton.tsx @@ -1,6 +1,6 @@ import type { GamutIconProps } from '@skillsoft/gamut-icons'; import type { StyleProps } from '@skillsoft/variance'; -import type { ComponentProps, ComponentType} from 'react'; +import type { ComponentProps, ComponentType } from 'react'; import { forwardRef, useMemo } from 'react'; import { createButtonComponent } from '../Button/shared'; diff --git a/packages/gamut/src/PatternBackdrop/PatternBackdrop.tsx b/packages/gamut/src/PatternBackdrop/PatternBackdrop.tsx index ee8408ffd5..962afda607 100644 --- a/packages/gamut/src/PatternBackdrop/PatternBackdrop.tsx +++ b/packages/gamut/src/PatternBackdrop/PatternBackdrop.tsx @@ -1,9 +1,9 @@ import styled from '@emotion/styled'; import { CheckerDense } from '@skillsoft/gamut-patterns'; import { styledOptions, system } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; import { Box } from '../Box'; diff --git a/packages/gamut/src/Popover/elements.tsx b/packages/gamut/src/Popover/elements.tsx index ae0364dcc5..983e67189c 100644 --- a/packages/gamut/src/Popover/elements.tsx +++ b/packages/gamut/src/Popover/elements.tsx @@ -7,12 +7,8 @@ import { BodyPortal } from '../BodyPortal'; import { Box, FlexBox } from '../Box'; import { popoverToolTipBodyAlignments } from '../Tip/shared/styles/styles'; import type { WithChildrenProp } from '../utils'; -import type { - popoverStates} from './styles/base'; -import { - raisedDivVariants, - transformValues, -} from './styles/base'; +import type { popoverStates } from './styles/base'; +import { raisedDivVariants, transformValues } from './styles/base'; import { patternContainerBaseStyles } from './styles/pattern'; import { beakBoxVariants, diff --git a/packages/gamut/src/Popover/types.tsx b/packages/gamut/src/Popover/types.tsx index 4a47715462..333e2d60f8 100755 --- a/packages/gamut/src/Popover/types.tsx +++ b/packages/gamut/src/Popover/types.tsx @@ -1,5 +1,5 @@ import type { PatternProps } from '@skillsoft/gamut-patterns'; -import type { HTMLAttributes} from 'react'; +import type { HTMLAttributes } from 'react'; import { type RefObject } from 'react'; import type { PopoverVariants } from './elements'; diff --git a/packages/gamut/src/PopoverContainer/utils.ts b/packages/gamut/src/PopoverContainer/utils.ts index 55bdd50189..8c97fa8ad0 100644 --- a/packages/gamut/src/PopoverContainer/utils.ts +++ b/packages/gamut/src/PopoverContainer/utils.ts @@ -1,8 +1,5 @@ -import type { - CSSObject} from '@skillsoft/variance'; -import { - percentageOrAbsolute as percent, -} from '@skillsoft/variance'; +import type { CSSObject } from '@skillsoft/variance'; +import { percentageOrAbsolute as percent } from '@skillsoft/variance'; import type { PopoverContainerAlignment, PopoverPositionConfig } from './types'; diff --git a/packages/gamut/src/Tabs/Tab.tsx b/packages/gamut/src/Tabs/Tab.tsx index 5cf76a0d56..dbd34a7a74 100644 --- a/packages/gamut/src/Tabs/Tab.tsx +++ b/packages/gamut/src/Tabs/Tab.tsx @@ -1,13 +1,10 @@ import styled from '@emotion/styled'; import type * as React from 'react'; -import type { - TabProps as ReactAriaTabProps} from 'react-aria-components'; -import { - Tab as ReactAriaTab -} from 'react-aria-components'; +import type { TabProps as ReactAriaTabProps } from 'react-aria-components'; +import { Tab as ReactAriaTab } from 'react-aria-components'; import { tabElementBaseProps } from './props'; -import type { TabButtonProps} from './TabButton'; +import type { TabButtonProps } from './TabButton'; import { tabStates, tabVariants } from './TabButton'; import { useTab } from './TabProvider'; diff --git a/packages/gamut/src/Tabs/TabButton.tsx b/packages/gamut/src/Tabs/TabButton.tsx index 567930d132..2d76d69bd8 100644 --- a/packages/gamut/src/Tabs/TabButton.tsx +++ b/packages/gamut/src/Tabs/TabButton.tsx @@ -3,12 +3,8 @@ import { states, variant } from '@skillsoft/gamut-styles'; import type { StyleProps } from '@skillsoft/variance'; import { ButtonBase } from '../ButtonBase'; -import type { - TabElementStyleProps} from './props'; -import { - tabElementBaseProps, - TabSelectors, -} from './props'; +import type { TabElementStyleProps } from './props'; +import { tabElementBaseProps, TabSelectors } from './props'; export interface TabButtonProps extends StyleProps, diff --git a/packages/gamut/src/Tabs/TabList.tsx b/packages/gamut/src/Tabs/TabList.tsx index 0337c8f895..d30783bbb2 100644 --- a/packages/gamut/src/Tabs/TabList.tsx +++ b/packages/gamut/src/Tabs/TabList.tsx @@ -3,10 +3,9 @@ import type { StyleProps } from '@skillsoft/variance'; import type * as React from 'react'; import type { TabListProps as ReactAriaTabListProps, - TabProps} from 'react-aria-components'; -import { - TabList as ReactAriaTabList + TabProps, } from 'react-aria-components'; +import { TabList as ReactAriaTabList } from 'react-aria-components'; import type { TabElementStyleProps } from './props'; import { tabElementBaseProps } from './props'; diff --git a/packages/gamut/src/Tabs/TabPanel.tsx b/packages/gamut/src/Tabs/TabPanel.tsx index 28e83f3055..d7787d2b6e 100644 --- a/packages/gamut/src/Tabs/TabPanel.tsx +++ b/packages/gamut/src/Tabs/TabPanel.tsx @@ -1,11 +1,8 @@ import styled from '@emotion/styled'; import { system } from '@skillsoft/gamut-styles'; import type * as React from 'react'; -import type { - TabPanelProps as ReactAriaTabPanelProps} from 'react-aria-components'; -import { - TabPanel as ReactAriaTabPanel -} from 'react-aria-components'; +import type { TabPanelProps as ReactAriaTabPanelProps } from 'react-aria-components'; +import { TabPanel as ReactAriaTabPanel } from 'react-aria-components'; import type { TabElementStyleProps } from './props'; import { tabElementBaseProps } from './props'; diff --git a/packages/gamut/src/Tabs/Tabs.tsx b/packages/gamut/src/Tabs/Tabs.tsx index e8344571b8..ef5c3e1687 100644 --- a/packages/gamut/src/Tabs/Tabs.tsx +++ b/packages/gamut/src/Tabs/Tabs.tsx @@ -2,11 +2,8 @@ import styled from '@emotion/styled'; import { Background } from '@skillsoft/gamut-styles'; import type { StyleProps } from '@skillsoft/variance'; import type * as React from 'react'; -import type { - TabsProps as ReactAriaTabsProps} from 'react-aria-components'; -import { - Tabs as ReactAriaTabs -} from 'react-aria-components'; +import type { TabsProps as ReactAriaTabsProps } from 'react-aria-components'; +import { Tabs as ReactAriaTabs } from 'react-aria-components'; import type { TabElementStyleProps } from './props'; import { tabElementBaseProps } from './props'; diff --git a/packages/gamut/src/Tabs/props.tsx b/packages/gamut/src/Tabs/props.tsx index e33f03e133..e565b67bee 100644 --- a/packages/gamut/src/Tabs/props.tsx +++ b/packages/gamut/src/Tabs/props.tsx @@ -1,5 +1,5 @@ import { system } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; export enum TabSelectors { diff --git a/packages/gamut/src/Tag/elements.tsx b/packages/gamut/src/Tag/elements.tsx index 2c8b224e42..41ee2798f8 100644 --- a/packages/gamut/src/Tag/elements.tsx +++ b/packages/gamut/src/Tag/elements.tsx @@ -23,10 +23,9 @@ import type { BaseTagProps, DismissButtonProps, TagAnchorProps, - TagTextProps} from './types'; -import { - tagProps + TagTextProps, } from './types'; +import { tagProps } from './types'; export const Outline = styled(FlexBox)(outlineStyling, outlineStates); diff --git a/packages/gamut/src/Tag/types.tsx b/packages/gamut/src/Tag/types.tsx index ffbfeae589..51a1a0c917 100644 --- a/packages/gamut/src/Tag/types.tsx +++ b/packages/gamut/src/Tag/types.tsx @@ -1,5 +1,5 @@ import { system } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; import type { ComponentProps, HTMLProps } from 'react'; diff --git a/packages/gamut/src/Tip/InfoTip/InfoTipButton.tsx b/packages/gamut/src/Tip/InfoTip/InfoTipButton.tsx index 7ae90659cf..bf87fdd988 100644 --- a/packages/gamut/src/Tip/InfoTip/InfoTipButton.tsx +++ b/packages/gamut/src/Tip/InfoTip/InfoTipButton.tsx @@ -2,18 +2,14 @@ import { MiniInfoCircleIcon, MiniInfoOutlineIcon, } from '@skillsoft/gamut-icons'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; import { createButtonComponent } from '../../Button/shared'; import type { ButtonBaseElements } from '../../ButtonBase/ButtonBase'; import type { InfoTipProps } from '.'; -import type { - InfoButtonStatesProps} from './styles'; -import { - infoButtonStates, - infoButtonStyles, -} from './styles'; +import type { InfoButtonStatesProps } from './styles'; +import { infoButtonStates, infoButtonStyles } from './styles'; const InfoTipButtonBase = createButtonComponent( infoButtonStyles, diff --git a/packages/gamut/src/Tip/InfoTip/index.tsx b/packages/gamut/src/Tip/InfoTip/index.tsx index 35b28eaa2b..226ab0e52e 100644 --- a/packages/gamut/src/Tip/InfoTip/index.tsx +++ b/packages/gamut/src/Tip/InfoTip/index.tsx @@ -10,12 +10,8 @@ import { import { getFocusableElements as getFocusableElementsUtil } from '../../utils/focus'; import { FloatingTip } from '../shared/FloatingTip'; import { InlineTip } from '../shared/InlineTip'; -import type { - TipBaseAlignment, - TipBaseProps} from '../shared/types'; -import { - tipDefaultProps, -} from '../shared/types'; +import type { TipBaseAlignment, TipBaseProps } from '../shared/types'; +import { tipDefaultProps } from '../shared/types'; import { isFloatingElementOpen } from '../shared/utils'; import { InfoTipButton } from './InfoTipButton'; diff --git a/packages/gamut/src/Tip/PreviewTip/elements.tsx b/packages/gamut/src/Tip/PreviewTip/elements.tsx index 4b68576755..d79880b2c0 100644 --- a/packages/gamut/src/Tip/PreviewTip/elements.tsx +++ b/packages/gamut/src/Tip/PreviewTip/elements.tsx @@ -9,7 +9,10 @@ import { InteractiveSelectors } from '../../ButtonBase/ButtonBase'; import { Shimmer } from '../../Loading/Shimmer'; import { patternContainerBaseStyles } from '../../Popover/styles/pattern'; import { Text } from '../../Typography'; -import type { PreviewTipContent, TipPlacementComponentProps } from '../shared/types'; +import type { + PreviewTipContent, + TipPlacementComponentProps, +} from '../shared/types'; import { avatarColumnTemplate, avatarGridTemplate, diff --git a/packages/gamut/src/Tip/PreviewTip/index.tsx b/packages/gamut/src/Tip/PreviewTip/index.tsx index bf3591d579..10e2ab87fb 100644 --- a/packages/gamut/src/Tip/PreviewTip/index.tsx +++ b/packages/gamut/src/Tip/PreviewTip/index.tsx @@ -1,25 +1,16 @@ -import type { - ComponentProps, - FocusEvent} from 'react'; -import { - useEffect, - useId, - useMemo, - useRef, - useState, -} from 'react'; +import type { ComponentProps, FocusEvent } from 'react'; +import { useEffect, useId, useMemo, useRef, useState } from 'react'; -import type { Anchor} from '../..'; +import type { Anchor } from '../..'; import { Text } from '../..'; import { FloatingTip } from '../shared/FloatingTip'; import { InlineTip } from '../shared/InlineTip'; import type { PreviewTipContent, TipBaseAlignment, - TipBaseProps} from '../shared/types'; -import { - tipDefaultProps, + TipBaseProps, } from '../shared/types'; +import { tipDefaultProps } from '../shared/types'; import { PreviewTipAnchor } from './elements'; import { getPreviewDescription } from './utils'; diff --git a/packages/gamut/src/Tip/ToolTip/index.tsx b/packages/gamut/src/Tip/ToolTip/index.tsx index 9c7c7e284b..1a18d9ef53 100644 --- a/packages/gamut/src/Tip/ToolTip/index.tsx +++ b/packages/gamut/src/Tip/ToolTip/index.tsx @@ -4,12 +4,8 @@ import { Text } from '../../Typography'; import type { WithChildrenProp } from '../../utils'; import { FloatingTip } from '../shared/FloatingTip'; import { InlineTip } from '../shared/InlineTip'; -import type { - TipBaseProps, - TipCenterAlignment} from '../shared/types'; -import { - tipDefaultProps, -} from '../shared/types'; +import type { TipBaseProps, TipCenterAlignment } from '../shared/types'; +import { tipDefaultProps } from '../shared/types'; export type ToolTipProps = TipBaseProps & WithChildrenProp & { diff --git a/packages/gamut/src/Tip/__tests__/mocks.tsx b/packages/gamut/src/Tip/__tests__/mocks.tsx index a06e6800d4..4ccbc8db4e 100644 --- a/packages/gamut/src/Tip/__tests__/mocks.tsx +++ b/packages/gamut/src/Tip/__tests__/mocks.tsx @@ -1,4 +1,4 @@ -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { useState } from 'react'; import { FillButton } from '../../Button'; diff --git a/packages/gamut/src/Toast/Toast.tsx b/packages/gamut/src/Toast/Toast.tsx index ff2914a74a..fbac96d07c 100644 --- a/packages/gamut/src/Toast/Toast.tsx +++ b/packages/gamut/src/Toast/Toast.tsx @@ -2,7 +2,7 @@ import styled from '@emotion/styled'; import { MiniDeleteIcon } from '@skillsoft/gamut-icons'; import { system } from '@skillsoft/gamut-styles'; import type { StyleProps } from '@skillsoft/variance'; -import type { ReactNode} from 'react'; +import type { ReactNode } from 'react'; import type * as React from 'react'; import { useMemo } from 'react'; diff --git a/packages/gamut/src/Toggle/elements.tsx b/packages/gamut/src/Toggle/elements.tsx index 30aaeae5b4..d53c132d26 100644 --- a/packages/gamut/src/Toggle/elements.tsx +++ b/packages/gamut/src/Toggle/elements.tsx @@ -7,7 +7,7 @@ import { theme, variant, } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; import { Box } from '../Box'; diff --git a/packages/gamut/src/Typography/Text.tsx b/packages/gamut/src/Typography/Text.tsx index f96b6bb092..f9dae8a222 100644 --- a/packages/gamut/src/Typography/Text.tsx +++ b/packages/gamut/src/Typography/Text.tsx @@ -5,9 +5,9 @@ import { system, variant, } from '@skillsoft/gamut-styles'; -import type { StyleProps} from '@skillsoft/variance'; +import type { StyleProps } from '@skillsoft/variance'; import { variance } from '@skillsoft/variance'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; import { typographyElementVariants, typographyStyleVariants } from './variants'; diff --git a/packages/gamut/src/Video/lib/VidstackPlayer/index.tsx b/packages/gamut/src/Video/lib/VidstackPlayer/index.tsx index 55a6f927d9..9d01531bbd 100644 --- a/packages/gamut/src/Video/lib/VidstackPlayer/index.tsx +++ b/packages/gamut/src/Video/lib/VidstackPlayer/index.tsx @@ -7,7 +7,8 @@ import styled from '@emotion/styled'; import { styledOptions } from '@skillsoft/gamut-styles'; import type { MediaPlayerInstance, - MediaProviderAdapter} from '@vidstack/react'; + MediaProviderAdapter, +} from '@vidstack/react'; import { isYouTubeProvider, MediaPlayer, diff --git a/packages/gamut/src/Video/lib/utils/icons.tsx b/packages/gamut/src/Video/lib/utils/icons.tsx index 4f2c94b9aa..caf998cc79 100644 --- a/packages/gamut/src/Video/lib/utils/icons.tsx +++ b/packages/gamut/src/Video/lib/utils/icons.tsx @@ -19,10 +19,9 @@ import { } from '@skillsoft/gamut-icons'; import type { DefaultLayoutIcon, - DefaultLayoutIcons} from '@vidstack/react/player/layouts/default'; -import { - defaultLayoutIcons, + DefaultLayoutIcons, } from '@vidstack/react/player/layouts/default'; +import { defaultLayoutIcons } from '@vidstack/react/player/layouts/default'; const IconWrapper = (Icon: DefaultLayoutIcon) => (props: any) => ; diff --git a/packages/styleguide/src/lib/Atoms/Animations/ExpandInCollapseOut/ExpandInCollapseOut.stories.tsx b/packages/styleguide/src/lib/Atoms/Animations/ExpandInCollapseOut/ExpandInCollapseOut.stories.tsx index 6b85de2417..2ec1ca7f6d 100644 --- a/packages/styleguide/src/lib/Atoms/Animations/ExpandInCollapseOut/ExpandInCollapseOut.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/Animations/ExpandInCollapseOut/ExpandInCollapseOut.stories.tsx @@ -6,7 +6,7 @@ import { } from '@skillsoft/gamut'; import type { Meta } from '@storybook/react'; import { AnimatePresence } from 'framer-motion'; -import type { PropsWithChildren} from 'react'; +import type { PropsWithChildren } from 'react'; import { useState } from 'react'; const meta: Meta = { diff --git a/packages/styleguide/src/lib/Atoms/Animations/Rotation/Rotation.stories.tsx b/packages/styleguide/src/lib/Atoms/Animations/Rotation/Rotation.stories.tsx index ba132f3c10..a9590a3a02 100644 --- a/packages/styleguide/src/lib/Atoms/Animations/Rotation/Rotation.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/Animations/Rotation/Rotation.stories.tsx @@ -1,7 +1,7 @@ import { Rotation, StrokeButton } from '@skillsoft/gamut'; import { MiniChevronDownIcon } from '@skillsoft/gamut-icons'; import type { Meta } from '@storybook/react'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { useEffect, useState } from 'react'; const meta: Meta = { diff --git a/packages/styleguide/src/lib/Atoms/Badge/examples.tsx b/packages/styleguide/src/lib/Atoms/Badge/examples.tsx index 1fa5b2d320..a18e6f65b8 100644 --- a/packages/styleguide/src/lib/Atoms/Badge/examples.tsx +++ b/packages/styleguide/src/lib/Atoms/Badge/examples.tsx @@ -1,5 +1,5 @@ import styled from '@emotion/styled'; -import type { BadgeProps} from '@skillsoft/gamut'; +import type { BadgeProps } from '@skillsoft/gamut'; import { Badge, Box } from '@skillsoft/gamut'; import { MiniStarIcon } from '@skillsoft/gamut-icons'; import { css } from '@skillsoft/gamut-styles'; diff --git a/packages/styleguide/src/lib/Atoms/Drawer/Drawer.stories.tsx b/packages/styleguide/src/lib/Atoms/Drawer/Drawer.stories.tsx index aabc580630..de2d8d1acf 100644 --- a/packages/styleguide/src/lib/Atoms/Drawer/Drawer.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/Drawer/Drawer.stories.tsx @@ -1,6 +1,6 @@ import { Drawer, FlexBox, StrokeButton } from '@skillsoft/gamut'; import type { Meta } from '@storybook/react'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { useEffect, useState } from 'react'; const meta: Meta = { diff --git a/packages/styleguide/src/lib/Atoms/FormInputs/Checkbox/Checkbox.stories.tsx b/packages/styleguide/src/lib/Atoms/FormInputs/Checkbox/Checkbox.stories.tsx index fce0fc04ad..5f864b9073 100644 --- a/packages/styleguide/src/lib/Atoms/FormInputs/Checkbox/Checkbox.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/FormInputs/Checkbox/Checkbox.stories.tsx @@ -1,5 +1,4 @@ -import type { - CheckboxProps} from '@skillsoft/gamut'; +import type { CheckboxProps } from '@skillsoft/gamut'; import { Anchor, Box, diff --git a/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx b/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx index db9b0ec5b7..a2de49aec6 100644 --- a/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/FormInputs/Radio/Radio.stories.tsx @@ -1,6 +1,6 @@ import { FormGroup, Radio, RadioGroup } from '@skillsoft/gamut'; import type { Meta, StoryObj } from '@storybook/react'; -import type { ChangeEvent} from 'react'; +import type { ChangeEvent } from 'react'; import type React from 'react'; import { useState } from 'react'; import type { TypeWithDeepControls } from 'storybook-addon-deep-controls'; diff --git a/packages/styleguide/src/lib/Atoms/PopoverContainer/PopoverContainer.stories.tsx b/packages/styleguide/src/lib/Atoms/PopoverContainer/PopoverContainer.stories.tsx index 06893f35ee..091badbea2 100644 --- a/packages/styleguide/src/lib/Atoms/PopoverContainer/PopoverContainer.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/PopoverContainer/PopoverContainer.stories.tsx @@ -1,7 +1,7 @@ import { FlexBox, PopoverContainer, Text } from '@skillsoft/gamut'; import { Background } from '@skillsoft/gamut-styles'; import type { Meta } from '@storybook/react'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { useRef } from 'react'; const meta: Meta = { diff --git a/packages/styleguide/src/lib/Atoms/UtilityComponents/DelayedRenderWrapper/DelayedRenderWrapper.stories.tsx b/packages/styleguide/src/lib/Atoms/UtilityComponents/DelayedRenderWrapper/DelayedRenderWrapper.stories.tsx index 59e674f0ac..d8f82a522b 100644 --- a/packages/styleguide/src/lib/Atoms/UtilityComponents/DelayedRenderWrapper/DelayedRenderWrapper.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/UtilityComponents/DelayedRenderWrapper/DelayedRenderWrapper.stories.tsx @@ -6,7 +6,7 @@ import { Text, } from '@skillsoft/gamut'; import type { Meta } from '@storybook/react'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { useState } from 'react'; const meta: Meta = { diff --git a/packages/styleguide/src/lib/Atoms/UtilityComponents/FocusTrap/FocusTrap.stories.tsx b/packages/styleguide/src/lib/Atoms/UtilityComponents/FocusTrap/FocusTrap.stories.tsx index 62056ad9e2..8ca0219442 100644 --- a/packages/styleguide/src/lib/Atoms/UtilityComponents/FocusTrap/FocusTrap.stories.tsx +++ b/packages/styleguide/src/lib/Atoms/UtilityComponents/FocusTrap/FocusTrap.stories.tsx @@ -1,6 +1,6 @@ import { Box, FillButton, FocusTrap, GridForm } from '@skillsoft/gamut'; import type { Meta } from '@storybook/react'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { useEffect, useState } from 'react'; const meta: Meta = { diff --git a/packages/styleguide/src/lib/Foundations/ColorMode/examples.tsx b/packages/styleguide/src/lib/Foundations/ColorMode/examples.tsx index 7a6d53f1a5..2d404d2f95 100644 --- a/packages/styleguide/src/lib/Foundations/ColorMode/examples.tsx +++ b/packages/styleguide/src/lib/Foundations/ColorMode/examples.tsx @@ -1,5 +1,4 @@ -import type { - ButtonProps} from '@skillsoft/gamut'; +import type { ButtonProps } from '@skillsoft/gamut'; import { Anchor, Box, @@ -29,7 +28,7 @@ import { ColorMode, usePrefersDarkMode, } from '@skillsoft/gamut-styles'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import type * as React from 'react'; import { useState } from 'react'; diff --git a/packages/styleguide/src/lib/Foundations/shared/elements.tsx b/packages/styleguide/src/lib/Foundations/shared/elements.tsx index d5e9eb0370..2927b90602 100644 --- a/packages/styleguide/src/lib/Foundations/shared/elements.tsx +++ b/packages/styleguide/src/lib/Foundations/shared/elements.tsx @@ -1,9 +1,8 @@ -import type { Theme} from '@emotion/react'; +import type { Theme } from '@emotion/react'; import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { Anchor, Box } from '@skillsoft/gamut'; -import type { - ElevationState} from '@skillsoft/gamut-styles'; +import type { ElevationState } from '@skillsoft/gamut-styles'; import { Background, coreSwatches, diff --git a/packages/styleguide/src/lib/Molecules/Coachmark/Coachmark.stories.tsx b/packages/styleguide/src/lib/Molecules/Coachmark/Coachmark.stories.tsx index 92ac244113..3d3de3eb99 100644 --- a/packages/styleguide/src/lib/Molecules/Coachmark/Coachmark.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Coachmark/Coachmark.stories.tsx @@ -1,7 +1,7 @@ import { Coachmark, FillButton, FlexBox, Text } from '@skillsoft/gamut'; import * as patterns from '@skillsoft/gamut-patterns'; import type { Meta, StoryObj } from '@storybook/react'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { useEffect, useState } from 'react'; import type { TypeWithDeepControls } from 'storybook-addon-deep-controls'; diff --git a/packages/styleguide/src/lib/Molecules/Flyout/Flyout.stories.tsx b/packages/styleguide/src/lib/Molecules/Flyout/Flyout.stories.tsx index 3055073a4a..52ae8ca75c 100644 --- a/packages/styleguide/src/lib/Molecules/Flyout/Flyout.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Flyout/Flyout.stories.tsx @@ -1,6 +1,6 @@ import { Box, FlexBox, Flyout, StrokeButton } from '@skillsoft/gamut'; import type { Meta } from '@storybook/react'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { useEffect, useState } from 'react'; const meta: Meta = { diff --git a/packages/styleguide/src/lib/Molecules/Modals/Dialog/Dialog.stories.tsx b/packages/styleguide/src/lib/Molecules/Modals/Dialog/Dialog.stories.tsx index 448abd5e9c..37f841a0f1 100644 --- a/packages/styleguide/src/lib/Molecules/Modals/Dialog/Dialog.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Modals/Dialog/Dialog.stories.tsx @@ -8,7 +8,7 @@ import { } from '@skillsoft/gamut'; import { ColorMode } from '@skillsoft/gamut-styles'; import type { Meta } from '@storybook/react'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import { useEffect, useRef, useState } from 'react'; import type { TypeWithDeepControls } from 'storybook-addon-deep-controls'; diff --git a/packages/styleguide/src/lib/Molecules/Modals/Modal/Modal.stories.tsx b/packages/styleguide/src/lib/Molecules/Modals/Modal/Modal.stories.tsx index 37831ec2aa..ac1e86aad5 100644 --- a/packages/styleguide/src/lib/Molecules/Modals/Modal/Modal.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Modals/Modal/Modal.stories.tsx @@ -9,7 +9,7 @@ import { } from '@skillsoft/gamut'; import { CodeCelebration } from '@skillsoft/gamut-illustrations'; import type { Meta } from '@storybook/react'; -import type { ComponentProps} from 'react'; +import type { ComponentProps } from 'react'; import type React from 'react'; import { useEffect, useRef, useState } from 'react'; import type { TypeWithDeepControls } from 'storybook-addon-deep-controls'; diff --git a/packages/styleguide/src/lib/Molecules/Pagination/Pagination.stories.tsx b/packages/styleguide/src/lib/Molecules/Pagination/Pagination.stories.tsx index f7075a09ab..ba7515ebf9 100644 --- a/packages/styleguide/src/lib/Molecules/Pagination/Pagination.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Pagination/Pagination.stories.tsx @@ -1,11 +1,5 @@ -import type { - PaginationProps} from '@skillsoft/gamut'; -import { - FlexBox, - FormGroup, - Input, - Pagination -} from '@skillsoft/gamut'; +import type { PaginationProps } from '@skillsoft/gamut'; +import { FlexBox, FormGroup, Input, Pagination } from '@skillsoft/gamut'; import type { Meta, StoryObj } from '@storybook/react'; import { useCallback, useState } from 'react'; diff --git a/packages/styleguide/src/lib/Molecules/Popover/Popover.stories.tsx b/packages/styleguide/src/lib/Molecules/Popover/Popover.stories.tsx index 1ee66fbfa1..bc501e88a1 100644 --- a/packages/styleguide/src/lib/Molecules/Popover/Popover.stories.tsx +++ b/packages/styleguide/src/lib/Molecules/Popover/Popover.stories.tsx @@ -1,12 +1,5 @@ -import type { - FlexBoxProps, - PopoverProps} from '@skillsoft/gamut'; -import { - Box, - FillButton, - FlexBox, - Popover -} from '@skillsoft/gamut'; +import type { FlexBoxProps, PopoverProps } from '@skillsoft/gamut'; +import { Box, FillButton, FlexBox, Popover } from '@skillsoft/gamut'; import * as patterns from '@skillsoft/gamut-patterns'; import type { Meta, StoryObj } from '@storybook/react'; import { useRef, useState } from 'react'; diff --git a/packages/styleguide/src/lib/Organisms/BarChart/BarChart.stories.tsx b/packages/styleguide/src/lib/Organisms/BarChart/BarChart.stories.tsx index f833e14aa1..c3a5af5e39 100644 --- a/packages/styleguide/src/lib/Organisms/BarChart/BarChart.stories.tsx +++ b/packages/styleguide/src/lib/Organisms/BarChart/BarChart.stories.tsx @@ -1,10 +1,5 @@ -import type { - BarProps, - PartialBarChartTranslations} from '@skillsoft/gamut'; -import { - BarChart, - Box -} from '@skillsoft/gamut'; +import type { BarProps, PartialBarChartTranslations } from '@skillsoft/gamut'; +import { BarChart, Box } from '@skillsoft/gamut'; import { BookFlipPageIcon, DataScienceIcon, diff --git a/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.stories.tsx b/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.stories.tsx index a05077c07f..1f2a7d4296 100644 --- a/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.stories.tsx +++ b/packages/styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.stories.tsx @@ -1,5 +1,4 @@ -import type { - ConnectedFormGroupProps} from '@skillsoft/gamut'; +import type { ConnectedFormGroupProps } from '@skillsoft/gamut'; import { ConnectedForm, ConnectedFormGroup, diff --git a/packages/styleguide/src/lib/Organisms/ListsAndTables/examples.tsx b/packages/styleguide/src/lib/Organisms/ListsAndTables/examples.tsx index 58836b4334..c96e5a0e8e 100644 --- a/packages/styleguide/src/lib/Organisms/ListsAndTables/examples.tsx +++ b/packages/styleguide/src/lib/Organisms/ListsAndTables/examples.tsx @@ -1,5 +1,4 @@ -import type { - ColumnConfig} from '@skillsoft/gamut'; +import type { ColumnConfig } from '@skillsoft/gamut'; import { Box, DataList, diff --git a/packages/styleguide/src/lib/Typography/Anchor/Anchor.examples.tsx b/packages/styleguide/src/lib/Typography/Anchor/Anchor.examples.tsx index a7091ddb80..db38de7df3 100644 --- a/packages/styleguide/src/lib/Typography/Anchor/Anchor.examples.tsx +++ b/packages/styleguide/src/lib/Typography/Anchor/Anchor.examples.tsx @@ -1,5 +1,4 @@ -import type { - AnchorProps} from '@skillsoft/gamut'; +import type { AnchorProps } from '@skillsoft/gamut'; import { Anchor, Box, diff --git a/packages/variance/src/createTheme/createTheme.ts b/packages/variance/src/createTheme/createTheme.ts index f308fd41e2..d162ace627 100644 --- a/packages/variance/src/createTheme/createTheme.ts +++ b/packages/variance/src/createTheme/createTheme.ts @@ -5,9 +5,14 @@ import type { CSSObject } from '../types/props'; import type { AbstractTheme } from '../types/theme'; import type { LiteralPaths } from '../utils/flattenScale'; import { flattenScale } from '../utils/flattenScale'; -import type { KeyAsVariable} from '../utils/serializeTokens'; +import type { KeyAsVariable } from '../utils/serializeTokens'; import { serializeTokens } from '../utils/serializeTokens'; -import type { ColorModeConfig, Merge, MergeTheme, PrivateThemeKeys } from './types'; +import type { + ColorModeConfig, + Merge, + MergeTheme, + PrivateThemeKeys, +} from './types'; class ThemeBuilder { #theme = {} as T; From d88076a6b56bea2b645362197f5298bc5921574d Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 24 Sep 2026 14:13:09 -0400 Subject: [PATCH 21/47] feat(gamut-codemods): add codemods package with a scope-swap preset Adds @skillsoft/gamut-codemods, a jscodeshift-based CLI for moving consumers from @codecademy/gamut* to @skillsoft/gamut*: npx @skillsoft/gamut-codemods scope-swap . The scope-swap preset rewrites imports, mocks, `declare module`, and package-name strings; moves Video/VideoProps to @skillsoft/gamut/Video; maps /dist/ deep imports to public entry points; replaces gamut-kit in package.json and Module Federation shared config; and updates the ESLint plugin prefix. It refuses to run on a dirty tree, and ends with a leftovers report plus a checklist built from what fired. Structure: presets (one per upgrade) hold a data manifest and an ordered list of reusable migrations. String swaps are splice edits on the original text rather than recast prints, since recast reprinted neighbouring code in semicolon-less files and changed JSX whitespace. Also adds gamut-codemods, gamut-illustrations, and gamut-tests to the changesets fixed group so every consumer-facing package shares a version, which the preset uses for its target versions. Co-Authored-By: Claude Opus 5.5 --- .changeset/config.json | 3 + .changeset/gamut-codemods-scope-swap.md | 5 + .eslintignore | 1 + .prettierignore | 2 + packages/gamut-codemods/.gitignore | 1 + packages/gamut-codemods/README.md | 109 +++++ packages/gamut-codemods/jest.config.ts | 19 + packages/gamut-codemods/package.json | 38 ++ packages/gamut-codemods/project.json | 46 ++ .../__testfixtures__/end-to-end.input.tsx | 7 + .../__testfixtures__/end-to-end.output.tsx | 8 + .../src/__tests__/fixtures.test.ts | 112 +++++ .../gamut-codemods/src/__tests__/lib.test.ts | 116 +++++ .../src/__tests__/manifest.test.ts | 111 +++++ packages/gamut-codemods/src/bin.ts | 13 + packages/gamut-codemods/src/cli.ts | 187 ++++++++ packages/gamut-codemods/src/lib/git.ts | 27 ++ packages/gamut-codemods/src/lib/leftovers.ts | 81 ++++ packages/gamut-codemods/src/lib/manifest.ts | 72 +++ .../gamut-codemods/src/lib/module-strings.ts | 81 ++++ packages/gamut-codemods/src/lib/types.ts | 85 ++++ .../__testfixtures__/rewrites.input.tsx | 7 + .../__testfixtures__/rewrites.output.tsx | 7 + .../__testfixtures__/rewrites.warnings.json | 1 + .../src/migrations/deep-imports/index.ts | 127 ++++++ .../__testfixtures__/directives.input.tsx | 6 + .../__testfixtures__/directives.output.tsx | 6 + .../src/migrations/eslint-comments/index.ts | 49 +++ .../__testfixtures__/legacy.input.json | 9 + .../__testfixtures__/legacy.output.json | 9 + .../src/migrations/eslint-config/index.ts | 28 ++ .../__testfixtures__/already-shared.input.ts | 11 + .../__testfixtures__/already-shared.output.ts | 19 + .../mf-shared/__testfixtures__/kit.input.ts | 11 + .../mf-shared/__testfixtures__/kit.output.ts | 16 + .../__testfixtures__/kit.warnings.json | 1 + .../src/migrations/mf-shared/index.ts | 112 +++++ .../__testfixtures__/merge-existing.input.tsx | 5 + .../merge-existing.output.tsx | 5 + .../__testfixtures__/mixed-import.input.tsx | 7 + .../__testfixtures__/mixed-import.output.tsx | 8 + .../__testfixtures__/re-export.input.ts | 1 + .../__testfixtures__/re-export.output.ts | 2 + .../__testfixtures__/unsafe-shapes.input.tsx | 10 + .../__testfixtures__/unsafe-shapes.output.tsx | 10 + .../unsafe-shapes.warnings.json | 1 + .../__testfixtures__/video-only.input.tsx | 6 + .../__testfixtures__/video-only.output.tsx | 6 + .../src/migrations/moved-exports/index.ts | 246 +++++++++++ .../__testfixtures__/kit.input.json | 11 + .../__testfixtures__/kit.output.json | 16 + .../__testfixtures__/kit.warnings.json | 1 + .../src/migrations/package-json/index.ts | 72 +++ .../__testfixtures__/everywhere.input.tsx | 20 + .../__testfixtures__/everywhere.output.tsx | 20 + .../__testfixtures__/everywhere.warnings.json | 1 + .../__testfixtures__/no-semicolons.input.tsx | 13 + .../__testfixtures__/no-semicolons.output.tsx | 13 + .../src/migrations/scope-rename/index.ts | 69 +++ packages/gamut-codemods/src/presets/index.ts | 43 ++ .../src/presets/scope-swap/index.ts | 36 ++ .../src/presets/scope-swap/manifest.ts | 154 +++++++ packages/gamut-codemods/src/transform.ts | 128 ++++++ packages/gamut-codemods/tsconfig.json | 13 + packages/gamut-codemods/tsconfig.lib.json | 13 + packages/gamut-codemods/tsconfig.spec.json | 11 + yarn.lock | 414 ++++++++++++++---- 67 files changed, 2805 insertions(+), 93 deletions(-) create mode 100644 .changeset/gamut-codemods-scope-swap.md create mode 100644 packages/gamut-codemods/.gitignore create mode 100644 packages/gamut-codemods/README.md create mode 100644 packages/gamut-codemods/jest.config.ts create mode 100644 packages/gamut-codemods/package.json create mode 100644 packages/gamut-codemods/project.json create mode 100644 packages/gamut-codemods/src/__tests__/__testfixtures__/end-to-end.input.tsx create mode 100644 packages/gamut-codemods/src/__tests__/__testfixtures__/end-to-end.output.tsx create mode 100644 packages/gamut-codemods/src/__tests__/fixtures.test.ts create mode 100644 packages/gamut-codemods/src/__tests__/lib.test.ts create mode 100644 packages/gamut-codemods/src/__tests__/manifest.test.ts create mode 100644 packages/gamut-codemods/src/bin.ts create mode 100644 packages/gamut-codemods/src/cli.ts create mode 100644 packages/gamut-codemods/src/lib/git.ts create mode 100644 packages/gamut-codemods/src/lib/leftovers.ts create mode 100644 packages/gamut-codemods/src/lib/manifest.ts create mode 100644 packages/gamut-codemods/src/lib/module-strings.ts create mode 100644 packages/gamut-codemods/src/lib/types.ts create mode 100644 packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.input.tsx create mode 100644 packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.output.tsx create mode 100644 packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json create mode 100644 packages/gamut-codemods/src/migrations/deep-imports/index.ts create mode 100644 packages/gamut-codemods/src/migrations/eslint-comments/__testfixtures__/directives.input.tsx create mode 100644 packages/gamut-codemods/src/migrations/eslint-comments/__testfixtures__/directives.output.tsx create mode 100644 packages/gamut-codemods/src/migrations/eslint-comments/index.ts create mode 100644 packages/gamut-codemods/src/migrations/eslint-config/__testfixtures__/legacy.input.json create mode 100644 packages/gamut-codemods/src/migrations/eslint-config/__testfixtures__/legacy.output.json create mode 100644 packages/gamut-codemods/src/migrations/eslint-config/index.ts create mode 100644 packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/already-shared.input.ts create mode 100644 packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/already-shared.output.ts create mode 100644 packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.input.ts create mode 100644 packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.output.ts create mode 100644 packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.warnings.json create mode 100644 packages/gamut-codemods/src/migrations/mf-shared/index.ts create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/merge-existing.input.tsx create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/merge-existing.output.tsx create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/mixed-import.input.tsx create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/mixed-import.output.tsx create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/re-export.input.ts create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/re-export.output.ts create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.input.tsx create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.output.tsx create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.warnings.json create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/video-only.input.tsx create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/video-only.output.tsx create mode 100644 packages/gamut-codemods/src/migrations/moved-exports/index.ts create mode 100644 packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.input.json create mode 100644 packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.output.json create mode 100644 packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.warnings.json create mode 100644 packages/gamut-codemods/src/migrations/package-json/index.ts create mode 100644 packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.input.tsx create mode 100644 packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.output.tsx create mode 100644 packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.warnings.json create mode 100644 packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/no-semicolons.input.tsx create mode 100644 packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/no-semicolons.output.tsx create mode 100644 packages/gamut-codemods/src/migrations/scope-rename/index.ts create mode 100644 packages/gamut-codemods/src/presets/index.ts create mode 100644 packages/gamut-codemods/src/presets/scope-swap/index.ts create mode 100644 packages/gamut-codemods/src/presets/scope-swap/manifest.ts create mode 100644 packages/gamut-codemods/src/transform.ts create mode 100644 packages/gamut-codemods/tsconfig.json create mode 100644 packages/gamut-codemods/tsconfig.lib.json create mode 100644 packages/gamut-codemods/tsconfig.spec.json diff --git a/.changeset/config.json b/.changeset/config.json index 67eba4b98a..60a8f22d4f 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -8,9 +8,12 @@ "fixed": [ [ "@skillsoft/gamut-agent-tools", + "@skillsoft/gamut-codemods", "@skillsoft/gamut-icons", + "@skillsoft/gamut-illustrations", "@skillsoft/gamut-patterns", "@skillsoft/gamut-styles", + "@skillsoft/gamut-tests", "@skillsoft/gamut", "@skillsoft/variance" ] diff --git a/.changeset/gamut-codemods-scope-swap.md b/.changeset/gamut-codemods-scope-swap.md new file mode 100644 index 0000000000..f7d48bf20d --- /dev/null +++ b/.changeset/gamut-codemods-scope-swap.md @@ -0,0 +1,5 @@ +--- +'@skillsoft/gamut-codemods': minor +--- + +Add `@skillsoft/gamut-codemods` with a `scope-swap` preset for moving a repo from `@codecademy/gamut*` to `@skillsoft/gamut*`. Run `npx @skillsoft/gamut-codemods scope-swap .` from a clean working tree. It renames imports, mocks, and dependencies, moves `Video` imports to `@skillsoft/gamut/Video`, rewrites `/dist/` deep imports, replaces `@codecademy/gamut-kit`, and finishes with a list of what's left to fix by hand. diff --git a/.eslintignore b/.eslintignore index 790b3f75f1..3b8050a6ca 100644 --- a/.eslintignore +++ b/.eslintignore @@ -12,3 +12,4 @@ packages/gamut-patterns/src/patterns packages/code-connect .nx packages/gamut-agent-tools/skills/*-workspace +packages/gamut-codemods/**/__testfixtures__ diff --git a/.prettierignore b/.prettierignore index 104cb1cfe7..17524c399a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -7,6 +7,8 @@ packages/gamut-patterns/src/patterns packages/gamut-styles/**/*.d.ts packages/styleguide/stories/Core/Atoms/Markdown/*.md packages/code-connect/**/* +# Codemod fixtures are exact expected output, formatting included. +packages/gamut-codemods/**/__testfixtures__ /.nx/cache /.nx/workspace-data diff --git a/packages/gamut-codemods/.gitignore b/packages/gamut-codemods/.gitignore new file mode 100644 index 0000000000..1521c8b765 --- /dev/null +++ b/packages/gamut-codemods/.gitignore @@ -0,0 +1 @@ +dist diff --git a/packages/gamut-codemods/README.md b/packages/gamut-codemods/README.md new file mode 100644 index 0000000000..c5511ea61e --- /dev/null +++ b/packages/gamut-codemods/README.md @@ -0,0 +1,109 @@ +# @skillsoft/gamut-codemods + +Codemods for moving a repo onto `@skillsoft/gamut` and between its releases. + +## Presets + +Each preset is one upgrade. Run them in order if you're more than one behind. + +| Preset | What it's for | +| ------------ | ------------------------------------------------------- | +| `scope-swap` | Moving from `@codecademy/gamut*` to `@skillsoft/gamut*` | + +`npx @skillsoft/gamut-codemods list` shows every preset and the migrations inside it. + +## Running scope-swap + +Start from a clean working tree. The codemod won't write into uncommitted changes (pass `--force` to override), so `git checkout .` always undoes a run. + +```sh +# Preview without writing anything +npx @skillsoft/gamut-codemods scope-swap . --dry + +# Run it +npx @skillsoft/gamut-codemods scope-swap . + +# Run only some migrations +npx @skillsoft/gamut-codemods scope-swap . --only=moved-exports,scope-rename +``` + +A run ends with three things: + +1. **Warnings**, prefixed with the migration name, e.g. `[moved-exports] src/Player.test.tsx:12 mock of '@codecademy/gamut' stubs Video/VideoProps`. Each one says what to do. +2. **Leftovers**: every line that still names an old package. These are for you to fix: jest `moduleNameMapper` regexes, tsconfig `paths`, flat ESLint configs, comments, and docs. +3. **Next steps**, built from what actually happened in the run. + +### What scope-swap changes + +| Migration | What it does | +| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `deep-imports` | `@codecademy/gamut/dist/PopoverContainer/types` → `@codecademy/gamut`, and the rest of the promoted deep imports. Warns on deep imports with no public replacement (`Menu/elements`, `Form/SelectDropdown/elements`, `ButtonBase/ButtonBase`, `Form/styles`) and on ones it doesn't know. | +| `moved-exports` | Moves `Video` and `VideoProps` off the root import onto `/Video`. Warns on namespace imports, `export *`, and mocks that stub `Video`. | +| `mf-shared` | Replaces `@codecademy/gamut-kit` in Module Federation `shared` config with the packages it bundled. Gamut becomes a real singleton, so test the host and remotes together. | +| `eslint-comments` | `// eslint-disable-next-line gamut/x` → `@skillsoft/gamut/x`. | +| `scope-rename` | Every `@codecademy/gamut*` module string becomes `@skillsoft/gamut*`: imports, exports, `require`, `import()`, `jest.mock`/`vi.mock`, `declare module`, and `import('x').T`. Also exact package-name strings elsewhere, like `transpilePackages`, with one warning per file. | +| `package-json` | Renames dependencies and sets their versions. Replaces `@codecademy/gamut-kit` with the individual packages. | +| `eslint-config` | `.eslintrc` / `.eslintrc.json`: plugin name, `plugin:` extends, and rule keys. | + +### Known limits + +- Every file is parsed with the `tsx` parser, so Flow-typed JS won't parse. +- Flat ESLint configs (`eslint.config.*`) and `.eslintrc.js` aren't rewritten. In a flat config the rule prefix is whatever key you register the plugin under, so renaming rule keys blindly would break it. They show up in the leftovers. +- The leftovers report uses regex, not an AST, so expect some false positives. + +## Contributing + +### How it's put together + +``` +src/ + presets/ + index.ts # every preset the CLI can run + / + index.ts # ordered migrations + next-steps checklist + manifest.ts # the data: what changed in this release + migrations// + index.ts # a reusable migration + __testfixtures__/ # .input., .output., optional .warnings.json + lib/ # shared types, module-string finder, leftovers, git guard + transform.ts # jscodeshift entry point + cli.ts, bin.ts +``` + +Two rules hold it together: + +- **Manifests hold the data; migrations hold the code.** Most Gamut changes need a manifest row and a fixture, not a new migration. +- **Manifests use the old package names.** In `scope-swap`, `scope-rename` runs last and swaps the scope, so nothing before it needs to know the new one. + +### Three kinds of migration + +- **`splice`** (the default choice): uses the AST to find ranges, then edits the original text by offset. Use it for anything that swaps one string for another. recast never prints the file, so nothing else in it moves. +- **`ast`**: mutates the AST, and recast prints the file. Only for structural rewrites like splitting an import. recast can reprint more than you changed: mutating one string literal in a semicolon-less file added semicolons and changed JSX text whitespace in neighbouring statements. Presets must list every `ast` migration before any `splice` one, and `validatePreset` enforces it. +- **`file`**: gets raw text for files its `match()` accepts (package.json, .eslintrc). + +### Changing a preset's manifest + +1. Add the row to `src/presets//manifest.ts`. +2. Add a fixture pair under the migration that handles it, e.g. `src/migrations/moved-exports/__testfixtures__/my-case.input.tsx` and `.output.tsx`. +3. If it should warn, add `my-case.warnings.json`: a list of substrings that must appear in the warnings. +4. `yarn nx test gamut-codemods`. + +`manifest.test.ts` type-checks every export a manifest points at against the built packages, so a row can't promise an export that doesn't exist. + +### Adding a migration + +1. Create `src/migrations//index.ts` exporting an `AstMigration`, `SpliceMigration`, or `FileMigration` (see `src/lib/types.ts`). +2. Add it to the presets that need it. In `scope-swap`, put it before `scope-rename` if it matches on old names. +3. Add fixtures. They're picked up automatically, and every source migration is also checked for idempotence. +4. If you find a new place a module name can appear, teach `lib/module-strings.ts` rather than special-casing it. +5. If it leaves follow-up work, call `note('')` and add the key to the preset's `conditionalChecklist`. + +### Adding a preset + +Create `src/presets//` with a manifest and an `index.ts`, register it in `src/presets/index.ts`, and reuse migrations from `src/migrations`. + +### recast gotchas already hit + +- Rebuild specifiers instead of mutating them. Changing `imported` on `import { List }` drops the alias, because `imported` and `local` share one source range. +- Clone nodes before moving them into a new declaration, or recast's patcher can crash. +- `insertAfter` and `replace(a, b)` copy the gap after the original node, which can leave a stray blank line. `moved-exports.postPrint` closes that specific gap. diff --git a/packages/gamut-codemods/jest.config.ts b/packages/gamut-codemods/jest.config.ts new file mode 100644 index 0000000000..dc5f1ad9f1 --- /dev/null +++ b/packages/gamut-codemods/jest.config.ts @@ -0,0 +1,19 @@ +/** @jest-config-loader ts-node */ +/* eslint-disable */ +import base from '../../jest.config.base'; + +export default base('gamut-codemods', { + testEnvironment: 'node', + transform: { + '^.+\\.ts$': [ + 'ts-jest', + { + tsconfig: '/tsconfig.spec.json', + }, + ], + }, + /* Fixtures are inputs, not tests, and may be deliberately odd code. */ + testPathIgnorePatterns: ['node_modules', 'dist', '__testfixtures__'], + setupFiles: [], + setupFilesAfterEnv: [], +}); diff --git a/packages/gamut-codemods/package.json b/packages/gamut-codemods/package.json new file mode 100644 index 0000000000..6acbecb748 --- /dev/null +++ b/packages/gamut-codemods/package.json @@ -0,0 +1,38 @@ +{ + "name": "@skillsoft/gamut-codemods", + "description": "Codemods for upgrading to and between @skillsoft/gamut releases", + "version": "0.0.1", + "author": "Skillsoft Engineering ", + "bin": "./dist/bin.js", + "dependencies": { + "jscodeshift": "^17.3.0" + }, + "devDependencies": { + "@skillsoft/gamut": "workspace:*", + "@types/jscodeshift": "^17.3.0" + }, + "engines": { + "node": ">=18" + }, + "files": [ + "dist" + ], + "keywords": [ + "codemod", + "gamut", + "jscodeshift", + "migration" + ], + "license": "MIT", + "main": "./dist/cli.js", + "publishConfig": { + "access": "public" + }, + "repository": "Codecademy/skillsoft-gamut.git", + "scripts": { + "build": "nx build gamut-codemods", + "verify": "tsc --noEmit -p tsconfig.lib.json && tsc --noEmit -p tsconfig.spec.json" + }, + "types": "./dist/cli.d.ts", + "type": "commonjs" +} diff --git a/packages/gamut-codemods/project.json b/packages/gamut-codemods/project.json new file mode 100644 index 0000000000..91d962dcc2 --- /dev/null +++ b/packages/gamut-codemods/project.json @@ -0,0 +1,46 @@ +{ + "name": "gamut-codemods", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/gamut-codemods/src", + "projectType": "library", + "tags": [], + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "cwd": "packages/gamut-codemods", + "commands": [ + "rm -rf ./dist", + "tsc -p tsconfig.lib.json", + "chmod +x ./dist/bin.js" + ], + "parallel": false + } + }, + "test": { + "executor": "@nx/jest:jest", + "dependsOn": ["^build"], + "outputs": ["{workspaceRoot}/coverage/packages/gamut-codemods"], + "options": { + "jestConfig": "packages/gamut-codemods/jest.config.ts" + } + }, + "verify-package": { + "executor": "nx:run-commands", + "dependsOn": ["build"], + "options": { + "cwd": "{projectRoot}", + "commands": ["publint ."], + "parallel": false + } + }, + "publish-build": { + "executor": "nx:run-commands", + "dependsOn": ["build"], + "options": { + "commands": [], + "parallel": false + } + } + } +} diff --git a/packages/gamut-codemods/src/__tests__/__testfixtures__/end-to-end.input.tsx b/packages/gamut-codemods/src/__tests__/__testfixtures__/end-to-end.input.tsx new file mode 100644 index 0000000000..32a4d06d2e --- /dev/null +++ b/packages/gamut-codemods/src/__tests__/__testfixtures__/end-to-end.input.tsx @@ -0,0 +1,7 @@ +import { Box, Video } from '@codecademy/gamut'; +import { PopoverContainerProps } from '@codecademy/gamut/dist/PopoverContainer/types'; +import { theme } from '@codecademy/gamut-styles'; + +// eslint-disable-next-line gamut/no-inline-style +export const Thing = (p: PopoverContainerProps) => ; +export const shared = { '@codecademy/gamut-kit': { singleton: true } }; diff --git a/packages/gamut-codemods/src/__tests__/__testfixtures__/end-to-end.output.tsx b/packages/gamut-codemods/src/__tests__/__testfixtures__/end-to-end.output.tsx new file mode 100644 index 0000000000..2b457b6ceb --- /dev/null +++ b/packages/gamut-codemods/src/__tests__/__testfixtures__/end-to-end.output.tsx @@ -0,0 +1,8 @@ +import { Box } from '@skillsoft/gamut'; +import { Video } from '@skillsoft/gamut/Video'; +import { PopoverContainerProps } from '@skillsoft/gamut'; +import { theme } from '@skillsoft/gamut-styles'; + +// eslint-disable-next-line @skillsoft/gamut/no-inline-style +export const Thing = (p: PopoverContainerProps) => ; +export const shared = { '@skillsoft/gamut': { singleton: true }, '@skillsoft/gamut-icons': { singleton: true }, '@skillsoft/gamut-illustrations': { singleton: true }, '@skillsoft/gamut-patterns': { singleton: true }, '@skillsoft/gamut-styles': { singleton: true }, '@skillsoft/variance': { singleton: true } }; diff --git a/packages/gamut-codemods/src/__tests__/fixtures.test.ts b/packages/gamut-codemods/src/__tests__/fixtures.test.ts new file mode 100644 index 0000000000..5a001f24c9 --- /dev/null +++ b/packages/gamut-codemods/src/__tests__/fixtures.test.ts @@ -0,0 +1,112 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +import { applyTransform } from 'jscodeshift/src/testUtils'; + +import { presets } from '../presets'; +import * as transform from '../transform'; + +/* + Fixture-driven. Every `.input.` in a migration's + __testfixtures__ runs through that migration alone and must match + `.output.`. An optional `.warnings.json` lists substrings + that must each appear in some warning. `{{version}}` in an output stands + for this package's version. Adding a case means adding files, not code. +*/ + +const { version } = JSON.parse( + fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf8') +) as { version: string }; + +interface Case { + name: string; + ext: string; + input: string; + output: string; + warnings: string[]; +} + +const readCases = (dir: string): Case[] => { + if (!fs.existsSync(dir)) return []; + const read = (f: string) => fs.readFileSync(path.join(dir, f), 'utf8'); + return fs + .readdirSync(dir) + .filter((f) => f.includes('.input.')) + .map((input) => { + const [name, ext] = input.split('.input.'); + const warnings = `${name}.warnings.json`; + return { + name, + ext, + input: read(input), + output: read(`${name}.output.${ext}`).replace(/{{version}}/g, version), + warnings: fs.existsSync(path.join(dir, warnings)) + ? (JSON.parse(read(warnings)) as string[]) + : [], + }; + }); +}; + +const fixtureDir = (migration: string) => + path.join(__dirname, '../migrations', migration, '__testfixtures__'); + +const expectWarnings = (actual: string[], expected: string[]) => { + for (const needle of expected) { + expect(actual.join('\n')).toContain(needle); + } +}; + +const runSource = (preset: string, source: string, only?: string) => { + const warnings: string[] = []; + const out = applyTransform( + transform, + { preset, only, onWarn: (w: string) => warnings.push(w) }, + { source, path: 'fixture.tsx' }, + { parser: 'tsx' } + ); + return { out: out || source, warnings }; +}; + +describe.each(Object.values(presets))('preset $name', (preset) => { + for (const migration of preset.migrations) { + const cases = readCases(fixtureDir(migration.name)); + if (cases.length === 0) continue; + + describe(migration.name, () => { + it.each(cases)('$name', (c) => { + if (migration.kind === 'file') { + const warnings: string[] = []; + const out = migration.run({ + source: c.input, + manifest: preset.manifest, + warn: (w) => warnings.push(w), + note: () => {}, + }); + expect((out ?? c.input).trim()).toBe(c.output.trim()); + expectWarnings(warnings, c.warnings); + return; + } + + const { out, warnings } = runSource( + preset.name, + c.input, + migration.name + ); + expect(out.trim()).toBe(c.output.trim()); + expectWarnings(warnings, c.warnings); + + /* Idempotent: a second run over the output changes nothing. */ + expect( + runSource(preset.name, c.output, migration.name).out.trim() + ).toBe(c.output.trim()); + }); + }); + } + + const endToEnd = readCases(path.join(__dirname, '__testfixtures__')); + if (endToEnd.length > 0) { + it.each(endToEnd)('every migration: $name', (c) => { + expect(runSource(preset.name, c.input).out.trim()).toBe(c.output.trim()); + }); + } +}); diff --git a/packages/gamut-codemods/src/__tests__/lib.test.ts b/packages/gamut-codemods/src/__tests__/lib.test.ts new file mode 100644 index 0000000000..fa5953e11a --- /dev/null +++ b/packages/gamut-codemods/src/__tests__/lib.test.ts @@ -0,0 +1,116 @@ +import { execFileSync } from 'node:child_process'; +import fs from 'node:fs'; +import os from 'node:os'; +import path from 'node:path'; + +import jscodeshift from 'jscodeshift'; + +import { parseArgs } from '../cli'; +import { dirtyTreeReason } from '../lib/git'; +import { findLeftovers } from '../lib/leftovers'; +import type { Manifest } from '../lib/manifest'; +import { deepImports } from '../migrations/deep-imports'; +import { validatePreset } from '../presets'; +import { scopeSwap } from '../presets/scope-swap'; +import { manifest } from '../presets/scope-swap/manifest'; + +const tmp = () => + fs.mkdtempSync(path.join(os.tmpdir(), 'gamut-codemods-test-')); + +describe('deep-imports renames', () => { + /* scope-swap has no rename rows today, so this uses its own manifest. */ + it('renames the export and keeps the local binding', () => { + const j = jscodeshift.withParser('tsx'); + const root = j( + "import { List, ListItem as Item } from '@codecademy/gamut/dist/Menu/elements';" + ); + const withRenames: Manifest = { + ...manifest, + deepImports: [ + { + from: '@codecademy/gamut/dist/Menu/elements', + to: '@codecademy/gamut', + renames: { List: 'MenuList', ListItem: 'MenuListItem' }, + }, + ], + }; + deepImports.run({ + j, + root, + source: '', + manifest: withRenames, + warn: () => {}, + note: () => {}, + }); + expect(root.toSource({ quote: 'single' })).toBe( + "import { MenuList as List, MenuListItem as Item } from '@codecademy/gamut';" + ); + }); +}); + +describe('validatePreset', () => { + it('accepts scope-swap', () => { + expect(() => validatePreset(scopeSwap)).not.toThrow(); + }); + + it('rejects an ast migration listed after a splice one', () => { + const [deep, moved, mf] = scopeSwap.migrations; + expect(() => + validatePreset({ ...scopeSwap, migrations: [deep, mf, moved] }) + ).toThrow(/moved-exports/); + }); +}); + +describe('parseArgs', () => { + it('reads a preset, paths, and flags', () => { + expect( + parseArgs(['scope-swap', 'a', '--dry', '--only=scope-rename']) + ).toEqual( + expect.objectContaining({ + preset: 'scope-swap', + paths: [path.resolve('a')], + dry: true, + force: false, + only: 'scope-rename', + }) + ); + }); + + it('rejects unknown flags', () => { + expect(() => parseArgs(['scope-swap', 'a', '--drry'])).toThrow(/--drry/); + }); +}); + +describe('dirtyTreeReason', () => { + const git = (cwd: string, ...args: string[]) => + execFileSync('git', args, { cwd, stdio: 'ignore' }); + + it('refuses outside a git repo, and on uncommitted changes', () => { + const dir = tmp(); + expect(dirtyTreeReason(dir)).toMatch(/not inside a git repository/); + + git(dir, 'init', '-q'); + fs.writeFileSync(path.join(dir, 'a.ts'), ''); + expect(dirtyTreeReason(dir)).toMatch(/uncommitted changes/); + + git(dir, 'add', '-A'); + git(dir, '-c', 'user.email=t@t', '-c', 'user.name=t', 'commit', '-qm', 'x'); + expect(dirtyTreeReason(dir)).toBeNull(); + }); +}); + +describe('findLeftovers', () => { + it('finds old names but not new names that contain them', () => { + const dir = tmp(); + fs.writeFileSync( + path.join(dir, 'a.js'), + [ + "moduleNameMapper: { '^@codecademy/gamut(.*)$': 'x' }", + "'@skillsoft/eslint-plugin-gamut'", + "'@skillsoft/gamut-styles'", + "'@codecademy/gamut-kit'", + ].join('\n') + ); + expect(findLeftovers([dir], manifest).map((h) => h.line)).toEqual([1, 4]); + }); +}); diff --git a/packages/gamut-codemods/src/__tests__/manifest.test.ts b/packages/gamut-codemods/src/__tests__/manifest.test.ts new file mode 100644 index 0000000000..4265860ae3 --- /dev/null +++ b/packages/gamut-codemods/src/__tests__/manifest.test.ts @@ -0,0 +1,111 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +import ts from 'typescript'; + +import { renameSpecifier } from '../lib/manifest'; +import { presets } from '../presets'; +import { manifest } from '../presets/scope-swap/manifest'; + +/* + Guards against a manifest that promises something the packages don't + deliver. Runs against the built dist, so `^build` has to run first + (project.json wires that up). +*/ + +const REPO = path.join(__dirname, '../../../..'); +const readJson = (file: string) => + JSON.parse(fs.readFileSync(path.join(REPO, file), 'utf8')); + +/* + Every name a manifest claims is importable from a new entry point: + moved exports at their destination, and renamed deep-import exports at + theirs. Written as one virtual file so tsc resolves it the way a + consumer's bundler would, through the exports map. +*/ +const importsToCheck = () => { + const lines: string[] = []; + for (const preset of Object.values(presets)) { + const m = preset.manifest; + for (const rule of m.movedExports) { + lines.push( + `import type { ${rule.names.join(', ')} } from '${renameSpecifier( + m, + rule.to + )}';` + ); + } + for (const row of m.deepImports) { + if (!row.to || !row.renames) continue; + lines.push( + `import type { ${Object.values(row.renames).join( + ', ' + )} } from '${renameSpecifier(m, row.to)}';` + ); + } + } + return lines.join('\n'); +}; + +describe('manifests', () => { + it('only point at exports that exist in the built packages', () => { + const file = path.join( + REPO, + 'packages/gamut-codemods/__manifest-check__.ts' + ); + const host = ts.createCompilerHost({}); + const source = importsToCheck(); + const readFile = host.readFile.bind(host); + host.readFile = (f) => (f === file ? source : readFile(f)); + const fileExists = host.fileExists.bind(host); + host.fileExists = (f) => f === file || fileExists(f); + + const program = ts.createProgram( + [file], + { + noEmit: true, + skipLibCheck: true, + module: ts.ModuleKind.ESNext, + moduleResolution: ts.ModuleResolutionKind.Bundler, + types: [], + }, + host + ); + const errors = ts + .getPreEmitDiagnostics(program) + .map((d) => ts.flattenDiagnosticMessageText(d.messageText, '\n')); + + expect(errors).toEqual([]); + }); + + it('rename every package to one that exists in this repo', () => { + const published = new Set( + fs + .readdirSync(path.join(REPO, 'packages')) + .map((dir) => path.join(REPO, 'packages', dir, 'package.json')) + .filter((file) => fs.existsSync(file)) + .map((file) => JSON.parse(fs.readFileSync(file, 'utf8')).name) + ); + for (const { to } of Object.values(manifest.packages)) { + expect(published).toContain(to); + } + }); + + it('keep scope-swap target versions in step with the packages', () => { + const { fixed } = readJson('.changeset/config.json') as { + fixed: string[][]; + }; + const group = + fixed.find((g) => g.includes('@skillsoft/gamut-codemods')) ?? []; + const eslintPlugin = readJson('packages/eslint-plugin-gamut/package.json'); + + for (const [pkg, range] of Object.entries(manifest.targetVersions)) { + if (pkg === eslintPlugin.name) { + expect(range).toBe(`^${eslintPlugin.version}`); + } else { + /* Versioned by the fixed group, which is what makes GROUP_RANGE right. */ + expect(group).toContain(pkg); + } + } + }); +}); diff --git a/packages/gamut-codemods/src/bin.ts b/packages/gamut-codemods/src/bin.ts new file mode 100644 index 0000000000..1d6eb0af32 --- /dev/null +++ b/packages/gamut-codemods/src/bin.ts @@ -0,0 +1,13 @@ +#!/usr/bin/env node +import { main } from './cli'; + +main(process.argv.slice(2)).then( + (code) => { + process.exitCode = code; + }, + (err: unknown) => { + // eslint-disable-next-line no-console + console.error(err instanceof Error ? err.message : err); + process.exitCode = 1; + } +); diff --git a/packages/gamut-codemods/src/cli.ts b/packages/gamut-codemods/src/cli.ts new file mode 100644 index 0000000000..911960efdc --- /dev/null +++ b/packages/gamut-codemods/src/cli.ts @@ -0,0 +1,187 @@ +/* eslint-disable no-console -- it's a CLI; stdout is the interface. */ +import fs from 'node:fs'; +import os from 'node:os'; +import path from 'node:path'; + +import { dirtyTreeReason } from './lib/git'; +import { findLeftovers, walk } from './lib/leftovers'; +import type { FileMigration, Preset } from './lib/types'; +import { getPreset, presets } from './presets'; + +/* No published types for the Runner; it's jscodeshift's programmatic API. */ +// eslint-disable-next-line @typescript-eslint/no-var-requires +const Runner = require('jscodeshift/src/Runner') as { + run( + transformFile: string, + paths: string[], + options: Record + ): Promise<{ error: number }>; +}; + +const USAGE = `Usage: gamut-codemods [options] + gamut-codemods list + +Options: + --dry Don't write anything; show what would change + --force Run even if the target has uncommitted changes + --only=a,b Run only these migrations + --no-report Skip the leftovers report`; + +interface Options { + preset?: string; + paths: string[]; + dry: boolean; + force: boolean; + only?: string; + report: boolean; +} + +export const parseArgs = (argv: string[]): Options | 'help' | 'list' => { + const [command, ...rest] = argv; + if (!command || command === '-h' || command === '--help') return 'help'; + if (command === 'list') return 'list'; + + const opts: Options = { + preset: command, + paths: [], + dry: false, + force: false, + report: true, + }; + for (const arg of rest) { + if (arg === '--dry') opts.dry = true; + else if (arg === '--force') opts.force = true; + else if (arg === '--no-report') opts.report = false; + else if (arg.startsWith('--only=')) opts.only = arg.slice('--only='.length); + else if (arg.startsWith('--')) throw new Error(`unknown option ${arg}`); + else opts.paths.push(path.resolve(arg)); + } + return opts; +}; + +const heading = (text: string) => console.log(`\n— ${text} —`); + +const runFileMigrations = ( + preset: Preset, + opts: Options, + note: (key: string) => void +) => { + const only = opts.only ? new Set(opts.only.split(',')) : null; + const active = preset.migrations.filter( + (m): m is FileMigration => m.kind === 'file' && (!only || only.has(m.name)) + ); + let changed = 0; + + for (const root of opts.paths) { + const files = fs.statSync(root).isDirectory() ? walk(root) : [root]; + for (const file of files) { + for (const migration of active) { + if (!migration.match(file)) continue; + const source = fs.readFileSync(file, 'utf8'); + const warn = (msg: string) => + console.log(`[${migration.name}] ${file} ${msg}`); + const next = migration.run({ + source, + manifest: preset.manifest, + warn, + note, + }); + if (next === null) continue; + changed += 1; + console.log(`${opts.dry ? 'would update' : 'updated'} ${file}`); + if (!opts.dry) fs.writeFileSync(file, next); + } + } + } + return changed; +}; + +const printChecklist = (preset: Preset, notes: Set) => { + heading('next steps'); + const items = [ + ...Object.entries(preset.conditionalChecklist) + .filter(([key]) => notes.has(key)) + .map(([, text]) => text), + ...preset.checklist, + ]; + items.forEach((item, i) => console.log(`${i + 1}. ${item}`)); +}; + +export const main = async (argv: string[]) => { + const opts = parseArgs(argv); + + if (opts === 'help') { + console.log(USAGE); + return 0; + } + if (opts === 'list') { + for (const preset of Object.values(presets)) { + console.log(`${preset.name} ${preset.description}`); + for (const m of preset.migrations) { + console.log(` ${m.name.padEnd(18)} ${m.description}`); + } + } + return 0; + } + + const preset = getPreset(opts.preset!); + if (opts.paths.length === 0) { + console.log(USAGE); + return 1; + } + + if (!opts.dry && !opts.force) { + const reasons = opts.paths.map(dirtyTreeReason).filter(Boolean); + if (reasons.length > 0) { + reasons.forEach((reason) => console.error(reason)); + console.error( + 'Re-run with --force to write anyway, or --dry to preview.' + ); + return 1; + } + } + + const notesDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gamut-codemods-')); + try { + heading('source files'); + const result = await Runner.run( + path.join(__dirname, 'transform.js'), + opts.paths, + { + preset: preset.name, + only: opts.only, + notesDir, + dry: opts.dry, + extensions: 'ts,tsx,js,jsx,mjs,cjs,mts,cts', + /* .d.ts stays in: Emotion theme augmentations import gamut-styles. */ + ignorePattern: ['**/node_modules/**', '**/dist/**', '**/build/**'], + parser: 'tsx', + babel: false, + verbose: 0, + } + ); + + const notes = new Set(fs.readdirSync(notesDir).map(decodeURIComponent)); + + heading('package.json and .eslintrc'); + const changed = runFileMigrations(preset, opts, (key) => notes.add(key)); + console.log(`${changed} file(s) ${opts.dry ? 'would change' : 'changed'}`); + + if (opts.report && opts.dry) { + heading( + 'leftovers skipped in --dry (nothing was written, so everything would show up)' + ); + } else if (opts.report) { + const hits = findLeftovers(opts.paths, preset.manifest); + heading(`leftovers (${hits.length})`); + hits.forEach((hit) => + console.log(`${hit.file}:${hit.line} ${hit.text}`) + ); + } + + if (!opts.dry) printChecklist(preset, notes); + return result.error > 0 ? 1 : 0; + } finally { + fs.rmSync(notesDir, { recursive: true, force: true }); + } +}; diff --git a/packages/gamut-codemods/src/lib/git.ts b/packages/gamut-codemods/src/lib/git.ts new file mode 100644 index 0000000000..6929f0f277 --- /dev/null +++ b/packages/gamut-codemods/src/lib/git.ts @@ -0,0 +1,27 @@ +import { execFileSync } from 'node:child_process'; +import fs from 'node:fs'; +import path from 'node:path'; + +/* + The CLI refuses to write into a dirty tree, so `git checkout .` always + undoes a run completely and the codemod's diff never mixes with work in + progress. Returns a reason to refuse, or null if it's safe. +*/ +export const dirtyTreeReason = (target: string) => { + const cwd = fs.statSync(target).isDirectory() ? target : path.dirname(target); + let status: string; + try { + /* execFileSync with an argument array: no shell, so paths can't inject. */ + status = execFileSync('git', ['status', '--porcelain', '--', '.'], { + cwd, + encoding: 'utf8', + stdio: ['ignore', 'pipe', 'ignore'], + }); + } catch { + return `${target} is not inside a git repository, so a run couldn't be undone.`; + } + if (status.trim()) { + return `${target} has uncommitted changes. Commit or stash them first, so the codemod's diff stands on its own.`; + } + return null; +}; diff --git a/packages/gamut-codemods/src/lib/leftovers.ts b/packages/gamut-codemods/src/lib/leftovers.ts new file mode 100644 index 0000000000..9ddf45e9a0 --- /dev/null +++ b/packages/gamut-codemods/src/lib/leftovers.ts @@ -0,0 +1,81 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +import type { Manifest } from './manifest'; + +/* + After the migrations run, anything still naming an old package is for a + person: jest moduleNameMapper regexes, tsconfig paths, flat ESLint + configs, comments, docs. This lists them as file:line. +*/ + +export const SKIP_DIRS = new Set([ + 'node_modules', + 'dist', + 'build', + 'coverage', + '.git', + '.next', + '.nx', + 'tmp', +]); +const SKIP_FILES = + /(^|\/)(yarn\.lock|package-lock\.json|pnpm-lock\.yaml|CHANGELOG\.md)$/; +const TEXT_EXT = + /\.(m?[jt]sx?|c[jt]s|json|ya?ml|md|mdx|html|scss|css)$|(^|\/)\.eslintrc$/; + +const escape = (s: string) => s.replace(/[.*+?^${}()|[\]\\/]/g, '\\$&'); + +/* + Old names, not already followed by a longer package name, and not the + tail of a new one (`@skillsoft/eslint-plugin-gamut` contains + `eslint-plugin-gamut`). +*/ +const oldNamesPattern = (manifest: Manifest) => { + const names = [ + ...Object.keys(manifest.packages), + ...Object.keys(manifest.removedPackages), + ] + .sort((a, b) => b.length - a.length) + .map(escape); + const prefix = escape(manifest.eslintPlugin.from); + return new RegExp( + `(? { + for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { + if (entry.isDirectory()) { + if (!SKIP_DIRS.has(entry.name)) yield* walk(path.join(dir, entry.name)); + } else { + yield path.join(dir, entry.name); + } + } +} + +export interface Leftover { + file: string; + line: number; + text: string; +} + +export const findLeftovers = (roots: string[], manifest: Manifest) => { + const pattern = oldNamesPattern(manifest); + const hits: Leftover[] = []; + for (const root of roots) { + const files = fs.statSync(root).isDirectory() ? walk(root) : [root]; + for (const file of files) { + if (SKIP_FILES.test(file) || !TEXT_EXT.test(file)) continue; + fs.readFileSync(file, 'utf8') + .split('\n') + .forEach((text, i) => { + if (pattern.test(text)) + hits.push({ file, line: i + 1, text: text.trim() }); + }); + } + } + return hits; +}; diff --git a/packages/gamut-codemods/src/lib/manifest.ts b/packages/gamut-codemods/src/lib/manifest.ts new file mode 100644 index 0000000000..495458f723 --- /dev/null +++ b/packages/gamut-codemods/src/lib/manifest.ts @@ -0,0 +1,72 @@ +/* + The shape of a preset's manifest: the data describing what changed. Most + contributions should only add rows to a preset's manifest.ts plus a + fixture; migrations read from here and never hardcode package or export + names. +*/ + +export interface PackageRename { + to: string; +} + +export interface RemovedPackage { + /* Old package names to depend on instead, in package.json. */ + expandTo: string[]; + /* Old package names to share as singletons in Module Federation config. */ + mfSharedAs: string[]; + note: string; +} + +export interface MovedExport { + from: string; + to: string; + names: string[]; + note: string; +} + +export interface DeepImport { + from: string; + /* null when there's no public replacement; the migration warns instead. */ + to: string | null; + /* Old imported name -> new exported name. Local bindings are kept. */ + renames?: Record; + note?: string; +} + +export interface Manifest { + /* Old package -> new package. */ + packages: Record; + /* Packages with no replacement under the new name. */ + removedPackages: Record; + /* Version range written to package.json, keyed by NEW package name. */ + targetVersions: Record; + movedExports: MovedExport[]; + deepImports: DeepImport[]; + /* ESLint plugin prefix, for rule keys, `plugin:` extends, and comments. */ + eslintPlugin: { from: string; to: string }; +} + +/* + Match a specifier against a package name, exact or with a subpath. + '@codecademy/gamut' matches '@codecademy/gamut/Video' but not + '@codecademy/gamut-styles'. Returns the subpath ('' or '/Video') or null. +*/ +export const matchPackage = (specifier: string, pkg: string) => { + if (specifier === pkg) return ''; + if (specifier.startsWith(`${pkg}/`)) return specifier.slice(pkg.length); + return null; +}; + +/* The new name for an old specifier, keeping any subpath. */ +export const renameSpecifier = (manifest: Manifest, value: string) => { + for (const [from, { to }] of Object.entries(manifest.packages)) { + const subpath = matchPackage(value, from); + if (subpath !== null) return to + subpath; + } + return null; +}; + +export const removedPackageFor = (manifest: Manifest, value: string) => + Object.keys(manifest.removedPackages).find( + (pkg) => matchPackage(value, pkg) !== null + ); diff --git a/packages/gamut-codemods/src/lib/module-strings.ts b/packages/gamut-codemods/src/lib/module-strings.ts new file mode 100644 index 0000000000..50b7a5f484 --- /dev/null +++ b/packages/gamut-codemods/src/lib/module-strings.ts @@ -0,0 +1,81 @@ +import type { Collection, JSCodeshift, StringLiteral } from 'jscodeshift'; + +/* + Finds every string in a file that names a module: import and export + sources, require(), dynamic import(), jest/vi mocks, `import('x').T` types, + and `declare module 'x'` augmentations. Migrations that rewrite a specifier + should go through here, so a new place a module name can appear only has + to be taught once. +*/ + +const CALLEE_OBJECTS = new Set(['jest', 'vi']); +const CALLEE_METHODS = new Set([ + 'mock', + 'doMock', + 'unmock', + 'dontMock', + 'requireActual', + 'requireMock', + 'importActual', + 'importMock', + 'setMock', +]); + +/* + The tsx parser produces StringLiteral; the babel/estree ones produce + Literal. Both carry babel's start/end offsets, which splice edits rely on. +*/ +export type StringNode = StringLiteral & { start: number; end: number }; + +export const isStringLiteral = (node: unknown): node is StringNode => { + const n = node as { type?: string; value?: unknown } | null; + return ( + !!n && + (n.type === 'StringLiteral' || + (n.type === 'Literal' && typeof n.value === 'string')) + ); +}; + +/* + Identifier-ish nodes (Identifier, JSXIdentifier, TSTypeParameter) all + carry a string `name`, but the jscodeshift types don't share one shape. +*/ +export const nameOf = (node: unknown) => { + const name = (node as { name?: unknown } | null | undefined)?.name; + return typeof name === 'string' ? name : ''; +}; + +const isModuleCall = (callee: any): boolean => { + if (callee.type === 'Import') return true; + if (callee.type === 'Identifier') return callee.name === 'require'; + if (callee.type === 'MemberExpression' && !callee.computed) { + const { object, property } = callee; + if (object.type !== 'Identifier') return false; + if (object.name === 'require') return property.name === 'resolve'; + return CALLEE_OBJECTS.has(object.name) && CALLEE_METHODS.has(property.name); + } + return false; +}; + +/* The string literal nodes that name a module, in source order. */ +export const findModuleStrings = (j: JSCodeshift, root: Collection) => { + const found: StringNode[] = []; + const push = (node: unknown) => { + if (isStringLiteral(node)) found.push(node); + }; + + root.find(j.ImportDeclaration).forEach((p) => push(p.node.source)); + root.find(j.ExportNamedDeclaration).forEach((p) => push(p.node.source)); + root.find(j.ExportAllDeclaration).forEach((p) => push(p.node.source)); + root.find(j.CallExpression).forEach((p) => { + if (isModuleCall(p.node.callee)) push(p.node.arguments[0]); + }); + root.find(j.ImportExpression).forEach((p) => push(p.node.source)); + root.find(j.TSImportType).forEach((p) => push(p.node.argument)); + root.find(j.TSModuleDeclaration).forEach((p) => push(p.node.id)); + root + .find(j.TSExternalModuleReference) + .forEach((p) => push(p.node.expression)); + + return found; +}; diff --git a/packages/gamut-codemods/src/lib/types.ts b/packages/gamut-codemods/src/lib/types.ts new file mode 100644 index 0000000000..558c9d74c1 --- /dev/null +++ b/packages/gamut-codemods/src/lib/types.ts @@ -0,0 +1,85 @@ +import type { Collection, JSCodeshift } from 'jscodeshift'; + +import type { Manifest } from './manifest'; + +/* Anything with a source location, so warnings can point at a line. */ +export type Locatable = + | { loc?: { start: { line: number } } | null } + | null + | undefined; + +export type Warn = (node: Locatable, message: string) => void; + +/* + Records that a checklist item applies to this run. Keys are defined by the + preset; the CLI prints the matching items once every file is done. +*/ +export type Note = (checklistKey: string) => void; + +export interface SourceContext { + j: JSCodeshift; + root: Collection; + source: string; + manifest: Manifest; + warn: Warn; + note: Note; +} + +export interface Edit { + start: number; + end: number; + text: string; +} + +interface MigrationBase { + name: string; + description: string; +} + +/* + Mutates the shared AST. Use for structural rewrites only: recast reprints + whatever it thinks changed, and in semicolon-less files that has spread to + neighbouring statements. Return true if anything changed. +*/ +export interface AstMigration extends MigrationBase { + kind: 'ast'; + run(ctx: SourceContext): boolean; + /* Formatting fixes on the printed output that the AST can't express. */ + postPrint?(source: string, ctx: { manifest: Manifest }): string; +} + +/* + Uses the AST to find ranges, then edits the original text by offset. The + default for anything that swaps one string for another. +*/ +export interface SpliceMigration extends MigrationBase { + kind: 'splice'; + edits(ctx: SourceContext): Edit[]; +} + +/* Gets raw text for non-source files (package.json, .eslintrc). */ +export interface FileMigration extends MigrationBase { + kind: 'file'; + match(path: string): boolean; + run(ctx: { + source: string; + manifest: Manifest; + warn: (message: string) => void; + note: Note; + }): string | null; +} + +export type SourceMigration = AstMigration | SpliceMigration; +export type Migration = SourceMigration | FileMigration; + +export interface Preset { + name: string; + description: string; + manifest: Manifest; + /* Run in order. All `ast` migrations must come before any `splice` one. */ + migrations: Migration[]; + /* Printed at the end of every run. */ + checklist: string[]; + /* Printed only when a migration calls note(key). */ + conditionalChecklist: Record; +} diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.input.tsx b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.input.tsx new file mode 100644 index 0000000000..d45be932f1 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.input.tsx @@ -0,0 +1,7 @@ +import { PopoverContainerProps } from '@codecademy/gamut/dist/PopoverContainer/types'; +import type { Prop } from '@codecademy/variance/dist/types/config'; +import { formStyles } from '@codecademy/gamut/dist/Form/styles'; +import { List } from '@codecademy/gamut/dist/Menu/elements'; +import { Mystery } from '@codecademy/gamut/dist/Nope'; + +jest.mock('@codecademy/gamut/dist/Box/props'); diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.output.tsx b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.output.tsx new file mode 100644 index 0000000000..0c0e468b23 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.output.tsx @@ -0,0 +1,7 @@ +import { PopoverContainerProps } from '@codecademy/gamut'; +import type { Prop } from '@codecademy/variance'; +import { formStyles } from '@codecademy/gamut/dist/Form/styles'; +import { List } from '@codecademy/gamut/dist/Menu/elements'; +import { Mystery } from '@codecademy/gamut/dist/Nope'; + +jest.mock('@codecademy/gamut'); diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json new file mode 100644 index 0000000000..1e95c663a1 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json @@ -0,0 +1 @@ +["'@codecademy/gamut/dist/Form/styles' has no public replacement", "'@codecademy/gamut/dist/Menu/elements' has no public replacement", "unmapped deep import '@codecademy/gamut/dist/Nope'"] diff --git a/packages/gamut-codemods/src/migrations/deep-imports/index.ts b/packages/gamut-codemods/src/migrations/deep-imports/index.ts new file mode 100644 index 0000000000..b394c39c45 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/deep-imports/index.ts @@ -0,0 +1,127 @@ +import type { + ExportSpecifier, + ImportSpecifier, + JSCodeshift, +} from 'jscodeshift'; + +import { findModuleStrings, nameOf } from '../../lib/module-strings'; +import type { AstMigration } from '../../lib/types'; + +/* + `@codecademy/gamut/dist/...` -> the public entry point from + manifest.deepImports. Renamed exports keep their local name so call sites + don't change: `import { List }` becomes `import { MenuList as List }`. +*/ + +const DIST = /^(@codecademy\/[\w-]+|eslint-plugin-gamut)\/dist(\/|$)/; + +type Specifier = ImportSpecifier | ExportSpecifier | { type: string }; + +/* + Specifiers are rebuilt rather than mutated. `import { List }` has imported + and local sharing one source range, so recast's patcher drops the alias if + you only swap `imported`. +*/ +const renameSpecifiers = ( + j: JSCodeshift, + specifiers: Specifier[], + renames: Record +) => + specifiers.map((spec) => { + if (spec.type === 'ImportSpecifier') { + const { imported, local, importKind } = spec as ImportSpecifier & { + importKind?: string; + }; + const next = renames[nameOf(imported)]; + if (!next) return spec; + const renamed = j.importSpecifier( + j.identifier(next), + j.identifier(nameOf(local ?? imported)) + ); + Object.assign(renamed, { importKind }); + return renamed; + } + if (spec.type === 'ExportSpecifier') { + const { local, exported } = spec as ExportSpecifier; + const next = renames[nameOf(local)]; + if (!next) return spec; + return j.exportSpecifier.from({ + local: j.identifier(next), + exported: j.identifier(nameOf(exported ?? local)), + }); + } + return spec; + }); + +export const deepImports: AstMigration = { + name: 'deep-imports', + kind: 'ast', + description: 'Rewrite /dist/ deep imports to public entry points.', + run({ j, root, manifest, warn }) { + const byPath = new Map(manifest.deepImports.map((row) => [row.from, row])); + let changed = false; + + /* Declarations first, so renames can be applied to their specifiers. */ + const declarations = [ + ...root.find(j.ImportDeclaration).nodes(), + ...root.find(j.ExportNamedDeclaration).nodes(), + ...root.find(j.ExportAllDeclaration).nodes(), + ]; + const handled = new Set(); + + for (const node of declarations) { + const source = node.source as { value?: unknown } | null | undefined; + if (typeof source?.value !== 'string' || !DIST.test(source.value)) { + continue; + } + handled.add(source); + const row = byPath.get(source.value); + if (!row) { + warn( + node, + `unmapped deep import '${source.value}'. Add it to the preset manifest's deepImports.` + ); + continue; + } + if (!row.to) { + warn( + node, + `'${row.from}' has no public replacement. ${row.note ?? ''}` + ); + continue; + } + if (row.renames && 'specifiers' in node && node.specifiers) { + node.specifiers = renameSpecifiers( + j, + node.specifiers, + row.renames + ) as typeof node.specifiers; + } + node.source = j.stringLiteral(row.to); + changed = true; + } + + /* Then mocks, require(), import(): only the string can change here. */ + for (const literal of findModuleStrings(j, root)) { + if (handled.has(literal) || !DIST.test(literal.value)) continue; + const row = byPath.get(literal.value); + if (!row?.to) { + warn( + literal, + `deep import '${literal.value}' in a mock or require() needs a manual rewrite.` + ); + continue; + } + if (row.renames) { + warn( + literal, + `'${literal.value}' has renamed exports. Check the mock factory by hand.` + ); + } + literal.value = row.to; + changed = true; + } + + return changed; + }, +}; diff --git a/packages/gamut-codemods/src/migrations/eslint-comments/__testfixtures__/directives.input.tsx b/packages/gamut-codemods/src/migrations/eslint-comments/__testfixtures__/directives.input.tsx new file mode 100644 index 0000000000..61b977827c --- /dev/null +++ b/packages/gamut-codemods/src/migrations/eslint-comments/__testfixtures__/directives.input.tsx @@ -0,0 +1,6 @@ +// eslint-disable-next-line gamut/no-inline-style +const a = 1; +/* eslint-disable gamut/prefer-themed, react/no-danger */ +// eslint-disable-next-line @skillsoft/gamut/no-css-standalone +const b = 2; +// talking about gamut/no-inline-style in prose stays put diff --git a/packages/gamut-codemods/src/migrations/eslint-comments/__testfixtures__/directives.output.tsx b/packages/gamut-codemods/src/migrations/eslint-comments/__testfixtures__/directives.output.tsx new file mode 100644 index 0000000000..6902386e06 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/eslint-comments/__testfixtures__/directives.output.tsx @@ -0,0 +1,6 @@ +// eslint-disable-next-line @skillsoft/gamut/no-inline-style +const a = 1; +/* eslint-disable @skillsoft/gamut/prefer-themed, react/no-danger */ +// eslint-disable-next-line @skillsoft/gamut/no-css-standalone +const b = 2; +// talking about gamut/no-inline-style in prose stays put diff --git a/packages/gamut-codemods/src/migrations/eslint-comments/index.ts b/packages/gamut-codemods/src/migrations/eslint-comments/index.ts new file mode 100644 index 0000000000..977550f4d0 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/eslint-comments/index.ts @@ -0,0 +1,49 @@ +import type { Edit, SpliceMigration } from '../../lib/types'; + +/* + `// eslint-disable-next-line gamut/no-inline-style` -> + `// eslint-disable-next-line @skillsoft/gamut/no-inline-style`. + Rule names are unchanged; only the plugin prefix moves. +*/ + +const DIRECTIVE = /^\s*(eslint-disable|eslint-enable|eslint\s)/; + +interface CommentNode { + type: string; + value: string; + start: number; + end: number; +} + +const isBlock = (comment: CommentNode) => + comment.type === 'CommentBlock' || comment.type === 'Block'; + +export const eslintComments: SpliceMigration = { + name: 'eslint-comments', + kind: 'splice', + description: + 'Update ESLint directive comments to the new plugin rule prefix.', + edits({ j, root, manifest }) { + const { from, to } = manifest.eslintPlugin; + /* The prefix at the start of a rule name, not one already scoped. */ + const prefix = new RegExp(`(^|[\\s,])${from}/`, 'g'); + const edits: Edit[] = []; + const seen = new Set(); + + /* j.Comment paths point at the owning node, so walk node.comments. */ + root.find(j.Node).forEach((p) => { + const comments = (p.node as { comments?: CommentNode[] }).comments ?? []; + for (const comment of comments) { + if (seen.has(comment.start)) continue; + seen.add(comment.start); + if (!DIRECTIVE.test(comment.value)) continue; + const value = comment.value.replace(prefix, `$1${to}/`); + if (value === comment.value) continue; + const text = isBlock(comment) ? `/*${value}*/` : `//${value}`; + edits.push({ start: comment.start, end: comment.end, text }); + } + }); + + return edits; + }, +}; diff --git a/packages/gamut-codemods/src/migrations/eslint-config/__testfixtures__/legacy.input.json b/packages/gamut-codemods/src/migrations/eslint-config/__testfixtures__/legacy.input.json new file mode 100644 index 0000000000..8fc62bdc2b --- /dev/null +++ b/packages/gamut-codemods/src/migrations/eslint-config/__testfixtures__/legacy.input.json @@ -0,0 +1,9 @@ +{ + "plugins": ["gamut"], + "extends": ["plugin:gamut/recommended"], + "rules": { + // keep these on + "gamut/no-css-standalone": "error", + "gamut/no-inline-style": "error" + } +} diff --git a/packages/gamut-codemods/src/migrations/eslint-config/__testfixtures__/legacy.output.json b/packages/gamut-codemods/src/migrations/eslint-config/__testfixtures__/legacy.output.json new file mode 100644 index 0000000000..cfb581e347 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/eslint-config/__testfixtures__/legacy.output.json @@ -0,0 +1,9 @@ +{ + "plugins": ["@skillsoft/gamut"], + "extends": ["plugin:@skillsoft/gamut/recommended"], + "rules": { + // keep these on + "@skillsoft/gamut/no-css-standalone": "error", + "@skillsoft/gamut/no-inline-style": "error" + } +} diff --git a/packages/gamut-codemods/src/migrations/eslint-config/index.ts b/packages/gamut-codemods/src/migrations/eslint-config/index.ts new file mode 100644 index 0000000000..34f50ed381 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/eslint-config/index.ts @@ -0,0 +1,28 @@ +import type { FileMigration } from '../../lib/types'; + +/* + Legacy .eslintrc / .eslintrc.json only. These are often JSONC (mono's + have comments), so this is a targeted text rewrite rather than + JSON.parse. JS and flat configs are left alone: in a flat config the rule + prefix is whatever key the plugin is registered under, so blindly + renaming rule keys would break it. The leftovers report lists them. +*/ + +const escape = (s: string) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + +export const eslintConfig: FileMigration = { + name: 'eslint-config', + kind: 'file', + description: + 'Update the plugin name, `plugin:` extends, and rule prefix in .eslintrc(.json).', + match: (file) => /(^|\/)\.eslintrc(\.json)?$/.test(file), + run({ source, manifest }) { + const { from, to } = manifest.eslintPlugin; + const old = escape(from); + const next = source + .replace(new RegExp(`"plugin:${old}/`, 'g'), `"plugin:${to}/`) + .replace(new RegExp(`"${old}/`, 'g'), `"${to}/`) + .replace(new RegExp(`"(eslint-plugin-)?${old}"`, 'g'), `"${to}"`); + return next === source ? null : next; + }, +}; diff --git a/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/already-shared.input.ts b/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/already-shared.input.ts new file mode 100644 index 0000000000..04847f011a --- /dev/null +++ b/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/already-shared.input.ts @@ -0,0 +1,11 @@ +const shared = { + '@codecademy/gamut': { singleton: true, requiredVersion: '^73.0.0' }, + '@codecademy/gamut-kit': { singleton: true }, +}; +export const config = { shared }; +export const inline = { + shared: { + '@codecademy/gamut-kit': { eager: true }, + '@codecademy/gamut': { singleton: true }, + }, +}; diff --git a/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/already-shared.output.ts b/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/already-shared.output.ts new file mode 100644 index 0000000000..e3154ac7d5 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/already-shared.output.ts @@ -0,0 +1,19 @@ +const shared = { + '@codecademy/gamut': { singleton: true, requiredVersion: '^73.0.0' }, + '@codecademy/gamut-icons': { singleton: true }, + '@codecademy/gamut-illustrations': { singleton: true }, + '@codecademy/gamut-patterns': { singleton: true }, + '@codecademy/gamut-styles': { singleton: true }, + '@codecademy/variance': { singleton: true }, +}; +export const config = { shared }; +export const inline = { + shared: { + '@codecademy/gamut-icons': { eager: true }, + '@codecademy/gamut-illustrations': { eager: true }, + '@codecademy/gamut-patterns': { eager: true }, + '@codecademy/gamut-styles': { eager: true }, + '@codecademy/variance': { eager: true }, + '@codecademy/gamut': { singleton: true }, + }, +}; diff --git a/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.input.ts b/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.input.ts new file mode 100644 index 0000000000..caf4b09e6d --- /dev/null +++ b/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.input.ts @@ -0,0 +1,11 @@ +export default { + plugins: [ + new ModuleFederationPlugin({ + shared: { + react: { singleton: true }, + '@codecademy/gamut-kit': { singleton: true }, + '@emotion/react': { singleton: true }, + }, + }), + ], +}; diff --git a/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.output.ts b/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.output.ts new file mode 100644 index 0000000000..4c70a53c17 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.output.ts @@ -0,0 +1,16 @@ +export default { + plugins: [ + new ModuleFederationPlugin({ + shared: { + react: { singleton: true }, + '@codecademy/gamut': { singleton: true }, + '@codecademy/gamut-icons': { singleton: true }, + '@codecademy/gamut-illustrations': { singleton: true }, + '@codecademy/gamut-patterns': { singleton: true }, + '@codecademy/gamut-styles': { singleton: true }, + '@codecademy/variance': { singleton: true }, + '@emotion/react': { singleton: true }, + }, + }), + ], +}; diff --git a/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.warnings.json b/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.warnings.json new file mode 100644 index 0000000000..cc4b2bc076 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/mf-shared/__testfixtures__/kit.warnings.json @@ -0,0 +1 @@ +["replaced '@codecademy/gamut-kit' in Module Federation shared config"] diff --git a/packages/gamut-codemods/src/migrations/mf-shared/index.ts b/packages/gamut-codemods/src/migrations/mf-shared/index.ts new file mode 100644 index 0000000000..9d3e677821 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/mf-shared/index.ts @@ -0,0 +1,112 @@ +import { isStringLiteral } from '../../lib/module-strings'; +import type { Edit, SpliceMigration } from '../../lib/types'; + +/* + Module Federation `shared` config that names a removed package: + + shared: { '@codecademy/gamut-kit': { singleton: true } } + becomes + shared: { + '@codecademy/gamut': { singleton: true }, + '@codecademy/gamut-styles': { singleton: true }, + ... + } + + Handles `const shared = { ... }` the same way. + + MF matches shared entries by import name, and code imports the individual + packages, not the kit. So the old entry never deduped anything, and after + this Gamut really is a singleton across host and remotes. That's a runtime + change, hence the warning and checklist item. scope-rename runs after this + and swaps the scope on the new keys. +*/ + +const keyName = (key: any): string | null => { + if (!key) return null; + if (key.type === 'Identifier') return key.name; + if (isStringLiteral(key)) return key.value; + return null; +}; + +/* + The object in `shared: { ... }` (inline plugin options) or + `const shared = { ... }` (declared, then passed in). +*/ +const sharedObject = (node: any) => { + if ( + (node.type === 'ObjectProperty' || node.type === 'Property') && + keyName(node.key) === 'shared' && + node.value?.type === 'ObjectExpression' + ) { + return node.value; + } + if ( + node.type === 'VariableDeclarator' && + keyName(node.id) === 'shared' && + node.init?.type === 'ObjectExpression' + ) { + return node.init; + } + return null; +}; + +export const mfShared: SpliceMigration = { + name: 'mf-shared', + kind: 'splice', + description: + 'Replace removed packages in Module Federation `shared` config with the packages they bundled.', + edits({ j, root, source, manifest, warn, note }) { + const edits: Edit[] = []; + + root + .find(j.Node) + .filter((p) => sharedObject(p.node) !== null) + .forEach((p) => { + const shared = sharedObject(p.node); + const existing = new Set( + shared.properties.map((prop: any) => keyName(prop.key)) + ); + + for (const prop of shared.properties) { + const removed = manifest.removedPackages[keyName(prop.key) ?? '']; + if (!removed) continue; + + const lineStart = source.lastIndexOf('\n', prop.start) + 1; + const before = source.slice(lineStart, prop.start); + /* One entry per line if the old one had its own line, else inline. */ + const ownLine = /^\s*$/.test(before); + const separator = ownLine ? `,\n${before}` : ', '; + const value = source.slice(prop.value.start, prop.value.end); + const additions = removed.mfSharedAs.filter( + (pkg) => !existing.has(pkg) + ); + const text = additions + .map((pkg) => `'${pkg}': ${value}`) + .join(separator); + + /* Nothing to add: drop the entry and the comma that follows it. */ + const end = + text || source[prop.end] !== ',' + ? prop.end + : prop.end + + 1 + + (source.slice(prop.end + 1).match(/^\s*/)?.[0].length ?? 0); + edits.push({ + start: text || !ownLine ? prop.start : lineStart, + end, + text, + }); + + warn( + prop, + `replaced '${keyName( + prop.key + )}' in Module Federation shared config. Gamut is now actually shared as a singleton; test the host and remotes together.` + ); + note('mf-shared'); + } + }); + + return edits; + }, +}; diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/merge-existing.input.tsx b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/merge-existing.input.tsx new file mode 100644 index 0000000000..811c580c56 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/merge-existing.input.tsx @@ -0,0 +1,5 @@ +import { Text, Video } from '@codecademy/gamut'; +import { VideoProps } from '@codecademy/gamut/Video'; + +export const x: VideoProps = { videoUrl: '' }; +export const y = [Text, Video]; diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/merge-existing.output.tsx b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/merge-existing.output.tsx new file mode 100644 index 0000000000..2342b88e7d --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/merge-existing.output.tsx @@ -0,0 +1,5 @@ +import { Text } from '@codecademy/gamut'; +import { VideoProps, Video } from '@codecademy/gamut/Video'; + +export const x: VideoProps = { videoUrl: '' }; +export const y = [Text, Video]; diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/mixed-import.input.tsx b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/mixed-import.input.tsx new file mode 100644 index 0000000000..98db12ff86 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/mixed-import.input.tsx @@ -0,0 +1,7 @@ +import { Box, Video, type VideoProps } from '@codecademy/gamut'; + +export const Player = (props: VideoProps) => ( + + + +); diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/mixed-import.output.tsx b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/mixed-import.output.tsx new file mode 100644 index 0000000000..a2058bdebb --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/mixed-import.output.tsx @@ -0,0 +1,8 @@ +import { Box } from '@codecademy/gamut'; +import { Video, type VideoProps } from '@codecademy/gamut/Video'; + +export const Player = (props: VideoProps) => ( + + + +); diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/re-export.input.ts b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/re-export.input.ts new file mode 100644 index 0000000000..d12c1f8c44 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/re-export.input.ts @@ -0,0 +1 @@ +export { Box, Video } from '@codecademy/gamut'; diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/re-export.output.ts b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/re-export.output.ts new file mode 100644 index 0000000000..efcc9aafd3 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/re-export.output.ts @@ -0,0 +1,2 @@ +export { Box } from '@codecademy/gamut'; +export { Video } from '@codecademy/gamut/Video'; diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.input.tsx b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.input.tsx new file mode 100644 index 0000000000..1d2a688be7 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.input.tsx @@ -0,0 +1,10 @@ +import * as Gamut from '@codecademy/gamut'; + +export * from '@codecademy/gamut'; + +jest.mock('@codecademy/gamut', () => ({ + ...jest.requireActual('@codecademy/gamut'), + Video: () => null, +})); + +export const V = Gamut.Video; diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.output.tsx b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.output.tsx new file mode 100644 index 0000000000..1d2a688be7 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.output.tsx @@ -0,0 +1,10 @@ +import * as Gamut from '@codecademy/gamut'; + +export * from '@codecademy/gamut'; + +jest.mock('@codecademy/gamut', () => ({ + ...jest.requireActual('@codecademy/gamut'), + Video: () => null, +})); + +export const V = Gamut.Video; diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.warnings.json b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.warnings.json new file mode 100644 index 0000000000..ba02d37ffd --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/unsafe-shapes.warnings.json @@ -0,0 +1 @@ +["namespace import uses Video", "'export *' from '@codecademy/gamut'", "mock of '@codecademy/gamut' stubs Video"] diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/video-only.input.tsx b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/video-only.input.tsx new file mode 100644 index 0000000000..690bc76dad --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/video-only.input.tsx @@ -0,0 +1,6 @@ +// the player +import { Video } from '@codecademy/gamut'; +import type { VideoProps } from '@codecademy/gamut'; + +export type P = VideoProps; +export const V = Video; diff --git a/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/video-only.output.tsx b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/video-only.output.tsx new file mode 100644 index 0000000000..968c84aef1 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/__testfixtures__/video-only.output.tsx @@ -0,0 +1,6 @@ +// the player +import { Video } from '@codecademy/gamut/Video'; +import type { VideoProps } from '@codecademy/gamut/Video'; + +export type P = VideoProps; +export const V = Video; diff --git a/packages/gamut-codemods/src/migrations/moved-exports/index.ts b/packages/gamut-codemods/src/migrations/moved-exports/index.ts new file mode 100644 index 0000000000..250d882da6 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/moved-exports/index.ts @@ -0,0 +1,246 @@ +import type { + ASTPath, + Collection, + ExportNamedDeclaration, + ExportSpecifier, + ImportDeclaration, + ImportSpecifier, + JSCodeshift, +} from 'jscodeshift'; + +import type { Manifest, MovedExport } from '../../lib/manifest'; +import { nameOf } from '../../lib/module-strings'; +import type { AstMigration, Warn } from '../../lib/types'; + +/* + Moves named exports that left a package root onto their new subpath, per + manifest.movedExports. For scope-swap that's Video and VideoProps: + + import { Box, Video } from '@codecademy/gamut'; + becomes + import { Box } from '@codecademy/gamut'; + import { Video } from '@codecademy/gamut/Video'; + + Shapes it can't rewrite safely (namespace imports, `export *`, mock + factories) get a warning instead. +*/ + +type Declaration = ImportDeclaration | ExportNamedDeclaration; +type NamedSpecifier = ImportSpecifier | ExportSpecifier; + +const isNamed = (spec: { type: string }): spec is NamedSpecifier => + spec.type === 'ImportSpecifier' || spec.type === 'ExportSpecifier'; + +const specName = (spec: NamedSpecifier) => + nameOf(spec.type === 'ImportSpecifier' ? spec.imported : spec.local); + +const kindOf = (node: Declaration) => + (node as { importKind?: string; exportKind?: string }).importKind ?? + (node as { exportKind?: string }).exportKind ?? + 'value'; + +/* + Fresh copies, not the original nodes. Reparenting nodes that still carry + their source location trips recast's patcher when the file has other edits. +*/ +const cloneSpecifier = (j: JSCodeshift, spec: NamedSpecifier) => { + if (spec.type === 'ExportSpecifier') { + return j.exportSpecifier.from({ + local: j.identifier(nameOf(spec.local)), + exported: j.identifier(nameOf(spec.exported ?? spec.local)), + }); + } + const copy = j.importSpecifier( + j.identifier(nameOf(spec.imported)), + j.identifier(nameOf(spec.local ?? spec.imported)) + ); + Object.assign(copy, { + importKind: (spec as { importKind?: string }).importKind, + }); + return copy; +}; + +/* An existing all-named declaration of the same kind we can merge into. */ +const findTarget = ( + j: JSCodeshift, + root: Collection, + node: Declaration, + to: string, + kind: string +): Declaration | undefined => { + const matches = (candidate: Declaration) => + kindOf(candidate) === kind && + (candidate.specifiers ?? []).every((s) => isNamed(s)); + return node.type === 'ImportDeclaration' + ? root + .find(j.ImportDeclaration, { source: { value: to } }) + .nodes() + .find(matches) + : root + .find(j.ExportNamedDeclaration, { source: { value: to } }) + .nodes() + .find(matches); +}; + +const moveSpecifiers = ( + j: JSCodeshift, + root: Collection, + path: ASTPath, + rule: MovedExport +) => { + const { node } = path; + const names = new Set(rule.names); + const specifiers = (node.specifiers ?? []) as { type: string }[]; + const matched = specifiers.filter( + (s): s is NamedSpecifier => isNamed(s) && names.has(specName(s)) + ); + if (matched.length === 0) return false; + + const moving = matched.map((s) => cloneSpecifier(j, s)); + const staying = specifiers.filter( + (s) => !matched.includes(s as NamedSpecifier) + ); + const kind = kindOf(node); + const existing = findTarget(j, root, node, rule.to, kind); + + if (existing) { + (existing.specifiers as unknown[]).push(...moving); + if (staying.length === 0) path.prune(); + else node.specifiers = staying as typeof node.specifiers; + return true; + } + + if (staying.length === 0) { + /* Whole declaration moves. Keep the node so its comments stay put. */ + node.source = j.stringLiteral(rule.to); + return true; + } + + const created = + node.type === 'ImportDeclaration' + ? j.importDeclaration( + moving as ImportSpecifier[], + j.stringLiteral(rule.to) + ) + : j.exportNamedDeclaration( + null, + moving as ExportSpecifier[], + j.stringLiteral(rule.to) + ); + Object.assign( + created, + node.type === 'ImportDeclaration' + ? { importKind: kind } + : { exportKind: kind } + ); + node.specifiers = staying as typeof node.specifiers; + path.replace(node, created); + return true; +}; + +const warnAboutUnsafeShapes = ( + j: JSCodeshift, + root: Collection, + rule: MovedExport, + warn: Warn +) => { + const list = rule.names.join('/'); + + root + .find(j.ImportDeclaration, { source: { value: rule.from } }) + .forEach((p) => { + for (const spec of p.node.specifiers ?? []) { + if (spec.type !== 'ImportNamespaceSpecifier') continue; + const ns = nameOf(spec.local); + const member = root + .find(j.MemberExpression, { object: { name: ns } }) + .filter((m) => rule.names.includes(nameOf(m.node.property))); + const qualified = root + .find(j.TSQualifiedName, { left: { name: ns } }) + .filter((q) => rule.names.includes(nameOf(q.node.right))); + if (member.size() + qualified.size() > 0) { + warn( + p.node, + `namespace import uses ${list}, which moved to '${rule.to}'. Rewrite by hand.` + ); + } + } + }); + + root + .find(j.ExportAllDeclaration, { source: { value: rule.from } }) + .forEach((p) => { + warn( + p.node, + `'export *' from '${rule.from}' no longer re-exports ${list}. Add an export from '${rule.to}' if you need them.` + ); + }); + + root + .find(j.CallExpression, { arguments: [{ value: rule.from }] }) + .filter((p) => p.node.arguments.length > 1) + .forEach((p) => { + const mentions = j(p.get('arguments', 1)) + .find(j.Identifier) + .filter((id) => rule.names.includes(id.node.name)); + if (mentions.size() > 0) { + warn( + p.node, + `mock of '${rule.from}' stubs ${list}. Mock '${rule.to}' instead.` + ); + } + }); +}; + +const escape = (s: string) => s.replace(/[.*+?^${}()|[\]\\/]/g, '\\$&'); + +/* An old specifier and its renamed form, since scope-rename may have run. */ +const bothScopes = (manifest: Manifest, spec: string) => { + const pkg = Object.keys(manifest.packages).find( + (p) => spec === p || spec.startsWith(`${p}/`) + ); + return pkg + ? [spec, manifest.packages[pkg].to + spec.slice(pkg.length)] + : [spec]; +}; + +export const movedExports: AstMigration = { + name: 'moved-exports', + kind: 'ast', + description: + 'Move exports that left a package root (e.g. Video) to their new subpath.', + run({ j, root, manifest, warn }) { + let changed = false; + for (const rule of manifest.movedExports) { + const paths = [ + ...root + .find(j.ImportDeclaration, { source: { value: rule.from } }) + .paths(), + ...root + .find(j.ExportNamedDeclaration, { source: { value: rule.from } }) + .paths(), + ] as ASTPath[]; + for (const p of paths) { + changed = moveSpecifiers(j, root, p, rule) || changed; + } + warnAboutUnsafeShapes(j, root, rule, warn); + } + return changed; + }, + /* + recast copies the gap that followed the original declaration onto the + new one, so a split can leave a blank line between the two halves. + Close exactly that gap and nothing else. + */ + postPrint(source, { manifest }) { + return manifest.movedExports.reduce((out, rule) => { + const from = bothScopes(manifest, rule.from).map(escape).join('|'); + const to = bothScopes(manifest, rule.to).map(escape).join('|'); + const split = new RegExp( + `(from '(?:${from})';?)\\n\\n((?:import|export)[^\\n]*from '(?:${to})';?)`, + 'g' + ); + return out.replace(split, '$1\n$2'); + }, source); + }, +}; diff --git a/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.input.json b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.input.json new file mode 100644 index 0000000000..1ad0d5bf74 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.input.json @@ -0,0 +1,11 @@ +{ + "name": "app", + "dependencies": { + "@codecademy/gamut": "73.6.1", + "@codecademy/gamut-kit": "3.0.24", + "react": "^19.0.0" + }, + "devDependencies": { + "eslint-plugin-gamut": "3.1.0" + } +} diff --git a/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.output.json b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.output.json new file mode 100644 index 0000000000..779450d73c --- /dev/null +++ b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.output.json @@ -0,0 +1,16 @@ +{ + "name": "app", + "dependencies": { + "@skillsoft/gamut": "^{{version}}", + "@skillsoft/gamut-icons": "^{{version}}", + "@skillsoft/gamut-illustrations": "^{{version}}", + "@skillsoft/gamut-patterns": "^{{version}}", + "@skillsoft/gamut-styles": "^{{version}}", + "@skillsoft/gamut-tests": "^{{version}}", + "@skillsoft/variance": "^{{version}}", + "react": "^19.0.0" + }, + "devDependencies": { + "@skillsoft/eslint-plugin-gamut": "^0.0.1" + } +} diff --git a/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.warnings.json b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.warnings.json new file mode 100644 index 0000000000..47a5eebf34 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/kit.warnings.json @@ -0,0 +1 @@ +["replaced '@codecademy/gamut-kit'"] diff --git a/packages/gamut-codemods/src/migrations/package-json/index.ts b/packages/gamut-codemods/src/migrations/package-json/index.ts new file mode 100644 index 0000000000..7d25d0ae30 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/package-json/index.ts @@ -0,0 +1,72 @@ +import type { FileMigration } from '../../lib/types'; + +/* + Renames dependencies in package.json and pins them to + manifest.targetVersions. Removed packages are replaced by the packages + they bundled. Only touched fields are re-sorted; indentation and the + trailing newline are kept. +*/ + +const FIELDS = [ + 'dependencies', + 'devDependencies', + 'peerDependencies', + 'optionalDependencies', +] as const; + +const sortKeys = (obj: Record) => + Object.fromEntries( + Object.entries(obj).sort(([a], [b]) => a.localeCompare(b)) + ); + +const detectIndent = (text: string) => + (text.match(/^[ \t]+(?=")/m) ?? [' '])[0]; + +export const packageJson: FileMigration = { + name: 'package-json', + kind: 'file', + description: 'Rename dependencies in package.json.', + match: (file) => /(^|\/)package\.json$/.test(file), + run({ source, manifest, warn, note }) { + const pkg = JSON.parse(source) as Record; + let changed = false; + + for (const field of FIELDS) { + const deps = pkg[field] as Record | undefined; + if (!deps) continue; + const next = { ...deps }; + let touched = false; + + for (const [removed, { expandTo, note: why }] of Object.entries( + manifest.removedPackages + )) { + if (!(removed in next)) continue; + delete next[removed]; + for (const old of expandTo) { + if (!(old in next)) next[old] = '*'; + } + warn( + `${field}: replaced '${removed}' with its individual packages. ${why}` + ); + note(`removed:${removed}`); + touched = true; + } + + for (const [from, { to }] of Object.entries(manifest.packages)) { + if (!(from in next)) continue; + delete next[from]; + next[to] = manifest.targetVersions[to]; + touched = true; + } + + if (touched) { + pkg[field] = sortKeys(next); + changed = true; + } + } + + if (!changed) return null; + const trailing = source.endsWith('\n') ? '\n' : ''; + return JSON.stringify(pkg, null, detectIndent(source)) + trailing; + }, +}; diff --git a/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.input.tsx b/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.input.tsx new file mode 100644 index 0000000000..db77a7d96b --- /dev/null +++ b/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.input.tsx @@ -0,0 +1,20 @@ +import { Box } from '@codecademy/gamut'; +import { theme } from '@codecademy/gamut-styles'; +import { Video } from '@codecademy/gamut/Video'; +import { setupRtl } from '@codecademy/gamut-tests'; +import type { CoreTheme } from '@codecademy/gamut-styles'; +import { Kit } from '@codecademy/gamut-kit'; +import { Other } from '@codecademy/gamut-extra-thing'; + +export * from '@codecademy/gamut-icons'; + +declare module '@codecademy/gamut-styles' { + interface Theme extends CoreTheme {} +} + +jest.mock('@codecademy/variance'); +const lazy = () => import('@codecademy/gamut-patterns'); +const req = require('@codecademy/gamut-illustrations'); +type T = import('@codecademy/gamut').BoxProps; + +export const transpilePackages = ['@codecademy/gamut']; diff --git a/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.output.tsx b/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.output.tsx new file mode 100644 index 0000000000..dca4d84c5d --- /dev/null +++ b/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.output.tsx @@ -0,0 +1,20 @@ +import { Box } from '@skillsoft/gamut'; +import { theme } from '@skillsoft/gamut-styles'; +import { Video } from '@skillsoft/gamut/Video'; +import { setupRtl } from '@skillsoft/gamut-tests'; +import type { CoreTheme } from '@skillsoft/gamut-styles'; +import { Kit } from '@codecademy/gamut-kit'; +import { Other } from '@codecademy/gamut-extra-thing'; + +export * from '@skillsoft/gamut-icons'; + +declare module '@skillsoft/gamut-styles' { + interface Theme extends CoreTheme {} +} + +jest.mock('@skillsoft/variance'); +const lazy = () => import('@skillsoft/gamut-patterns'); +const req = require('@skillsoft/gamut-illustrations'); +type T = import('@skillsoft/gamut').BoxProps; + +export const transpilePackages = ['@skillsoft/gamut']; diff --git a/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.warnings.json b/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.warnings.json new file mode 100644 index 0000000000..158b86d60b --- /dev/null +++ b/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/everywhere.warnings.json @@ -0,0 +1 @@ +["'@codecademy/gamut-kit' has no replacement package", "renamed 1 package-name string(s) outside imports (@codecademy/gamut)"] diff --git a/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/no-semicolons.input.tsx b/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/no-semicolons.input.tsx new file mode 100644 index 0000000000..5570545ab3 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/no-semicolons.input.tsx @@ -0,0 +1,13 @@ +import { Box } from '@codecademy/gamut' + +jest.mock('./Card', () => { + return ({ title, description }: any) => ( +
+ {title} - {description} +
+ ) +}) + +jest.mock("@codecademy/gamut-icons", () => ({ + AiEditSparkIcon: () =>
AI Icon
, +})) diff --git a/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/no-semicolons.output.tsx b/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/no-semicolons.output.tsx new file mode 100644 index 0000000000..fac3c38590 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/scope-rename/__testfixtures__/no-semicolons.output.tsx @@ -0,0 +1,13 @@ +import { Box } from '@skillsoft/gamut' + +jest.mock('./Card', () => { + return ({ title, description }: any) => ( +
+ {title} - {description} +
+ ) +}) + +jest.mock("@skillsoft/gamut-icons", () => ({ + AiEditSparkIcon: () =>
AI Icon
, +})) diff --git a/packages/gamut-codemods/src/migrations/scope-rename/index.ts b/packages/gamut-codemods/src/migrations/scope-rename/index.ts new file mode 100644 index 0000000000..0b62ee9295 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/scope-rename/index.ts @@ -0,0 +1,69 @@ +import { removedPackageFor, renameSpecifier } from '../../lib/manifest'; +import type { StringNode } from '../../lib/module-strings'; +import { findModuleStrings, isStringLiteral } from '../../lib/module-strings'; +import type { Edit, SpliceMigration } from '../../lib/types'; + +/* + Swaps old package names for new ones in every module position: imports, + exports, require, mocks, `declare module`, import types. Runs last, since + every other migration is written against the old names. + + Any other string that exactly names an old package (Next's + transpilePackages, Module Federation shared keys, lint ignore lists) is + rewritten too. Across mono, platform, front, and talent-intelligence every + one of those was a correct rename, so they get one warning per file + asking for a look at the diff, not one per string. + + This is a splice migration: it edits the text inside the quotes and never + asks recast to print. Mutating even one literal's value made recast + reprint neighbouring statements in semicolon-less files, including JSX + text whitespace. +*/ + +export const scopeRename: SpliceMigration = { + name: 'scope-rename', + kind: 'splice', + description: 'Swap old package specifiers for their new names.', + edits({ j, root, manifest, warn }) { + const edits: Edit[] = []; + const moduleStrings = new Set(findModuleStrings(j, root)); + const outsideImports: string[] = []; + + const visit = (literal: StringNode, inModulePosition: boolean) => { + const removed = removedPackageFor(manifest, literal.value); + if (removed) { + warn( + literal, + `'${removed}' has no replacement package. ${manifest.removedPackages[removed].note}` + ); + return; + } + const next = renameSpecifier(manifest, literal.value); + if (!next) return; + if (!inModulePosition) outsideImports.push(literal.value); + /* Inside the quotes only, so the file's quote style survives. */ + edits.push({ + start: literal.start + 1, + end: literal.end - 1, + text: next, + }); + }; + + for (const literal of moduleStrings) visit(literal, true); + + root + .find(j.Node) + .filter((p) => isStringLiteral(p.node) && !moduleStrings.has(p.node)) + .forEach((p) => visit(p.node as StringNode, false)); + + if (outsideImports.length > 0) { + const names = [...new Set(outsideImports)].join(', '); + warn( + null, + `renamed ${outsideImports.length} package-name string(s) outside imports (${names}). Check the diff.` + ); + } + + return edits; + }, +}; diff --git a/packages/gamut-codemods/src/presets/index.ts b/packages/gamut-codemods/src/presets/index.ts new file mode 100644 index 0000000000..2ff0c9294a --- /dev/null +++ b/packages/gamut-codemods/src/presets/index.ts @@ -0,0 +1,43 @@ +import type { Preset } from '../lib/types'; +import { scopeSwap } from './scope-swap'; + +/* + Every preset the CLI can run. A preset is one upgrade: its own manifest, + an ordered list of migrations, and the checklist to print afterwards. + Later presets are named for the release they target and can reuse + migrations from src/migrations with a different manifest. +*/ +export const presets: Record = { + [scopeSwap.name]: scopeSwap, +}; + +/* + AST migrations print through recast once, then splice migrations edit that + output by offset. Interleaving them would need a print and re-parse per + switch, so presets have to list every `ast` migration before any + `splice` one. +*/ +export const validatePreset = (preset: Preset) => { + const source = preset.migrations.filter((m) => m.kind !== 'file'); + const firstSplice = source.findIndex((m) => m.kind === 'splice'); + const lateAst = + firstSplice === -1 + ? undefined + : source.slice(firstSplice).find((m) => m.kind === 'ast'); + if (lateAst) { + throw new Error( + `preset '${preset.name}': ast migration '${lateAst.name}' is listed after a splice migration. List every ast migration first.` + ); + } + return preset; +}; + +export const getPreset = (name: string) => { + const preset = presets[name]; + if (!preset) { + throw new Error( + `unknown preset '${name}'. Available: ${Object.keys(presets).join(', ')}` + ); + } + return validatePreset(preset); +}; diff --git a/packages/gamut-codemods/src/presets/scope-swap/index.ts b/packages/gamut-codemods/src/presets/scope-swap/index.ts new file mode 100644 index 0000000000..8ece32e855 --- /dev/null +++ b/packages/gamut-codemods/src/presets/scope-swap/index.ts @@ -0,0 +1,36 @@ +import type { Preset } from '../../lib/types'; +import { deepImports } from '../../migrations/deep-imports'; +import { eslintComments } from '../../migrations/eslint-comments'; +import { eslintConfig } from '../../migrations/eslint-config'; +import { mfShared } from '../../migrations/mf-shared'; +import { movedExports } from '../../migrations/moved-exports'; +import { packageJson } from '../../migrations/package-json'; +import { scopeRename } from '../../migrations/scope-rename'; +import { manifest } from './manifest'; + +export const scopeSwap: Preset = { + name: 'scope-swap', + description: 'Move from @codecademy/gamut* to @skillsoft/gamut*.', + manifest, + migrations: [ + deepImports, + movedExports, + mfShared, + eslintComments, + /* Last: everything above matches on @codecademy names. */ + scopeRename, + packageJson, + eslintConfig, + ], + checklist: [ + 'Run your formatter (prettier --write / eslint --fix). Split imports come out in recast style.', + 'Reinstall (yarn), then type-check and run your tests.', + 'Work through the warnings above and the leftovers list.', + ], + conditionalChecklist: { + 'removed:@codecademy/gamut-kit': + 'gamut-kit is gone. Delete anything that reads it for versions, such as a sync-gamut-deps script.', + 'mf-shared': + "Module Federation shared config changed. Gamut is now a real singleton: run the host and every remote together, and update the remotes' shared config to match.", + }, +}; diff --git a/packages/gamut-codemods/src/presets/scope-swap/manifest.ts b/packages/gamut-codemods/src/presets/scope-swap/manifest.ts new file mode 100644 index 0000000000..dc45537356 --- /dev/null +++ b/packages/gamut-codemods/src/presets/scope-swap/manifest.ts @@ -0,0 +1,154 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +import type { Manifest } from '../../lib/manifest'; + +/* + What changed between @codecademy/gamut* and @skillsoft/gamut*. Every entry + uses the OLD (@codecademy) names; scope-rename runs last and swaps the + scope, so no other migration needs to know the new one. + + manifest.test.ts type-checks every export this file points at against the + built packages, so a row can't reference an export that doesn't exist. +*/ + +/* + This package is in the changesets `fixed` group with the packages it + migrates to, so its own version is theirs. +*/ +const { version } = JSON.parse( + fs.readFileSync(path.join(__dirname, '../../../package.json'), 'utf8') +) as { version: string }; + +const GROUP_RANGE = `^${version}`; + +export const manifest: Manifest = { + packages: { + '@codecademy/gamut': { to: '@skillsoft/gamut' }, + '@codecademy/gamut-styles': { to: '@skillsoft/gamut-styles' }, + '@codecademy/gamut-icons': { to: '@skillsoft/gamut-icons' }, + '@codecademy/gamut-illustrations': { to: '@skillsoft/gamut-illustrations' }, + '@codecademy/gamut-patterns': { to: '@skillsoft/gamut-patterns' }, + '@codecademy/gamut-tests': { to: '@skillsoft/gamut-tests' }, + '@codecademy/variance': { to: '@skillsoft/variance' }, + 'eslint-plugin-gamut': { to: '@skillsoft/eslint-plugin-gamut' }, + }, + + removedPackages: { + '@codecademy/gamut-kit': { + expandTo: [ + '@codecademy/gamut', + '@codecademy/gamut-icons', + '@codecademy/gamut-illustrations', + '@codecademy/gamut-patterns', + '@codecademy/gamut-styles', + '@codecademy/gamut-tests', + '@codecademy/variance', + ], + /* gamut-tests is test-only, so it has no business in a runtime share. */ + mfSharedAs: [ + '@codecademy/gamut', + '@codecademy/gamut-icons', + '@codecademy/gamut-illustrations', + '@codecademy/gamut-patterns', + '@codecademy/gamut-styles', + '@codecademy/variance', + ], + note: 'gamut-kit is not published under @skillsoft. Depend on the individual packages instead.', + }, + }, + + targetVersions: { + '@skillsoft/gamut': GROUP_RANGE, + '@skillsoft/gamut-styles': GROUP_RANGE, + '@skillsoft/gamut-icons': GROUP_RANGE, + '@skillsoft/gamut-illustrations': GROUP_RANGE, + '@skillsoft/gamut-patterns': GROUP_RANGE, + '@skillsoft/gamut-tests': GROUP_RANGE, + '@skillsoft/variance': GROUP_RANGE, + /* + Versioned outside the fixed group. manifest.test.ts fails if this + falls behind packages/eslint-plugin-gamut/package.json. + */ + '@skillsoft/eslint-plugin-gamut': '^0.0.1', + }, + + movedExports: [ + { + from: '@codecademy/gamut', + to: '@codecademy/gamut/Video', + names: ['Video', 'VideoProps'], + note: 'Video is no longer on the root barrel. See packages/gamut/src/index.tsx.', + }, + ], + + /* + From the GMT-1740 deep-import inventory. Rows are only added once the + target is really exported; manifest.test.ts checks. + */ + deepImports: [ + { + from: '@codecademy/gamut/dist/PopoverContainer/types', + to: '@codecademy/gamut', + }, + { + from: '@codecademy/gamut/dist/Form/SelectDropdown/types', + to: '@codecademy/gamut', + }, + { from: '@codecademy/gamut/dist/Form/types', to: '@codecademy/gamut' }, + { from: '@codecademy/gamut/dist/Box/props', to: '@codecademy/gamut' }, + { + from: '@codecademy/gamut/dist/Tip/shared/types', + to: '@codecademy/gamut', + }, + { from: '@codecademy/gamut/dist/Button/shared', to: '@codecademy/gamut' }, + { + from: '@codecademy/gamut/dist/Markdown/libs/overrides', + to: '@codecademy/gamut', + }, + /* + No public replacement for the next three. Upstream GMT-1740 renamed + them (List -> MenuList, IconOption -> IconOptionComponent) and promoted + ButtonBase, then reverted all three before merging (upstream 009aa43f6) + as breaking changes for a separate PR. skillsoft-gamut matches that. + */ + { + from: '@codecademy/gamut/dist/ButtonBase/ButtonBase', + to: null, + note: 'ButtonBase is deliberately not public. Use FillButton, StrokeButton, TextButton, IconButton, or CTAButton.', + }, + { + from: '@codecademy/gamut/dist/Menu/elements', + to: null, + note: 'Menu list elements are not public (a MenuList* rename was held back upstream). Compose Menu/MenuItem, or copy the element.', + }, + { + from: '@codecademy/gamut/dist/Form/SelectDropdown/elements', + to: null, + note: 'The IconOption component is not public. Copy it into your app if you need it.', + }, + { + from: '@codecademy/gamut/dist/Form/styles', + to: null, + note: 'Form/styles has no public replacement. Inline the styles or use system props / css().', + }, + { + from: '@codecademy/gamut-styles/dist/AssetProvider', + to: '@codecademy/gamut-styles', + }, + { + from: '@codecademy/gamut-icons/dist/types', + to: '@codecademy/gamut-icons', + }, + { + from: '@codecademy/gamut-icons/dist/props', + to: '@codecademy/gamut-icons', + }, + { + from: '@codecademy/variance/dist/types/config', + to: '@codecademy/variance', + }, + ], + + eslintPlugin: { from: 'gamut', to: '@skillsoft/gamut' }, +}; diff --git a/packages/gamut-codemods/src/transform.ts b/packages/gamut-codemods/src/transform.ts new file mode 100644 index 0000000000..2bf5cef8bb --- /dev/null +++ b/packages/gamut-codemods/src/transform.ts @@ -0,0 +1,128 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +import type { API, FileInfo } from 'jscodeshift'; + +import type { + AstMigration, + Edit, + Locatable, + SourceMigration, + SpliceMigration, +} from './lib/types'; +import { getPreset } from './presets'; + +/* + jscodeshift entry point. Two phases: + + 1. AST migrations share one parse and mutate it. If any changed + something, recast prints the file once and `postPrint` hooks run. + 2. Splice migrations run in order, each against a fresh parse of the + current text, returning `{ start, end, text }` edits applied back to + front. A re-parse between them means a later splice sees an earlier + one's output (mf-shared writes @codecademy keys that scope-rename then + renames). + + Options: + preset: preset name (default: scope-swap) + only: comma-separated migration names to run (default: all) + notesDir: directory the CLI reads checklist notes back from. jscodeshift + only aggregates api.stats in --dry runs, so workers leave an + empty marker file per note key instead. + onWarn: (message) => void, for tests; otherwise warnings go to api.report +*/ + +export interface TransformOptions { + preset?: string; + only?: string; + notesDir?: string; + onWarn?: (message: string) => void; +} + +const applyEdits = (source: string, edits: Edit[]) => + [...edits] + .sort((a, b) => b.start - a.start) + .reduce( + (out, { start, end, text }) => + out.slice(0, start) + text + out.slice(end), + source + ); + +export default function transform( + file: FileInfo, + api: API, + options: TransformOptions = {} +) { + const preset = getPreset(options.preset ?? 'scope-swap'); + const { manifest } = preset; + + /* Cheap pre-filter so big repos don't parse every file. */ + const oldNames = [ + ...Object.keys(manifest.packages), + ...Object.keys(manifest.removedPackages), + `${manifest.eslintPlugin.from}/`, + ]; + if (!oldNames.some((name) => file.source.includes(name))) return undefined; + + const only = options.only ? new Set(options.only.split(',')) : null; + const active = preset.migrations.filter( + (m): m is SourceMigration => + m.kind !== 'file' && (!only || only.has(m.name)) + ); + + const j = api.jscodeshift; + const note = (key: string) => { + if (options.notesDir) { + fs.writeFileSync( + path.join(options.notesDir, encodeURIComponent(key)), + '' + ); + } + }; + const warnFor = (name: string) => (node: Locatable, message: string) => { + const line = node?.loc ? `:${node.loc.start.line}` : ''; + const text = `[${name}] ${file.path}${line} ${message}`; + if (options.onWarn) options.onWarn(text); + else api.report(text); + }; + + let { source } = file; + + const astMigrations = active.filter( + (m): m is AstMigration => m.kind === 'ast' + ); + if (astMigrations.length > 0) { + const root = j(source); + let changed = false; + for (const m of astMigrations) { + changed = + m.run({ j, root, source, manifest, warn: warnFor(m.name), note }) || + changed; + } + if (changed) { + source = astMigrations.reduce( + (out, m) => (m.postPrint ? m.postPrint(out, { manifest }) : out), + root.toSource({ quote: 'single' }) + ); + } + } + + for (const m of active.filter( + (x): x is SpliceMigration => x.kind === 'splice' + )) { + const root = j(source); + const edits = m.edits({ + j, + root, + source, + manifest, + warn: warnFor(m.name), + note, + }); + if (edits.length > 0) source = applyEdits(source, edits); + } + + return source === file.source ? undefined : source; +} + +export const parser = 'tsx'; diff --git a/packages/gamut-codemods/tsconfig.json b/packages/gamut-codemods/tsconfig.json new file mode 100644 index 0000000000..62ebbd9464 --- /dev/null +++ b/packages/gamut-codemods/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/gamut-codemods/tsconfig.lib.json b/packages/gamut-codemods/tsconfig.lib.json new file mode 100644 index 0000000000..8c51e7c29d --- /dev/null +++ b/packages/gamut-codemods/tsconfig.lib.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "module": "CommonJS", + "outDir": "./dist", + "rootDir": "./src", + "lib": ["es2022"], + "types": ["node"] + }, + "exclude": ["jest.config.ts", "**/*.test.ts", "**/__testfixtures__/**"], + "include": ["./src/**/*.ts"] +} diff --git a/packages/gamut-codemods/tsconfig.spec.json b/packages/gamut-codemods/tsconfig.spec.json new file mode 100644 index 0000000000..38a15e287a --- /dev/null +++ b/packages/gamut-codemods/tsconfig.spec.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "./dist", + "lib": ["es2022"], + "types": ["jest", "node"] + }, + "exclude": ["**/__testfixtures__/**"], + "include": ["jest.config.ts", "**/*.test.ts", "**/*.d.ts"] +} diff --git a/yarn.lock b/yarn.lock index 086fa9efad..c62b2f4f7d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -478,7 +478,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.29.0": +"@babel/core@npm:^7.24.7, @babel/core@npm:^7.29.0": version: 7.29.7 resolution: "@babel/core@npm:7.29.7" dependencies: @@ -527,12 +527,12 @@ __metadata: languageName: node linkType: hard -"@babel/helper-annotate-as-pure@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-annotate-as-pure@npm:7.25.9" +"@babel/helper-annotate-as-pure@npm:^7.25.9, @babel/helper-annotate-as-pure@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/helper-annotate-as-pure@npm:7.29.7" dependencies: - "@babel/types": "npm:^7.25.9" - checksum: 10c0/095b6ba50489d797733abebc4596a81918316a99e3632755c9f02508882912b00c2ae5e468532a25a5c2108d109ddbe9b7da78333ee7cc13817fc50c00cf06fe + "@babel/types": "npm:^7.29.7" + checksum: 10c0/c56536b52d17632d89d49db2063ed6102f0e3bbadf6a0ccb74e6599d6a77173b644c7fe8c3ef17c7a162709d55b75ee5145ef6db917d16ba7f375fbffcf2e942 languageName: node linkType: hard @@ -572,20 +572,20 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-create-class-features-plugin@npm:7.25.9" +"@babel/helper-create-class-features-plugin@npm:^7.25.9, @babel/helper-create-class-features-plugin@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/helper-create-class-features-plugin@npm:7.29.7" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.25.9" - "@babel/helper-member-expression-to-functions": "npm:^7.25.9" - "@babel/helper-optimise-call-expression": "npm:^7.25.9" - "@babel/helper-replace-supers": "npm:^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.25.9" - "@babel/traverse": "npm:^7.25.9" + "@babel/helper-annotate-as-pure": "npm:^7.29.7" + "@babel/helper-member-expression-to-functions": "npm:^7.29.7" + "@babel/helper-optimise-call-expression": "npm:^7.29.7" + "@babel/helper-replace-supers": "npm:^7.29.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.29.7" + "@babel/traverse": "npm:^7.29.7" semver: "npm:^6.3.1" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/b2bdd39f38056a76b9ba00ec5b209dd84f5c5ebd998d0f4033cf0e73d5f2c357fbb49d1ce52db77a2709fb29ee22321f84a5734dc9914849bdfee9ad12ce8caf + checksum: 10c0/75f34905b5e708b473f1e9b33e07b2fcc8f4c60676df8bc74541bb91c77f387c32a948dd04d5071e469ba454d72d0a872e3ace40fbb1d1e7aaa8569efcf09ed4 languageName: node linkType: hard @@ -631,13 +631,13 @@ __metadata: languageName: node linkType: hard -"@babel/helper-member-expression-to-functions@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-member-expression-to-functions@npm:7.25.9" +"@babel/helper-member-expression-to-functions@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/helper-member-expression-to-functions@npm:7.29.7" dependencies: - "@babel/traverse": "npm:^7.25.9" - "@babel/types": "npm:^7.25.9" - checksum: 10c0/e08c7616f111e1fb56f398365e78858e26e466d4ac46dff25921adc5ccae9b232f66e952a2f4162bbe336627ba336c7fd9eca4835b6548935973d3380d77eaff + "@babel/traverse": "npm:^7.29.7" + "@babel/types": "npm:^7.29.7" + checksum: 10c0/eef7940ce0797208854a5af1049a98fee9abbffb5c619640c69ff5a555f8e3552295bb18756490b02bc6af7df8c1babcb83f12203aac2deb9dfecfc78846e12d languageName: node linkType: hard @@ -687,12 +687,12 @@ __metadata: languageName: node linkType: hard -"@babel/helper-optimise-call-expression@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-optimise-call-expression@npm:7.25.9" +"@babel/helper-optimise-call-expression@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/helper-optimise-call-expression@npm:7.29.7" dependencies: - "@babel/types": "npm:^7.25.9" - checksum: 10c0/90203e6607edeadd2a154940803fd616c0ed92c1013d6774c4b8eb491f1a5a3448b68faae6268141caa5c456e55e3ee49a4ed2bd7ddaf2365daea321c435914c + "@babel/types": "npm:^7.29.7" + checksum: 10c0/fd0244b9bfbb487db02d59aa2703c6991d654ea5f3f39d912682842bdca2e87b5ae8643b0ce8069bf5fbee39d1aa9db7abefeb5e6ba1aa650dca12777cf5b7e2 languageName: node linkType: hard @@ -723,36 +723,26 @@ __metadata: languageName: node linkType: hard -"@babel/helper-replace-supers@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-replace-supers@npm:7.25.9" +"@babel/helper-replace-supers@npm:^7.25.9, @babel/helper-replace-supers@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/helper-replace-supers@npm:7.29.7" dependencies: - "@babel/helper-member-expression-to-functions": "npm:^7.25.9" - "@babel/helper-optimise-call-expression": "npm:^7.25.9" - "@babel/traverse": "npm:^7.25.9" + "@babel/helper-member-expression-to-functions": "npm:^7.29.7" + "@babel/helper-optimise-call-expression": "npm:^7.29.7" + "@babel/traverse": "npm:^7.29.7" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/0b40d7d2925bd3ba4223b3519e2e4d2456d471ad69aa458f1c1d1783c80b522c61f8237d3a52afc9e47c7174129bbba650df06393a6787d5722f2ec7f223c3f4 - languageName: node - linkType: hard - -"@babel/helper-simple-access@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-simple-access@npm:7.25.9" - dependencies: - "@babel/traverse": "npm:^7.25.9" - "@babel/types": "npm:^7.25.9" - checksum: 10c0/3f1bcdb88ee3883ccf86959869a867f6bbf8c4737cd44fb9f799c38e54f67474590bc66802500ae9fe18161792875b2cfb7ec15673f48ed6c8663f6d09686ca8 + checksum: 10c0/1c7ae37797f226e965ab85f6affa53d25a10c169c604a4daeb36f9df09e673471e6522f631c13761cf9fbafeca2ea14c241dea8d723a51039d561beb01d86ac4 languageName: node linkType: hard -"@babel/helper-skip-transparent-expression-wrappers@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.25.9" +"@babel/helper-skip-transparent-expression-wrappers@npm:^7.25.9, @babel/helper-skip-transparent-expression-wrappers@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.29.7" dependencies: - "@babel/traverse": "npm:^7.25.9" - "@babel/types": "npm:^7.25.9" - checksum: 10c0/09ace0c6156961624ac9524329ce7f45350bab94bbe24335cbe0da7dfaa1448e658771831983cb83fe91cf6635b15d0a3cab57c03b92657480bfb49fb56dd184 + "@babel/traverse": "npm:^7.29.7" + "@babel/types": "npm:^7.29.7" + checksum: 10c0/8c59493621487fc491f27adfc200af82a6aca3b9a5511e4e6050f8716593b4b243472cb56c8d2016e828b7ae12d605a819205aa8600ca08ee291dcd58d65c832 languageName: node linkType: hard @@ -987,6 +977,17 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-syntax-flow@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/plugin-syntax-flow@npm:7.29.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.29.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/b2e330dd0dc535c7364937ce2b29a06065e60b1d523db75f36ab4fb89e4ba664e2230cbb1937b35712c9a0ebafc3358f323d6e6b22247d5ebad12fdd3e1f6e98 + languageName: node + linkType: hard + "@babel/plugin-syntax-import-assertions@npm:^7.26.0": version: 7.26.0 resolution: "@babel/plugin-syntax-import-assertions@npm:7.26.0" @@ -1212,15 +1213,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-class-properties@npm:^7.22.5, @babel/plugin-transform-class-properties@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/plugin-transform-class-properties@npm:7.25.9" +"@babel/plugin-transform-class-properties@npm:^7.22.5, @babel/plugin-transform-class-properties@npm:^7.24.7, @babel/plugin-transform-class-properties@npm:^7.25.9": + version: 7.29.7 + resolution: "@babel/plugin-transform-class-properties@npm:7.29.7" dependencies: - "@babel/helper-create-class-features-plugin": "npm:^7.25.9" - "@babel/helper-plugin-utils": "npm:^7.25.9" + "@babel/helper-create-class-features-plugin": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.29.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/f0603b6bd34d8ba62c03fc0572cb8bbc75874d097ac20cc7c5379e001081210a84dba1749e7123fca43b978382f605bb9973c99caf2c5b4c492d5c0a4a441150 + checksum: 10c0/c370700423439aa9f0c1f8c4b97f2ef7c2dc46a1b04ec3b10e83e6bae5e4e2159f56d8e4376c9d669b3cf827650cc3740170a36e3924e3e9970d27fd85f4e48a languageName: node linkType: hard @@ -1344,6 +1345,18 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-transform-flow-strip-types@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/plugin-transform-flow-strip-types@npm:7.29.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/plugin-syntax-flow": "npm:^7.29.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/083e864a60927cde7bd75822bdf5c6c72de200ee955e48f6ff5923f0d2b0744ab8f1b64c45e74b88ae3796f03721489afffdb0536f25c54d0dd58508a8904f40 + languageName: node + linkType: hard + "@babel/plugin-transform-for-of@npm:^7.25.9": version: 7.25.9 resolution: "@babel/plugin-transform-for-of@npm:7.25.9" @@ -1425,16 +1438,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-modules-commonjs@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/plugin-transform-modules-commonjs@npm:7.25.9" +"@babel/plugin-transform-modules-commonjs@npm:^7.24.7, @babel/plugin-transform-modules-commonjs@npm:^7.25.9": + version: 7.29.7 + resolution: "@babel/plugin-transform-modules-commonjs@npm:7.29.7" dependencies: - "@babel/helper-module-transforms": "npm:^7.25.9" - "@babel/helper-plugin-utils": "npm:^7.25.9" - "@babel/helper-simple-access": "npm:^7.25.9" + "@babel/helper-module-transforms": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.29.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/6ce771fb04d4810257fc8900374fece877dacaed74b05eaa16ad9224b390f43795c4d046cbe9ae304e1eb5aad035d37383895e3c64496d647c2128d183916e74 + checksum: 10c0/9791cb524438b2a8ba6cb8715788fa1e202fbecd4e76b3ccab0af0819fd69212b40ae30d72ac377012f7149889f7792ed8bf91e97bbe9113ca9641f8ad3bf332 languageName: node linkType: hard @@ -1487,14 +1499,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.25.9" +"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.24.7, @babel/plugin-transform-nullish-coalescing-operator@npm:^7.25.9": + version: 7.29.7 + resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.29.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.25.9" + "@babel/helper-plugin-utils": "npm:^7.29.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/eb623db5be078a1c974afe7c7797b0309ba2ea9e9237c0b6831ade0f56d8248bb4ab3432ab34495ff8c877ec2fe412ff779d1e9b3c2b8139da18e1753d950bc3 + checksum: 10c0/b0c186fe38bc66830e1be76f06fabbae8a655d3896a841ba5ffa12d6c40bb9c8a6ecd38a7e2196034b1d7470653109b1ceac1ef5e46a5fdc9291d14afa56e0d0 languageName: node linkType: hard @@ -1545,15 +1557,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-optional-chaining@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/plugin-transform-optional-chaining@npm:7.25.9" +"@babel/plugin-transform-optional-chaining@npm:^7.24.7, @babel/plugin-transform-optional-chaining@npm:^7.25.9": + version: 7.29.7 + resolution: "@babel/plugin-transform-optional-chaining@npm:7.29.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.25.9" + "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.29.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/041ad2beae5affb8e68a0bcb6882a2dadb758db3c629a0e012f57488ab43a822ac1ea17a29db8ef36560a28262a5dfa4dbbbf06ed6e431db55abe024b7cd3961 + checksum: 10c0/71feacf9a7083030f4c69bf4e91db75f2fceae28e58c58b63db040006d908e15bc1e85a464f24ad659f17702e91a64eabbff9f1dd555ba33d78bb1af8a1d697a languageName: node linkType: hard @@ -1568,15 +1580,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-private-methods@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/plugin-transform-private-methods@npm:7.25.9" +"@babel/plugin-transform-private-methods@npm:^7.24.7, @babel/plugin-transform-private-methods@npm:^7.25.9": + version: 7.29.7 + resolution: "@babel/plugin-transform-private-methods@npm:7.29.7" dependencies: - "@babel/helper-create-class-features-plugin": "npm:^7.25.9" - "@babel/helper-plugin-utils": "npm:^7.25.9" + "@babel/helper-create-class-features-plugin": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.29.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/64bd71de93d39daefa3e6c878d6f2fd238ed7d4ecfb13b0e771ddbbc131487def3ceb405b62b534a5cbb5043046b504e1b189b0a45229cc75af979a9fbcaa7bd + checksum: 10c0/d0dc12fa478d05e346dfb02fad2ed99b308d9a7324bada71530a62dc1ccbf07b4c2581ac677b7196b3994f191ef1922199e2c8f33957b726e2019ce07b4ced0f languageName: node linkType: hard @@ -1934,6 +1946,19 @@ __metadata: languageName: node linkType: hard +"@babel/preset-flow@npm:^7.24.7": + version: 7.29.7 + resolution: "@babel/preset-flow@npm:7.29.7" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-validator-option": "npm:^7.29.7" + "@babel/plugin-transform-flow-strip-types": "npm:^7.29.7" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/17bb0f3c320fadb631ab64951ec0f6e05a62b15418c7864c181645b3205cabd3a8541dd3f497bf06cb1d0e04a3806f6cffee7675c97a87d4aaa04961f334cdcb + languageName: node + linkType: hard + "@babel/preset-modules@npm:0.1.6-no-external-plugins": version: 0.1.6-no-external-plugins resolution: "@babel/preset-modules@npm:0.1.6-no-external-plugins" @@ -1978,6 +2003,21 @@ __metadata: languageName: node linkType: hard +"@babel/register@npm:^7.24.6": + version: 7.29.7 + resolution: "@babel/register@npm:7.29.7" + dependencies: + clone-deep: "npm:^4.0.1" + find-cache-dir: "npm:^2.0.0" + make-dir: "npm:^2.1.0" + pirates: "npm:^4.0.6" + source-map-support: "npm:^0.5.16" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/154dc72cc354a3d2b7b69d10738f02278774bbf53d3b365f7897035c9f26ad6433b24e81ad277c0fbf33139e08230e0cab3913e91d9325308af532da854765f2 + languageName: node + linkType: hard + "@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.22.6, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7": version: 7.28.2 resolution: "@babel/runtime@npm:7.28.2" @@ -8099,6 +8139,18 @@ __metadata: languageName: unknown linkType: soft +"@skillsoft/gamut-codemods@workspace:packages/gamut-codemods": + version: 0.0.0-use.local + resolution: "@skillsoft/gamut-codemods@workspace:packages/gamut-codemods" + dependencies: + "@skillsoft/gamut": "workspace:*" + "@types/jscodeshift": "npm:^17.3.0" + jscodeshift: "npm:^17.3.0" + bin: + gamut-codemods: ./dist/bin.js + languageName: unknown + linkType: soft + "@skillsoft/gamut-docs@workspace:packages/gamut-docs": version: 0.0.0-use.local resolution: "@skillsoft/gamut-docs@workspace:packages/gamut-docs" @@ -9380,6 +9432,16 @@ __metadata: languageName: node linkType: hard +"@types/jscodeshift@npm:^17.3.0": + version: 17.3.0 + resolution: "@types/jscodeshift@npm:17.3.0" + dependencies: + ast-types: "npm:^0.16.1" + recast: "npm:^0.23.11" + checksum: 10c0/56b889b290f12322b43d74c7434b69cef3e1ca8444e37891e08585f716b1c23f44596f650fb92220a8c6e5776d3dbc7d8ece67e950b6f9e733eee8e712128c73 + languageName: node + linkType: hard + "@types/jsdom@npm:^21.1.7": version: 21.1.7 resolution: "@types/jsdom@npm:21.1.7" @@ -11946,6 +12008,17 @@ __metadata: languageName: node linkType: hard +"clone-deep@npm:^4.0.1": + version: 4.0.1 + resolution: "clone-deep@npm:4.0.1" + dependencies: + is-plain-object: "npm:^2.0.4" + kind-of: "npm:^6.0.2" + shallow-clone: "npm:^3.0.0" + checksum: 10c0/637753615aa24adf0f2d505947a1bb75e63964309034a1cf56ba4b1f30af155201edd38d26ffe26911adaae267a3c138b344a4947d39f5fc1b6d6108125aa758 + languageName: node + linkType: hard + "clone@npm:^1.0.2": version: 1.0.4 resolution: "clone@npm:1.0.4" @@ -14503,6 +14576,17 @@ __metadata: languageName: node linkType: hard +"find-cache-dir@npm:^2.0.0": + version: 2.1.0 + resolution: "find-cache-dir@npm:2.1.0" + dependencies: + commondir: "npm:^1.0.1" + make-dir: "npm:^2.0.0" + pkg-dir: "npm:^3.0.0" + checksum: 10c0/556117fd0af14eb88fb69250f4bba9e905e7c355c6136dff0e161b9cbd1f5285f761b778565a278da73a130f42eccc723d7ad4c002ae547ed1d698d39779dabb + languageName: node + linkType: hard + "find-cache-dir@npm:^3.3.1, find-cache-dir@npm:^3.3.2": version: 3.3.2 resolution: "find-cache-dir@npm:3.3.2" @@ -14546,6 +14630,15 @@ __metadata: languageName: node linkType: hard +"find-up@npm:^3.0.0": + version: 3.0.0 + resolution: "find-up@npm:3.0.0" + dependencies: + locate-path: "npm:^3.0.0" + checksum: 10c0/2c2e7d0a26db858e2f624f39038c74739e38306dee42b45f404f770db357947be9d0d587f1cac72d20c114deb38aa57316e879eb0a78b17b46da7dab0a3bd6e3 + languageName: node + linkType: hard + "find-up@npm:^4.0.0, find-up@npm:^4.1.0": version: 4.1.0 resolution: "find-up@npm:4.1.0" @@ -14600,6 +14693,22 @@ __metadata: languageName: node linkType: hard +"flow-estree@npm:0.331.0": + version: 0.331.0 + resolution: "flow-estree@npm:0.331.0" + checksum: 10c0/3e967611d5e4f83a4fde886d90cffe48078702b51258eddcc2f6c2e5d8bca37986df5d890b9f787b0760bb35886bcc3aecd7db6f7db1fff0f9f2ef7b216cd281 + languageName: node + linkType: hard + +"flow-parser@npm:0.*": + version: 0.331.0 + resolution: "flow-parser@npm:0.331.0" + dependencies: + flow-estree: "npm:0.331.0" + checksum: 10c0/bfeb7652a3f82c6689b7290ec2e40973c0a665990a199fd160e16854f6f163449e348c296df218cebe303f5e547665a32131e4598a4eeba821ac72fd415e7134 + languageName: node + linkType: hard + "focus-lock@npm:^1.3.6": version: 1.3.6 resolution: "focus-lock@npm:1.3.6" @@ -16407,6 +16516,15 @@ __metadata: languageName: node linkType: hard +"is-plain-object@npm:^2.0.4": + version: 2.0.4 + resolution: "is-plain-object@npm:2.0.4" + dependencies: + isobject: "npm:^3.0.1" + checksum: 10c0/f050fdd5203d9c81e8c4df1b3ff461c4bc64e8b5ca383bcdde46131361d0a678e80bcf00b5257646f6c636197629644d53bd8e2375aea633de09a82d57e942f4 + languageName: node + linkType: hard + "is-plain-object@npm:^5.0.0": version: 5.0.0 resolution: "is-plain-object@npm:5.0.0" @@ -16574,6 +16692,13 @@ __metadata: languageName: node linkType: hard +"isobject@npm:^3.0.1": + version: 3.0.1 + resolution: "isobject@npm:3.0.1" + checksum: 10c0/03344f5064a82f099a0cd1a8a407f4c0d20b7b8485e8e816c39f249e9416b06c322e8dec5b842b6bb8a06de0af9cb48e7bc1b5352f0fadc2f0abac033db3d4db + languageName: node + linkType: hard + "isomorphic-ws@npm:5.0.0": version: 5.0.0 resolution: "isomorphic-ws@npm:5.0.0" @@ -17224,6 +17349,39 @@ __metadata: languageName: node linkType: hard +"jscodeshift@npm:^17.3.0": + version: 17.4.0 + resolution: "jscodeshift@npm:17.4.0" + dependencies: + "@babel/core": "npm:^7.24.7" + "@babel/parser": "npm:^7.24.7" + "@babel/plugin-transform-class-properties": "npm:^7.24.7" + "@babel/plugin-transform-modules-commonjs": "npm:^7.24.7" + "@babel/plugin-transform-nullish-coalescing-operator": "npm:^7.24.7" + "@babel/plugin-transform-optional-chaining": "npm:^7.24.7" + "@babel/plugin-transform-private-methods": "npm:^7.24.7" + "@babel/preset-flow": "npm:^7.24.7" + "@babel/preset-typescript": "npm:^7.24.7" + "@babel/register": "npm:^7.24.6" + flow-parser: "npm:0.*" + graceful-fs: "npm:^4.2.4" + neo-async: "npm:^2.5.0" + picocolors: "npm:^1.0.1" + picomatch: "npm:^4.0.2" + recast: "npm:^0.23.11" + tmp: "npm:^0.2.3" + write-file-atomic: "npm:^5.0.1" + peerDependencies: + "@babel/preset-env": ^7.1.6 + peerDependenciesMeta: + "@babel/preset-env": + optional: true + bin: + jscodeshift: bin/jscodeshift.js + checksum: 10c0/ef7b71c22f211cbba8ae96ffd2d3e8af28450d8f703d32050ff9f6cb29042bc163ce7d8239798b672b543bb12203adea20fb4d2c0034acc5440d26cb17c7a42f + languageName: node + linkType: hard + "jsdom@npm:^26.1.0": version: 26.1.0 resolution: "jsdom@npm:26.1.0" @@ -17395,7 +17553,7 @@ __metadata: languageName: node linkType: hard -"kind-of@npm:^6.0.3": +"kind-of@npm:^6.0.2, kind-of@npm:^6.0.3": version: 6.0.3 resolution: "kind-of@npm:6.0.3" checksum: 10c0/61cdff9623dabf3568b6445e93e31376bee1cdb93f8ba7033d86022c2a9b1791a1d9510e026e6465ebd701a6dd2f7b0808483ad8838341ac52f003f512e0b4c4 @@ -17670,6 +17828,16 @@ __metadata: languageName: node linkType: hard +"locate-path@npm:^3.0.0": + version: 3.0.0 + resolution: "locate-path@npm:3.0.0" + dependencies: + p-locate: "npm:^3.0.0" + path-exists: "npm:^3.0.0" + checksum: 10c0/3db394b7829a7fe2f4fbdd25d3c4689b85f003c318c5da4052c7e56eed697da8f1bce5294f685c69ff76e32cba7a33629d94396976f6d05fb7f4c755c5e2ae8b + languageName: node + linkType: hard + "locate-path@npm:^5.0.0": version: 5.0.0 resolution: "locate-path@npm:5.0.0" @@ -17907,6 +18075,16 @@ __metadata: languageName: node linkType: hard +"make-dir@npm:^2.0.0, make-dir@npm:^2.1.0": + version: 2.1.0 + resolution: "make-dir@npm:2.1.0" + dependencies: + pify: "npm:^4.0.1" + semver: "npm:^5.6.0" + checksum: 10c0/ada869944d866229819735bee5548944caef560d7a8536ecbc6536edca28c72add47cc4f6fc39c54fb25d06b58da1f8994cf7d9df7dadea047064749efc085d8 + languageName: node + linkType: hard + "make-dir@npm:^3.0.0, make-dir@npm:^3.0.2": version: 3.1.0 resolution: "make-dir@npm:3.1.0" @@ -19223,7 +19401,7 @@ __metadata: languageName: node linkType: hard -"neo-async@npm:^2.6.2": +"neo-async@npm:^2.5.0, neo-async@npm:^2.6.2": version: 2.6.2 resolution: "neo-async@npm:2.6.2" checksum: 10c0/c2f5a604a54a8ec5438a342e1f356dff4bc33ccccdb6dc668d94fe8e5eccfc9d2c2eea6064b0967a767ba63b33763f51ccf2cd2441b461a7322656c1f06b3f5d @@ -19984,7 +20162,7 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:^2.2.0": +"p-limit@npm:^2.0.0, p-limit@npm:^2.2.0": version: 2.3.0 resolution: "p-limit@npm:2.3.0" dependencies: @@ -20011,6 +20189,15 @@ __metadata: languageName: node linkType: hard +"p-locate@npm:^3.0.0": + version: 3.0.0 + resolution: "p-locate@npm:3.0.0" + dependencies: + p-limit: "npm:^2.0.0" + checksum: 10c0/7b7f06f718f19e989ce6280ed4396fb3c34dabdee0df948376483032f9d5ec22fdf7077ec942143a75827bb85b11da72016497fc10dac1106c837ed593969ee8 + languageName: node + linkType: hard + "p-locate@npm:^4.1.0": version: 4.1.0 resolution: "p-locate@npm:4.1.0" @@ -20233,6 +20420,13 @@ __metadata: languageName: node linkType: hard +"path-exists@npm:^3.0.0": + version: 3.0.0 + resolution: "path-exists@npm:3.0.0" + checksum: 10c0/17d6a5664bc0a11d48e2b2127d28a0e58822c6740bde30403f08013da599182289c56518bec89407e3f31d3c2b6b296a4220bc3f867f0911fee6952208b04167 + languageName: node + linkType: hard + "path-exists@npm:^4.0.0": version: 4.0.0 resolution: "path-exists@npm:4.0.0" @@ -20368,6 +20562,13 @@ __metadata: languageName: node linkType: hard +"pify@npm:^4.0.1": + version: 4.0.1 + resolution: "pify@npm:4.0.1" + checksum: 10c0/6f9d404b0d47a965437403c9b90eca8bb2536407f03de165940e62e72c8c8b75adda5516c6b9b23675a5877cc0bcac6bdfb0ef0e39414cd2476d5495da40e7cf + languageName: node + linkType: hard + "pinkie-promise@npm:^2.0.0": version: 2.0.1 resolution: "pinkie-promise@npm:2.0.1" @@ -20384,13 +20585,22 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.7": +"pirates@npm:^4.0.6, pirates@npm:^4.0.7": version: 4.0.7 resolution: "pirates@npm:4.0.7" checksum: 10c0/a51f108dd811beb779d58a76864bbd49e239fa40c7984cd11596c75a121a8cc789f1c8971d8bb15f0dbf9d48b76c05bb62fcbce840f89b688c0fa64b37e8478a languageName: node linkType: hard +"pkg-dir@npm:^3.0.0": + version: 3.0.0 + resolution: "pkg-dir@npm:3.0.0" + dependencies: + find-up: "npm:^3.0.0" + checksum: 10c0/902a3d0c1f8ac43b1795fa1ba6ffeb37dfd53c91469e969790f6ed5e29ff2bdc50b63ba6115dc056d2efb4a040aa2446d512b3804bdafdf302f734fb3ec21847 + languageName: node + linkType: hard + "pkg-dir@npm:^4.1.0, pkg-dir@npm:^4.2.0": version: 4.2.0 resolution: "pkg-dir@npm:4.2.0" @@ -21359,16 +21569,16 @@ __metadata: languageName: node linkType: hard -"recast@npm:^0.23.5": - version: 0.23.9 - resolution: "recast@npm:0.23.9" +"recast@npm:^0.23.11, recast@npm:^0.23.5": + version: 0.23.21 + resolution: "recast@npm:0.23.21" dependencies: ast-types: "npm:^0.16.1" esprima: "npm:~4.0.0" source-map: "npm:~0.6.1" tiny-invariant: "npm:^1.3.3" tslib: "npm:^2.0.1" - checksum: 10c0/65d6e780351f0180ea4fe5c9593ac18805bf2b79977f5bedbbbf26f6d9b619ed0f6992c1bf9e06dd40fca1aea727ad6d62463cfb5d3a33342ee5a6e486305fe5 + checksum: 10c0/afee4673fda5a95b0db8199a3f75c6f675269f00328a3673f241a6088c99b5a58f7082b6cff683456a182e3302bfb57313ebb1c2073228b260724b0993ff1f9a languageName: node linkType: hard @@ -22553,6 +22763,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^5.6.0": + version: 5.7.2 + resolution: "semver@npm:5.7.2" + bin: + semver: bin/semver + checksum: 10c0/e4cf10f86f168db772ae95d86ba65b3fd6c5967c94d97c708ccb463b778c2ee53b914cd7167620950fc07faf5a564e6efe903836639e512a1aa15fbc9667fa25 + languageName: node + linkType: hard + "semver@npm:^6.0.0, semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" @@ -22655,6 +22874,15 @@ __metadata: languageName: node linkType: hard +"shallow-clone@npm:^3.0.0": + version: 3.0.1 + resolution: "shallow-clone@npm:3.0.1" + dependencies: + kind-of: "npm:^6.0.2" + checksum: 10c0/7bab09613a1b9f480c85a9823aebec533015579fa055ba6634aa56ba1f984380670eaf33b8217502931872aa1401c9fcadaa15f9f604d631536df475b05bcf1e + languageName: node + linkType: hard + "shallowequal@npm:^1.1.0": version: 1.1.0 resolution: "shallowequal@npm:1.1.0" @@ -23113,7 +23341,7 @@ __metadata: languageName: node linkType: hard -"source-map-support@npm:^0.5.21, source-map-support@npm:~0.5.20": +"source-map-support@npm:^0.5.16, source-map-support@npm:^0.5.21, source-map-support@npm:~0.5.20": version: 0.5.21 resolution: "source-map-support@npm:0.5.21" dependencies: @@ -24058,10 +24286,10 @@ __metadata: languageName: node linkType: hard -"tmp@npm:~0.2.1": - version: 0.2.3 - resolution: "tmp@npm:0.2.3" - checksum: 10c0/3e809d9c2f46817475b452725c2aaa5d11985cf18d32a7a970ff25b568438e2c076c2e8609224feef3b7923fa9749b74428e3e634f6b8e520c534eef2fd24125 +"tmp@npm:^0.2.3, tmp@npm:~0.2.1": + version: 0.2.7 + resolution: "tmp@npm:0.2.7" + checksum: 10c0/59eb55584f2f07210d3231b6a1f6b5c2b9794d8a7b509c8ee867ed2acad6d2245ee2448b7937b676ffbff3155a70077edde8a69f9d7cf0f90c86a62e8910c357 languageName: node linkType: hard From b1b91a74f2465f1a979b9dd3cc0fe1c1d2738e45 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 24 Sep 2026 14:29:31 -0400 Subject: [PATCH 22/47] ci(preview): TEMPORARY publish previews for PRs stacked on cass-gmt-1795 Lets the @skillsoft/gamut-codemods PR, which targets cass-gmt-1795, publish installable pkg.pr.new previews. Revert this commit before either branch ships to main. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/preview.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 441f68ea96..d1caef6201 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -16,7 +16,10 @@ name: Preview on: pull_request: - branches: [main] + # TEMPORARY: cass-gmt-1795 is here so PRs stacked on it (the + # @skillsoft/gamut-codemods PR) publish previews. Revert this before + # either branch ships to main. + branches: [main, cass-gmt-1795] env: NODE_OPTIONS: '--max_old_space_size=8196' From d0693b15eee3599cfa7673262b662c8eb19b6818 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 24 Sep 2026 14:42:38 -0400 Subject: [PATCH 23/47] feat(gamut)!: export Menu list elements and IconOptionComponent from the root Ships the rename upstream GMT-1740 held back (Codecademy/gamut 009aa43f6, "move Menu/elements and IconOptionComponent renames to a separate PR"): - Menu/elements: List* -> MenuList* (List, ListProps, ListItem, ListItemProps, ListLink, ListLinkProps, ListButton), and Menu/index now re-exports './elements'. MenuToolTipWrapper becomes public too. - Form/SelectDropdown: the IconOption component -> IconOptionComponent, exported from the barrel. The IconOption type is unchanged. The names changed because List and IconOption collide with the public List component and IconOption type once they're on the root. The scope-swap codemod maps both deep imports to the root with the new names, keeping local bindings (`import { MenuList as List }`), and its manifest test now type-checks those names against the built package. Co-Authored-By: Claude Opus 5.5 --- .../gamut-menu-selectdropdown-renames.md | 15 +++++++ packages/gamut-codemods/README.md | 18 ++++----- .../gamut-codemods/src/__tests__/lib.test.ts | 35 ----------------- .../__testfixtures__/renames.input.tsx | 6 +++ .../__testfixtures__/renames.output.tsx | 6 +++ .../__testfixtures__/renames.warnings.json | 1 + .../__testfixtures__/rewrites.input.tsx | 2 +- .../__testfixtures__/rewrites.output.tsx | 2 +- .../__testfixtures__/rewrites.warnings.json | 2 +- .../src/presets/scope-swap/manifest.ts | 32 +++++++++------ .../__snapshots__/gamut.test.ts.snap | 6 +++ .../src/Form/SelectDropdown/core/constants.ts | 4 +- .../src/Form/SelectDropdown/elements/index.ts | 2 +- .../Form/SelectDropdown/elements/options.tsx | 2 +- .../gamut/src/Form/SelectDropdown/index.tsx | 1 + packages/gamut/src/Menu/Menu.tsx | 8 ++-- packages/gamut/src/Menu/MenuItem.tsx | 39 +++++++++++-------- packages/gamut/src/Menu/elements.tsx | 23 ++++++----- packages/gamut/src/Menu/index.tsx | 1 + 19 files changed, 111 insertions(+), 94 deletions(-) create mode 100644 .changeset/gamut-menu-selectdropdown-renames.md create mode 100644 packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.input.tsx create mode 100644 packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.output.tsx create mode 100644 packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.warnings.json diff --git a/.changeset/gamut-menu-selectdropdown-renames.md b/.changeset/gamut-menu-selectdropdown-renames.md new file mode 100644 index 0000000000..84bcef371e --- /dev/null +++ b/.changeset/gamut-menu-selectdropdown-renames.md @@ -0,0 +1,15 @@ +--- +'@skillsoft/gamut': minor +--- + +**Breaking:** export Menu's list elements and SelectDropdown's option component from the package root, under new names that don't collide with the public `List` component and `IconOption` type. + +| Old (`dist/Menu/elements`, `dist/Form/SelectDropdown/elements`) | New (`@skillsoft/gamut`) | +| --------------------------------------------------------------- | ----------------------------------- | +| `List`, `ListProps` | `MenuList`, `MenuListProps` | +| `ListItem`, `ListItemProps` | `MenuListItem`, `MenuListItemProps` | +| `ListLink`, `ListLinkProps` | `MenuListLink`, `MenuListLinkProps` | +| `ListButton` | `MenuListButton` | +| `IconOption` (the component) | `IconOptionComponent` | + +`MenuToolTipWrapper` is now exported from the root too. The `IconOption` type is unchanged. Coming from `@codecademy/gamut`, `npx @skillsoft/gamut-codemods scope-swap .` rewrites these imports for you. diff --git a/packages/gamut-codemods/README.md b/packages/gamut-codemods/README.md index c5511ea61e..d4dce90918 100644 --- a/packages/gamut-codemods/README.md +++ b/packages/gamut-codemods/README.md @@ -35,15 +35,15 @@ A run ends with three things: ### What scope-swap changes -| Migration | What it does | -| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `deep-imports` | `@codecademy/gamut/dist/PopoverContainer/types` → `@codecademy/gamut`, and the rest of the promoted deep imports. Warns on deep imports with no public replacement (`Menu/elements`, `Form/SelectDropdown/elements`, `ButtonBase/ButtonBase`, `Form/styles`) and on ones it doesn't know. | -| `moved-exports` | Moves `Video` and `VideoProps` off the root import onto `/Video`. Warns on namespace imports, `export *`, and mocks that stub `Video`. | -| `mf-shared` | Replaces `@codecademy/gamut-kit` in Module Federation `shared` config with the packages it bundled. Gamut becomes a real singleton, so test the host and remotes together. | -| `eslint-comments` | `// eslint-disable-next-line gamut/x` → `@skillsoft/gamut/x`. | -| `scope-rename` | Every `@codecademy/gamut*` module string becomes `@skillsoft/gamut*`: imports, exports, `require`, `import()`, `jest.mock`/`vi.mock`, `declare module`, and `import('x').T`. Also exact package-name strings elsewhere, like `transpilePackages`, with one warning per file. | -| `package-json` | Renames dependencies and sets their versions. Replaces `@codecademy/gamut-kit` with the individual packages. | -| `eslint-config` | `.eslintrc` / `.eslintrc.json`: plugin name, `plugin:` extends, and rule keys. | +| Migration | What it does | +| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `deep-imports` | `@codecademy/gamut/dist/PopoverContainer/types` → `@codecademy/gamut`, and the rest of the promoted deep imports. Menu's `List*` and SelectDropdown's `IconOption` component were renamed on the way to the root (`MenuList*`, `IconOptionComponent`); local names are kept, so `import { List }` becomes `import { MenuList as List }`. Warns on deep imports with no public replacement (`ButtonBase/ButtonBase`, `Form/styles`) and on ones it doesn't know. | +| `moved-exports` | Moves `Video` and `VideoProps` off the root import onto `/Video`. Warns on namespace imports, `export *`, and mocks that stub `Video`. | +| `mf-shared` | Replaces `@codecademy/gamut-kit` in Module Federation `shared` config with the packages it bundled. Gamut becomes a real singleton, so test the host and remotes together. | +| `eslint-comments` | `// eslint-disable-next-line gamut/x` → `@skillsoft/gamut/x`. | +| `scope-rename` | Every `@codecademy/gamut*` module string becomes `@skillsoft/gamut*`: imports, exports, `require`, `import()`, `jest.mock`/`vi.mock`, `declare module`, and `import('x').T`. Also exact package-name strings elsewhere, like `transpilePackages`, with one warning per file. | +| `package-json` | Renames dependencies and sets their versions. Replaces `@codecademy/gamut-kit` with the individual packages. | +| `eslint-config` | `.eslintrc` / `.eslintrc.json`: plugin name, `plugin:` extends, and rule keys. | ### Known limits diff --git a/packages/gamut-codemods/src/__tests__/lib.test.ts b/packages/gamut-codemods/src/__tests__/lib.test.ts index fa5953e11a..81de758d10 100644 --- a/packages/gamut-codemods/src/__tests__/lib.test.ts +++ b/packages/gamut-codemods/src/__tests__/lib.test.ts @@ -3,13 +3,9 @@ import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; -import jscodeshift from 'jscodeshift'; - import { parseArgs } from '../cli'; import { dirtyTreeReason } from '../lib/git'; import { findLeftovers } from '../lib/leftovers'; -import type { Manifest } from '../lib/manifest'; -import { deepImports } from '../migrations/deep-imports'; import { validatePreset } from '../presets'; import { scopeSwap } from '../presets/scope-swap'; import { manifest } from '../presets/scope-swap/manifest'; @@ -17,37 +13,6 @@ import { manifest } from '../presets/scope-swap/manifest'; const tmp = () => fs.mkdtempSync(path.join(os.tmpdir(), 'gamut-codemods-test-')); -describe('deep-imports renames', () => { - /* scope-swap has no rename rows today, so this uses its own manifest. */ - it('renames the export and keeps the local binding', () => { - const j = jscodeshift.withParser('tsx'); - const root = j( - "import { List, ListItem as Item } from '@codecademy/gamut/dist/Menu/elements';" - ); - const withRenames: Manifest = { - ...manifest, - deepImports: [ - { - from: '@codecademy/gamut/dist/Menu/elements', - to: '@codecademy/gamut', - renames: { List: 'MenuList', ListItem: 'MenuListItem' }, - }, - ], - }; - deepImports.run({ - j, - root, - source: '', - manifest: withRenames, - warn: () => {}, - note: () => {}, - }); - expect(root.toSource({ quote: 'single' })).toBe( - "import { MenuList as List, MenuListItem as Item } from '@codecademy/gamut';" - ); - }); -}); - describe('validatePreset', () => { it('accepts scope-swap', () => { expect(() => validatePreset(scopeSwap)).not.toThrow(); diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.input.tsx b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.input.tsx new file mode 100644 index 0000000000..32ee05b6fa --- /dev/null +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.input.tsx @@ -0,0 +1,6 @@ +import { List, ListItem as Item, type ListProps } from '@codecademy/gamut/dist/Menu/elements'; +import { IconOption } from '@codecademy/gamut/dist/Form/SelectDropdown/elements'; + +export { ListButton } from '@codecademy/gamut/dist/Menu/elements'; + +jest.mock('@codecademy/gamut/dist/Menu/elements', () => ({ List: () => null })); diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.output.tsx b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.output.tsx new file mode 100644 index 0000000000..e05682435d --- /dev/null +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.output.tsx @@ -0,0 +1,6 @@ +import { MenuList as List, MenuListItem as Item, type MenuListProps as ListProps } from '@codecademy/gamut'; +import { IconOptionComponent as IconOption } from '@codecademy/gamut'; + +export { MenuListButton as ListButton } from '@codecademy/gamut'; + +jest.mock('@codecademy/gamut', () => ({ List: () => null })); diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.warnings.json b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.warnings.json new file mode 100644 index 0000000000..5d13e00b9c --- /dev/null +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.warnings.json @@ -0,0 +1 @@ +["'@codecademy/gamut/dist/Menu/elements' has renamed exports. Check the mock factory by hand."] diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.input.tsx b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.input.tsx index d45be932f1..3fad9f3b4b 100644 --- a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.input.tsx +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.input.tsx @@ -1,7 +1,7 @@ import { PopoverContainerProps } from '@codecademy/gamut/dist/PopoverContainer/types'; import type { Prop } from '@codecademy/variance/dist/types/config'; import { formStyles } from '@codecademy/gamut/dist/Form/styles'; -import { List } from '@codecademy/gamut/dist/Menu/elements'; +import { ButtonBase } from '@codecademy/gamut/dist/ButtonBase/ButtonBase'; import { Mystery } from '@codecademy/gamut/dist/Nope'; jest.mock('@codecademy/gamut/dist/Box/props'); diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.output.tsx b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.output.tsx index 0c0e468b23..d882b3d9f0 100644 --- a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.output.tsx +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.output.tsx @@ -1,7 +1,7 @@ import { PopoverContainerProps } from '@codecademy/gamut'; import type { Prop } from '@codecademy/variance'; import { formStyles } from '@codecademy/gamut/dist/Form/styles'; -import { List } from '@codecademy/gamut/dist/Menu/elements'; +import { ButtonBase } from '@codecademy/gamut/dist/ButtonBase/ButtonBase'; import { Mystery } from '@codecademy/gamut/dist/Nope'; jest.mock('@codecademy/gamut'); diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json index 1e95c663a1..eeb8344b5b 100644 --- a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json @@ -1 +1 @@ -["'@codecademy/gamut/dist/Form/styles' has no public replacement", "'@codecademy/gamut/dist/Menu/elements' has no public replacement", "unmapped deep import '@codecademy/gamut/dist/Nope'"] +["'@codecademy/gamut/dist/Form/styles' has no public replacement", "'@codecademy/gamut/dist/ButtonBase/ButtonBase' has no public replacement", "unmapped deep import '@codecademy/gamut/dist/Nope'"] diff --git a/packages/gamut-codemods/src/presets/scope-swap/manifest.ts b/packages/gamut-codemods/src/presets/scope-swap/manifest.ts index dc45537356..3c3b002e1e 100644 --- a/packages/gamut-codemods/src/presets/scope-swap/manifest.ts +++ b/packages/gamut-codemods/src/presets/scope-swap/manifest.ts @@ -107,25 +107,33 @@ export const manifest: Manifest = { to: '@codecademy/gamut', }, /* - No public replacement for the next three. Upstream GMT-1740 renamed - them (List -> MenuList, IconOption -> IconOptionComponent) and promoted - ButtonBase, then reverted all three before merging (upstream 009aa43f6) - as breaking changes for a separate PR. skillsoft-gamut matches that. + Renamed on the way to the root: `List` and `IconOption` collided with + the public List component and IconOption type. This is the rename + upstream GMT-1740 held back (upstream 009aa43f6); skillsoft-gamut + ships it. */ - { - from: '@codecademy/gamut/dist/ButtonBase/ButtonBase', - to: null, - note: 'ButtonBase is deliberately not public. Use FillButton, StrokeButton, TextButton, IconButton, or CTAButton.', - }, { from: '@codecademy/gamut/dist/Menu/elements', - to: null, - note: 'Menu list elements are not public (a MenuList* rename was held back upstream). Compose Menu/MenuItem, or copy the element.', + to: '@codecademy/gamut', + renames: { + List: 'MenuList', + ListProps: 'MenuListProps', + ListItem: 'MenuListItem', + ListItemProps: 'MenuListItemProps', + ListLink: 'MenuListLink', + ListLinkProps: 'MenuListLinkProps', + ListButton: 'MenuListButton', + }, }, { from: '@codecademy/gamut/dist/Form/SelectDropdown/elements', + to: '@codecademy/gamut', + renames: { IconOption: 'IconOptionComponent' }, + }, + { + from: '@codecademy/gamut/dist/ButtonBase/ButtonBase', to: null, - note: 'The IconOption component is not public. Copy it into your app if you need it.', + note: 'ButtonBase is deliberately not public. Use FillButton, StrokeButton, TextButton, IconButton, or CTAButton.', }, { from: '@codecademy/gamut/dist/Form/styles', diff --git a/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap b/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap index 30593dae53..6e3bc667ee 100644 --- a/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap +++ b/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap @@ -65,6 +65,7 @@ exports[`Gamut Exported Keys 1`] = ` "GridForm", "GridFormContent", "IconButton", + "IconOptionComponent", "iFrameWrapper", "InfoTip", "Input", @@ -78,7 +79,12 @@ exports[`Gamut Exported Keys 1`] = ` "matchDisabledDates", "Menu", "MenuItem", + "MenuList", + "MenuListButton", + "MenuListItem", + "MenuListLink", "MenuSeparator", + "MenuToolTipWrapper", "Modal", "omitProps", "Overlay", diff --git a/packages/gamut/src/Form/SelectDropdown/core/constants.ts b/packages/gamut/src/Form/SelectDropdown/core/constants.ts index a5629613a2..50c1009384 100644 --- a/packages/gamut/src/Form/SelectDropdown/core/constants.ts +++ b/packages/gamut/src/Form/SelectDropdown/core/constants.ts @@ -6,7 +6,7 @@ import { CustomInput, CustomValueContainer, DropdownButton, - IconOption, + IconOptionComponent, MultiValueRemoveButton, MultiValueWithColorMode, RemoveAllButton, @@ -20,7 +20,7 @@ const baseDefaultComponents = { ValueContainer: CustomValueContainer, MultiValue: MultiValueWithColorMode, MultiValueRemove: MultiValueRemoveButton, - Option: IconOption, + Option: IconOptionComponent, SingleValue: AbbreviatedSingleValue, Input: CustomInput, }; diff --git a/packages/gamut/src/Form/SelectDropdown/elements/index.ts b/packages/gamut/src/Form/SelectDropdown/elements/index.ts index 5a67d3619b..9ab1c6655e 100644 --- a/packages/gamut/src/Form/SelectDropdown/elements/index.ts +++ b/packages/gamut/src/Form/SelectDropdown/elements/index.ts @@ -18,7 +18,7 @@ export { } from './containers'; export { - IconOption, + IconOptionComponent, AbbreviatedSingleValue, formatOptionLabel, formatGroupLabel, diff --git a/packages/gamut/src/Form/SelectDropdown/elements/options.tsx b/packages/gamut/src/Form/SelectDropdown/elements/options.tsx index e91b25178a..17b011b7d4 100644 --- a/packages/gamut/src/Form/SelectDropdown/elements/options.tsx +++ b/packages/gamut/src/Form/SelectDropdown/elements/options.tsx @@ -46,7 +46,7 @@ const IconOptionLabel: React.FC< * Also manages ARIA attributes for accessibility. * Skips the check icon for react-select/creatable's "Add" row (__isNew__). */ -export const IconOption = ({ +export const IconOptionComponent = ({ children, ...rest }: CustomSelectComponentProps) => { diff --git a/packages/gamut/src/Form/SelectDropdown/index.tsx b/packages/gamut/src/Form/SelectDropdown/index.tsx index fd0cb718f8..f6d233827e 100644 --- a/packages/gamut/src/Form/SelectDropdown/index.tsx +++ b/packages/gamut/src/Form/SelectDropdown/index.tsx @@ -1,3 +1,4 @@ export type { SelectDropdownTranslations } from './core/translations'; export * from './types'; +export { IconOptionComponent } from './elements'; export * from './SelectDropdown'; diff --git a/packages/gamut/src/Menu/Menu.tsx b/packages/gamut/src/Menu/Menu.tsx index 83b6bd328d..10d647f08e 100644 --- a/packages/gamut/src/Menu/Menu.tsx +++ b/packages/gamut/src/Menu/Menu.tsx @@ -1,12 +1,12 @@ import type { ComponentProps } from 'react'; import { forwardRef } from 'react'; -import { List } from './elements'; +import { MenuList } from './elements'; import { MenuProvider, useMenu } from './MenuContext'; export const Menu = forwardRef< HTMLUListElement | HTMLOListElement, - Omit, 'root'> + Omit, 'root'> >( ( { children, variant = 'popover', spacing = 'normal', role, ...rest }, @@ -15,9 +15,9 @@ export const Menu = forwardRef< const currentContext = useMenu({ variant, role, spacing }); return ( - + {children} - + ); } ); diff --git a/packages/gamut/src/Menu/MenuItem.tsx b/packages/gamut/src/Menu/MenuItem.tsx index 04ca7efb7c..3288ab987a 100644 --- a/packages/gamut/src/Menu/MenuItem.tsx +++ b/packages/gamut/src/Menu/MenuItem.tsx @@ -6,8 +6,13 @@ import { forwardRef, useId } from 'react'; import { FlexBox } from '../Box'; import type { ToolTipProps } from '../Tip/ToolTip'; import { Text } from '../Typography'; -import type { ListItemProps, ListLinkProps } from './elements'; -import { ListButton, ListItem, ListLink, MenuToolTipWrapper } from './elements'; +import type { MenuListItemProps, MenuListLinkProps } from './elements'; +import { + MenuListButton, + MenuListItem, + MenuListLink, + MenuToolTipWrapper, +} from './elements'; import { useMenuContext } from './MenuContext'; const getListItemType = (href: boolean, onClick: boolean) => @@ -26,7 +31,7 @@ const currentItemText = { type HTMLProps = Partial>; type ForwardListItemProps = Omit< - ComponentProps, + ComponentProps, 'variant' | 'selected' | 'active-navlink' | 'children' >; @@ -97,7 +102,7 @@ export const MenuItem = forwardRef< role: listItemRole, height, width, - } as ListItemProps; + } as MenuListItemProps; const ariaLabel = label ? typeof label === 'string' @@ -139,18 +144,18 @@ export const MenuItem = forwardRef< if (listItemType === 'link' && !disabled) { return ( - + - (ref)} target={target} > {content} - + - + ); } @@ -160,32 +165,32 @@ export const MenuItem = forwardRef< : (props.onClick as any as MouseEventHandler); return ( - + - (ref)} onClick={handleClick} > {content} - + - + ); } return ( // These are non-interactive and will never have tooltips (nor should they). - (ref)} > {content} - + ); } ); diff --git a/packages/gamut/src/Menu/elements.tsx b/packages/gamut/src/Menu/elements.tsx index d0f63d75cc..6ce6501958 100644 --- a/packages/gamut/src/Menu/elements.tsx +++ b/packages/gamut/src/Menu/elements.tsx @@ -34,7 +34,7 @@ const listProps = variance.compose( system.color ); -export interface ListProps extends ListStyleProps, StyleStateProps { +export interface MenuListProps extends ListStyleProps, StyleStateProps { /** How offset spacing should be */ spacing?: 'normal' | 'condensed'; /** Menu variants for specific use cases and styles */ @@ -46,7 +46,7 @@ export interface ListProps extends ListStyleProps, StyleStateProps { showBorder?: boolean; } -const StyledList = styled('ul', styledOptions<'ul'>())( +const StyledList = styled('ul', styledOptions<'ul'>())( system.css({ listStyle: 'none', width: 1, @@ -70,7 +70,7 @@ const StyledList = styled('ul', styledOptions<'ul'>())( listProps ); -export const List = forwardRef< +export const MenuList = forwardRef< HTMLUListElement, ComponentProps >(({ context = true, m = 0, root = true, variant, ...rest }, ref) => ( @@ -195,14 +195,17 @@ const sizeVariants = system.variant({ }, }); -export interface ListItemProps +export interface MenuListItemProps extends ListStyleProps, StyleStateProps, StyleProps, StyleProps, StyleProps {} -export const ListItem = styled('li', styledOptions<'li'>())( +export const MenuListItem = styled( + 'li', + styledOptions<'li'>() +)( interactiveVariants, activeStates, sizeVariants, @@ -210,12 +213,12 @@ export const ListItem = styled('li', styledOptions<'li'>())( listProps ); -export interface ListLinkProps extends ListItemProps { +export interface MenuListLinkProps extends MenuListItemProps { active?: boolean; navlink?: boolean; } -const StyledListLink = styled('a', styledOptions<'a'>())( +const StyledListLink = styled('a', styledOptions<'a'>())( resetStyles, interactiveVariants, activeStates, @@ -224,17 +227,17 @@ const StyledListLink = styled('a', styledOptions<'a'>())( listProps ); -export const ListLink = forwardRef< +export const MenuListLink = forwardRef< HTMLAnchorElement, ComponentProps >(({ zIndex = 1, ...rest }, ref) => ( )); -export const ListButton = styled( +export const MenuListButton = styled( 'button', styledOptions<'button'>() -)( +)( resetStyles, interactiveVariants, activeStates, diff --git a/packages/gamut/src/Menu/index.tsx b/packages/gamut/src/Menu/index.tsx index 65077f603d..54f17e7928 100644 --- a/packages/gamut/src/Menu/index.tsx +++ b/packages/gamut/src/Menu/index.tsx @@ -1,3 +1,4 @@ +export * from './elements'; export * from './Menu'; export * from './MenuItem'; export * from './MenuSeparator'; From 8f6f3ee5cb191f89e60e45801ae0673dc5b47cbb Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 24 Sep 2026 15:17:49 -0400 Subject: [PATCH 24/47] fix(gamut-codemods): keep existing @skillsoft versions; handle .mdx and .yarnrc.yml From a scope-swap run against mono: - package-json no longer overwrites a new package that's already listed. Expanding gamut-kit re-added @codecademy/* names and the rename step then replaced hand-added @skillsoft/* preview URLs with ^0.0.1, which isn't published for most packages, so yarn install 404'd. Expansion now checks for the new name too, and existing entries win. - A `*` peer range stays `*` instead of narrowing to the target version. - New mdx-imports migration: runs the source migrations over ESM import/export statements in .mdx files, skipping fenced code. Stories get the scope rename, Video split, and deep-import rewrites. - New yarnrc migration: renames old names in .yarnrc.yml list items, or drops them when a scope glob like '@skillsoft/*' covers the new name. Quotes the result, since a YAML plain scalar can't start with `@`. The source-migration runner moves to lib/run-source.ts so file migrations can reuse it through a `transformSource` helper. Co-Authored-By: Claude Opus 5.5 --- packages/gamut-codemods/README.md | 4 +- .../src/__tests__/fixtures.test.ts | 1 + packages/gamut-codemods/src/cli.ts | 23 ++++ packages/gamut-codemods/src/lib/run-source.ts | 108 ++++++++++++++++++ packages/gamut-codemods/src/lib/types.ts | 7 +- .../__testfixtures__/story.input.mdx | 18 +++ .../__testfixtures__/story.output.mdx | 19 +++ .../src/migrations/mdx-imports/index.ts | 63 ++++++++++ .../already-renamed.input.json | 9 ++ .../already-renamed.output.json | 12 ++ .../__testfixtures__/peers.input.json | 7 ++ .../__testfixtures__/peers.output.json | 7 ++ .../src/migrations/package-json/index.ts | 16 ++- .../yarnrc/__testfixtures__/no-glob.input.yml | 2 + .../__testfixtures__/no-glob.output.yml | 2 + .../__testfixtures__/preapproved.input.yml | 10 ++ .../__testfixtures__/preapproved.output.yml | 9 ++ .../src/migrations/yarnrc/index.ts | 45 ++++++++ .../src/presets/scope-swap/index.ts | 4 + packages/gamut-codemods/src/transform.ts | 96 +++------------- 20 files changed, 381 insertions(+), 81 deletions(-) create mode 100644 packages/gamut-codemods/src/lib/run-source.ts create mode 100644 packages/gamut-codemods/src/migrations/mdx-imports/__testfixtures__/story.input.mdx create mode 100644 packages/gamut-codemods/src/migrations/mdx-imports/__testfixtures__/story.output.mdx create mode 100644 packages/gamut-codemods/src/migrations/mdx-imports/index.ts create mode 100644 packages/gamut-codemods/src/migrations/package-json/__testfixtures__/already-renamed.input.json create mode 100644 packages/gamut-codemods/src/migrations/package-json/__testfixtures__/already-renamed.output.json create mode 100644 packages/gamut-codemods/src/migrations/package-json/__testfixtures__/peers.input.json create mode 100644 packages/gamut-codemods/src/migrations/package-json/__testfixtures__/peers.output.json create mode 100644 packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/no-glob.input.yml create mode 100644 packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/no-glob.output.yml create mode 100644 packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/preapproved.input.yml create mode 100644 packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/preapproved.output.yml create mode 100644 packages/gamut-codemods/src/migrations/yarnrc/index.ts diff --git a/packages/gamut-codemods/README.md b/packages/gamut-codemods/README.md index d4dce90918..27e8c02367 100644 --- a/packages/gamut-codemods/README.md +++ b/packages/gamut-codemods/README.md @@ -42,8 +42,10 @@ A run ends with three things: | `mf-shared` | Replaces `@codecademy/gamut-kit` in Module Federation `shared` config with the packages it bundled. Gamut becomes a real singleton, so test the host and remotes together. | | `eslint-comments` | `// eslint-disable-next-line gamut/x` → `@skillsoft/gamut/x`. | | `scope-rename` | Every `@codecademy/gamut*` module string becomes `@skillsoft/gamut*`: imports, exports, `require`, `import()`, `jest.mock`/`vi.mock`, `declare module`, and `import('x').T`. Also exact package-name strings elsewhere, like `transpilePackages`, with one warning per file. | -| `package-json` | Renames dependencies and sets their versions. Replaces `@codecademy/gamut-kit` with the individual packages. | +| `package-json` | Renames dependencies and sets their versions. A new package that's already listed keeps its value (a preview URL, say), and a `*` peer range stays `*`. Replaces `@codecademy/gamut-kit` with the individual packages. | | `eslint-config` | `.eslintrc` / `.eslintrc.json`: plugin name, `plugin:` extends, and rule keys. | +| `mdx-imports` | Runs the migrations above over `import`/`export` statements in `.mdx` files. Fenced code blocks are left alone. | +| `yarnrc` | `.yarnrc.yml` list items, like `npmPreapprovedPackages`: renames old package names, or drops them if a glob like `'@skillsoft/*'` already covers the new one. | ### Known limits diff --git a/packages/gamut-codemods/src/__tests__/fixtures.test.ts b/packages/gamut-codemods/src/__tests__/fixtures.test.ts index 5a001f24c9..cc5f0f2d48 100644 --- a/packages/gamut-codemods/src/__tests__/fixtures.test.ts +++ b/packages/gamut-codemods/src/__tests__/fixtures.test.ts @@ -81,6 +81,7 @@ describe.each(Object.values(presets))('preset $name', (preset) => { manifest: preset.manifest, warn: (w) => warnings.push(w), note: () => {}, + transformSource: (code) => runSource(preset.name, code).out, }); expect((out ?? c.input).trim()).toBe(c.output.trim()); expectWarnings(warnings, c.warnings); diff --git a/packages/gamut-codemods/src/cli.ts b/packages/gamut-codemods/src/cli.ts index 911960efdc..ed8dff62c6 100644 --- a/packages/gamut-codemods/src/cli.ts +++ b/packages/gamut-codemods/src/cli.ts @@ -3,8 +3,15 @@ import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; +import jscodeshift from 'jscodeshift'; + import { dirtyTreeReason } from './lib/git'; import { findLeftovers, walk } from './lib/leftovers'; +import { + activeSourceMigrations, + mentionsOldNames, + runSourceMigrations, +} from './lib/run-source'; import type { FileMigration, Preset } from './lib/types'; import { getPreset, presets } from './presets'; @@ -80,11 +87,27 @@ const runFileMigrations = ( const source = fs.readFileSync(file, 'utf8'); const warn = (msg: string) => console.log(`[${migration.name}] ${file} ${msg}`); + const transformSource = (code: string) => + mentionsOldNames(preset.manifest, code) + ? runSourceMigrations({ + j: jscodeshift.withParser('tsx'), + source: code, + migrations: activeSourceMigrations( + preset.migrations, + opts.only + ), + manifest: preset.manifest, + warnFor: (name) => (_node, message) => + console.log(`[${name}] ${file} ${message}`), + note, + }) + : code; const next = migration.run({ source, manifest: preset.manifest, warn, note, + transformSource, }); if (next === null) continue; changed += 1; diff --git a/packages/gamut-codemods/src/lib/run-source.ts b/packages/gamut-codemods/src/lib/run-source.ts new file mode 100644 index 0000000000..7a78043b7d --- /dev/null +++ b/packages/gamut-codemods/src/lib/run-source.ts @@ -0,0 +1,108 @@ +import type { JSCodeshift } from 'jscodeshift'; + +import type { Manifest } from './manifest'; +import type { + AstMigration, + Edit, + Locatable, + Note, + SourceMigration, + SpliceMigration, +} from './types'; + +/* + Runs source migrations over one piece of source text. Two phases: + + 1. AST migrations share one parse and mutate it. If any changed + something, recast prints the text once and `postPrint` hooks run. + 2. Splice migrations run in order, each against a fresh parse of the + current text, returning `{ start, end, text }` edits applied back to + front. The re-parse means a later splice sees an earlier one's output + (mf-shared writes @codecademy keys that scope-rename then renames). + + Shared by the jscodeshift transform (whole files) and file migrations + that embed code, like MDX's ESM blocks. +*/ + +export interface RunSourceOptions { + j: JSCodeshift; + source: string; + migrations: SourceMigration[]; + manifest: Manifest; + warnFor: (migration: string) => (node: Locatable, message: string) => void; + note: Note; +} + +const applyEdits = (source: string, edits: Edit[]) => + [...edits] + .sort((a, b) => b.start - a.start) + .reduce( + (out, { start, end, text }) => + out.slice(0, start) + text + out.slice(end), + source + ); + +export const runSourceMigrations = ({ + j, + source: original, + migrations, + manifest, + warnFor, + note, +}: RunSourceOptions) => { + let source = original; + + const astMigrations = migrations.filter( + (m): m is AstMigration => m.kind === 'ast' + ); + if (astMigrations.length > 0) { + const root = j(source); + let changed = false; + for (const m of astMigrations) { + changed = + m.run({ j, root, source, manifest, warn: warnFor(m.name), note }) || + changed; + } + if (changed) { + source = astMigrations.reduce( + (out, m) => (m.postPrint ? m.postPrint(out, { manifest }) : out), + root.toSource({ quote: 'single' }) + ); + } + } + + for (const m of migrations.filter( + (x): x is SpliceMigration => x.kind === 'splice' + )) { + const root = j(source); + const edits = m.edits({ + j, + root, + source, + manifest, + warn: warnFor(m.name), + note, + }); + if (edits.length > 0) source = applyEdits(source, edits); + } + + return source; +}; + +/* The pre-filter every caller uses so big repos don't parse every file. */ +export const mentionsOldNames = (manifest: Manifest, source: string) => + [ + ...Object.keys(manifest.packages), + ...Object.keys(manifest.removedPackages), + `${manifest.eslintPlugin.from}/`, + ].some((name) => source.includes(name)); + +export const activeSourceMigrations = ( + migrations: { kind: string; name: string }[], + only?: string +) => { + const names = only ? new Set(only.split(',')) : null; + return migrations.filter( + (m) => m.kind !== 'file' && (!names || names.has(m.name)) + ) as SourceMigration[]; +}; diff --git a/packages/gamut-codemods/src/lib/types.ts b/packages/gamut-codemods/src/lib/types.ts index 558c9d74c1..4321561927 100644 --- a/packages/gamut-codemods/src/lib/types.ts +++ b/packages/gamut-codemods/src/lib/types.ts @@ -57,7 +57,7 @@ export interface SpliceMigration extends MigrationBase { edits(ctx: SourceContext): Edit[]; } -/* Gets raw text for non-source files (package.json, .eslintrc). */ +/* Gets raw text for non-source files (package.json, .eslintrc, .mdx). */ export interface FileMigration extends MigrationBase { kind: 'file'; match(path: string): boolean; @@ -66,6 +66,11 @@ export interface FileMigration extends MigrationBase { manifest: Manifest; warn: (message: string) => void; note: Note; + /* + Runs the preset's source migrations (respecting --only) over a + snippet of JS/TS, for files that embed code, like MDX's ESM blocks. + */ + transformSource: (code: string) => string; }): string | null; } diff --git a/packages/gamut-codemods/src/migrations/mdx-imports/__testfixtures__/story.input.mdx b/packages/gamut-codemods/src/migrations/mdx-imports/__testfixtures__/story.input.mdx new file mode 100644 index 0000000000..513edb7e2b --- /dev/null +++ b/packages/gamut-codemods/src/migrations/mdx-imports/__testfixtures__/story.input.mdx @@ -0,0 +1,18 @@ +import { Canvas, Meta } from '@storybook/blocks'; +import { Box, Video } from '@codecademy/gamut'; +import { + PopoverContainerProps, +} from '@codecademy/gamut/dist/PopoverContainer/types'; +import * as Stories from './Card.stories'; + + + +# Card + +Built on `@codecademy/gamut`'s Box. + +```tsx +import { Card } from '@codecademy/gamut'; +``` + + diff --git a/packages/gamut-codemods/src/migrations/mdx-imports/__testfixtures__/story.output.mdx b/packages/gamut-codemods/src/migrations/mdx-imports/__testfixtures__/story.output.mdx new file mode 100644 index 0000000000..4acaac1535 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/mdx-imports/__testfixtures__/story.output.mdx @@ -0,0 +1,19 @@ +import { Canvas, Meta } from '@storybook/blocks'; +import { Box } from '@skillsoft/gamut'; +import { Video } from '@skillsoft/gamut/Video'; +import { + PopoverContainerProps, +} from '@skillsoft/gamut'; +import * as Stories from './Card.stories'; + + + +# Card + +Built on `@codecademy/gamut`'s Box. + +```tsx +import { Card } from '@codecademy/gamut'; +``` + + diff --git a/packages/gamut-codemods/src/migrations/mdx-imports/index.ts b/packages/gamut-codemods/src/migrations/mdx-imports/index.ts new file mode 100644 index 0000000000..f98acf3d56 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/mdx-imports/index.ts @@ -0,0 +1,63 @@ +import type { FileMigration } from '../../lib/types'; + +/* + MDX files (Storybook docs, mostly) import from Gamut like any module, but + jscodeshift can't parse MDX. This pulls out the top-level ESM statements + (`import ... from '...'`, `export ... from '...'`) and runs each one + through the preset's source migrations, so stories get the same scope + rename, Video split, and deep-import rewrites as .tsx files. + + Fenced code blocks are left alone. They're documentation, and a code + sample that still says @codecademy is the leftovers report's job. +*/ + +const FENCE = /^\s*(```|~~~)/; +const STATEMENT_START = /^(import\s|export\s+(\*|\{|type\s+\{))/; +const STATEMENT_END = + /(from\s*(['"])[^'"\n]*\2|^import\s*(['"])[^'"\n]*\3)\s*;?\s*$/; +/* A statement that runs longer than this isn't one we understand. */ +const MAX_STATEMENT_LINES = 50; + +export const mdxImports: FileMigration = { + name: 'mdx-imports', + kind: 'file', + description: + 'Run the source migrations over import/export statements in .mdx files.', + match: (file) => file.endsWith('.mdx'), + run({ source, transformSource }) { + const lines = source.split('\n'); + const out: string[] = []; + let inFence = false; + let changed = false; + + for (let i = 0; i < lines.length; i += 1) { + const line = lines[i]; + if (FENCE.test(line)) inFence = !inFence; + if (inFence || !STATEMENT_START.test(line)) { + out.push(line); + continue; + } + + let end = i; + while ( + end < lines.length - 1 && + end - i < MAX_STATEMENT_LINES && + !STATEMENT_END.test(lines.slice(i, end + 1).join('\n')) + ) { + end += 1; + } + const statement = lines.slice(i, end + 1).join('\n'); + if (!STATEMENT_END.test(statement)) { + out.push(line); + continue; + } + + const next = transformSource(statement); + if (next !== statement) changed = true; + out.push(next); + i = end; + } + + return changed ? out.join('\n') : null; + }, +}; diff --git a/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/already-renamed.input.json b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/already-renamed.input.json new file mode 100644 index 0000000000..a332e52190 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/already-renamed.input.json @@ -0,0 +1,9 @@ +{ + "name": "app", + "dependencies": { + "@codecademy/gamut-kit": "3.0.25", + "@skillsoft/gamut": "https://pkg.pr.new/@skillsoft/gamut@28", + "@skillsoft/gamut-icons": "https://pkg.pr.new/@skillsoft/gamut-icons@28", + "@codecademy/gamut-styles": "21.2.0" + } +} diff --git a/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/already-renamed.output.json b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/already-renamed.output.json new file mode 100644 index 0000000000..e51edd4454 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/already-renamed.output.json @@ -0,0 +1,12 @@ +{ + "name": "app", + "dependencies": { + "@skillsoft/gamut": "https://pkg.pr.new/@skillsoft/gamut@28", + "@skillsoft/gamut-icons": "https://pkg.pr.new/@skillsoft/gamut-icons@28", + "@skillsoft/gamut-illustrations": "^{{version}}", + "@skillsoft/gamut-patterns": "^{{version}}", + "@skillsoft/gamut-styles": "^{{version}}", + "@skillsoft/gamut-tests": "^{{version}}", + "@skillsoft/variance": "^{{version}}" + } +} diff --git a/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/peers.input.json b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/peers.input.json new file mode 100644 index 0000000000..27dbc10c94 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/peers.input.json @@ -0,0 +1,7 @@ +{ + "name": "lib", + "peerDependencies": { + "@codecademy/gamut": "*", + "@codecademy/gamut-styles": "^21.0.0" + } +} diff --git a/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/peers.output.json b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/peers.output.json new file mode 100644 index 0000000000..e4ecfdfaf1 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/package-json/__testfixtures__/peers.output.json @@ -0,0 +1,7 @@ +{ + "name": "lib", + "peerDependencies": { + "@skillsoft/gamut": "*", + "@skillsoft/gamut-styles": "^{{version}}" + } +} diff --git a/packages/gamut-codemods/src/migrations/package-json/index.ts b/packages/gamut-codemods/src/migrations/package-json/index.ts index 7d25d0ae30..257bd4fa73 100644 --- a/packages/gamut-codemods/src/migrations/package-json/index.ts +++ b/packages/gamut-codemods/src/migrations/package-json/index.ts @@ -5,6 +5,12 @@ import type { FileMigration } from '../../lib/types'; manifest.targetVersions. Removed packages are replaced by the packages they bundled. Only touched fields are re-sorted; indentation and the trailing newline are kept. + + A new package that's already listed keeps its value. People add the new + names by hand before running this, often pointed at a preview tarball, + and overwriting that with a range that isn't published yet breaks + install. A `*` peer range stays `*`: it means "whatever the host has", + and narrowing it is a decision for the package owner. */ const FIELDS = [ @@ -43,7 +49,8 @@ export const packageJson: FileMigration = { if (!(removed in next)) continue; delete next[removed]; for (const old of expandTo) { - if (!(old in next)) next[old] = '*'; + const renamed = manifest.packages[old]?.to; + if (!(old in next) && !(renamed && renamed in next)) next[old] = '*'; } warn( `${field}: replaced '${removed}' with its individual packages. ${why}` @@ -54,9 +61,14 @@ export const packageJson: FileMigration = { for (const [from, { to }] of Object.entries(manifest.packages)) { if (!(from in next)) continue; + const range = next[from]; delete next[from]; - next[to] = manifest.targetVersions[to]; touched = true; + if (to in next) continue; + next[to] = + field === 'peerDependencies' && range === '*' + ? '*' + : manifest.targetVersions[to]; } if (touched) { diff --git a/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/no-glob.input.yml b/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/no-glob.input.yml new file mode 100644 index 0000000000..6452a33ad1 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/no-glob.input.yml @@ -0,0 +1,2 @@ +npmPreapprovedPackages: + - eslint-plugin-gamut # lint rules diff --git a/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/no-glob.output.yml b/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/no-glob.output.yml new file mode 100644 index 0000000000..7a6d8c80bf --- /dev/null +++ b/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/no-glob.output.yml @@ -0,0 +1,2 @@ +npmPreapprovedPackages: + - '@skillsoft/eslint-plugin-gamut' # lint rules diff --git a/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/preapproved.input.yml b/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/preapproved.input.yml new file mode 100644 index 0000000000..8c251e0841 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/preapproved.input.yml @@ -0,0 +1,10 @@ +npmPreapprovedPackages: + - '@skillsoft/*' + - 'eslint-plugin-gamut' + - "@codecademy/gamut-kit" + - react + +packageExtensions: + '@codecademy/gamut@*': + peerDependencies: + react: '*' diff --git a/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/preapproved.output.yml b/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/preapproved.output.yml new file mode 100644 index 0000000000..0d09a98e03 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/yarnrc/__testfixtures__/preapproved.output.yml @@ -0,0 +1,9 @@ +npmPreapprovedPackages: + - '@skillsoft/*' + - "@codecademy/gamut-kit" + - react + +packageExtensions: + '@codecademy/gamut@*': + peerDependencies: + react: '*' diff --git a/packages/gamut-codemods/src/migrations/yarnrc/index.ts b/packages/gamut-codemods/src/migrations/yarnrc/index.ts new file mode 100644 index 0000000000..34074ee969 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/yarnrc/index.ts @@ -0,0 +1,45 @@ +import { renameSpecifier } from '../../lib/manifest'; +import type { FileMigration } from '../../lib/types'; + +/* + Package names listed in .yarnrc.yml, like npmPreapprovedPackages: + + npmPreapprovedPackages: + - '@skillsoft/*' + - 'eslint-plugin-gamut' + + An old name is renamed, or dropped if a scope glob in the same file + (`'@skillsoft/*'`) already covers the new one. Only exact list items are + touched; anything more involved shows up in the leftovers report. +*/ + +const LIST_ITEM = /^(\s*-\s*)(['"]?)([^'"\s#]+)\2(\s*(#.*)?)$/; + +export const yarnrc: FileMigration = { + name: 'yarnrc', + kind: 'file', + description: 'Rename or drop old package names in .yarnrc.yml lists.', + match: (file) => /(^|\/)\.yarnrc\.yml$/.test(file), + run({ source, manifest }) { + const lines = source.split('\n'); + const globs = lines + .map((line) => LIST_ITEM.exec(line)?.[3]) + .filter((value): value is string => !!value?.endsWith('/*')) + .map((glob) => glob.slice(0, -1)); + + let changed = false; + const out = lines.flatMap((line) => { + const match = LIST_ITEM.exec(line); + const next = match && renameSpecifier(manifest, match[3]); + if (!match || !next) return [line]; + changed = true; + if (globs.some((prefix) => next.startsWith(prefix))) return []; + const [, lead, quote, , trail] = match; + /* `@` is reserved in YAML, so a plain scalar can't start with it. */ + const q = quote || (next.startsWith('@') ? "'" : ''); + return [`${lead}${q}${next}${q}${trail}`]; + }); + + return changed ? out.join('\n') : null; + }, +}; diff --git a/packages/gamut-codemods/src/presets/scope-swap/index.ts b/packages/gamut-codemods/src/presets/scope-swap/index.ts index 8ece32e855..0174666b37 100644 --- a/packages/gamut-codemods/src/presets/scope-swap/index.ts +++ b/packages/gamut-codemods/src/presets/scope-swap/index.ts @@ -2,10 +2,12 @@ import type { Preset } from '../../lib/types'; import { deepImports } from '../../migrations/deep-imports'; import { eslintComments } from '../../migrations/eslint-comments'; import { eslintConfig } from '../../migrations/eslint-config'; +import { mdxImports } from '../../migrations/mdx-imports'; import { mfShared } from '../../migrations/mf-shared'; import { movedExports } from '../../migrations/moved-exports'; import { packageJson } from '../../migrations/package-json'; import { scopeRename } from '../../migrations/scope-rename'; +import { yarnrc } from '../../migrations/yarnrc'; import { manifest } from './manifest'; export const scopeSwap: Preset = { @@ -21,6 +23,8 @@ export const scopeSwap: Preset = { scopeRename, packageJson, eslintConfig, + mdxImports, + yarnrc, ], checklist: [ 'Run your formatter (prettier --write / eslint --fix). Split imports come out in recast style.', diff --git a/packages/gamut-codemods/src/transform.ts b/packages/gamut-codemods/src/transform.ts index 2bf5cef8bb..4892c2781e 100644 --- a/packages/gamut-codemods/src/transform.ts +++ b/packages/gamut-codemods/src/transform.ts @@ -3,29 +3,21 @@ import path from 'node:path'; import type { API, FileInfo } from 'jscodeshift'; -import type { - AstMigration, - Edit, - Locatable, - SourceMigration, - SpliceMigration, -} from './lib/types'; +import { + activeSourceMigrations, + mentionsOldNames, + runSourceMigrations, +} from './lib/run-source'; +import type { Locatable } from './lib/types'; import { getPreset } from './presets'; /* - jscodeshift entry point. Two phases: - - 1. AST migrations share one parse and mutate it. If any changed - something, recast prints the file once and `postPrint` hooks run. - 2. Splice migrations run in order, each against a fresh parse of the - current text, returning `{ start, end, text }` edits applied back to - front. A re-parse between them means a later splice sees an earlier - one's output (mf-shared writes @codecademy keys that scope-rename then - renames). + jscodeshift entry point: runs a preset's source migrations over one file + (see lib/run-source.ts for the two phases). Options: - preset: preset name (default: scope-swap) - only: comma-separated migration names to run (default: all) + preset: preset name (default: scope-swap) + only: comma-separated migration names to run (default: all) notesDir: directory the CLI reads checklist notes back from. jscodeshift only aggregates api.stats in --dry runs, so workers leave an empty marker file per note key instead. @@ -39,15 +31,6 @@ export interface TransformOptions { onWarn?: (message: string) => void; } -const applyEdits = (source: string, edits: Edit[]) => - [...edits] - .sort((a, b) => b.start - a.start) - .reduce( - (out, { start, end, text }) => - out.slice(0, start) + text + out.slice(end), - source - ); - export default function transform( file: FileInfo, api: API, @@ -55,22 +38,8 @@ export default function transform( ) { const preset = getPreset(options.preset ?? 'scope-swap'); const { manifest } = preset; + if (!mentionsOldNames(manifest, file.source)) return undefined; - /* Cheap pre-filter so big repos don't parse every file. */ - const oldNames = [ - ...Object.keys(manifest.packages), - ...Object.keys(manifest.removedPackages), - `${manifest.eslintPlugin.from}/`, - ]; - if (!oldNames.some((name) => file.source.includes(name))) return undefined; - - const only = options.only ? new Set(options.only.split(',')) : null; - const active = preset.migrations.filter( - (m): m is SourceMigration => - m.kind !== 'file' && (!only || only.has(m.name)) - ); - - const j = api.jscodeshift; const note = (key: string) => { if (options.notesDir) { fs.writeFileSync( @@ -86,41 +55,14 @@ export default function transform( else api.report(text); }; - let { source } = file; - - const astMigrations = active.filter( - (m): m is AstMigration => m.kind === 'ast' - ); - if (astMigrations.length > 0) { - const root = j(source); - let changed = false; - for (const m of astMigrations) { - changed = - m.run({ j, root, source, manifest, warn: warnFor(m.name), note }) || - changed; - } - if (changed) { - source = astMigrations.reduce( - (out, m) => (m.postPrint ? m.postPrint(out, { manifest }) : out), - root.toSource({ quote: 'single' }) - ); - } - } - - for (const m of active.filter( - (x): x is SpliceMigration => x.kind === 'splice' - )) { - const root = j(source); - const edits = m.edits({ - j, - root, - source, - manifest, - warn: warnFor(m.name), - note, - }); - if (edits.length > 0) source = applyEdits(source, edits); - } + const source = runSourceMigrations({ + j: api.jscodeshift, + source: file.source, + migrations: activeSourceMigrations(preset.migrations, options.only), + manifest, + warnFor, + note, + }); return source === file.source ? undefined : source; } From 1bebf4340951cf62bc1a5bc83f4209106b55d905 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 24 Sep 2026 15:40:51 -0400 Subject: [PATCH 25/47] feat(gamut): export formFieldStyles, formFieldPaddingStyles, conditionalStyles For custom inputs that should look like Input, such as third-party hosted payment fields; mono's Recurly fields import all three from dist/Form/styles today. The rest of Form/styles stays internal. The scope-swap codemod now rewrites Form/styles deep imports to the root when every imported name is one of the three, via a new `onlyNames` manifest field, and warns otherwise. Deep-import rewrites inside mocks now always warn, since mocking the root covers the whole package. Co-Authored-By: Claude Opus 5.5 --- .changeset/gamut-form-field-styles.md | 5 +++ packages/gamut-codemods/README.md | 22 +++++------ .../src/__tests__/manifest.test.ts | 8 ++++ packages/gamut-codemods/src/lib/manifest.ts | 5 +++ .../__testfixtures__/form-styles.input.tsx | 4 ++ .../__testfixtures__/form-styles.output.tsx | 4 ++ .../form-styles.warnings.json | 1 + .../__testfixtures__/renames.warnings.json | 2 +- .../__testfixtures__/rewrites.warnings.json | 2 +- .../src/migrations/deep-imports/index.ts | 39 ++++++++++++++++--- .../src/presets/scope-swap/manifest.ts | 9 ++++- .../__snapshots__/gamut.test.ts.snap | 3 ++ packages/gamut/src/Form/index.tsx | 9 +++++ 13 files changed, 92 insertions(+), 21 deletions(-) create mode 100644 .changeset/gamut-form-field-styles.md create mode 100644 packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.input.tsx create mode 100644 packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.output.tsx create mode 100644 packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.warnings.json diff --git a/.changeset/gamut-form-field-styles.md b/.changeset/gamut-form-field-styles.md new file mode 100644 index 0000000000..d75fa130a5 --- /dev/null +++ b/.changeset/gamut-form-field-styles.md @@ -0,0 +1,5 @@ +--- +'@skillsoft/gamut': minor +--- + +Export `formFieldStyles`, `formFieldPaddingStyles`, and `conditionalStyles` from the package root, for custom inputs that should look like `Input`, such as third-party hosted payment fields. The rest of `Form/styles` stays internal. Coming from `@codecademy/gamut/dist/Form/styles`, `npx @skillsoft/gamut-codemods scope-swap .` rewrites imports of these three. diff --git a/packages/gamut-codemods/README.md b/packages/gamut-codemods/README.md index 27e8c02367..f5645d7db5 100644 --- a/packages/gamut-codemods/README.md +++ b/packages/gamut-codemods/README.md @@ -35,17 +35,17 @@ A run ends with three things: ### What scope-swap changes -| Migration | What it does | -| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `deep-imports` | `@codecademy/gamut/dist/PopoverContainer/types` → `@codecademy/gamut`, and the rest of the promoted deep imports. Menu's `List*` and SelectDropdown's `IconOption` component were renamed on the way to the root (`MenuList*`, `IconOptionComponent`); local names are kept, so `import { List }` becomes `import { MenuList as List }`. Warns on deep imports with no public replacement (`ButtonBase/ButtonBase`, `Form/styles`) and on ones it doesn't know. | -| `moved-exports` | Moves `Video` and `VideoProps` off the root import onto `/Video`. Warns on namespace imports, `export *`, and mocks that stub `Video`. | -| `mf-shared` | Replaces `@codecademy/gamut-kit` in Module Federation `shared` config with the packages it bundled. Gamut becomes a real singleton, so test the host and remotes together. | -| `eslint-comments` | `// eslint-disable-next-line gamut/x` → `@skillsoft/gamut/x`. | -| `scope-rename` | Every `@codecademy/gamut*` module string becomes `@skillsoft/gamut*`: imports, exports, `require`, `import()`, `jest.mock`/`vi.mock`, `declare module`, and `import('x').T`. Also exact package-name strings elsewhere, like `transpilePackages`, with one warning per file. | -| `package-json` | Renames dependencies and sets their versions. A new package that's already listed keeps its value (a preview URL, say), and a `*` peer range stays `*`. Replaces `@codecademy/gamut-kit` with the individual packages. | -| `eslint-config` | `.eslintrc` / `.eslintrc.json`: plugin name, `plugin:` extends, and rule keys. | -| `mdx-imports` | Runs the migrations above over `import`/`export` statements in `.mdx` files. Fenced code blocks are left alone. | -| `yarnrc` | `.yarnrc.yml` list items, like `npmPreapprovedPackages`: renames old package names, or drops them if a glob like `'@skillsoft/*'` already covers the new one. | +| Migration | What it does | +| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `deep-imports` | `@codecademy/gamut/dist/PopoverContainer/types` → `@codecademy/gamut`, and the rest of the promoted deep imports. Menu's `List*` and SelectDropdown's `IconOption` component were renamed on the way to the root (`MenuList*`, `IconOptionComponent`); local names are kept, so `import { List }` becomes `import { MenuList as List }`. `Form/styles` is only partly public (`formFieldStyles`, `formFieldPaddingStyles`, `conditionalStyles`), so imports of anything else from it are left alone with a warning. Also warns on deep imports with no public replacement (`ButtonBase/ButtonBase`) and on ones it doesn't know. | +| `moved-exports` | Moves `Video` and `VideoProps` off the root import onto `/Video`. Warns on namespace imports, `export *`, and mocks that stub `Video`. | +| `mf-shared` | Replaces `@codecademy/gamut-kit` in Module Federation `shared` config with the packages it bundled. Gamut becomes a real singleton, so test the host and remotes together. | +| `eslint-comments` | `// eslint-disable-next-line gamut/x` → `@skillsoft/gamut/x`. | +| `scope-rename` | Every `@codecademy/gamut*` module string becomes `@skillsoft/gamut*`: imports, exports, `require`, `import()`, `jest.mock`/`vi.mock`, `declare module`, and `import('x').T`. Also exact package-name strings elsewhere, like `transpilePackages`, with one warning per file. | +| `package-json` | Renames dependencies and sets their versions. A new package that's already listed keeps its value (a preview URL, say), and a `*` peer range stays `*`. Replaces `@codecademy/gamut-kit` with the individual packages. | +| `eslint-config` | `.eslintrc` / `.eslintrc.json`: plugin name, `plugin:` extends, and rule keys. | +| `mdx-imports` | Runs the migrations above over `import`/`export` statements in `.mdx` files. Fenced code blocks are left alone. | +| `yarnrc` | `.yarnrc.yml` list items, like `npmPreapprovedPackages`: renames old package names, or drops them if a glob like `'@skillsoft/*'` already covers the new one. | ### Known limits diff --git a/packages/gamut-codemods/src/__tests__/manifest.test.ts b/packages/gamut-codemods/src/__tests__/manifest.test.ts index 4265860ae3..62089107a9 100644 --- a/packages/gamut-codemods/src/__tests__/manifest.test.ts +++ b/packages/gamut-codemods/src/__tests__/manifest.test.ts @@ -36,6 +36,14 @@ const importsToCheck = () => { ); } for (const row of m.deepImports) { + if (row.to && row.onlyNames) { + lines.push( + `import type { ${row.onlyNames.join(', ')} } from '${renameSpecifier( + m, + row.to + )}';` + ); + } if (!row.to || !row.renames) continue; lines.push( `import type { ${Object.values(row.renames).join( diff --git a/packages/gamut-codemods/src/lib/manifest.ts b/packages/gamut-codemods/src/lib/manifest.ts index 495458f723..74ca28b9c3 100644 --- a/packages/gamut-codemods/src/lib/manifest.ts +++ b/packages/gamut-codemods/src/lib/manifest.ts @@ -30,6 +30,11 @@ export interface DeepImport { to: string | null; /* Old imported name -> new exported name. Local bindings are kept. */ renames?: Record; + /* + When only some of the old module went public: the names `to` exports. + A declaration importing anything else is left alone with a warning. + */ + onlyNames?: string[]; note?: string; } diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.input.tsx b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.input.tsx new file mode 100644 index 0000000000..11737f72e1 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.input.tsx @@ -0,0 +1,4 @@ +import { conditionalStyles, formFieldStyles } from '@codecademy/gamut/dist/Form/styles'; +import { formFieldPaddingStyles as padding } from '@codecademy/gamut/dist/Form/styles'; +import { formFieldStyles as f, checkboxLabel } from '@codecademy/gamut/dist/Form/styles'; +import * as formStyles from '@codecademy/gamut/dist/Form/styles'; diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.output.tsx b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.output.tsx new file mode 100644 index 0000000000..1c8ceea9f4 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.output.tsx @@ -0,0 +1,4 @@ +import { conditionalStyles, formFieldStyles } from '@codecademy/gamut'; +import { formFieldPaddingStyles as padding } from '@codecademy/gamut'; +import { formFieldStyles as f, checkboxLabel } from '@codecademy/gamut/dist/Form/styles'; +import * as formStyles from '@codecademy/gamut/dist/Form/styles'; diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.warnings.json b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.warnings.json new file mode 100644 index 0000000000..e127ff61a0 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/form-styles.warnings.json @@ -0,0 +1 @@ +["checkboxLabel isn't exported from '@codecademy/gamut'", "* isn't exported from '@codecademy/gamut'"] diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.warnings.json b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.warnings.json index 5d13e00b9c..6b61771448 100644 --- a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.warnings.json +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/renames.warnings.json @@ -1 +1 @@ -["'@codecademy/gamut/dist/Menu/elements' has renamed exports. Check the mock factory by hand."] +["That now covers the whole package, and some exports were renamed. Check it by hand."] diff --git a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json index eeb8344b5b..99cf5b0f92 100644 --- a/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json +++ b/packages/gamut-codemods/src/migrations/deep-imports/__testfixtures__/rewrites.warnings.json @@ -1 +1 @@ -["'@codecademy/gamut/dist/Form/styles' has no public replacement", "'@codecademy/gamut/dist/ButtonBase/ButtonBase' has no public replacement", "unmapped deep import '@codecademy/gamut/dist/Nope'"] +["'@codecademy/gamut/dist/Form/styles' is only partly public. formStyles isn't exported from '@codecademy/gamut'", "'@codecademy/gamut/dist/ButtonBase/ButtonBase' has no public replacement", "unmapped deep import '@codecademy/gamut/dist/Nope'", "rewrote '@codecademy/gamut/dist/Box/props' to '@codecademy/gamut' in a mock or require(). That now covers the whole package."] diff --git a/packages/gamut-codemods/src/migrations/deep-imports/index.ts b/packages/gamut-codemods/src/migrations/deep-imports/index.ts index b394c39c45..f703d6b9cb 100644 --- a/packages/gamut-codemods/src/migrations/deep-imports/index.ts +++ b/packages/gamut-codemods/src/migrations/deep-imports/index.ts @@ -90,6 +90,30 @@ export const deepImports: AstMigration = { ); continue; } + if (row.onlyNames) { + const allowed = new Set(row.onlyNames); + const specifiers = + 'specifiers' in node ? ((node.specifiers ?? []) as Specifier[]) : []; + const blocked = specifiers + .map((spec) => + spec.type === 'ImportSpecifier' + ? nameOf((spec as ImportSpecifier).imported) + : spec.type === 'ExportSpecifier' + ? nameOf((spec as ExportSpecifier).local) + : '*' + ) + .filter((name) => !allowed.has(name)); + if (node.type === 'ExportAllDeclaration') blocked.push('*'); + if (blocked.length > 0) { + warn( + node, + `'${row.from}' is only partly public. ${blocked.join( + ', ' + )} isn't exported from '${row.to}'. ${row.note ?? ''}` + ); + continue; + } + } if (row.renames && 'specifiers' in node && node.specifiers) { node.specifiers = renameSpecifiers( j, @@ -112,12 +136,15 @@ export const deepImports: AstMigration = { ); continue; } - if (row.renames) { - warn( - literal, - `'${literal.value}' has renamed exports. Check the mock factory by hand.` - ); - } + /* jest.mock of a deep path now mocks the whole package. */ + warn( + literal, + `rewrote '${literal.value}' to '${ + row.to + }' in a mock or require(). That now covers the whole package${ + row.renames ? ', and some exports were renamed' : '' + }. Check it by hand.` + ); literal.value = row.to; changed = true; } diff --git a/packages/gamut-codemods/src/presets/scope-swap/manifest.ts b/packages/gamut-codemods/src/presets/scope-swap/manifest.ts index 3c3b002e1e..556c02c05f 100644 --- a/packages/gamut-codemods/src/presets/scope-swap/manifest.ts +++ b/packages/gamut-codemods/src/presets/scope-swap/manifest.ts @@ -137,8 +137,13 @@ export const manifest: Manifest = { }, { from: '@codecademy/gamut/dist/Form/styles', - to: null, - note: 'Form/styles has no public replacement. Inline the styles or use system props / css().', + to: '@codecademy/gamut', + onlyNames: [ + 'conditionalStyles', + 'formFieldPaddingStyles', + 'formFieldStyles', + ], + note: 'The rest of Form/styles is internal. Inline the styles, or use system props / css().', }, { from: '@codecademy/gamut-styles/dist/AssetProvider', diff --git a/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap b/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap index 6e3bc667ee..c04b2fbe56 100644 --- a/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap +++ b/packages/gamut/__tests__/__snapshots__/gamut.test.ts.snap @@ -16,6 +16,7 @@ exports[`Gamut Exported Keys 1`] = ` "Checkbox", "Coachmark", "Column", + "conditionalStyles", "ConnectedCheckbox", "ConnectedForm", "ConnectedFormGroup", @@ -54,6 +55,8 @@ exports[`Gamut Exported Keys 1`] = ` "focusVisibleStyle", "Form", "FormError", + "formFieldPaddingStyles", + "formFieldStyles", "FormGroup", "FormGroupDescription", "FormGroupLabel", diff --git a/packages/gamut/src/Form/index.tsx b/packages/gamut/src/Form/index.tsx index f59e8507d7..7301e9103c 100644 --- a/packages/gamut/src/Form/index.tsx +++ b/packages/gamut/src/Form/index.tsx @@ -13,3 +13,12 @@ export * from './inputs/Radio'; export * from './inputs/RadioGroup'; export * from './inputs/types'; export * from './types'; +/* + For custom inputs that should look like Input, such as third-party hosted + payment fields. The rest of ./styles is internal. +*/ +export { + conditionalStyles, + formFieldPaddingStyles, + formFieldStyles, +} from './styles'; From 658a4df14e03c860c97047da108143fd7497a427 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 24 Sep 2026 15:58:13 -0400 Subject: [PATCH 26/47] fix: Video under node10 resolution; codemod only rewrites names the target exports From a type-checked scope-swap run against mono (15 errors left after the consumer-side fixes, all from these): gamut - Add a Video/package.json stub (and ship it) so `@skillsoft/gamut/Video` resolves under TypeScript's node10 resolution and bundlers that ignore `exports`, the same way upstream does. Drop attw's `no-resolution` ignore, which was hiding exactly this. - Export the HTMLToReactNode and ButtonBaseProps types from the root; mono deep-imports both. gamut-codemods - Five deep-import rows were sending every name to the root even though only some are public there (Box/props, Button/shared, Markdown/libs/overrides, SelectDropdown/elements, gamut-icons/props). They now list their public names in `onlyNames`, and manifest.test.ts fails if any row could send a name its target doesn't export. - New tsconfig-dom report: warns on `lib` without "dom", which Video used to supply through the root import, with a matching next-steps item. - The gamut-kit next step mentions gamut-styles' stylis peer dependency. - README: how to test against pkg.pr.new previews (resolutions to avoid duplicate copies). Co-Authored-By: Claude Opus 5.5 --- .changeset/gamut-video-node10-and-types.md | 6 + packages/gamut-codemods/README.md | 20 +++ .../src/__tests__/manifest.test.ts | 117 +++++++++++++++--- packages/gamut-codemods/src/lib/manifest.ts | 6 +- .../__testfixtures__/has-dom.input.json | 1 + .../__testfixtures__/has-dom.output.json | 1 + .../__testfixtures__/no-dom.input.json | 4 + .../__testfixtures__/no-dom.output.json | 4 + .../__testfixtures__/no-dom.warnings.json | 1 + .../src/migrations/tsconfig-dom/index.ts | 30 +++++ .../src/presets/scope-swap/index.ts | 6 +- .../src/presets/scope-swap/manifest.ts | 24 +++- packages/gamut/Video/package.json | 5 + packages/gamut/package.json | 3 +- packages/gamut/project.json | 5 +- packages/gamut/src/Button/index.ts | 2 +- packages/gamut/src/Markdown/index.tsx | 1 + 17 files changed, 205 insertions(+), 31 deletions(-) create mode 100644 .changeset/gamut-video-node10-and-types.md create mode 100644 packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/has-dom.input.json create mode 100644 packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/has-dom.output.json create mode 100644 packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.input.json create mode 100644 packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.output.json create mode 100644 packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.warnings.json create mode 100644 packages/gamut-codemods/src/migrations/tsconfig-dom/index.ts create mode 100644 packages/gamut/Video/package.json diff --git a/.changeset/gamut-video-node10-and-types.md b/.changeset/gamut-video-node10-and-types.md new file mode 100644 index 0000000000..2fdaa4c386 --- /dev/null +++ b/.changeset/gamut-video-node10-and-types.md @@ -0,0 +1,6 @@ +--- +'@skillsoft/gamut': patch +--- + +- `@skillsoft/gamut/Video` now resolves under TypeScript's `moduleResolution: "node"` (node10) and in bundlers that ignore `package.json#exports`, through a `Video/package.json` stub. +- Export the `HTMLToReactNode` and `ButtonBaseProps` types from the package root. diff --git a/packages/gamut-codemods/README.md b/packages/gamut-codemods/README.md index f5645d7db5..3372a62581 100644 --- a/packages/gamut-codemods/README.md +++ b/packages/gamut-codemods/README.md @@ -33,6 +33,25 @@ A run ends with three things: 2. **Leftovers**: every line that still names an old package. These are for you to fix: jest `moduleNameMapper` regexes, tsconfig `paths`, flat ESLint configs, comments, and docs. 3. **Next steps**, built from what actually happened in the run. +### Trying it against a preview build + +Every skillsoft-gamut pull request publishes installable previews through pkg.pr.new. To test a migration against one: + +1. Add the `@skillsoft/*` packages to your root `package.json` first, pointed at the preview URLs. The codemod keeps any `@skillsoft/*` entry that's already there. +2. Preview packages point at each other through commit-pinned URLs, so without help yarn installs a second copy of `gamut-styles`, `variance`, and so on under `@skillsoft/gamut/node_modules`. Pin every `@skillsoft/*` package you use with `resolutions`: + + ```json + "resolutions": { + "@skillsoft/gamut": "https://pkg.pr.new/@skillsoft/gamut@", + "@skillsoft/gamut-styles": "https://pkg.pr.new/@skillsoft/gamut-styles@", + "@skillsoft/variance": "https://pkg.pr.new/@skillsoft/variance@" + } + ``` + + Published releases don't need this. The packages share one version through the changesets `fixed` group, so their dependencies on each other line up. + +3. Commit, then run the codemod (or pass `--force`). + ### What scope-swap changes | Migration | What it does | @@ -46,6 +65,7 @@ A run ends with three things: | `eslint-config` | `.eslintrc` / `.eslintrc.json`: plugin name, `plugin:` extends, and rule keys. | | `mdx-imports` | Runs the migrations above over `import`/`export` statements in `.mdx` files. Fenced code blocks are left alone. | | `yarnrc` | `.yarnrc.yml` list items, like `npmPreapprovedPackages`: renames old package names, or drops them if a glob like `'@skillsoft/*'` already covers the new one. | +| `tsconfig-dom` | Report only. Warns about `tsconfig` files whose `lib` has no `"dom"`, since Video used to supply the DOM types through the root import. | ### Known limits diff --git a/packages/gamut-codemods/src/__tests__/manifest.test.ts b/packages/gamut-codemods/src/__tests__/manifest.test.ts index 62089107a9..f48b665496 100644 --- a/packages/gamut-codemods/src/__tests__/manifest.test.ts +++ b/packages/gamut-codemods/src/__tests__/manifest.test.ts @@ -24,38 +24,115 @@ const readJson = (file: string) => consumer's bundler would, through the exports map. */ const importsToCheck = () => { - const lines: string[] = []; + const byModule = new Map>(); + const add = (spec: string | null, names: string[]) => { + if (!spec) return; + const set = byModule.get(spec) ?? new Set(); + names.forEach((name) => set.add(name)); + byModule.set(spec, set); + }; for (const preset of Object.values(presets)) { const m = preset.manifest; for (const rule of m.movedExports) { - lines.push( - `import type { ${rule.names.join(', ')} } from '${renameSpecifier( - m, - rule.to - )}';` - ); + add(renameSpecifier(m, rule.to), rule.names); } for (const row of m.deepImports) { - if (row.to && row.onlyNames) { - lines.push( - `import type { ${row.onlyNames.join(', ')} } from '${renameSpecifier( - m, - row.to - )}';` + if (!row.to) continue; + const to = renameSpecifier(m, row.to); + if (row.onlyNames) { + add( + to, + row.onlyNames.map((name) => row.renames?.[name] ?? name) ); } - if (!row.to || !row.renames) continue; - lines.push( - `import type { ${Object.values(row.renames).join( - ', ' - )} } from '${renameSpecifier(m, row.to)}';` - ); + if (row.renames) add(to, Object.values(row.renames)); } } - return lines.join('\n'); + return [...byModule] + .map( + ([spec, names]) => + `import type { ${[...names].join(', ')} } from '${spec}';` + ) + .join('\n'); +}; + +/* `@codecademy/gamut/dist/Form/styles` -> packages/gamut/src/Form/styles(.ts|/index.tsx|...) */ +const sourceModuleFor = (deepPath: string) => { + const match = /^@codecademy\/([\w-]+)\/dist\/(.+)$/.exec(deepPath); + if (!match) return null; + const base = path.join(REPO, 'packages', match[1], 'src', match[2]); + return ( + ['.ts', '.tsx', '/index.ts', '/index.tsx'] + .map((ext) => base + ext) + .find((file) => fs.existsSync(file)) ?? null + ); +}; + +/* Export names of each module specifier, resolved like a bundler would. */ +const exportsOf = (specifiers: string[]) => { + const file = path.join(REPO, 'packages/gamut-codemods/__exports-check__.ts'); + const source = specifiers + .map((spec, i) => `import * as m${i} from '${spec}';`) + .join('\n'); + const host = ts.createCompilerHost({}); + const readFile = host.readFile.bind(host); + host.readFile = (f) => (f === file ? source : readFile(f)); + const fileExists = host.fileExists.bind(host); + host.fileExists = (f) => f === file || fileExists(f); + const program = ts.createProgram( + [file], + { + noEmit: true, + skipLibCheck: true, + jsx: ts.JsxEmit.ReactJSX, + module: ts.ModuleKind.ESNext, + moduleResolution: ts.ModuleResolutionKind.Bundler, + types: [], + }, + host + ); + const checker = program.getTypeChecker(); + const imports = program + .getSourceFile(file)! + .statements.filter(ts.isImportDeclaration); + return specifiers.map((_, i) => { + const symbol = checker.getSymbolAtLocation(imports[i].moduleSpecifier); + return new Set( + symbol ? checker.getExportsOfModule(symbol).map((s) => s.name) : [] + ); + }); }; describe('manifests', () => { + /* + A deep-import row sends every name imported from `from` to `to`, so + everything `from` exports has to be available there: directly, via + `renames`, or be left out on purpose by listing what is public in + `onlyNames`. Otherwise the codemod writes imports that don't compile. + */ + it('only rewrite deep imports whose names all exist at the target', () => { + const rows = manifest.deepImports.filter((row) => row.to && !row.onlyNames); + const sources = rows.map((row) => sourceModuleFor(row.from)); + const targets = rows.map((row) => renameSpecifier(manifest, row.to!)!); + const found = exportsOf([ + ...sources.map((s) => s ?? 'missing'), + ...targets, + ]); + + const problems = rows.flatMap((row, i) => { + if (!sources[i]) return [`${row.from}: no source module found`]; + const available = found[rows.length + i]; + const missing = [...found[i]] + .map((name) => row.renames?.[name] ?? name) + .filter((name) => !available.has(name)); + return missing.length + ? [`${row.from} -> ${targets[i]}: missing ${missing.join(', ')}`] + : []; + }); + + expect(problems).toEqual([]); + }); + it('only point at exports that exist in the built packages', () => { const file = path.join( REPO, diff --git a/packages/gamut-codemods/src/lib/manifest.ts b/packages/gamut-codemods/src/lib/manifest.ts index 74ca28b9c3..8fdc71137a 100644 --- a/packages/gamut-codemods/src/lib/manifest.ts +++ b/packages/gamut-codemods/src/lib/manifest.ts @@ -31,8 +31,10 @@ export interface DeepImport { /* Old imported name -> new exported name. Local bindings are kept. */ renames?: Record; /* - When only some of the old module went public: the names `to` exports. - A declaration importing anything else is left alone with a warning. + When only some of the old module went public: the old names that work + from `to` (after `renames`). A declaration importing anything else is + left alone with a warning. manifest.test.ts fails if a row sends names + to `to` that it doesn't export, so partial rows must list these. */ onlyNames?: string[]; note?: string; diff --git a/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/has-dom.input.json b/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/has-dom.input.json new file mode 100644 index 0000000000..38cca72cc6 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/has-dom.input.json @@ -0,0 +1 @@ +{ "compilerOptions": { "lib": ["es2022", "DOM", "dom.iterable"] } } diff --git a/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/has-dom.output.json b/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/has-dom.output.json new file mode 100644 index 0000000000..38cca72cc6 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/has-dom.output.json @@ -0,0 +1 @@ +{ "compilerOptions": { "lib": ["es2022", "DOM", "dom.iterable"] } } diff --git a/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.input.json b/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.input.json new file mode 100644 index 0000000000..3a90a0ce69 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.input.json @@ -0,0 +1,4 @@ +{ + // server code + "compilerOptions": { "lib": ["es2022"] } +} diff --git a/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.output.json b/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.output.json new file mode 100644 index 0000000000..3a90a0ce69 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.output.json @@ -0,0 +1,4 @@ +{ + // server code + "compilerOptions": { "lib": ["es2022"] } +} diff --git a/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.warnings.json b/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.warnings.json new file mode 100644 index 0000000000..f83a4ee348 --- /dev/null +++ b/packages/gamut-codemods/src/migrations/tsconfig-dom/__testfixtures__/no-dom.warnings.json @@ -0,0 +1 @@ +["\"lib\" has no \"dom\""] diff --git a/packages/gamut-codemods/src/migrations/tsconfig-dom/index.ts b/packages/gamut-codemods/src/migrations/tsconfig-dom/index.ts new file mode 100644 index 0000000000..86e7f69b7d --- /dev/null +++ b/packages/gamut-codemods/src/migrations/tsconfig-dom/index.ts @@ -0,0 +1,30 @@ +import type { FileMigration } from '../../lib/types'; + +/* + Report-only. Before scope-swap, the gamut root re-exported Video, which + pulled @vidstack/react's DOM types into every program that imported + gamut. A tsconfig with an explicit `lib` and no "dom" got DOM globals + anyway. Once Video moves to its subpath they're gone, and `document`, + `HTMLInputElement`, `ResizeObserver` and friends stop type-checking. + Adding "dom" is the owner's call, so this warns rather than rewriting. +*/ + +const LIB = /"lib"\s*:\s*\[([^\]]*)\]/; + +export const tsconfigDom: FileMigration = { + name: 'tsconfig-dom', + kind: 'file', + description: + 'Warn about tsconfig `lib` settings without "dom", which Video used to supply.', + match: (file) => /(^|\/)tsconfig[\w.-]*\.json$/.test(file), + run({ source, warn, note }) { + const lib = LIB.exec(source); + if (lib && !/["']dom["']/i.test(lib[1])) { + warn( + `"lib" has no "dom". Gamut's root import used to bring DOM types in through Video; add "dom" if type-checking now fails on document, HTMLElement, and so on.` + ); + note('tsconfig-no-dom'); + } + return null; + }, +}; diff --git a/packages/gamut-codemods/src/presets/scope-swap/index.ts b/packages/gamut-codemods/src/presets/scope-swap/index.ts index 0174666b37..d883d99a3b 100644 --- a/packages/gamut-codemods/src/presets/scope-swap/index.ts +++ b/packages/gamut-codemods/src/presets/scope-swap/index.ts @@ -7,6 +7,7 @@ import { mfShared } from '../../migrations/mf-shared'; import { movedExports } from '../../migrations/moved-exports'; import { packageJson } from '../../migrations/package-json'; import { scopeRename } from '../../migrations/scope-rename'; +import { tsconfigDom } from '../../migrations/tsconfig-dom'; import { yarnrc } from '../../migrations/yarnrc'; import { manifest } from './manifest'; @@ -25,6 +26,7 @@ export const scopeSwap: Preset = { eslintConfig, mdxImports, yarnrc, + tsconfigDom, ], checklist: [ 'Run your formatter (prettier --write / eslint --fix). Split imports come out in recast style.', @@ -33,7 +35,9 @@ export const scopeSwap: Preset = { ], conditionalChecklist: { 'removed:@codecademy/gamut-kit': - 'gamut-kit is gone. Delete anything that reads it for versions, such as a sync-gamut-deps script.', + "gamut-kit is gone. Delete anything that reads it for versions, such as a sync-gamut-deps script. @skillsoft/gamut-styles has a stylis peer dependency, and it's now a direct dependency of yours, so add stylis if yarn warns that it isn't provided.", + 'tsconfig-no-dom': + 'Some tsconfig files set "lib" without "dom" (see the tsconfig-dom warnings). Video no longer loads with the root import, and it was supplying the DOM types. Add "dom" to those files if type-checking fails on document, HTMLElement, ResizeObserver, and so on.', 'mf-shared': "Module Federation shared config changed. Gamut is now a real singleton: run the host and every remote together, and update the remotes' shared config to match.", }, diff --git a/packages/gamut-codemods/src/presets/scope-swap/manifest.ts b/packages/gamut-codemods/src/presets/scope-swap/manifest.ts index 556c02c05f..3edf272f1b 100644 --- a/packages/gamut-codemods/src/presets/scope-swap/manifest.ts +++ b/packages/gamut-codemods/src/presets/scope-swap/manifest.ts @@ -96,15 +96,33 @@ export const manifest: Manifest = { to: '@codecademy/gamut', }, { from: '@codecademy/gamut/dist/Form/types', to: '@codecademy/gamut' }, - { from: '@codecademy/gamut/dist/Box/props', to: '@codecademy/gamut' }, + { + from: '@codecademy/gamut/dist/Box/props', + to: '@codecademy/gamut', + onlyNames: ['BoxProps', 'FlexBoxProps', 'GridBoxProps'], + }, { from: '@codecademy/gamut/dist/Tip/shared/types', to: '@codecademy/gamut', }, - { from: '@codecademy/gamut/dist/Button/shared', to: '@codecademy/gamut' }, + { + from: '@codecademy/gamut/dist/Button/shared', + to: '@codecademy/gamut', + onlyNames: ['ButtonBaseProps', 'ButtonProps', 'buttonProps'], + }, { from: '@codecademy/gamut/dist/Markdown/libs/overrides', to: '@codecademy/gamut', + onlyNames: [ + 'HTMLToReactNode', + 'MarkdownOverrideSetting', + 'MarkdownOverrideSettings', + 'createCodeBlockOverride', + 'createInputOverride', + 'createTagOverride', + 'createVideoOverride', + 'standardOverrides', + ], }, /* Renamed on the way to the root: `List` and `IconOption` collided with @@ -129,6 +147,7 @@ export const manifest: Manifest = { from: '@codecademy/gamut/dist/Form/SelectDropdown/elements', to: '@codecademy/gamut', renames: { IconOption: 'IconOptionComponent' }, + onlyNames: ['IconOption'], }, { from: '@codecademy/gamut/dist/ButtonBase/ButtonBase', @@ -156,6 +175,7 @@ export const manifest: Manifest = { { from: '@codecademy/gamut-icons/dist/props', to: '@codecademy/gamut-icons', + onlyNames: ['GamutIconProps', 'IconStyleProps'], }, { from: '@codecademy/variance/dist/types/config', diff --git a/packages/gamut/Video/package.json b/packages/gamut/Video/package.json new file mode 100644 index 0000000000..9a1490663a --- /dev/null +++ b/packages/gamut/Video/package.json @@ -0,0 +1,5 @@ +{ + "main": "../dist/Video/index.js", + "module": "../dist/Video/index.mjs", + "types": "../dist/Video/index.d.ts" +} diff --git a/packages/gamut/package.json b/packages/gamut/package.json index 1e67294cb6..dcbf3cd213 100644 --- a/packages/gamut/package.json +++ b/packages/gamut/package.json @@ -45,7 +45,8 @@ }, "files": [ "dist", - "bin" + "bin", + "Video" ], "license": "MIT", "main": "./dist/index.js", diff --git a/packages/gamut/project.json b/packages/gamut/project.json index 1f01215c71..b9760357dc 100644 --- a/packages/gamut/project.json +++ b/packages/gamut/project.json @@ -39,10 +39,7 @@ "dependsOn": ["build"], "options": { "cwd": "{projectRoot}", - "commands": [ - "publint .", - "attw --pack . --ignore-rules false-cjs no-resolution" - ], + "commands": ["publint .", "attw --pack . --ignore-rules false-cjs"], "parallel": false } }, diff --git a/packages/gamut/src/Button/index.ts b/packages/gamut/src/Button/index.ts index dae5e26ff3..dd02cffb1d 100644 --- a/packages/gamut/src/Button/index.ts +++ b/packages/gamut/src/Button/index.ts @@ -1,4 +1,4 @@ -export type { ButtonProps } from './shared'; +export type { ButtonBaseProps, ButtonProps } from './shared'; export { buttonProps } from './shared'; export * from './CTAButton'; export * from './FillButton'; diff --git a/packages/gamut/src/Markdown/index.tsx b/packages/gamut/src/Markdown/index.tsx index 8b04affd7a..80af520bcb 100644 --- a/packages/gamut/src/Markdown/index.tsx +++ b/packages/gamut/src/Markdown/index.tsx @@ -191,6 +191,7 @@ export class Markdown extends PureComponent { } export type { + HTMLToReactNode, MarkdownOverrideSetting, MarkdownOverrideSettings, } from './libs/overrides'; From 46ad288edbc96e8d749f7ae41ff583d7fa55296d Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 24 Sep 2026 16:19:30 -0400 Subject: [PATCH 27/47] build(deps): make @skillsoft packages easier to install A consumer now needs react, react-dom, @emotion/react, and @emotion/styled alongside @skillsoft/gamut, down from also installing @emotion/cache, lodash, stylis, and typescript by hand. Verified by installing packed tarballs into a fresh yarn project: the only peer warning left is yarn's implicit @types/react. - gamut-styles: stylis, lodash, @emotion/cache peer -> dependency. stylis only feeds the cache's prefixer, and @emotion/cache already ships its own copy, so nothing needs to be shared with the host. - gamut-icons: drop the lodash peer; nothing imports it. - variance: mark the typescript peer optional; no runtime import. - Sibling @skillsoft deps use ^ ranges instead of exact pins, so a consumer on a slightly different patch shares one gamut-styles (one theme context) instead of getting two. - gamut-tests: component-test-setup * -> ^0.3.1. - gamut: @types/marked -> devDependencies; no published .d.ts uses it. Third-party exact pins (react-aria-components and friends) stay exact: loosening them re-resolved react-aria-components 1.7.1 -> 1.21.1, which is an upgrade to test on its own. The scope-swap checklist drops its now-unneeded stylis note. Co-Authored-By: Claude Opus 5.5 --- .changeset/consumer-friendly-deps.md | 18 ++++++ .../src/presets/scope-swap/index.ts | 2 +- packages/gamut-icons/package.json | 5 +- packages/gamut-illustrations/package.json | 2 +- packages/gamut-patterns/package.json | 4 +- packages/gamut-styles/package.json | 12 ++-- packages/gamut-tests/package.json | 4 +- packages/gamut/package.json | 14 +++-- packages/variance/package.json | 7 ++- yarn.lock | 56 ++++++++++--------- 10 files changed, 75 insertions(+), 49 deletions(-) create mode 100644 .changeset/consumer-friendly-deps.md diff --git a/.changeset/consumer-friendly-deps.md b/.changeset/consumer-friendly-deps.md new file mode 100644 index 0000000000..7ff73112d2 --- /dev/null +++ b/.changeset/consumer-friendly-deps.md @@ -0,0 +1,18 @@ +--- +'@skillsoft/gamut': patch +'@skillsoft/gamut-styles': patch +'@skillsoft/gamut-icons': patch +'@skillsoft/gamut-illustrations': patch +'@skillsoft/gamut-patterns': patch +'@skillsoft/gamut-tests': patch +'@skillsoft/variance': patch +--- + +Fewer packages to install by hand. `@skillsoft/gamut` now needs only `react`, `react-dom`, `@emotion/react`, and `@emotion/styled` alongside it. + +- `@skillsoft/gamut-styles`: `stylis`, `lodash`, and `@emotion/cache` are now regular dependencies instead of peer dependencies. +- `@skillsoft/gamut-icons`: dropped an unused `lodash` peer dependency. +- `@skillsoft/variance`: the `typescript` peer dependency is now optional. +- `@skillsoft/*` packages depend on each other with `^` ranges instead of exact versions, so installs share one copy of `gamut-styles` and `variance`. +- `@skillsoft/gamut-tests`: `component-test-setup` is now `^0.3.1` instead of `*`. +- `@skillsoft/gamut`: `@types/marked` moved to devDependencies. The published types don't reference it. diff --git a/packages/gamut-codemods/src/presets/scope-swap/index.ts b/packages/gamut-codemods/src/presets/scope-swap/index.ts index d883d99a3b..268ec8a107 100644 --- a/packages/gamut-codemods/src/presets/scope-swap/index.ts +++ b/packages/gamut-codemods/src/presets/scope-swap/index.ts @@ -35,7 +35,7 @@ export const scopeSwap: Preset = { ], conditionalChecklist: { 'removed:@codecademy/gamut-kit': - "gamut-kit is gone. Delete anything that reads it for versions, such as a sync-gamut-deps script. @skillsoft/gamut-styles has a stylis peer dependency, and it's now a direct dependency of yours, so add stylis if yarn warns that it isn't provided.", + 'gamut-kit is gone. Delete anything that reads it for versions, such as a sync-gamut-deps script.', 'tsconfig-no-dom': 'Some tsconfig files set "lib" without "dom" (see the tsconfig-dom warnings). Video no longer loads with the root import, and it was supplying the DOM types. Add "dom" to those files if type-checking fails on document, HTMLElement, ResizeObserver, and so on.', 'mf-shared': diff --git a/packages/gamut-icons/package.json b/packages/gamut-icons/package.json index 7b1e72c985..19adbe5907 100644 --- a/packages/gamut-icons/package.json +++ b/packages/gamut-icons/package.json @@ -4,8 +4,8 @@ "version": "0.0.1", "author": "Skillsoft Engineering ", "dependencies": { - "@skillsoft/gamut-styles": "0.0.1", - "@skillsoft/variance": "0.0.1" + "@skillsoft/gamut-styles": "^0.0.1", + "@skillsoft/variance": "^0.0.1" }, "exports": { "./package.json": "./package.json", @@ -24,7 +24,6 @@ "peerDependencies": { "@emotion/react": "^11.4.0", "@emotion/styled": "^11.3.0", - "lodash": "^4.17.23", "react": "^17.0.2 || ^18.3.0 || ^19.0.0" }, "publishConfig": { diff --git a/packages/gamut-illustrations/package.json b/packages/gamut-illustrations/package.json index b2e3f118e0..6dc03baed4 100644 --- a/packages/gamut-illustrations/package.json +++ b/packages/gamut-illustrations/package.json @@ -5,7 +5,7 @@ "author": "Skillsoft Engineering ", "bugs": "https://github.com/Codecademy/skillsoft-gamut/issues", "dependencies": { - "@skillsoft/gamut-styles": "0.0.1", + "@skillsoft/gamut-styles": "^0.0.1", "classnames": "^2.2.5" }, "exports": { diff --git a/packages/gamut-patterns/package.json b/packages/gamut-patterns/package.json index 5bcd8a2d6e..62c4677fd8 100644 --- a/packages/gamut-patterns/package.json +++ b/packages/gamut-patterns/package.json @@ -5,8 +5,8 @@ "author": "Skillsoft Engineering ", "bugs": "https://github.com/Codecademy/skillsoft-gamut/issues", "dependencies": { - "@skillsoft/gamut-styles": "0.0.1", - "@skillsoft/variance": "0.0.1", + "@skillsoft/gamut-styles": "^0.0.1", + "@skillsoft/variance": "^0.0.1", "classnames": "^2.2.5" }, "exports": { diff --git a/packages/gamut-styles/package.json b/packages/gamut-styles/package.json index e43eceef59..142fecbde2 100644 --- a/packages/gamut-styles/package.json +++ b/packages/gamut-styles/package.json @@ -4,11 +4,14 @@ "version": "0.0.1", "author": "Skillsoft Engineering ", "dependencies": { + "@emotion/cache": "^11.4.0", "@emotion/is-prop-valid": "^1.1.0", - "@skillsoft/variance": "0.0.1", + "@skillsoft/variance": "^0.0.1", "framer-motion": "^12.0.0", "get-nonce": "^1.0.0", - "polished": "^4.1.2" + "lodash": "^4.17.23", + "polished": "^4.1.2", + "stylis": "^4.2.0" }, "exports": { "./package.json": "./package.json", @@ -26,12 +29,9 @@ "main": "dist/index.js", "module": "dist/index.mjs", "peerDependencies": { - "@emotion/cache": "^11.4.0", "@emotion/react": "^11.4.0", "@emotion/styled": "^11.3.0", - "lodash": "^4.17.23", - "react": "^17.0.2 || ^18.3.0 || ^19.0.0", - "stylis": "^4.0.7" + "react": "^17.0.2 || ^18.3.0 || ^19.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/gamut-tests/package.json b/packages/gamut-tests/package.json index d8fbf72a64..62e2bb15fb 100644 --- a/packages/gamut-tests/package.json +++ b/packages/gamut-tests/package.json @@ -4,8 +4,8 @@ "version": "0.0.1", "author": "Skillsoft Engineering ", "dependencies": { - "@skillsoft/gamut-styles": "0.0.1", - "component-test-setup": "*", + "@skillsoft/gamut-styles": "^0.0.1", + "component-test-setup": "^0.3.1", "lodash": "^4.17.23" }, "exports": { diff --git a/packages/gamut/package.json b/packages/gamut/package.json index dcbf3cd213..010bbacd8d 100644 --- a/packages/gamut/package.json +++ b/packages/gamut/package.json @@ -7,12 +7,11 @@ "dependencies": { "@formatjs/intl-locale": "5.3.1", "@react-aria/interactions": "3.25.0", - "@skillsoft/gamut-icons": "0.0.1", - "@skillsoft/gamut-illustrations": "0.0.1", - "@skillsoft/gamut-patterns": "0.0.1", - "@skillsoft/gamut-styles": "0.0.1", - "@skillsoft/variance": "0.0.1", - "@types/marked": "^4.0.8", + "@skillsoft/gamut-icons": "^0.0.1", + "@skillsoft/gamut-illustrations": "^0.0.1", + "@skillsoft/gamut-patterns": "^0.0.1", + "@skillsoft/gamut-styles": "^0.0.1", + "@skillsoft/variance": "^0.0.1", "@vidstack/react": "^1.12.12", "classnames": "^2.2.5", "framer-motion": "^12.0.0", @@ -30,6 +29,9 @@ "react-use": "^17.6.1", "sanitize-markdown": "^2.6.7" }, + "devDependencies": { + "@types/marked": "^4.0.8" + }, "exports": { "./package.json": "./package.json", ".": { diff --git a/packages/variance/package.json b/packages/variance/package.json index 9625a1bcc1..a750678e6a 100644 --- a/packages/variance/package.json +++ b/packages/variance/package.json @@ -40,5 +40,10 @@ "build": "nx build variance" }, "sideEffects": false, - "types": "dist/index.d.ts" + "types": "dist/index.d.ts", + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } } diff --git a/yarn.lock b/yarn.lock index c62b2f4f7d..075216b703 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8173,25 +8173,24 @@ __metadata: languageName: unknown linkType: soft -"@skillsoft/gamut-icons@npm:0.0.1, @skillsoft/gamut-icons@workspace:*, @skillsoft/gamut-icons@workspace:packages/gamut-icons": +"@skillsoft/gamut-icons@npm:^0.0.1, @skillsoft/gamut-icons@workspace:*, @skillsoft/gamut-icons@workspace:packages/gamut-icons": version: 0.0.0-use.local resolution: "@skillsoft/gamut-icons@workspace:packages/gamut-icons" dependencies: - "@skillsoft/gamut-styles": "npm:0.0.1" - "@skillsoft/variance": "npm:0.0.1" + "@skillsoft/gamut-styles": "npm:^0.0.1" + "@skillsoft/variance": "npm:^0.0.1" peerDependencies: "@emotion/react": ^11.4.0 "@emotion/styled": ^11.3.0 - lodash: ^4.17.23 react: ^17.0.2 || ^18.3.0 || ^19.0.0 languageName: unknown linkType: soft -"@skillsoft/gamut-illustrations@npm:0.0.1, @skillsoft/gamut-illustrations@workspace:packages/gamut-illustrations": +"@skillsoft/gamut-illustrations@npm:^0.0.1, @skillsoft/gamut-illustrations@workspace:packages/gamut-illustrations": version: 0.0.0-use.local resolution: "@skillsoft/gamut-illustrations@workspace:packages/gamut-illustrations" dependencies: - "@skillsoft/gamut-styles": "npm:0.0.1" + "@skillsoft/gamut-styles": "npm:^0.0.1" classnames: "npm:^2.2.5" peerDependencies: "@emotion/react": ^11.4.0 @@ -8201,12 +8200,12 @@ __metadata: languageName: unknown linkType: soft -"@skillsoft/gamut-patterns@npm:0.0.1, @skillsoft/gamut-patterns@workspace:packages/gamut-patterns": +"@skillsoft/gamut-patterns@npm:^0.0.1, @skillsoft/gamut-patterns@workspace:packages/gamut-patterns": version: 0.0.0-use.local resolution: "@skillsoft/gamut-patterns@workspace:packages/gamut-patterns" dependencies: - "@skillsoft/gamut-styles": "npm:0.0.1" - "@skillsoft/variance": "npm:0.0.1" + "@skillsoft/gamut-styles": "npm:^0.0.1" + "@skillsoft/variance": "npm:^0.0.1" classnames: "npm:^2.2.5" peerDependencies: "@emotion/react": ^11.4.0 @@ -8216,22 +8215,22 @@ __metadata: languageName: unknown linkType: soft -"@skillsoft/gamut-styles@npm:0.0.1, @skillsoft/gamut-styles@workspace:*, @skillsoft/gamut-styles@workspace:packages/gamut-styles": +"@skillsoft/gamut-styles@npm:^0.0.1, @skillsoft/gamut-styles@workspace:*, @skillsoft/gamut-styles@workspace:packages/gamut-styles": version: 0.0.0-use.local resolution: "@skillsoft/gamut-styles@workspace:packages/gamut-styles" dependencies: + "@emotion/cache": "npm:^11.4.0" "@emotion/is-prop-valid": "npm:^1.1.0" - "@skillsoft/variance": "npm:0.0.1" + "@skillsoft/variance": "npm:^0.0.1" framer-motion: "npm:^12.0.0" get-nonce: "npm:^1.0.0" + lodash: "npm:^4.17.23" polished: "npm:^4.1.2" + stylis: "npm:^4.2.0" peerDependencies: - "@emotion/cache": ^11.4.0 "@emotion/react": ^11.4.0 "@emotion/styled": ^11.3.0 - lodash: ^4.17.23 react: ^17.0.2 || ^18.3.0 || ^19.0.0 - stylis: ^4.0.7 languageName: unknown linkType: soft @@ -8239,8 +8238,8 @@ __metadata: version: 0.0.0-use.local resolution: "@skillsoft/gamut-tests@workspace:packages/gamut-tests" dependencies: - "@skillsoft/gamut-styles": "npm:0.0.1" - component-test-setup: "npm:*" + "@skillsoft/gamut-styles": "npm:^0.0.1" + component-test-setup: "npm:^0.3.1" lodash: "npm:^4.17.23" peerDependencies: react: ^17.0.2 || ^18.3.0 || ^19.0.0 @@ -8253,11 +8252,11 @@ __metadata: dependencies: "@formatjs/intl-locale": "npm:5.3.1" "@react-aria/interactions": "npm:3.25.0" - "@skillsoft/gamut-icons": "npm:0.0.1" - "@skillsoft/gamut-illustrations": "npm:0.0.1" - "@skillsoft/gamut-patterns": "npm:0.0.1" - "@skillsoft/gamut-styles": "npm:0.0.1" - "@skillsoft/variance": "npm:0.0.1" + "@skillsoft/gamut-icons": "npm:^0.0.1" + "@skillsoft/gamut-illustrations": "npm:^0.0.1" + "@skillsoft/gamut-patterns": "npm:^0.0.1" + "@skillsoft/gamut-styles": "npm:^0.0.1" + "@skillsoft/variance": "npm:^0.0.1" "@types/marked": "npm:^4.0.8" "@vidstack/react": "npm:^1.12.12" classnames: "npm:^2.2.5" @@ -8303,7 +8302,7 @@ __metadata: languageName: unknown linkType: soft -"@skillsoft/variance@npm:0.0.1, @skillsoft/variance@workspace:packages/variance": +"@skillsoft/variance@npm:^0.0.1, @skillsoft/variance@workspace:packages/variance": version: 0.0.0-use.local resolution: "@skillsoft/variance@workspace:packages/variance" dependencies: @@ -8312,6 +8311,9 @@ __metadata: peerDependencies: "@emotion/react": "*" typescript: ">=4.3.5" + peerDependenciesMeta: + typescript: + optional: true languageName: unknown linkType: soft @@ -12193,7 +12195,7 @@ __metadata: languageName: node linkType: hard -"component-test-setup@npm:*, component-test-setup@npm:^0.3.1": +"component-test-setup@npm:^0.3.1": version: 0.3.3 resolution: "component-test-setup@npm:0.3.3" checksum: 10c0/f85ee9a5bf5f65b8440cd6fe03a626e1222b1bba2f29798a4de1c1d7fdbf87397a5ad11e19b0ed20030033c7bede66d2ae6c5bfba426e00b9383adbe0dd0a584 @@ -23871,10 +23873,10 @@ __metadata: languageName: node linkType: hard -"stylis@npm:^4.3.0": - version: 4.3.4 - resolution: "stylis@npm:4.3.4" - checksum: 10c0/4899c2674cd2538e314257abd1ba7ea3c2176439659ddac6593c78192cfd4a06f814a0a4fc69bc7f8fcc6b997e13d383dd9b578b71074746a0fb86045a83e42d +"stylis@npm:^4.2.0, stylis@npm:^4.3.0": + version: 4.4.0 + resolution: "stylis@npm:4.4.0" + checksum: 10c0/259be096d90dfbfe903c8656dcb7591e52a421e577e950ef42ebd9ca02f387623a1165dd08761492fb6e92a7a562d62a53a694a10b0a2f6dcd7a0db107b4bf55 languageName: node linkType: hard From aaa5505a7435931663f6d40ab88a11049e8dc004 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Mon, 5 Oct 2026 10:30:29 -0400 Subject: [PATCH 28/47] dedupe --- yarn.lock | 936 ++++-------------------------------------------------- 1 file changed, 60 insertions(+), 876 deletions(-) diff --git a/yarn.lock b/yarn.lock index 086fa9efad..cb150b23ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -396,18 +396,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.24.7, @babel/code-frame@npm:^7.27.1, @babel/code-frame@npm:^7.28.6, @babel/code-frame@npm:^7.29.0": - version: 7.29.0 - resolution: "@babel/code-frame@npm:7.29.0" - dependencies: - "@babel/helper-validator-identifier": "npm:^7.28.5" - js-tokens: "npm:^4.0.0" - picocolors: "npm:^1.1.1" - checksum: 10c0/d34cc504e7765dfb576a663d97067afb614525806b5cad1a5cc1a7183b916fec8ff57fa233585e3926fd5a9e6b31aae6df91aa81ae9775fb7a28f658d3346f0d - languageName: node - linkType: hard - -"@babel/code-frame@npm:^7.29.7": +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.21.4, @babel/code-frame@npm:^7.24.7, @babel/code-frame@npm:^7.27.1, @babel/code-frame@npm:^7.29.7": version: 7.29.7 resolution: "@babel/code-frame@npm:7.29.7" dependencies: @@ -418,14 +407,7 @@ __metadata: languageName: node linkType: hard -"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.26.0, @babel/compat-data@npm:^7.28.6": - version: 7.29.0 - resolution: "@babel/compat-data@npm:7.29.0" - checksum: 10c0/08f348554989d23aa801bf1405aa34b15e841c0d52d79da7e524285c77a5f9d298e70e11d91cc578d8e2c9542efc586d50c5f5cf8e1915b254a9dcf786913a94 - languageName: node - linkType: hard - -"@babel/compat-data@npm:^7.29.7": +"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.26.0, @babel/compat-data@npm:^7.29.7": version: 7.29.7 resolution: "@babel/compat-data@npm:7.29.7" checksum: 10c0/47913f05e08a45a1c9df38c02b4b49e391005085b489432647a1abe112e5d9c75e3be8ea5972b7f6da4ec5d1339922ceb9ea02b8a25d4ed1cb8636e5261f344e @@ -455,30 +437,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.12.3, @babel/core@npm:^7.21.3, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.9, @babel/core@npm:^7.27.4, @babel/core@npm:^7.28.0": - version: 7.29.0 - resolution: "@babel/core@npm:7.29.0" - dependencies: - "@babel/code-frame": "npm:^7.29.0" - "@babel/generator": "npm:^7.29.0" - "@babel/helper-compilation-targets": "npm:^7.28.6" - "@babel/helper-module-transforms": "npm:^7.28.6" - "@babel/helpers": "npm:^7.28.6" - "@babel/parser": "npm:^7.29.0" - "@babel/template": "npm:^7.28.6" - "@babel/traverse": "npm:^7.29.0" - "@babel/types": "npm:^7.29.0" - "@jridgewell/remapping": "npm:^2.3.5" - convert-source-map: "npm:^2.0.0" - debug: "npm:^4.1.0" - gensync: "npm:^1.0.0-beta.2" - json5: "npm:^2.2.3" - semver: "npm:^6.3.1" - checksum: 10c0/5127d2e8e842ae409e11bcbb5c2dff9874abf5415e8026925af7308e903f4f43397341467a130490d1a39884f461bc2b67f3063bce0be44340db89687fd852aa - languageName: node - linkType: hard - -"@babel/core@npm:^7.29.0": +"@babel/core@npm:^7.12.3, @babel/core@npm:^7.21.3, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.9, @babel/core@npm:^7.27.4, @babel/core@npm:^7.28.0, @babel/core@npm:^7.29.0": version: 7.29.7 resolution: "@babel/core@npm:7.29.7" dependencies: @@ -501,20 +460,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.24.7, @babel/generator@npm:^7.27.5, @babel/generator@npm:^7.29.0": - version: 7.29.1 - resolution: "@babel/generator@npm:7.29.1" - dependencies: - "@babel/parser": "npm:^7.29.0" - "@babel/types": "npm:^7.29.0" - "@jridgewell/gen-mapping": "npm:^0.3.12" - "@jridgewell/trace-mapping": "npm:^0.3.28" - jsesc: "npm:^3.0.2" - checksum: 10c0/349086e6876258ef3fb2823030fee0f6c0eb9c3ebe35fc572e16997f8c030d765f636ddc6299edae63e760ea6658f8ee9a2edfa6d6b24c9a80c917916b973551 - languageName: node - linkType: hard - -"@babel/generator@npm:^7.29.7, @babel/generator@npm:^7.29.8": +"@babel/generator@npm:^7.24.7, @babel/generator@npm:^7.27.5, @babel/generator@npm:^7.29.7, @babel/generator@npm:^7.29.8": version: 7.29.8 resolution: "@babel/generator@npm:7.29.8" dependencies: @@ -546,20 +492,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.24.7, @babel/helper-compilation-targets@npm:^7.25.9, @babel/helper-compilation-targets@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helper-compilation-targets@npm:7.28.6" - dependencies: - "@babel/compat-data": "npm:^7.28.6" - "@babel/helper-validator-option": "npm:^7.27.1" - browserslist: "npm:^4.24.0" - lru-cache: "npm:^5.1.1" - semver: "npm:^6.3.1" - checksum: 10c0/3fcdf3b1b857a1578e99d20508859dbd3f22f3c87b8a0f3dc540627b4be539bae7f6e61e49d931542fe5b557545347272bbdacd7f58a5c77025a18b745593a50 - languageName: node - linkType: hard - -"@babel/helper-compilation-targets@npm:^7.29.7": +"@babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.24.7, @babel/helper-compilation-targets@npm:^7.25.9, @babel/helper-compilation-targets@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-compilation-targets@npm:7.29.7" dependencies: @@ -617,13 +550,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-globals@npm:^7.28.0": - version: 7.28.0 - resolution: "@babel/helper-globals@npm:7.28.0" - checksum: 10c0/5a0cd0c0e8c764b5f27f2095e4243e8af6fa145daea2b41b53c0c1414fe6ff139e3640f4e2207ae2b3d2153a1abd346f901c26c290ee7cb3881dd922d4ee9232 - languageName: node - linkType: hard - "@babel/helper-globals@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-globals@npm:7.29.7" @@ -641,17 +567,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.18.6, @babel/helper-module-imports@npm:^7.25.9, @babel/helper-module-imports@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helper-module-imports@npm:7.28.6" - dependencies: - "@babel/traverse": "npm:^7.28.6" - "@babel/types": "npm:^7.28.6" - checksum: 10c0/b49d8d8f204d9dbfd5ac70c54e533e5269afb3cea966a9d976722b13e9922cc773a653405f53c89acb247d5aebdae4681d631a3ae3df77ec046b58da76eda2ac - languageName: node - linkType: hard - -"@babel/helper-module-imports@npm:^7.29.7": +"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.18.6, @babel/helper-module-imports@npm:^7.25.9, @babel/helper-module-imports@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-module-imports@npm:7.29.7" dependencies: @@ -661,20 +577,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.24.7, @babel/helper-module-transforms@npm:^7.25.9, @babel/helper-module-transforms@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helper-module-transforms@npm:7.28.6" - dependencies: - "@babel/helper-module-imports": "npm:^7.28.6" - "@babel/helper-validator-identifier": "npm:^7.28.5" - "@babel/traverse": "npm:^7.28.6" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/6f03e14fc30b287ce0b839474b5f271e72837d0cafe6b172d759184d998fbee3903a035e81e07c2c596449e504f453463d58baa65b6f40a37ded5bec74620b2b - languageName: node - linkType: hard - -"@babel/helper-module-transforms@npm:^7.29.7": +"@babel/helper-module-transforms@npm:^7.24.7, @babel/helper-module-transforms@npm:^7.25.9, @babel/helper-module-transforms@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-module-transforms@npm:7.29.7" dependencies: @@ -696,14 +599,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.25.9, @babel/helper-plugin-utils@npm:^7.27.1, @babel/helper-plugin-utils@npm:^7.8.0": - version: 7.28.6 - resolution: "@babel/helper-plugin-utils@npm:7.28.6" - checksum: 10c0/3f5f8acc152fdbb69a84b8624145ff4f9b9f6e776cb989f9f968f8606eb7185c5c3cfcf3ba08534e37e1e0e1c118ac67080610333f56baa4f7376c99b5f1143d - languageName: node - linkType: hard - -"@babel/helper-plugin-utils@npm:^7.29.7": +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.25.9, @babel/helper-plugin-utils@npm:^7.27.1, @babel/helper-plugin-utils@npm:^7.29.7, @babel/helper-plugin-utils@npm:^7.8.0": version: 7.29.7 resolution: "@babel/helper-plugin-utils@npm:7.29.7" checksum: 10c0/380477a06133274a2759f9355929cb60a95e8b8fee624a1ae1fa349e1d1645b89daca456f72833f6d1062bffa12ee4271c5bf0cc5a61c0166cdc24c7591e2408 @@ -756,13 +652,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.27.1": - version: 7.27.1 - resolution: "@babel/helper-string-parser@npm:7.27.1" - checksum: 10c0/8bda3448e07b5583727c103560bcf9c4c24b3c1051a4c516d4050ef69df37bb9a4734a585fe12725b8c2763de0a265aa1e909b485a4e3270b7cfd3e4dbe4b602 - languageName: node - linkType: hard - "@babel/helper-string-parser@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-string-parser@npm:7.29.7" @@ -770,28 +659,14 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.25.9, @babel/helper-validator-identifier@npm:^7.28.5": - version: 7.28.5 - resolution: "@babel/helper-validator-identifier@npm:7.28.5" - checksum: 10c0/42aaebed91f739a41f3d80b72752d1f95fd7c72394e8e4bd7cdd88817e0774d80a432451bcba17c2c642c257c483bf1d409dd4548883429ea9493a3bc4ab0847 - languageName: node - linkType: hard - -"@babel/helper-validator-identifier@npm:^7.29.7": +"@babel/helper-validator-identifier@npm:^7.25.9, @babel/helper-validator-identifier@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-validator-identifier@npm:7.29.7" checksum: 10c0/4795354e7ae0dcafa72de1cd04ec51252dc1498517170beaf019e03effc5b7bf13c6b21a3949a77e07b8125be7f106ed1131350d8ebd4566ae874094a726d62b languageName: node linkType: hard -"@babel/helper-validator-option@npm:^7.25.9, @babel/helper-validator-option@npm:^7.27.1": - version: 7.27.1 - resolution: "@babel/helper-validator-option@npm:7.27.1" - checksum: 10c0/6fec5f006eba40001a20f26b1ef5dbbda377b7b68c8ad518c05baa9af3f396e780bdfded24c4eef95d14bb7b8fd56192a6ed38d5d439b97d10efc5f1a191d148 - languageName: node - linkType: hard - -"@babel/helper-validator-option@npm:^7.29.7": +"@babel/helper-validator-option@npm:^7.25.9, @babel/helper-validator-option@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-validator-option@npm:7.29.7" checksum: 10c0/d2a06c6d0ac40ba4a2f219fc2cab249c7a94bacdb2686273b7f9598571c908809b48468ff588915a346e6cc7296f60b581023d1d498b747fed06f779d335c2cc @@ -809,17 +684,7 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.24.7, @babel/helpers@npm:^7.28.6": - version: 7.29.2 - resolution: "@babel/helpers@npm:7.29.2" - dependencies: - "@babel/template": "npm:^7.28.6" - "@babel/types": "npm:^7.29.0" - checksum: 10c0/dab0e65b9318b2502a62c58bc0913572318595eec0482c31f0ad416b72636e6698a1d7c57cd2791d4528eb8c548bca88d338dc4d2a55a108dc1f6702f9bc5512 - languageName: node - linkType: hard - -"@babel/helpers@npm:^7.29.7": +"@babel/helpers@npm:^7.24.7, @babel/helpers@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helpers@npm:7.29.7" dependencies: @@ -829,18 +694,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.7, @babel/parser@npm:^7.28.6, @babel/parser@npm:^7.29.0": - version: 7.29.2 - resolution: "@babel/parser@npm:7.29.2" - dependencies: - "@babel/types": "npm:^7.29.0" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/e5a4e69e3ac7acdde995f37cf299a68458cfe7009dff66bd0962fd04920bef287201169006af365af479c08ff216bfefbb595e331f87f6ae7283858aebbc3317 - languageName: node - linkType: hard - -"@babel/parser@npm:^7.29.7, @babel/parser@npm:^7.29.8": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.7, @babel/parser@npm:^7.29.7, @babel/parser@npm:^7.29.8": version: 7.29.8 resolution: "@babel/parser@npm:7.29.8" dependencies: @@ -1985,18 +1839,7 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.24.7, @babel/template@npm:^7.25.9, @babel/template@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/template@npm:7.28.6" - dependencies: - "@babel/code-frame": "npm:^7.28.6" - "@babel/parser": "npm:^7.28.6" - "@babel/types": "npm:^7.28.6" - checksum: 10c0/66d87225ed0bc77f888181ae2d97845021838c619944877f7c4398c6748bcf611f216dfd6be74d39016af502bca876e6ce6873db3c49e4ac354c56d34d57e9f5 - languageName: node - linkType: hard - -"@babel/template@npm:^7.29.7": +"@babel/template@npm:^7.24.7, @babel/template@npm:^7.25.9, @babel/template@npm:^7.29.7": version: 7.29.7 resolution: "@babel/template@npm:7.29.7" dependencies: @@ -2007,22 +1850,7 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.25.9, @babel/traverse@npm:^7.28.0, @babel/traverse@npm:^7.28.6, @babel/traverse@npm:^7.29.0": - version: 7.29.0 - resolution: "@babel/traverse@npm:7.29.0" - dependencies: - "@babel/code-frame": "npm:^7.29.0" - "@babel/generator": "npm:^7.29.0" - "@babel/helper-globals": "npm:^7.28.0" - "@babel/parser": "npm:^7.29.0" - "@babel/template": "npm:^7.28.6" - "@babel/types": "npm:^7.29.0" - debug: "npm:^4.3.1" - checksum: 10c0/f63ef6e58d02a9fbf3c0e2e5f1c877da3e0bc57f91a19d2223d53e356a76859cbaf51171c9211c71816d94a0e69efa2732fd27ffc0e1bbc84b636e60932333eb - languageName: node - linkType: hard - -"@babel/traverse@npm:^7.29.7": +"@babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.25.9, @babel/traverse@npm:^7.28.0, @babel/traverse@npm:^7.29.7": version: 7.29.8 resolution: "@babel/traverse@npm:7.29.8" dependencies: @@ -2037,17 +1865,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.6, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.9, @babel/types@npm:^7.27.3, @babel/types@npm:^7.28.2, @babel/types@npm:^7.28.6, @babel/types@npm:^7.29.0, @babel/types@npm:^7.4.4": - version: 7.29.0 - resolution: "@babel/types@npm:7.29.0" - dependencies: - "@babel/helper-string-parser": "npm:^7.27.1" - "@babel/helper-validator-identifier": "npm:^7.28.5" - checksum: 10c0/23cc3466e83bcbfab8b9bd0edaafdb5d4efdb88b82b3be6728bbade5ba2f0996f84f63b1c5f7a8c0d67efded28300898a5f930b171bb40b311bca2029c4e9b4f - languageName: node - linkType: hard - -"@babel/types@npm:^7.29.7, @babel/types@npm:^7.29.8": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.6, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.9, @babel/types@npm:^7.27.3, @babel/types@npm:^7.28.2, @babel/types@npm:^7.29.7, @babel/types@npm:^7.29.8, @babel/types@npm:^7.4.4": version: 7.29.8 resolution: "@babel/types@npm:7.29.8" dependencies: @@ -2613,7 +2431,7 @@ __metadata: languageName: node linkType: hard -"@emnapi/core@npm:1.11.1": +"@emnapi/core@npm:1.11.1, @emnapi/core@npm:^1.1.0, @emnapi/core@npm:^1.4.3, @emnapi/core@npm:^1.5.0": version: 1.11.1 resolution: "@emnapi/core@npm:1.11.1" dependencies: @@ -2623,16 +2441,6 @@ __metadata: languageName: node linkType: hard -"@emnapi/core@npm:^1.1.0, @emnapi/core@npm:^1.4.3, @emnapi/core@npm:^1.5.0, @emnapi/core@npm:^1.7.1": - version: 1.9.1 - resolution: "@emnapi/core@npm:1.9.1" - dependencies: - "@emnapi/wasi-threads": "npm:1.2.0" - tslib: "npm:^2.4.0" - checksum: 10c0/00e7a99a2bc3ad908ca8272ba861a934da87dffa8797a41316c4a3b571a1e4d2743e2fa14b1a0f131fa4a3c2018ddb601cd2a8cb7f574fa940af696df3c2fe8d - languageName: node - linkType: hard - "@emnapi/runtime@npm:1.11.1": version: 1.11.1 resolution: "@emnapi/runtime@npm:1.11.1" @@ -2642,16 +2450,7 @@ __metadata: languageName: node linkType: hard -"@emnapi/runtime@npm:^1.1.0, @emnapi/runtime@npm:^1.4.3, @emnapi/runtime@npm:^1.5.0, @emnapi/runtime@npm:^1.7.1": - version: 1.9.1 - resolution: "@emnapi/runtime@npm:1.9.1" - dependencies: - tslib: "npm:^2.4.0" - checksum: 10c0/750edca117e0363ab2de10622f8ee60e57d8690c2f29c49704813da5cd627c641798d7f3cb0d953c62fdc71688e02e333ddbf2c1204f38b47e3e40657332a6f5 - languageName: node - linkType: hard - -"@emnapi/runtime@npm:^1.11.3": +"@emnapi/runtime@npm:^1.1.0, @emnapi/runtime@npm:^1.11.3, @emnapi/runtime@npm:^1.4.3, @emnapi/runtime@npm:^1.5.0": version: 1.11.3 resolution: "@emnapi/runtime@npm:1.11.3" dependencies: @@ -2660,15 +2459,6 @@ __metadata: languageName: node linkType: hard -"@emnapi/wasi-threads@npm:1.2.0": - version: 1.2.0 - resolution: "@emnapi/wasi-threads@npm:1.2.0" - dependencies: - tslib: "npm:^2.4.0" - checksum: 10c0/1e3724b5814b06c14782fda87eee9b9aa68af01576c81ffeaefdf621ddb74386e419d5b3b1027b6a8172397729d95a92f814fc4b8d3c224376428faa07a6a01a - languageName: node - linkType: hard - "@emnapi/wasi-threads@npm:1.2.2": version: 1.2.2 resolution: "@emnapi/wasi-threads@npm:1.2.2" @@ -4153,14 +3943,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15, @jridgewell/sourcemap-codec@npm:^1.5.0": - version: 1.5.0 - resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" - checksum: 10c0/2eb864f276eb1096c3c11da3e9bb518f6d9fc0023c78344cdc037abadc725172c70314bdb360f2d4b7bffec7f5d657ce006816bc5d4ecb35e61b66132db00c18 - languageName: node - linkType: hard - -"@jridgewell/sourcemap-codec@npm:^1.5.5, @jridgewell/sourcemap-codec@npm:^1.6.0": +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15, @jridgewell/sourcemap-codec@npm:^1.5.0, @jridgewell/sourcemap-codec@npm:^1.5.5, @jridgewell/sourcemap-codec@npm:^1.6.0": version: 1.6.0 resolution: "@jridgewell/sourcemap-codec@npm:1.6.0" checksum: 10c0/b5be700e45a775f218589c3466c4ffea630582b4988657652da464e5ab8a7d18bf928ee4fd2363fb346ede4bea9c6ff0bae05a538358c4565ece6199531b5f72 @@ -4651,18 +4434,7 @@ __metadata: languageName: node linkType: hard -"@napi-rs/wasm-runtime@npm:^1.1.1": - version: 1.1.1 - resolution: "@napi-rs/wasm-runtime@npm:1.1.1" - dependencies: - "@emnapi/core": "npm:^1.7.1" - "@emnapi/runtime": "npm:^1.7.1" - "@tybys/wasm-util": "npm:^0.10.1" - checksum: 10c0/04d57b67e80736e41fe44674a011878db0a8ad893f4d44abb9d3608debb7c174224cba2796ed5b0c1d367368159f3ca6be45f1c59222f70e32ddc880f803d447 - languageName: node - linkType: hard - -"@napi-rs/wasm-runtime@npm:^1.1.6, @napi-rs/wasm-runtime@npm:^1.2.3, @napi-rs/wasm-runtime@npm:^1.2.4": +"@napi-rs/wasm-runtime@npm:^1.1.1, @napi-rs/wasm-runtime@npm:^1.1.6, @napi-rs/wasm-runtime@npm:^1.2.3, @napi-rs/wasm-runtime@npm:^1.2.4": version: 1.2.4 resolution: "@napi-rs/wasm-runtime@npm:1.2.4" dependencies: @@ -5165,13 +4937,6 @@ __metadata: languageName: node linkType: hard -"@oxc-project/types@npm:=0.149.0": - version: 0.149.0 - resolution: "@oxc-project/types@npm:0.149.0" - checksum: 10c0/f91ff8101300ce5a29fbfc57bdaafd9c1c9d3d9b46c63093f437c479d047042eb615cb6c3ddac91a0d289701ce60c365632866a85d0f1e0d159b20180115187e - languageName: node - linkType: hard - "@oxc-project/types@npm:=0.150.0": version: 0.150.0 resolution: "@oxc-project/types@npm:0.150.0" @@ -7138,13 +6903,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-android-arm-eabi@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-android-arm-eabi@npm:1.2.8" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - "@rolldown/binding-android-arm-eabi@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-android-arm-eabi@npm:1.2.9" @@ -7152,13 +6910,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-android-arm64@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-android-arm64@npm:1.2.8" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@rolldown/binding-android-arm64@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-android-arm64@npm:1.2.9" @@ -7166,13 +6917,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-darwin-arm64@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-darwin-arm64@npm:1.2.8" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@rolldown/binding-darwin-arm64@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-darwin-arm64@npm:1.2.9" @@ -7180,13 +6924,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-darwin-x64@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-darwin-x64@npm:1.2.8" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@rolldown/binding-darwin-x64@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-darwin-x64@npm:1.2.9" @@ -7194,13 +6931,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-freebsd-x64@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-freebsd-x64@npm:1.2.8" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - "@rolldown/binding-freebsd-x64@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-freebsd-x64@npm:1.2.9" @@ -7208,13 +6938,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-linux-arm-gnueabihf@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-linux-arm-gnueabihf@npm:1.2.8" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - "@rolldown/binding-linux-arm-gnueabihf@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-linux-arm-gnueabihf@npm:1.2.9" @@ -7222,13 +6945,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-linux-arm64-gnu@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-linux-arm64-gnu@npm:1.2.8" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - "@rolldown/binding-linux-arm64-gnu@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-linux-arm64-gnu@npm:1.2.9" @@ -7236,13 +6952,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-linux-arm64-musl@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-linux-arm64-musl@npm:1.2.8" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - "@rolldown/binding-linux-arm64-musl@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-linux-arm64-musl@npm:1.2.9" @@ -7250,13 +6959,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-linux-ppc64-gnu@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-linux-ppc64-gnu@npm:1.2.8" - conditions: os=linux & cpu=ppc64 & libc=glibc - languageName: node - linkType: hard - "@rolldown/binding-linux-ppc64-gnu@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-linux-ppc64-gnu@npm:1.2.9" @@ -7264,13 +6966,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-linux-s390x-gnu@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-linux-s390x-gnu@npm:1.2.8" - conditions: os=linux & cpu=s390x & libc=glibc - languageName: node - linkType: hard - "@rolldown/binding-linux-s390x-gnu@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-linux-s390x-gnu@npm:1.2.9" @@ -7278,13 +6973,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-linux-x64-gnu@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-linux-x64-gnu@npm:1.2.8" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - "@rolldown/binding-linux-x64-gnu@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-linux-x64-gnu@npm:1.2.9" @@ -7292,13 +6980,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-linux-x64-musl@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-linux-x64-musl@npm:1.2.8" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - "@rolldown/binding-linux-x64-musl@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-linux-x64-musl@npm:1.2.9" @@ -7306,13 +6987,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-openharmony-arm64@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-openharmony-arm64@npm:1.2.8" - conditions: os=openharmony & cpu=arm64 - languageName: node - linkType: hard - "@rolldown/binding-openharmony-arm64@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-openharmony-arm64@npm:1.2.9" @@ -7320,13 +6994,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-win32-arm64-msvc@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-win32-arm64-msvc@npm:1.2.8" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@rolldown/binding-win32-arm64-msvc@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-win32-arm64-msvc@npm:1.2.9" @@ -7334,13 +7001,6 @@ __metadata: languageName: node linkType: hard -"@rolldown/binding-win32-x64-msvc@npm:1.2.8": - version: 1.2.8 - resolution: "@rolldown/binding-win32-x64-msvc@npm:1.2.8" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@rolldown/binding-win32-x64-msvc@npm:1.2.9": version: 1.2.9 resolution: "@rolldown/binding-win32-x64-msvc@npm:1.2.9" @@ -7483,23 +7143,7 @@ __metadata: languageName: node linkType: hard -"@rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.1.0": - version: 5.2.0 - resolution: "@rollup/pluginutils@npm:5.2.0" - dependencies: - "@types/estree": "npm:^1.0.0" - estree-walker: "npm:^2.0.2" - picomatch: "npm:^4.0.2" - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - checksum: 10c0/794890d512751451bcc06aa112366ef47ea8f9125dac49b1abf72ff8b079518b09359de9c60a013b33266541634e765ae61839c749fae0edb59a463418665c55 - languageName: node - linkType: hard - -"@rollup/pluginutils@npm:^5.0.2": +"@rollup/pluginutils@npm:^5.0.1, @rollup/pluginutils@npm:^5.0.2, @rollup/pluginutils@npm:^5.1.0": version: 5.4.0 resolution: "@rollup/pluginutils@npm:5.4.0" dependencies: @@ -7515,13 +7159,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.47.1" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - "@rollup/rollup-android-arm-eabi@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-android-arm-eabi@npm:4.63.1" @@ -7529,13 +7166,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-android-arm64@npm:4.47.1" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-android-arm64@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-android-arm64@npm:4.63.1" @@ -7543,13 +7173,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-darwin-arm64@npm:4.47.1" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-darwin-arm64@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-darwin-arm64@npm:4.63.1" @@ -7557,13 +7180,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-darwin-x64@npm:4.47.1" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-darwin-x64@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-darwin-x64@npm:4.63.1" @@ -7571,13 +7187,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-freebsd-arm64@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.47.1" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-freebsd-arm64@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-freebsd-arm64@npm:4.63.1" @@ -7585,13 +7194,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-freebsd-x64@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-freebsd-x64@npm:4.47.1" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-freebsd-x64@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-freebsd-x64@npm:4.63.1" @@ -7599,13 +7201,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.47.1" - conditions: os=linux & cpu=arm & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-arm-gnueabihf@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.63.1" @@ -7613,13 +7208,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.47.1" - conditions: os=linux & cpu=arm & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-arm-musleabihf@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.63.1" @@ -7627,13 +7215,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.47.1" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-arm64-gnu@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.63.1" @@ -7641,13 +7222,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.47.1" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-arm64-musl@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-arm64-musl@npm:4.63.1" @@ -7669,20 +7243,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-loongarch64-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.47.1" - conditions: os=linux & cpu=loong64 & libc=glibc - languageName: node - linkType: hard - -"@rollup/rollup-linux-ppc64-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.47.1" - conditions: os=linux & cpu=ppc64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-ppc64-gnu@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.63.1" @@ -7697,13 +7257,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.47.1" - conditions: os=linux & cpu=riscv64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-riscv64-gnu@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.63.1" @@ -7711,13 +7264,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-musl@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.47.1" - conditions: os=linux & cpu=riscv64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-riscv64-musl@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.63.1" @@ -7725,13 +7271,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.47.1" - conditions: os=linux & cpu=s390x & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-s390x-gnu@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.63.1" @@ -7739,13 +7278,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.47.1" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-x64-gnu@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-x64-gnu@npm:4.63.1" @@ -7753,13 +7285,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.47.1" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-x64-musl@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-linux-x64-musl@npm:4.63.1" @@ -7781,13 +7306,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.47.1" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-win32-arm64-msvc@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.63.1" @@ -7795,13 +7313,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.47.1" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@rollup/rollup-win32-ia32-msvc@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.63.1" @@ -7816,13 +7327,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.47.1": - version: 4.47.1 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.47.1" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-win32-x64-msvc@npm:4.63.1": version: 4.63.1 resolution: "@rollup/rollup-win32-x64-msvc@npm:4.63.1" @@ -9114,16 +8618,7 @@ __metadata: languageName: node linkType: hard -"@tybys/wasm-util@npm:^0.10.0, @tybys/wasm-util@npm:^0.10.1": - version: 0.10.1 - resolution: "@tybys/wasm-util@npm:0.10.1" - dependencies: - tslib: "npm:^2.4.0" - checksum: 10c0/b255094f293794c6d2289300c5fbcafbb5532a3aed3a5ffd2f8dc1828e639b88d75f6a376dd8f94347a44813fd7a7149d8463477a9a49525c8b2dcaa38c2d1e8 - languageName: node - linkType: hard - -"@tybys/wasm-util@npm:^0.10.3": +"@tybys/wasm-util@npm:^0.10.0, @tybys/wasm-util@npm:^0.10.1, @tybys/wasm-util@npm:^0.10.3": version: 0.10.4 resolution: "@tybys/wasm-util@npm:0.10.4" dependencies: @@ -9276,30 +8771,14 @@ __metadata: languageName: node linkType: hard -"@types/estree@npm:*, @types/estree@npm:1.0.8, @types/estree@npm:^1.0.0, @types/estree@npm:^1.0.8": - version: 1.0.8 - resolution: "@types/estree@npm:1.0.8" - checksum: 10c0/39d34d1afaa338ab9763f37ad6066e3f349444f9052b9676a7cc0252ef9485a41c6d81c9c4e0d26e9077993354edf25efc853f3224dd4b447175ef62bdcc86a5 - languageName: node - linkType: hard - -"@types/estree@npm:1.0.9": +"@types/estree@npm:*, @types/estree@npm:1.0.9, @types/estree@npm:^1.0.0, @types/estree@npm:^1.0.8": version: 1.0.9 resolution: "@types/estree@npm:1.0.9" checksum: 10c0/3ad3286ca2988cd550dafb8f2ad599c8474868e954fa601a36655bdfefd8039f7c714b8c1c7f2ae219ffbd58bd4660e66fa7479a0120fc02d4777057d4865387 languageName: node linkType: hard -"@types/hast@npm:^3.0.0": - version: 3.0.4 - resolution: "@types/hast@npm:3.0.4" - dependencies: - "@types/unist": "npm:*" - checksum: 10c0/3249781a511b38f1d330fd1e3344eed3c4e7ea8eff82e835d35da78e637480d36fad37a78be5a7aed8465d237ad0446abc1150859d0fde395354ea634decf9f7 - languageName: node - linkType: hard - -"@types/hast@npm:^3.0.4, @types/hast@npm:^3.0.5": +"@types/hast@npm:^3.0.0, @types/hast@npm:^3.0.4, @types/hast@npm:^3.0.5": version: 3.0.5 resolution: "@types/hast@npm:3.0.5" dependencies: @@ -9465,16 +8944,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:^22.0.0": - version: 22.19.15 - resolution: "@types/node@npm:22.19.15" - dependencies: - undici-types: "npm:~6.21.0" - checksum: 10c0/f17eaf3d0d1da5e93ad9e287efb78201f8a5282973c004c5f70d91675c5c6b926a23acaa7b158a42b3d7e27e36b349d65a531710c91c308fca53dd7fa280ef98 - languageName: node - linkType: hard - -"@types/node@npm:^24.9.2": +"@types/node@npm:*, @types/node@npm:^24.9.2": version: 24.13.5 resolution: "@types/node@npm:24.13.5" dependencies: @@ -9483,6 +8953,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:^22.0.0": + version: 22.19.15 + resolution: "@types/node@npm:22.19.15" + dependencies: + undici-types: "npm:~6.21.0" + checksum: 10c0/f17eaf3d0d1da5e93ad9e287efb78201f8a5282973c004c5f70d91675c5c6b926a23acaa7b158a42b3d7e27e36b349d65a531710c91c308fca53dd7fa280ef98 + languageName: node + linkType: hard + "@types/normalize-package-data@npm:^2.4.0": version: 2.4.4 resolution: "@types/normalize-package-data@npm:2.4.4" @@ -9771,20 +9250,13 @@ __metadata: languageName: node linkType: hard -"@ungap/structured-clone@npm:^1.0.0": +"@ungap/structured-clone@npm:^1.0.0, @ungap/structured-clone@npm:^1.2.0, @ungap/structured-clone@npm:^1.3.0": version: 1.4.0 resolution: "@ungap/structured-clone@npm:1.4.0" checksum: 10c0/be74a389850d02901c836c07f10c1070d7604dab4070ba3c4b77c91665b90b4175d9f186189a02a399cf054fc051d3251418238564a4491d0164969e05c802a2 languageName: node linkType: hard -"@ungap/structured-clone@npm:^1.2.0, @ungap/structured-clone@npm:^1.3.0": - version: 1.3.0 - resolution: "@ungap/structured-clone@npm:1.3.0" - checksum: 10c0/0fc3097c2540ada1fc340ee56d58d96b5b536a2a0dab6e3ec17d4bfc8c4c86db345f61a375a8185f9da96f01c69678f836a2b57eeaa9e4b8eeafd26428e57b0a - languageName: node - linkType: hard - "@unrs/resolver-binding-android-arm-eabi@npm:1.11.1": version: 1.11.1 resolution: "@unrs/resolver-binding-android-arm-eabi@npm:1.11.1" @@ -10671,20 +10143,13 @@ __metadata: languageName: node linkType: hard -"ansi-regex@npm:^6.1.0": +"ansi-regex@npm:^6.1.0, ansi-regex@npm:^6.2.2": version: 6.3.0 resolution: "ansi-regex@npm:6.3.0" checksum: 10c0/bc047786d0531f1f22d1e22e9863e8554488a399f1ee5270b753efa6de938a788d27456f2b256770f11fdd8b1e847483bc1b55ddc2b3ffe82ec45c875292c651 languageName: node linkType: hard -"ansi-regex@npm:^6.2.2": - version: 6.2.2 - resolution: "ansi-regex@npm:6.2.2" - checksum: 10c0/05d4acb1d2f59ab2cf4b794339c7b168890d44dda4bf0ce01152a8da0213aca207802f930442ce8cd22d7a92f44907664aac6508904e75e038fa944d2601b30f - languageName: node - linkType: hard - "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -13009,18 +12474,7 @@ __metadata: languageName: node linkType: hard -"domutils@npm:^3.0.1, domutils@npm:^3.1.0": - version: 3.1.0 - resolution: "domutils@npm:3.1.0" - dependencies: - dom-serializer: "npm:^2.0.0" - domelementtype: "npm:^2.3.0" - domhandler: "npm:^5.0.3" - checksum: 10c0/342d64cf4d07b8a0573fb51e0a6312a88fb520c7fefd751870bf72fa5fc0f2e0cb9a3958a573610b1d608c6e2a69b8e9b4b40f0bfb8f87a71bce4f180cca1887 - languageName: node - linkType: hard - -"domutils@npm:^3.2.2": +"domutils@npm:^3.0.1, domutils@npm:^3.1.0, domutils@npm:^3.2.2": version: 3.2.2 resolution: "domutils@npm:3.2.2" dependencies: @@ -14168,14 +13622,7 @@ __metadata: languageName: node linkType: hard -"eventemitter3@npm:^5.0.1": - version: 5.0.1 - resolution: "eventemitter3@npm:5.0.1" - checksum: 10c0/4ba5c00c506e6c786b4d6262cfbce90ddc14c10d4667e5c83ae993c9de88aa856033994dd2b35b83e8dc1170e224e66a319fa80adc4c32adcd2379bbc75da814 - languageName: node - linkType: hard - -"eventemitter3@npm:^5.0.4": +"eventemitter3@npm:^5.0.1, eventemitter3@npm:^5.0.4": version: 5.0.4 resolution: "eventemitter3@npm:5.0.4" checksum: 10c0/575b8cac8d709e1473da46f8f15ef311b57ff7609445a7c71af5cd42598583eee6f098fa7a593e30f27e94b8865642baa0689e8fa97c016f742abdb3b1bf6d9a @@ -15059,18 +14506,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^13.0.0": - version: 13.0.0 - resolution: "glob@npm:13.0.0" - dependencies: - minimatch: "npm:^10.1.1" - minipass: "npm:^7.1.2" - path-scurry: "npm:^2.0.0" - checksum: 10c0/8e2f5821f3f7c312dd102e23a15b80c79e0837a9872784293ba2e15ec73b3f3749a49a42a31bfcb4e52c84820a474e92331c2eebf18819d20308f5c33876630a - languageName: node - linkType: hard - -"glob@npm:^13.0.1": +"glob@npm:^13.0.0, glob@npm:^13.0.1": version: 13.0.6 resolution: "glob@npm:13.0.6" dependencies: @@ -15756,14 +15192,7 @@ __metadata: languageName: node linkType: hard -"http-cache-semantics@npm:^4.1.1": - version: 4.1.1 - resolution: "http-cache-semantics@npm:4.1.1" - checksum: 10c0/ce1319b8a382eb3cbb4a37c19f6bfe14e5bb5be3d09079e885e8c513ab2d3cd9214902f8a31c9dc4e37022633ceabfc2d697405deeaf1b8f3552bb4ed996fdfc - languageName: node - linkType: hard - -"http-cache-semantics@npm:^4.2.0": +"http-cache-semantics@npm:^4.1.1, http-cache-semantics@npm:^4.2.0": version: 4.2.0 resolution: "http-cache-semantics@npm:4.2.0" checksum: 10c0/45b66a945cf13ec2d1f29432277201313babf4a01d9e52f44b31ca923434083afeca03f18417f599c9ab3d0e7b618ceb21257542338b57c54b710463b4a53e37 @@ -17202,18 +16631,7 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:^4.0.0, js-yaml@npm:^4.1.0": - version: 4.1.0 - resolution: "js-yaml@npm:4.1.0" - dependencies: - argparse: "npm:^2.0.1" - bin: - js-yaml: bin/js-yaml.js - checksum: 10c0/184a24b4eaacfce40ad9074c64fd42ac83cf74d8c8cd137718d456ced75051229e5061b8633c3366b8aada17945a7a356b337828c19da92b51ae62126575018f - languageName: node - linkType: hard - -"js-yaml@npm:^4.1.1, js-yaml@npm:^4.3.0": +"js-yaml@npm:^4.0.0, js-yaml@npm:^4.1.0, js-yaml@npm:^4.1.1, js-yaml@npm:^4.3.0": version: 4.3.2 resolution: "js-yaml@npm:4.3.2" dependencies: @@ -17814,14 +17232,7 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^11.0.0, lru-cache@npm:^11.1.0, lru-cache@npm:^11.2.1": - version: 11.2.4 - resolution: "lru-cache@npm:11.2.4" - checksum: 10c0/4a24f9b17537619f9144d7b8e42cd5a225efdfd7076ebe7b5e7dc02b860a818455201e67fbf000765233fe7e339d3c8229fc815e9b58ee6ede511e07608c19b2 - languageName: node - linkType: hard - -"lru-cache@npm:^11.0.1, lru-cache@npm:^11.2.7": +"lru-cache@npm:^11.0.0, lru-cache@npm:^11.0.1, lru-cache@npm:^11.1.0, lru-cache@npm:^11.2.1, lru-cache@npm:^11.2.7": version: 11.5.2 resolution: "lru-cache@npm:11.5.2" checksum: 10c0/ece1ad731f5b655e85d67047d04bfc13823dc77aa61c5454924a9869ba600a0104e39cc33d726021feef812bc347ca34a5608a5eb1972a5dd0870b7ecd42c3f2 @@ -17869,7 +17280,7 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.0, magic-string@npm:^0.30.17, magic-string@npm:^0.30.21, magic-string@npm:^0.30.5": +"magic-string@npm:^0.30.0, magic-string@npm:^0.30.17, magic-string@npm:^0.30.21, magic-string@npm:^0.30.3, magic-string@npm:^0.30.5": version: 0.30.21 resolution: "magic-string@npm:0.30.21" dependencies: @@ -17878,15 +17289,6 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.3": - version: 0.30.17 - resolution: "magic-string@npm:0.30.17" - dependencies: - "@jridgewell/sourcemap-codec": "npm:^1.5.0" - checksum: 10c0/16826e415d04b88378f200fe022b53e638e3838b9e496edda6c0e086d7753a44a6ed187adc72d19f3623810589bf139af1a315541cd6a26ae0771a0193eaf7b8 - languageName: node - linkType: hard - "magic-string@npm:^1.0.0": version: 1.4.1 resolution: "magic-string@npm:1.4.1" @@ -18927,7 +18329,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^10.1.1, minimatch@npm:^10.2.2": +"minimatch@npm:^10.2.2": version: 10.2.5 resolution: "minimatch@npm:10.2.5" dependencies: @@ -19048,14 +18450,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.0.4, minipass@npm:^7.1.2": - version: 7.1.2 - resolution: "minipass@npm:7.1.2" - checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557 - languageName: node - linkType: hard - -"minipass@npm:^7.1.3": +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.0.4, minipass@npm:^7.1.2, minipass@npm:^7.1.3": version: 7.1.3 resolution: "minipass@npm:7.1.3" checksum: 10c0/539da88daca16533211ea5a9ee98dc62ff5742f531f54640dd34429e621955e91cc280a91a776026264b7f9f6735947629f920944e9c1558369e8bf22eb33fbb @@ -19175,15 +18570,6 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.3.11": - version: 3.3.11 - resolution: "nanoid@npm:3.3.11" - bin: - nanoid: bin/nanoid.cjs - checksum: 10c0/40e7f70b3d15f725ca072dfc4f74e81fcf1fbb02e491cf58ac0c79093adc9b0a73b152bcde57df4b79cd097e13023d7504acb38404a4da7bc1cd8e887b82fe0b - languageName: node - linkType: hard - "nanoid@npm:^3.3.18": version: 3.3.18 resolution: "nanoid@npm:3.3.18" @@ -20271,16 +19657,6 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^2.0.0": - version: 2.0.1 - resolution: "path-scurry@npm:2.0.1" - dependencies: - lru-cache: "npm:^11.0.0" - minipass: "npm:^7.1.2" - checksum: 10c0/2a16ed0e81fbc43513e245aa5763354e25e787dab0d539581a6c3f0f967461a159ed6236b2559de23aa5b88e7dc32b469b6c47568833dd142a4b24b4f5cd2620 - languageName: node - linkType: hard - "path-scurry@npm:^2.0.2": version: 2.0.2 resolution: "path-scurry@npm:2.0.2" @@ -20347,14 +19723,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^4.0.2, picomatch@npm:^4.0.3": - version: 4.0.4 - resolution: "picomatch@npm:4.0.4" - checksum: 10c0/e2c6023372cc7b5764719a5ffb9da0f8e781212fa7ca4bd0562db929df8e117460f00dff3cb7509dacfc06b86de924b247f504d0ce1806a37fac4633081466b0 - languageName: node - linkType: hard - -"picomatch@npm:^4.0.4, picomatch@npm:^4.0.7": +"picomatch@npm:^4.0.2, picomatch@npm:^4.0.3, picomatch@npm:^4.0.4, picomatch@npm:^4.0.7": version: 4.0.7 resolution: "picomatch@npm:4.0.7" checksum: 10c0/beb6ae02c43ae44e84883b90830196d9046b1726ead292adcf7f57945e0bb0d992d68563d87e03b484b6f3c9a5c6defda7523477f047d7f0e663f126cc01787f @@ -20560,18 +19929,7 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.4.38": - version: 8.5.8 - resolution: "postcss@npm:8.5.8" - dependencies: - nanoid: "npm:^3.3.11" - picocolors: "npm:^1.1.1" - source-map-js: "npm:^1.2.1" - checksum: 10c0/dd918f7127ee7c60a0295bae2e72b3787892296e1d1c3c564d7a2a00c68d8df83cadc3178491259daa19ccc54804fb71ed8c937c6787e08d8bd4bedf8d17044c - languageName: node - linkType: hard - -"postcss@npm:^8.5.28, postcss@npm:^8.5.6": +"postcss@npm:^8.4.38, postcss@npm:^8.5.28, postcss@npm:^8.5.6": version: 8.5.28 resolution: "postcss@npm:8.5.28" dependencies: @@ -21992,7 +21350,7 @@ __metadata: languageName: node linkType: hard -"rolldown@npm:~1.2.6": +"rolldown@npm:~1.2.6, rolldown@npm:~1.2.7": version: 1.2.9 resolution: "rolldown@npm:1.2.9" dependencies: @@ -22050,64 +21408,6 @@ __metadata: languageName: node linkType: hard -"rolldown@npm:~1.2.7": - version: 1.2.8 - resolution: "rolldown@npm:1.2.8" - dependencies: - "@oxc-project/types": "npm:=0.149.0" - "@rolldown/binding-android-arm-eabi": "npm:1.2.8" - "@rolldown/binding-android-arm64": "npm:1.2.8" - "@rolldown/binding-darwin-arm64": "npm:1.2.8" - "@rolldown/binding-darwin-x64": "npm:1.2.8" - "@rolldown/binding-freebsd-x64": "npm:1.2.8" - "@rolldown/binding-linux-arm-gnueabihf": "npm:1.2.8" - "@rolldown/binding-linux-arm64-gnu": "npm:1.2.8" - "@rolldown/binding-linux-arm64-musl": "npm:1.2.8" - "@rolldown/binding-linux-ppc64-gnu": "npm:1.2.8" - "@rolldown/binding-linux-s390x-gnu": "npm:1.2.8" - "@rolldown/binding-linux-x64-gnu": "npm:1.2.8" - "@rolldown/binding-linux-x64-musl": "npm:1.2.8" - "@rolldown/binding-openharmony-arm64": "npm:1.2.8" - "@rolldown/binding-win32-arm64-msvc": "npm:1.2.8" - "@rolldown/binding-win32-x64-msvc": "npm:1.2.8" - "@rolldown/pluginutils": "npm:^1.0.0" - dependenciesMeta: - "@rolldown/binding-android-arm-eabi": - optional: true - "@rolldown/binding-android-arm64": - optional: true - "@rolldown/binding-darwin-arm64": - optional: true - "@rolldown/binding-darwin-x64": - optional: true - "@rolldown/binding-freebsd-x64": - optional: true - "@rolldown/binding-linux-arm-gnueabihf": - optional: true - "@rolldown/binding-linux-arm64-gnu": - optional: true - "@rolldown/binding-linux-arm64-musl": - optional: true - "@rolldown/binding-linux-ppc64-gnu": - optional: true - "@rolldown/binding-linux-s390x-gnu": - optional: true - "@rolldown/binding-linux-x64-gnu": - optional: true - "@rolldown/binding-linux-x64-musl": - optional: true - "@rolldown/binding-openharmony-arm64": - optional: true - "@rolldown/binding-win32-arm64-msvc": - optional: true - "@rolldown/binding-win32-x64-msvc": - optional: true - bin: - rolldown: ./bin/cli.mjs - checksum: 10c0/5a9c6b30a7ef0af257a963e6b0b95d5a60b23512b7dbcca617273bd63fb0892b88be6b33dc9a6cb66350f47d260eff6456af0b7afef34898767f3527ce0d967d - languageName: node - linkType: hard - "rollup-plugin-typescript2@npm:^0.36.0": version: 0.36.0 resolution: "rollup-plugin-typescript2@npm:0.36.0" @@ -22124,82 +21424,7 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.14.0": - version: 4.47.1 - resolution: "rollup@npm:4.47.1" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.47.1" - "@rollup/rollup-android-arm64": "npm:4.47.1" - "@rollup/rollup-darwin-arm64": "npm:4.47.1" - "@rollup/rollup-darwin-x64": "npm:4.47.1" - "@rollup/rollup-freebsd-arm64": "npm:4.47.1" - "@rollup/rollup-freebsd-x64": "npm:4.47.1" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.47.1" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.47.1" - "@rollup/rollup-linux-arm64-gnu": "npm:4.47.1" - "@rollup/rollup-linux-arm64-musl": "npm:4.47.1" - "@rollup/rollup-linux-loongarch64-gnu": "npm:4.47.1" - "@rollup/rollup-linux-ppc64-gnu": "npm:4.47.1" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.47.1" - "@rollup/rollup-linux-riscv64-musl": "npm:4.47.1" - "@rollup/rollup-linux-s390x-gnu": "npm:4.47.1" - "@rollup/rollup-linux-x64-gnu": "npm:4.47.1" - "@rollup/rollup-linux-x64-musl": "npm:4.47.1" - "@rollup/rollup-win32-arm64-msvc": "npm:4.47.1" - "@rollup/rollup-win32-ia32-msvc": "npm:4.47.1" - "@rollup/rollup-win32-x64-msvc": "npm:4.47.1" - "@types/estree": "npm:1.0.8" - fsevents: "npm:~2.3.2" - dependenciesMeta: - "@rollup/rollup-android-arm-eabi": - optional: true - "@rollup/rollup-android-arm64": - optional: true - "@rollup/rollup-darwin-arm64": - optional: true - "@rollup/rollup-darwin-x64": - optional: true - "@rollup/rollup-freebsd-arm64": - optional: true - "@rollup/rollup-freebsd-x64": - optional: true - "@rollup/rollup-linux-arm-gnueabihf": - optional: true - "@rollup/rollup-linux-arm-musleabihf": - optional: true - "@rollup/rollup-linux-arm64-gnu": - optional: true - "@rollup/rollup-linux-arm64-musl": - optional: true - "@rollup/rollup-linux-loongarch64-gnu": - optional: true - "@rollup/rollup-linux-ppc64-gnu": - optional: true - "@rollup/rollup-linux-riscv64-gnu": - optional: true - "@rollup/rollup-linux-riscv64-musl": - optional: true - "@rollup/rollup-linux-s390x-gnu": - optional: true - "@rollup/rollup-linux-x64-gnu": - optional: true - "@rollup/rollup-linux-x64-musl": - optional: true - "@rollup/rollup-win32-arm64-msvc": - optional: true - "@rollup/rollup-win32-ia32-msvc": - optional: true - "@rollup/rollup-win32-x64-msvc": - optional: true - fsevents: - optional: true - bin: - rollup: dist/bin/rollup - checksum: 10c0/4d792f8a8bfb4408485bbc6c1f393a88422230c14d06b9de4d27bcf443fe3569f9fa4ed6111972bf6b8b515bd0133bfeb16ab66cdf32494ef0fbd2da41dc2855 - languageName: node - linkType: hard - -"rollup@npm:^4.43.0": +"rollup@npm:^4.14.0, rollup@npm:^4.43.0": version: 4.63.1 resolution: "rollup@npm:4.63.1" dependencies: @@ -23985,31 +23210,14 @@ __metadata: languageName: node linkType: hard -"tinyexec@npm:^1.0.4": - version: 1.0.4 - resolution: "tinyexec@npm:1.0.4" - checksum: 10c0/d4a5bbcf6bdb23527a4b74c4aa566f41432167112fe76f420ec7e3a90a3ecfd3a7d944383e2719fc3987b69400f7b928daf08700d145fb527c2e80ec01e198bd - languageName: node - linkType: hard - -"tinyexec@npm:^1.3.0, tinyexec@npm:^1.3.1": +"tinyexec@npm:^1.0.4, tinyexec@npm:^1.3.0, tinyexec@npm:^1.3.1": version: 1.3.1 resolution: "tinyexec@npm:1.3.1" checksum: 10c0/c590369cb3fa73cc18a3998caec8a00f9712d91309c881be3ac52b160fb2f80c7b1fbf3591858ab6abab47ad55385b0c86ec19982e32441a01f55298dab9ccd2 languageName: node linkType: hard -"tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.15": - version: 0.2.15 - resolution: "tinyglobby@npm:0.2.15" - dependencies: - fdir: "npm:^6.5.0" - picomatch: "npm:^4.0.3" - checksum: 10c0/869c31490d0d88eedb8305d178d4c75e7463e820df5a9b9d388291daf93e8b1eb5de1dad1c1e139767e4269fe75f3b10d5009b2cc14db96ff98986920a186844 - languageName: node - linkType: hard - -"tinyglobby@npm:^0.2.13, tinyglobby@npm:^0.2.14, tinyglobby@npm:^0.2.17": +"tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.13, tinyglobby@npm:^0.2.14, tinyglobby@npm:^0.2.15, tinyglobby@npm:^0.2.17": version: 0.2.17 resolution: "tinyglobby@npm:0.2.17" dependencies: @@ -25804,22 +25012,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.18.0": - version: 8.18.3 - resolution: "ws@npm:8.18.3" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 10c0/eac918213de265ef7cb3d4ca348b891a51a520d839aa51cdb8ca93d4fa7ff9f6ccb339ccee89e4075324097f0a55157c89fa3f7147bde9d8d7e90335dc087b53 - languageName: node - linkType: hard - -"ws@npm:^8.18.2": +"ws@npm:^8.18.0, ws@npm:^8.18.2": version: 8.21.3 resolution: "ws@npm:8.21.3" peerDependencies: @@ -25906,16 +25099,7 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.0.0, yaml@npm:^2.6.0, yaml@npm:^2.8.2": - version: 2.9.0 - resolution: "yaml@npm:2.9.0" - bin: - yaml: bin.mjs - checksum: 10c0/f340718df45e97a9551b9bf9dac61c80050bc464513b710debfb5067c380c8472e3b67809cffacb4ab5ffb5e66ef9310816c88b05f371cec60abfedd8c88e0a2 - languageName: node - linkType: hard - -"yaml@npm:^2.9.0": +"yaml@npm:^2.0.0, yaml@npm:^2.6.0, yaml@npm:^2.8.2, yaml@npm:^2.9.0": version: 2.9.1 resolution: "yaml@npm:2.9.1" bin: @@ -25924,13 +25108,20 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:21.1.1, yargs-parser@npm:>=21.1.1, yargs-parser@npm:^21.1.1": +"yargs-parser@npm:21.1.1, yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" checksum: 10c0/f84b5e48169479d2f402239c59f084cfd1c3acc197a05c59b98bab067452e6b3ea46d4dd8ba2985ba7b3d32a343d77df0debd6b343e5dae3da2aab2cdf5886b2 languageName: node linkType: hard +"yargs-parser@npm:>=21.1.1, yargs-parser@npm:^22.0.0": + version: 22.0.0 + resolution: "yargs-parser@npm:22.0.0" + checksum: 10c0/cb7ef81759c4271cb1d96b9351dbbc9a9ce35d3e1122d2b739bf6c432603824fa02c67cc12dcef6ea80283379d63495686e8f41cc7b06c6576e792aba4d33e1c + languageName: node + linkType: hard + "yargs-parser@npm:^20.2.2, yargs-parser@npm:^20.2.9": version: 20.2.9 resolution: "yargs-parser@npm:20.2.9" @@ -25938,13 +25129,6 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^22.0.0": - version: 22.0.0 - resolution: "yargs-parser@npm:22.0.0" - checksum: 10c0/cb7ef81759c4271cb1d96b9351dbbc9a9ce35d3e1122d2b739bf6c432603824fa02c67cc12dcef6ea80283379d63495686e8f41cc7b06c6576e792aba4d33e1c - languageName: node - linkType: hard - "yargs@npm:^16.0.0": version: 16.2.2 resolution: "yargs@npm:16.2.2" From 9b21a6f6db6d5c6a275a7f106cb81dddff7d3ce6 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Mon, 5 Oct 2026 10:54:44 -0400 Subject: [PATCH 29/47] change set --- .changeset/nice-peaches-hear.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .changeset/nice-peaches-hear.md diff --git a/.changeset/nice-peaches-hear.md b/.changeset/nice-peaches-hear.md new file mode 100644 index 0000000000..2bdfb62ff3 --- /dev/null +++ b/.changeset/nice-peaches-hear.md @@ -0,0 +1,12 @@ +--- +'@skillsoft/eslint-plugin-gamut': patch +'@skillsoft/gamut': patch +'@skillsoft/gamut-icons': patch +'@skillsoft/gamut-illustrations': patch +'@skillsoft/gamut-patterns': patch +'@skillsoft/gamut-styles': patch +'@skillsoft/gamut-tests': patch +'@skillsoft/variance': patch +--- + +Swap Emotion's transform to swc/plugin and explicit type exporting From c4ba27a35bff176e24adc2f04263075d02257bf0 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 8 Oct 2026 09:03:34 -0400 Subject: [PATCH 30/47] add to readme --- .changeset/gamut-scope-swap-skill.md | 6 + packages/gamut-agent-tools/README.md | 6 + .../gamut-scope-swap/BREAKING_CHANGES.md | 28 +++++ .../skills/gamut-scope-swap/SKILL.md | 103 ++++++++++++++++++ packages/gamut-codemods/README.md | 14 +++ 5 files changed, 157 insertions(+) create mode 100644 .changeset/gamut-scope-swap-skill.md create mode 100644 packages/gamut-agent-tools/skills/gamut-scope-swap/BREAKING_CHANGES.md create mode 100644 packages/gamut-agent-tools/skills/gamut-scope-swap/SKILL.md diff --git a/.changeset/gamut-scope-swap-skill.md b/.changeset/gamut-scope-swap-skill.md new file mode 100644 index 0000000000..6b3f020472 --- /dev/null +++ b/.changeset/gamut-scope-swap-skill.md @@ -0,0 +1,6 @@ +--- +'@skillsoft/gamut-agent-tools': minor +'@skillsoft/gamut-codemods': patch +--- + +Add the `gamut-scope-swap` agent skill. It helps with the `@codecademy/gamut*` to `@skillsoft/gamut*` move alongside the `scope-swap` codemod: it reads the warnings and leftovers, and fixes what the codemod can't rewrite. The codemod README now points to it. diff --git a/packages/gamut-agent-tools/README.md b/packages/gamut-agent-tools/README.md index 3071fb9c49..fe17ea9ce2 100644 --- a/packages/gamut-agent-tools/README.md +++ b/packages/gamut-agent-tools/README.md @@ -31,6 +31,12 @@ The first time you run `gamut plugin install` or `update`, it installs `@skillso Before large PRs, or when onboarding an existing codebase, run the `gamut-review` skill to audit for Gamut usage — dependencies, setup, import patterns, `styled()` wrapping that bypasses system props, hardcoded colors, bespoke component duplication, and test conventions. +### Moving from `@codecademy/gamut` + +If your app still depends on `@codecademy/gamut*`, the `gamut-scope-swap` skill helps with the move to `@skillsoft/gamut*`. It works alongside the [`@skillsoft/gamut-codemods`](../gamut-codemods/README.md) `scope-swap` preset. The codemod does the mechanical rewrite. The skill reads what it reports, including warnings, leftovers, and next steps, and helps with the parts it can't rewrite: deep imports, `Video`, renamed Menu exports, tsconfig `dom`, jest mocks, ESLint plugin keys, Module Federation config, and preview builds. It doesn't run the codemod unless you ask it to. + +Install the plugin after the swap. The `gamut` CLI comes from `@skillsoft/gamut`, so that package has to be in the app first. + ## The CLI lives here, not in `@skillsoft/gamut` `@skillsoft/gamut`'s `bin/gamut.mjs` is a thin bootstrap shim: it only knows how to check whether `@skillsoft/gamut-agent-tools` is installed, auto-install it if not (for `install`/`update`), and print help. Once that's resolved, it dynamically imports the actual `install`/`update`/`list`/`remove` command bodies from `cli/commands/plugin/` in *this* package and hands off execution to them. diff --git a/packages/gamut-agent-tools/skills/gamut-scope-swap/BREAKING_CHANGES.md b/packages/gamut-agent-tools/skills/gamut-scope-swap/BREAKING_CHANGES.md new file mode 100644 index 0000000000..755b49434e --- /dev/null +++ b/packages/gamut-agent-tools/skills/gamut-scope-swap/BREAKING_CHANGES.md @@ -0,0 +1,28 @@ +# Breaking changes: `@codecademy/gamut*` → `@skillsoft/gamut*` + +Short list of what changed. The codemod handles most of these. Entries marked **manual** need a person. Source: `packages/gamut-codemods/src/presets/scope-swap/manifest.ts`. + +## Packages + +- Every `@codecademy/*` Gamut package is now `@skillsoft/*`: `gamut`, `gamut-styles`, `gamut-icons`, `gamut-illustrations`, `gamut-patterns`, `gamut-tests`, and `variance`. +- `eslint-plugin-gamut` is now `@skillsoft/eslint-plugin-gamut`. +- `@codecademy/gamut-kit` is removed, with no replacement. Depend on the individual packages it bundled. + +## Imports + +- `Video` and `VideoProps` moved off the root. Import them from `@skillsoft/gamut/Video`. **Manual** for namespace imports and `export *`. +- Menu's `List`, `ListProps`, `ListItem`, `ListItemProps`, `ListLink`, `ListLinkProps`, and `ListButton` are renamed `MenuList*` and `MenuListButton`. The codemod keeps local names with an alias, e.g. `MenuList as List`. +- SelectDropdown's `IconOption` is renamed `IconOptionComponent`. +- `ButtonBase` is not public. Use `FillButton`, `StrokeButton`, `TextButton`, `IconButton`, or `CTAButton`. **Manual.** +- From `Form/styles`, only `formFieldStyles`, `formFieldPaddingStyles`, and `conditionalStyles` are public. Anything else there is internal. **Manual.** +- Deep `/dist/` imports for these are promoted to the package root: form and select types, `Box`, `Tip`, `Button`, `Markdown` overrides, `AssetProvider`, the icon `types` and `props`, and the variance config types. Any `dist` path not on that list is unmapped. **Manual.** + +## Runtime + +- Gamut is now a real singleton. Module Federation host and remotes must share the same version, so update each remote's `shared` config and deploy them together. **Manual.** + +## Build and tooling + +- `Video` used to bring DOM types in through the root import. Add `"dom"` to a tsconfig's `lib` if type-checking fails after the move. **Manual.** +- ESLint rule prefix `gamut/` becomes `@skillsoft/gamut/` in directives and legacy configs. Rule names don't change. Flat configs need the plugin registered under the matching key. **Manual** for flat configs. +- Jest mocks of the root package that stub `Video` should mock `@skillsoft/gamut/Video`. **Manual.** diff --git a/packages/gamut-agent-tools/skills/gamut-scope-swap/SKILL.md b/packages/gamut-agent-tools/skills/gamut-scope-swap/SKILL.md new file mode 100644 index 0000000000..b9df7989e7 --- /dev/null +++ b/packages/gamut-agent-tools/skills/gamut-scope-swap/SKILL.md @@ -0,0 +1,103 @@ +--- +name: gamut-scope-swap +description: Use this skill when moving an app from @codecademy/gamut* packages to @skillsoft/gamut* — running or re-running the scope-swap codemod (@skillsoft/gamut-codemods), triaging its warnings and leftovers, and fixing what it can't rewrite, such as deep imports, Video, renamed Menu exports, tsconfig dom, jest mocks, ESLint plugin keys, Module Federation shared config, the removed gamut-kit, and preview builds. Not for day-to-day Gamut usage after the move (see gamut-review) or for building new UI. +--- + +# Gamut Scope Swap + +Help an app move from `@codecademy/gamut*` to `@skillsoft/gamut*`. The codemod does the mechanical rewrite. This skill covers what the codemod reports, what it leaves for a person, and how to check the result. + +For a short overview of every breaking change, read [BREAKING_CHANGES.md](BREAKING_CHANGES.md). Load it only when you need the full list. The sections below cover triage. + +Sources of truth, in order: + +1. The codemod's README in `@skillsoft/gamut-codemods`, and `npx @skillsoft/gamut-codemods list` for the migrations in each preset. +2. The installed `@skillsoft/gamut` type declarations in `node_modules`. Before you suggest an import, confirm the symbol is actually exported there. Don't invent replacements. +3. The rest of the Gamut skills in this plugin, for choosing a replacement component or style API. + +## Workflow + +1. **Check the starting state.** Run `git status`. The codemod refuses to write into uncommitted changes unless it gets `--force`. If the tree is dirty, ask the user to commit or stash first. Don't add `--force` on your own. +2. **Preview.** Run `npx @skillsoft/gamut-codemods scope-swap . --dry`. It prints every file it would change and its warnings, and writes nothing. Run this before a real run. +3. **Run it,** once the user confirms: `npx @skillsoft/gamut-codemods scope-swap .`. Options: + - `--only=deep-imports,scope-rename` runs a subset of migrations. + - `--no-report` skips the leftovers report. + - To undo a run, `git checkout .`. That only restores the original state if the tree was clean before the run. +4. **Triage the output in this order.** Warnings first, because some change runtime behavior. Then leftovers. Then next steps. +5. **Verify.** Reinstall with `yarn`, run the formatter, then type-check, lint, test, and build. If the app uses Module Federation, test the host and its remotes together. + +If the codemod has already run, ask the user to paste the warnings and the leftovers list. If they can't, find the old names yourself. Exclude lockfiles and build output: + +```sh +grep -rn "@codecademy/gamut" --exclude-dir=node_modules --exclude-dir=dist --exclude=yarn.lock . +``` + +## Warnings + +Each warning starts with `[migration-name] file:line`. The migration name tells you what to check. + +| Migration | Warning starts with | What to do | +| --------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `deep-imports` | `unmapped deep import '…'` | The codemod has no mapping for this path. Find the symbol in the installed `@skillsoft/gamut` types. If it's exported from the root, import it from there. If it isn't public, don't deep-import the `dist` path. Ask the Gamut team. | +| `deep-imports` | `… has no public replacement` | `ButtonBase` is deliberately private. Use `FillButton`, `StrokeButton`, `TextButton`, `IconButton`, or `CTAButton`. See the `gamut-buttons` skill for which one. | +| `deep-imports` | `… is only partly public` | Only some names from this path are public. Inline the styles, or use system props or `css()`. See `gamut-style-utilities` and `gamut-system-props`. | +| `deep-imports` | `deep import … in a mock or require() needs a manual rewrite` | Rewrite the mock or `require()` path by hand. | +| `deep-imports` | `rewrote … in a mock or require(). That now covers the whole package` | `jest.mock` of a deep path now mocks the whole package. Check the test still mocks what it needs. If the rename list applies, update renamed names too. | +| `moved-exports` | `namespace import uses …` | `import * as Gamut` can't be rewritten safely. Replace it with named imports. `Video` and `VideoProps` come from `@skillsoft/gamut/Video`. | +| `moved-exports` | `'export *' from … no longer re-exports …` | Add an explicit re-export from `@skillsoft/gamut/Video` if other code depends on it. | +| `moved-exports` | `mock of … stubs Video/VideoProps` | Mock `@skillsoft/gamut/Video` instead of the root package. | +| `scope-rename` | `'@codecademy/gamut-kit' has no replacement package` | `gamut-kit` is removed, with no `@skillsoft` replacement. Depend on the individual packages it bundled. | +| `scope-rename` | `renamed N package-name string(s) outside imports. Check the diff.` | Review those lines in the diff. They're usually config or log strings, and a few may not be package names at all. | +| `package-json` | `…: replaced '@codecademy/gamut-kit' with its individual packages` | The individual packages are written at the release range (`^`), not at the kit's old version. They all land in the field `gamut-kit` was in, so `@skillsoft/gamut-tests` may end up in `dependencies`. Move it to `devDependencies` if it belongs there. | +| `mf-shared` | `replaced … in Module Federation shared config` | This is a runtime change. Gamut is now actually shared as a singleton, so host and remotes must agree. Update each remote's shared config to match and deploy them together. | +| `tsconfig-dom` | `"lib" has no "dom"` | The root import used to bring in DOM types through `Video`. Add `"dom"` to that tsconfig's `lib` only if type-checking now fails on `document`, `HTMLElement`, `ResizeObserver`, and similar. | + +## Leftovers + +The leftovers list shows every line that still names an old package. The codemod doesn't rewrite these, and the regex can produce false positives. Go through them one by one: + +- **Jest `moduleNameMapper` regexes and tsconfig `paths`.** Update them to the `@skillsoft/*` names. A stale mapper makes tests fail to resolve modules. +- **Flat ESLint configs (`eslint.config.*`) and `.eslintrc.js`.** The codemod doesn't rewrite these. Legacy `.eslintrc` and `.eslintrc.json` files are rewritten, and `eslint-comments` rewrites disable directives. Keep the plugin key consistent with the directives, or ESLint reports rules it can't find: + - Directives become `// eslint-disable-next-line @skillsoft/gamut/`. In a flat config, register the plugin under the key `@skillsoft/gamut`. Rule names don't change. + - In a legacy config, use `plugin:@skillsoft/gamut/...` and `"@skillsoft/gamut/"`. `eslint-config` rewrites these for you. + - If the plugin is registered under another key, rename either the key or the directives, but not just one of them. +- **Storybook config, docs, and comments.** Update them or leave them, but know they still say the old name. +- **Code samples in `.mdx`.** Fenced code blocks are left alone on purpose. Update them by hand if they matter. +- **Files the parser skipped.** Every file is parsed as `tsx`, so Flow-typed JavaScript is skipped. Fix any old names left in those files by hand. + +Don't edit `yarn.lock` by hand. Reinstalling updates it. + +## Next steps + +After the migrations finish: + +1. Reinstall with `yarn`. +2. Run the formatter (`prettier --write` or `eslint --fix`). Split imports from `moved-exports` come out in a different style until you do. +3. Type-check, run tests, and build. +4. If the app uses Module Federation, run the host and every remote together. +5. If the app depends on preview builds, pin them with `resolutions`. The codemod README has the exact JSON. Published releases don't need it. + +## Common failures + +| Symptom | Likely cause | Fix | +| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | +| `Module '"@skillsoft/gamut"' has no exported member 'Video'` | `Video` was imported from the root | Import from `@skillsoft/gamut/Video`. | +| `Cannot find name 'document'`, `HTMLElement`, or `ResizeObserver` | The affected tsconfig's `lib` has no `"dom"` | Add `"dom"` to that tsconfig's `compilerOptions.lib`. | +| Components render unstyled, or theme values don't apply | Two copies of `@skillsoft/gamut-styles` or `@skillsoft/variance` are installed | Run `yarn why @skillsoft/gamut-styles`. Make every `@skillsoft/*` package resolve to one version. Pin previews with `resolutions`. | +| `MenuList`, `MenuListItem`, or `IconOptionComponent` is not exported | Menu's `List*` and SelectDropdown's `IconOption` were renamed on the way to the root | Import the new name. Keep the local alias if the code relies on it, e.g. `import { MenuList as List }`. | +| Jest can't resolve `@skillsoft/...` modules, or a mock doesn't apply | A stale `moduleNameMapper` regex, or a mock still points at the root package | Update the mapper. Mock `@skillsoft/gamut/Video` for `Video`. | +| `Cannot find module '@codecademy/gamut/dist/...'` after the run | The file was skipped by the parser, or the path is in a code sample | Rewrite the import by hand, following the rules above. | +| ESLint: `Definition for rule '…' was not found`, or a disable comment does nothing | The plugin key doesn't match the rewritten directives | Make the plugin key match the directive prefix (see Leftovers). | +| Remotes load a second copy of Gamut at runtime | Module Federation `shared` still lists old names on a remote | Update that remote's `shared` config and deploy it with the host. | + +## What not to do + +- Don't re-add `@codecademy/gamut-kit`, and don't create `@skillsoft/gamut-kit`.`@codecademy/gamut-kit` is deprecated and `@skillsoft/gamut-kit` never existed. Depend on the individual packages it bundled. +- Don't fix a warning by deep-importing a `dist` path. Find a public export, or ask the Gamut team. +- Don't silence a warning or leftover by removing the `@skillsoft` entry it points at. +- Don't bump any `@skillsoft/*` package outside the group's shared version. The packages move together. +- Don't run the codemod on a dirty tree, and don't pass `--force` to get past the check. + +## Reporting back + +Say what the codemod changed, which warnings and leftovers are still open, which ones you fixed, and what the user should verify by hand. If you haven't seen the codemod output, ask for it before you start guessing at fixes. diff --git a/packages/gamut-codemods/README.md b/packages/gamut-codemods/README.md index 3372a62581..2510596e27 100644 --- a/packages/gamut-codemods/README.md +++ b/packages/gamut-codemods/README.md @@ -33,6 +33,20 @@ A run ends with three things: 2. **Leftovers**: every line that still names an old package. These are for you to fix: jest `moduleNameMapper` regexes, tsconfig `paths`, flat ESLint configs, comments, and docs. 3. **Next steps**, built from what actually happened in the run. +### Getting help from an AI agent + +The `gamut-scope-swap` skill, in [`@skillsoft/gamut-agent-tools`](../gamut-agent-tools/README.md), knows what this codemod does and what it leaves behind. It can go through the warnings and leftovers with you and help fix what the codemod can't rewrite. Install it from the app repo once `@skillsoft/gamut` is in place: + +```sh +# Cursor +gamut plugin install cursor + +# Claude Code +gamut plugin install claude +``` + +Then ask the agent to work through the output. Paste the warnings and leftovers, or let it grep for old names. The skill won't run the codemod unless you ask it to. + ### Trying it against a preview build Every skillsoft-gamut pull request publishes installable previews through pkg.pr.new. To test a migration against one: From cdc14a8653bdbb44ab538ebda5bff7c9119c77c1 Mon Sep 17 00:00:00 2001 From: dreamwasp Date: Thu, 8 Oct 2026 14:40:15 -0400 Subject: [PATCH 31/47] leftovers + video --- .../gamut-codemods/src/__tests__/lib.test.ts | 28 +++++++++++++++++++ packages/gamut-codemods/src/lib/leftovers.ts | 14 ++++++---- .../components/media-and-assets/video.mdx | 6 ++++ 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/packages/gamut-codemods/src/__tests__/lib.test.ts b/packages/gamut-codemods/src/__tests__/lib.test.ts index 81de758d10..decf7e3240 100644 --- a/packages/gamut-codemods/src/__tests__/lib.test.ts +++ b/packages/gamut-codemods/src/__tests__/lib.test.ts @@ -78,4 +78,32 @@ describe('findLeftovers', () => { ); expect(findLeftovers([dir], manifest).map((h) => h.line)).toEqual([1, 4]); }); + + it('tags every old package the manifest replaces, including gamut-kit', () => { + const dir = tmp(); + const old = [ + ...Object.keys(manifest.packages), + ...Object.keys(manifest.removedPackages), + ]; + fs.writeFileSync( + path.join(dir, 'README.md'), + old.map((name) => `import x from '${name}/dist/x';`).join('\n') + ); + expect(findLeftovers([dir], manifest).map((h) => h.line)).toEqual( + old.map((_, i) => i + 1) + ); + }); + + it('flags /dist paths into published packages only', () => { + const dir = tmp(); + fs.writeFileSync( + path.join(dir, 'README.md'), + [ + "import { X } from '@codecademy/gamut-styles/dist/AssetProvider';", + "import { Y } from '@codecademy/gamut-foo/dist/bar';", + "import { Z } from '@skillsoft/gamut-styles/dist/bar';", + ].join('\n') + ); + expect(findLeftovers([dir], manifest).map((h) => h.line)).toEqual([1]); + }); }); diff --git a/packages/gamut-codemods/src/lib/leftovers.ts b/packages/gamut-codemods/src/lib/leftovers.ts index 9ddf45e9a0..4a26092f4f 100644 --- a/packages/gamut-codemods/src/lib/leftovers.ts +++ b/packages/gamut-codemods/src/lib/leftovers.ts @@ -30,19 +30,23 @@ const escape = (s: string) => s.replace(/[.*+?^${}()|[\]\\/]/g, '\\$&'); Old names, not already followed by a longer package name, and not the tail of a new one (`@skillsoft/eslint-plugin-gamut` contains `eslint-plugin-gamut`). + + A `/dist` path into one of the packages this repo publishes also counts, + even outside files the parser reads (docs, JSON, Flow). Only the packages + in manifest.packages are checked. Removed and unrelated `@codecademy` + packages aren't ours to rewrite. */ const oldNamesPattern = (manifest: Manifest) => { - const names = [ - ...Object.keys(manifest.packages), - ...Object.keys(manifest.removedPackages), - ] + const published = Object.keys(manifest.packages); + const names = [...published, ...Object.keys(manifest.removedPackages)] .sort((a, b) => b.length - a.length) .map(escape); + const dist = published.map(escape).join('|'); const prefix = escape(manifest.eslintPlugin.from); return new RegExp( `(?` and YouTube/Vimeo `