chore(ailab): mechanical migration of @code-dot-org/ml-playground into the monorepo#72976
Conversation
…elector-refactor Refactor to leverage selectors
…urriculum-datasets Curriculum datasets
…olumn-inspector-refactor ColumnInspector refactor
…hape-datasets Shape datasets
* Localizes values. * Adds localization to the model card column values for label/features. * Adds simple unit tests for the getLocalized* functions.
* Bumps version to 0.0.48. * Fixes prettier issues, fixes export issues.
* Bumps version to 0.0.48. * Fixes prettier issues, fixes export issues.
* Fixes issues with redux. We need to make this package's redux the same version as the apps main. We also need to make sure we don't update state inside a reducer and instead queue a microtask. Otherwise the app crashes when selecting datasets. * Removes optimistic use of state.
* Fixes dev mode asset path. * Fixes chart labels.
🖼️ Storybook Visual Comparison Report✅ No Storybook eyes differences detected! |
stephenliang
left a comment
There was a problem hiding this comment.
Full-history preservation pulled in some large historical-only dataset blobs (notably public/datasets/food.csv ~50 MB, since deleted upstream — not in the current tree). Decide whether to accept the one-time history bloat (as #72539 did) or strip large historical blobs before merge.
I think it would be a good idea to do a one-time strip of this histrocial blob and do a history rewrite to avoid adding more size to the repo. What do you think?
Yeah, that's fine with me - doesn't seem like it's crucial for history. |
93f5066 to
d807359
Compare
Updated to strip large blobs! |
…o the monorepo Inlines the standalone @code-dot-org/ml-playground npm package into frontend/packages/labs/ailab/ with its full git history (merge commit brings 1385 commits + tags v0.0.9/v0.0.10/v1.0.1). Mechanical only — no toolchain swap, no src changes, no consumer rewiring (apps/ still pulls the npm-published @code-dot-org/ml-playground). - package.json: rename to @code-dot-org/ailab, private: true, re-point homepage/repository.directory to the monorepo path, drop npm-publish lifecycle scripts (preversion/version/postversion) + files. - Drop build/dev/start and typecheck scripts so the un-modernized package does not participate in the turbo pipeline yet (webpack build + a TS6 papaparse-typings typecheck error are deferred to the Vite/TS follow-up). lint, prettier, and the jest test suite (108 tests) pass and stay wired. - Remove standalone-repo cruft: .github/, LICENSE, .nvmrc, standalone yarn.lock (the workspace yarn.lock manages deps now). - Convert all public/ binary assets (44 jpg, 5 png) to Git LFS per the repo .gitattributes policy, matching frontend/packages/labs/oceans. The imported history was rewritten during the filter-repo pass to (a) strip large historical-only dataset blobs (>5 MiB, e.g. food.csv ~50 MB, deleted upstream; current tree unaffected, largest remaining blob ~5 MB) and (b) rewrite PR references in commit messages from bare #NNN to the cross-repo form code-dot-org/ml-playground#NNN, so they link to the original repo's PRs instead of unrelated code-dot-org PRs of the same number. Follow-ups: Vite + TypeScript + Vitest toolchain swap (restores a green typecheck + build); rewire apps/ to consume the workspace package. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
yarn install after adding @code-dot-org/ailab to packages/labs/*. Package is registered but unused (no consumer points at it yet). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d807359 to
cd987ce
Compare
|
Updated PR numbers in commit history to point back at ml-playground to preserve linking. |
Follow-up #1 to the mechanical migration (#72976). Replace the package's webpack + babel + jest toolchain with the monorepo-standard vite + vitest + tsc setup, restoring a green build/typecheck and wiring the package into the turbo pipeline. No consumer rewiring: apps/ still pulls npm @code-dot-org/ml-playground, so nothing in the studio build changes yet. Build: a vite library build emits dist/index.{mjs,cjs,d.ts}. peerDependencies (react, react-dom, redux, react-redux) are externalized so the consumer's single instances are used; everything else is bundled. The five UI images are inlined as data-URIs (no runtime path), and the 132 dataset files are emitted to dist/assets/datasets/ for the host to serve. A dev-only middleware serves them at /datasets/ for the standalone harness (index.html moved to the package root as the vite entry). Deleted the webpack __webpack_public_path__ machinery (setPublicPath.ts): with images inlined, setAssetPath now governs only the runtime dataset URLs. Tests: jest -> vitest, 108 passing. Lint/prettier adopt the shared flat eslint + prettier config; the .test.js suite gets vitest globals. The migrated source predates some shared-config strictness. Relaxed in this package with a documented, tracked cleanup follow-up: tsconfig verbatimModuleSyntax + noUnusedLocals/Parameters off; eslint import-x/no-cycle, no-unused-vars, no-explicit-any, and two react/papaparse CJS-interop false-positives off. The one genuine type error (a papaparse parse() overload) is fixed properly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(ailab): migrate to vite + vitest + typescript toolchain Follow-up #1 to the mechanical migration (#72976). Replace the package's webpack + babel + jest toolchain with the monorepo-standard vite + vitest + tsc setup, restoring a green build/typecheck and wiring the package into the turbo pipeline. No consumer rewiring: apps/ still pulls npm @code-dot-org/ml-playground, so nothing in the studio build changes yet. Build: a vite library build emits dist/index.{mjs,cjs,d.ts}. peerDependencies (react, react-dom, redux, react-redux) are externalized so the consumer's single instances are used; everything else is bundled. The five UI images are inlined as data-URIs (no runtime path), and the 132 dataset files are emitted to dist/assets/datasets/ for the host to serve. A dev-only middleware serves them at /datasets/ for the standalone harness (index.html moved to the package root as the vite entry). Deleted the webpack __webpack_public_path__ machinery (setPublicPath.ts): with images inlined, setAssetPath now governs only the runtime dataset URLs. Tests: jest -> vitest, 108 passing. Lint/prettier adopt the shared flat eslint + prettier config; the .test.js suite gets vitest globals. The migrated source predates some shared-config strictness. Relaxed in this package with a documented, tracked cleanup follow-up: tsconfig verbatimModuleSyntax + noUnusedLocals/Parameters off; eslint import-x/no-cycle, no-unused-vars, no-explicit-any, and two react/papaparse CJS-interop false-positives off. The one genuine type error (a papaparse parse() overload) is fixed properly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore(ailab): address review feedback From Stephen's review on the vite/vitest toolchain PR: - Emit the 5 UI images to dist/assets/images/ and resolve them off setAssetPath at runtime (new imageUrl helper) instead of inlining. Library mode always inlines imported assets as base-64, which put ~626 KB into the entry and lost separate caching; index.mjs drops 1430 KB -> 805 KB. Images now travel like the datasets (oceans pattern): emitted under dist/assets/, copied by the Gruntfile, fetched under the setAssetPath base. - tsconfig.app.json: include the two JSON files imported from outside src (public/datasets-manifest.json, i18n/mlPlayground.json) so vite-plugin-dts stops logging TS6307 (the build exited 0 but the dts step was unhappy). - dev asset middleware: decode + resolve + confirm the path stays under public/ before serving via /@fs (closes a dev-only ../ traversal); generalized to serve /images/ alongside /datasets/. - rename the standalone dev entry indexDev.tsx -> main.tsx for consistency with oceans; drop the now-dead @public alias and trim a stale lodash mention. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Why
@code-dot-org/ml-playground(the AI Lab / ML Playground curriculum lab) is published from a separate repo on a standalone Webpack + Babel + Jest toolchain, requiring a manual npm-publish loop and invisible to this repo's CI / lint / typecheck.This PR is the mechanical migration only, following the paradigm of #72539 (oceans-lab). It inlines the upstream package into
frontend/packages/labs/ailab/with its full git history. No code modernization, no toolchain swap, no consumer rewiring.What this PR contains
History preservation
Brought over via
git filter-repo --strip-blobs-bigger-than 5M --to-subdirectory-filter frontend/packages/labs/ailab --message-callback …+git merge --allow-unrelated-histories.git log -- frontend/packages/labs/ailab/shows ~1231 commits that touched files now under the package;git log --follow -- frontend/packages/labs/ailab/i18n/mlPlayground.jsontraces back to the original authors. Tagsv0.0.9,v0.0.10,v1.0.1repoint into this history.Two history rewrites done in the filter-repo pass
public/datasets/food.csv(~50 MB, deleted upstream long ago). The current tree is byte-for-byte unaffected; the largest blob anywhere in the imported history is now ~5 MB.#NNNto this repo, so 295 imported commits (283Merge pull request #NNN from …+ 12Title (#NNN)) would have linked to unrelated code-dot-org PRs. They were rewritten tocode-dot-org/ml-playground#NNN, which links to the original repo's PRs. (Requires theml-playgroundrepo to stay accessible.)Mechanical-move commit
package.json#namerenamed@code-dot-org/ml-playground→@code-dot-org/ailab;private: true;homepage+repository.directoryre-pointed at the monorepo path.preversion/version/postversion) +files.build/dev/startandtypecheckscripts so the un-modernized package does not participate in the turbo pipeline yet (the webpack build and a TS6papaparse-typingstypecheckerror are deferred to the Vite/TS follow-up).lint,prettier, and the jest suite (108 tests) pass and stay wired..github/,LICENSE,.nvmrc, standaloneyarn.lock(the workspacefrontend/yarn.lockmanages deps now).public/binary assets (44 jpg, 5 png) to Git LFS per the repo.gitattributespolicy, matchingfrontend/packages/labs/oceans.What this PR does NOT do
webpack.config.js,babel.config.json, Jest config.package.jsonmetadata.apps/still pulls@code-dot-org/ml-playground@0.0.51from npm; the new workspace package is@code-dot-org/ailab(different name → no resolution collision) and is currently unused.Risk
Near zero — the package is workspace-registered but no consumer points at it.
Test plan
build/typecheckwired into turbo).git log -- frontend/packages/labs/ailab/shows the ml-playground lineage;--followoni18n/mlPlayground.jsonresolves to original authors.code-dot-org/ml-playground, not code-dot-org.yarn workspace @code-dot-org/ailab test→ 108 passed;prettierclean.apps/still consumes npm@code-dot-org/ml-playground@0.0.51(no/s/regressions).Follow-ups
typecheck+build; register as a lazy-loaded studio lab).apps/to consume the workspace package instead of the npm release.🤖 Generated with Claude Code