Skip to content

chore(ailab): mechanical migration of @code-dot-org/ml-playground into the monorepo#72976

Merged
sanchitmalhotra126 merged 1388 commits into
stagingfrom
ailab-migration
Jun 3, 2026
Merged

chore(ailab): mechanical migration of @code-dot-org/ml-playground into the monorepo#72976
sanchitmalhotra126 merged 1388 commits into
stagingfrom
ailab-migration

Conversation

@sanchitmalhotra126

@sanchitmalhotra126 sanchitmalhotra126 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

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

chore(ailab): register package in frontend workspace lockfile
chore(ailab): mechanical migration of @code-dot-org/ml-playground into the monorepo
Merge remote-tracking branch 'ailab-src/main'   ← 1385 commits of ml-playground history
(origin/staging — merge-base)

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.json traces back to the original authors. Tags v0.0.9, v0.0.10, v1.0.1 repoint into this history.

Two history rewrites done in the filter-repo pass

  1. Large historical-only blobs stripped (>5 MiB). Notably 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.
  2. PR references rewritten to cross-repo form. GitHub autolinks #NNN to this repo, so 295 imported commits (283 Merge pull request #NNN from … + 12 Title (#NNN)) would have linked to unrelated code-dot-org PRs. They were rewritten to code-dot-org/ml-playground#NNN, which links to the original repo's PRs. (Requires the ml-playground repo to stay accessible.)

Mechanical-move commit

  • package.json#name renamed @code-dot-org/ml-playground@code-dot-org/ailab; private: true; homepage + repository.directory re-pointed at the monorepo path.
  • Dropped npm-publish lifecycle scripts (preversion/version/postversion) + files.
  • Dropped build/dev/start and typecheck scripts so the un-modernized package does not participate in the turbo pipeline yet (the webpack build and a TS6 papaparse-typings typecheck error are deferred to the Vite/TS follow-up). lint, prettier, and the jest suite (108 tests) pass and stay wired.
  • Removed standalone-repo cruft: .github/, LICENSE, .nvmrc, standalone yarn.lock (the workspace frontend/yarn.lock manages deps now).
  • Converted all public/ binary assets (44 jpg, 5 png) to Git LFS per the repo .gitattributes policy, matching frontend/packages/labs/oceans.

What this PR does NOT do

  • No toolchain swap. Still has webpack.config.js, babel.config.json, Jest config.
  • No source changes other than package.json metadata.
  • No consumer-side changes. Root apps/ still pulls @code-dot-org/ml-playground@0.0.51 from 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

  • CI passes (package is private; no build/typecheck wired into turbo).
  • git log -- frontend/packages/labs/ailab/ shows the ml-playground lineage; --follow on i18n/mlPlayground.json resolves to original authors.
  • Commit-message PR refs link to code-dot-org/ml-playground, not code-dot-org.
  • yarn workspace @code-dot-org/ailab test → 108 passed; prettier clean.
  • Root apps/ still consumes npm @code-dot-org/ml-playground@0.0.51 (no /s/ regressions).

Follow-ups

  1. Vite + TypeScript + Vitest toolchain swap (restores a green typecheck + build; register as a lazy-loaded studio lab).
  2. Rewire apps/ to consume the workspace package instead of the npm release.

🤖 Generated with Claude Code

dancodedotorg and others added 30 commits June 24, 2021 06:35
…elector-refactor

Refactor to leverage selectors
…olumn-inspector-refactor

ColumnInspector refactor
wilkie added 9 commits May 21, 2026 12:41
* 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.
@sanchitmalhotra126 sanchitmalhotra126 requested review from a team, stephenliang and wilkie June 1, 2026 21:15
@sanchitmalhotra126 sanchitmalhotra126 marked this pull request as ready for review June 1, 2026 21:15
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

🖼️ Storybook Visual Comparison Report

✅ No Storybook eyes differences detected!

@stephenliang stephenliang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@sanchitmalhotra126

Copy link
Copy Markdown
Contributor Author

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.

@sanchitmalhotra126

Copy link
Copy Markdown
Contributor Author

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?

Updated to strip large blobs!

sanchitmalhotra126 and others added 3 commits June 2, 2026 18:01
…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>
@sanchitmalhotra126

Copy link
Copy Markdown
Contributor Author

Updated PR numbers in commit history to point back at ml-playground to preserve linking.

@sanchitmalhotra126 sanchitmalhotra126 merged commit b8f3458 into staging Jun 3, 2026
16 checks passed
@sanchitmalhotra126 sanchitmalhotra126 deleted the ailab-migration branch June 3, 2026 17:55
sanchitmalhotra126 added a commit that referenced this pull request Jun 3, 2026
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>
sanchitmalhotra126 added a commit that referenced this pull request Jun 3, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.