Skip to content

Reorganize scripts into focused subdirectories by function#3426

Draft
jpzwarte wants to merge 1 commit into
mainfrom
claude/scripts-folder-organization-4h0hb5
Draft

Reorganize scripts into focused subdirectories by function#3426
jpzwarte wants to merge 1 commit into
mainfrom
claude/scripts-folder-organization-4h0hb5

Conversation

@jpzwarte

@jpzwarte jpzwarte commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Restructured the scripts/ directory to organize build and utility scripts into focused subdirectories based on their functionality, improving maintainability and clarity of the monorepo's build system.

Key Changes

  • Created functional script subdirectories:

    • scripts/build/ - TypeScript and SCSS compilation (packages.js, styles.js)
    • scripts/cem/ - Custom Elements Manifest generation and plugins
    • scripts/docs/ - Documentation generation (i18n extraction, story templates)
    • scripts/icons/ - Icon import from FontAwesome and Figma
    • scripts/qa/ - Quality assurance (backwards compatibility, a11y testing)
    • scripts/themes/ - Theme CSS generation and setup
    • scripts/tokens/ - Design token import from Tokens Studio
  • Updated package.json workspaces configuration to reference individual script subdirectories instead of the entire scripts/ folder

  • Created dedicated package.json files for each script subdirectory with appropriate dependencies and descriptions

  • Updated all script references throughout the monorepo:

    • Root package.json scripts and wireit configurations
    • Component and website package configurations
    • Config files (cem-angular-wrapper.config.mjs, website/custom-elements-manifest.config.js)
    • Internal script imports and path references
  • Adjusted relative paths in all moved scripts to account for the new directory structure (e.g., ../packages/../../packages/)

Implementation Details

Each script subdirectory now has its own package.json with only the dependencies required for that specific functionality, reducing unnecessary dependency bloat and making the purpose of each script directory explicit. The workspace configuration in the root package.json was updated to include all subdirectories, allowing yarn to properly resolve workspace dependencies.

All internal path references were updated to maintain correct relative paths from the new script locations to shared resources like packages/ and tools/.

https://claude.ai/code/session_01WaV4D4B4FvnP9dBjBkeA5n

Each subfolder now owns its own dependencies, making it clear what each
group of scripts requires and easier to update them independently:

- scripts/build/   — TypeScript and SCSS compilation (esbuild, sass)
- scripts/cem/     — Custom Elements Manifest generation and plugins
- scripts/docs/    — i18n extraction and Angular story template extraction
- scripts/icons/   — Icon import from FontAwesome Pro and Figma
- scripts/qa/      — Backwards compatibility checks and a11y test runner
- scripts/themes/  — Theme CSS generation from tokens and theme folder setup
- scripts/tokens/  — Design token import from Tokens Studio

All call-sites updated: root package.json wireit commands, workspaces list,
cem-angular-wrapper.config.mjs, packages/angular/package.json, and
website/custom-elements-manifest.config.js.

https://claude.ai/code/session_01WaV4D4B4FvnP9dBjBkeA5n
Copilot AI review requested due to automatic review settings June 9, 2026 19:25
@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 167ffb9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "@sl-design-system/scripts" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR restructures the monorepo’s scripts/ folder into function-focused workspace packages (build, CEM, docs, icons, QA, themes, tokens) and updates script/import references across the repo to match the new layout.

Changes:

  • Split scripts/ into multiple Yarn workspaces with dedicated package.json files and scoped dependencies.
  • Updated Wireit commands and config imports to point to the new script locations.
  • Added QA helpers for website a11y URL selection and reorganized CEM generation/plugins under scripts/cem/.

Reviewed changes

Copilot reviewed 23 out of 32 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/package.json Updates CEM plugin file references to new scripts/cem/ paths.
website/custom-elements-manifest.config.js Updates imports to CEM plugins in scripts/cem/.
scripts/tokens/package.json Adds dedicated workspace manifest for token import script.
scripts/tokens/.tokensstudio.json Fixes output path after moving token scripts into scripts/tokens/.
scripts/themes/setup.js Adjusts relative paths for theme setup after script relocation.
scripts/themes/package.json Adds dedicated workspace manifest/deps for theme build tooling.
scripts/themes/build.js Updates theme/token paths for new scripts/themes/ location.
scripts/qa/run-website-a11y-test.js Adds wrapper script to pass URL selection into website a11y tests.
scripts/qa/package.json Adds dedicated workspace manifest for QA scripts.
scripts/qa/get-changed-urls.js Adds logic to compute changed website URLs and write changed-urls.json.
scripts/qa/backwards-compatibility-check.js Updates usage text to the new script path under scripts/qa/.
scripts/qa/backwards-compatibility-check-README.md Updates documentation paths for the moved QA script.
scripts/icons/package.json Renames/repurposes workspace package metadata to icon tooling only.
scripts/icons/output-pages-to-folders-svg.js Adds a local figma-export outputter used by the icons pipeline.
scripts/icons/import.js Updates token/theme relative paths after moving to scripts/icons/.
scripts/icons/.figmaexportrc.js Updates theme output path for new script location and uses local outputter.
scripts/docs/README-extract-story-templates.md Updates docs to reference new scripts/docs/ location.
scripts/docs/package.json Adds dedicated workspace manifest/deps for docs generation scripts.
scripts/docs/extract-story-templates.js Updates Angular stories input/output paths after relocation.
scripts/docs/extract-i18n.js Updates component glob paths after moving to scripts/docs/.
scripts/cem/utils.js Adds utility string helpers used by CEM Angular wrapper plugin.
scripts/cem/plugins.js Introduces CEM plugins module under new scripts/cem/ structure.
scripts/cem/plugin-event-decorator.js Moves event decorator plugin under scripts/cem/.
scripts/cem/plugin-angular-wrapper.js Moves Angular wrapper generator plugin under scripts/cem/.
scripts/cem/package.json Adds dedicated workspace manifest/deps for CEM generation tooling.
scripts/cem/build.js Updates CEM build script paths/imports for new structure.
scripts/build/styles.js Adds SCSS→CSS→TS template pipeline and updates Wireit references.
scripts/build/packages.js Adds esbuild-based TS compilation helper for packages/examples.
scripts/build/package.json Adds dedicated workspace manifest/deps for build scripts.
packages/angular/package.json Updates extract-template commands to new scripts/docs/ location.
package.json Updates workspaces list and Wireit commands to new script locations.
cem-angular-wrapper.config.mjs Updates imports to the relocated CEM Angular wrapper/event plugins.

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.

3 participants