diff --git a/packages/boxel-ui/addon/bin/conditional-build.sh b/packages/boxel-ui/addon/bin/conditional-build.sh deleted file mode 100755 index d56f58bf64b..00000000000 --- a/packages/boxel-ui/addon/bin/conditional-build.sh +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/sh - -CURRENT_DIR="$(pwd)" -SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd)" - -SRC_DIR="${SCRIPTS_DIR}/../src" -DIST_DIR="${SCRIPTS_DIR}/../dist" - -if [ ! -d "$DIST_DIR" ]; then - echo "boxel-ui/addon dist dir does not exist. Building in ${SRC_DIR}/.." - cd "${SRC_DIR}/.." - pnpm run build - exit 0 -fi -if [ "$(uname)" = "Darwin" ]; then - mod_time_src=$(find "$SRC_DIR" -type f -exec stat -f %m {} + | sort -nr | head -n1) - mod_time_dist=$(find "$DIST_DIR" -type f -exec stat -f %m {} + | sort -nr | head -n1) -else - mod_time_src=$(find "$SRC_DIR" -type f -printf "%T@\n" | sort -nr | head -n1 | cut -d. -f1) - mod_time_dist=$(find "$DIST_DIR" -type f -printf "%T@\n" | sort -nr | head -n1 | cut -d. -f1) -fi - -if [ "$mod_time_src" -gt "$mod_time_dist" ]; then - echo "boxel-ui/addon dist dir is out of date. Building in ${SRC_DIR}/.." - cd "${SRC_DIR}/.." - pnpm run build -else - echo "✔️ boxel-ui/addon dist dir is up to date" -fi diff --git a/packages/boxel-ui/addon/package.json b/packages/boxel-ui/addon/package.json index 3138327c8eb..9e71ec09718 100644 --- a/packages/boxel-ui/addon/package.json +++ b/packages/boxel-ui/addon/package.json @@ -14,7 +14,6 @@ }, "scripts": { "build": "concurrently \"pnpm:build:*\" --names \"build:\"", - "build:js": "echo 'noop'", "build:types": "ember-tsc --declaration --emitDeclarationOnly --noEmit false", "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"", "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"", @@ -26,9 +25,7 @@ "rebuild:icons": "node bin/rebuild-icons.mjs", "rebuild:usage": "node bin/rebuild-usage.mjs", "generate:component-specs": "node bin/generate-component-specs.mjs", - "prepack": "rollup --config", "start": "concurrently \"pnpm:start:*\" --names \"start:\"", - "start:js": "rollup --config --watch --no-watch.clearScreen", "start:types": "ember-tsc --declaration --emitDeclarationOnly --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test" @@ -79,7 +76,6 @@ "@cardstack/local-types": "workspace:*", "@embroider/addon-dev": "^8.0.0", "@embroider/macros": "~1.16.5", - "@rollup/plugin-babel": "catalog:", "@tsconfig/ember": "3.0.1", "@types/dompurify": "catalog:", "@types/lodash-es": "catalog:", @@ -101,8 +97,6 @@ "glimmer-scoped-css": "catalog:", "prettier": "catalog:", "prettier-plugin-ember-template-tag": "catalog:", - "rollup": "catalog:", - "rollup-plugin-copy": "catalog:", "svgo": "catalog:", "@glint/ember-tsc": "catalog:" }, @@ -134,7 +128,6 @@ "files": [ "addon-main.cjs", "declarations", - "dist", "public" ], "typesVersions": { diff --git a/packages/boxel-ui/addon/rollup.config.mjs b/packages/boxel-ui/addon/rollup.config.mjs deleted file mode 100644 index 123f6fec0f7..00000000000 --- a/packages/boxel-ui/addon/rollup.config.mjs +++ /dev/null @@ -1,91 +0,0 @@ -import { Addon } from '@embroider/addon-dev/rollup'; -import { babel } from '@rollup/plugin-babel'; -import { scopedCSS } from 'glimmer-scoped-css/rollup'; -import copy from 'rollup-plugin-copy'; - -const addon = new Addon({ - srcDir: 'src', - destDir: 'dist', -}); - -export default { - // This provides defaults that work well alongside `publicEntrypoints` below. - // You can augment this if you need to. - output: addon.output(), - - plugins: [ - scopedCSS('src'), - - // These are the modules that users should be able to import from your - // addon. Anything not listed here may get optimized away. - addon.publicEntrypoints([ - 'components.js', - 'helpers.js', - 'icons.js', - 'modifiers.js', - 'usage.js', - ]), - - // These are the modules that should get reexported into the traditional - // "app" tree. Things in here should also be in publicEntrypoints above, but - // not everything in publicEntrypoints necessarily needs to go here. - addon.appReexports([]), - - // Follow the V2 Addon rules about dependencies. Your code can import from - // `dependencies` and `peerDependencies` as well as standard Ember-provided - // package names. - addon.dependencies(), - - // Ensure that standalone .hbs files are properly integrated as Javascript. - addon.hbs(), - - // Ensure that .gjs files are properly integrated as Javascript - addon.gjs(), - - // css is importable for side-effect - addon.keepAssets(['**/*.css']), - - // these asset types are imported for their URLs - addon.keepAssets( - ['**/*.otf', '**/*.png', '**/*.webp', '**/*.woff2'], - 'default', - ), - - // Remove leftover build artifacts when starting a new build. - addon.clean({ runOnce: true }), - - // Copy Readme and License into published package - copy({ - targets: [ - { src: '../README.md', dest: '.' }, - { src: '../LICENSE.md', dest: '.' }, - { src: './src/styles/*.{css,woff2,otf}', dest: './dist/styles' }, - { src: './src/styles/LICENSE.txt', dest: './dist/styles' }, - ], - // this makes it late enough that the `clean()` hook above doesn't remove - // our copied files - hook: 'generateBundle', - }), - - // This babel config should *not* apply presets or compile away ES modules. - // It exists only to provide development niceties for you, like automatic - // template colocation. - // - // By default, this will load the actual babel config from the file - // babel.config.json. - babel({ - babelHelpers: 'bundled', - extensions: ['.js', '.gjs', '.ts', '.gts'], - }), - ], - - onLog(level, log, handler) { - if (log.code === 'UNUSED_EXTERNAL_IMPORT') { - // Turn unused external imports from warnings to errors. Warnings - // accumulate and just generate noise. And this is an easily-fixable issue - // usually caused by failing to declare a type import correctly. - level = 'error'; - } - handler(level, log); - }, -}; diff --git a/packages/host/package.json b/packages/host/package.json index 053aa78047e..a02fb34b602 100644 --- a/packages/host/package.json +++ b/packages/host/package.json @@ -20,7 +20,6 @@ "lint:js": "eslint . --report-unused-disable-directives --cache", "lint:js:fix": "eslint . --report-unused-disable-directives --fix", "lint:types": "ember-tsc --noEmit", - "ensure-boxel-ui": "../boxel-ui/addon/bin/conditional-build.sh", "start": "node scripts/vite-serve.js", "serve:dist": "node scripts/serve-dist.js", "test": "concurrently \"pnpm:lint\" \"pnpm:test:*\" --names \"lint,test:\"", diff --git a/packages/host/scripts/vite-serve.js b/packages/host/scripts/vite-serve.js index 3949c1b852d..f034decb26a 100644 --- a/packages/host/scripts/vite-serve.js +++ b/packages/host/scripts/vite-serve.js @@ -2,41 +2,13 @@ * Wrapper around `vite` (dev server) for `pnpm start`. Delegates to the * shared launcher, which handles BOXEL_ENVIRONMENT / Traefik registration. * Mirrors scripts/serve-dist.js, which does the same for `vite preview`. - * - * Runs `ensure-boxel-ui` inline (synchronously, via execFileSync) so that - * the `start` script can be a single `node ...` command rather than - * `pnpm ensure-boxel-ui && node ...`. With `&&` chaining, pnpm runs the - * script through `sh -c`, which has no SIGTERM handler — so on Ctrl-C - * the shell dies via signal even though this Node process exits 0, - * leaving pnpm to report `Command failed with signal "SIGTERM"` and - * `[ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL]`. Running ensure-boxel-ui - * inline keeps Node as pnpm's direct child, so pnpm sees our clean exit. */ -const { execFileSync } = require('child_process'); -const path = require('path'); - -// Refuse a second env-mode vite from this worktree BEFORE the boxel-ui -// conditional-build runs — that step can take many seconds when the -// addon dist is stale, which would look like a hang to the user instead -// of a clear error. See env-mode-lock.js for the underlying constraint. +// Refuse a second env-mode vite from this worktree before we start, so the +// second start exits with a clear error instead of racing the first. See +// env-mode-lock.js for the underlying constraint. require('./env-mode-lock').refuseIfAnotherSlugLocked(); -execFileSync( - path.join( - __dirname, - '..', - '..', - 'boxel-ui', - 'addon', - 'bin', - 'conditional-build.sh', - ), - { - stdio: 'inherit', - }, -); - const { startWithTraefik } = require('./vite-with-traefik'); startWithTraefik({ diff --git a/packages/host/scripts/vite-with-traefik.js b/packages/host/scripts/vite-with-traefik.js index 30115f5e703..28f414f7b1d 100644 --- a/packages/host/scripts/vite-with-traefik.js +++ b/packages/host/scripts/vite-with-traefik.js @@ -294,8 +294,8 @@ function startWithTraefik({ subcommand, defaultPort, label, nodeMemory }) { const slug = getEnvSlug(); // Belt-and-suspenders: vite-serve.js / serve-dist.js also call this - // up-front (before boxel-ui conditional-build) so the second start - // exits immediately. Repeat here for direct callers of startWithTraefik. + // up-front so the second start exits immediately. Repeat here for + // direct callers of startWithTraefik. refuseIfAnotherSlugLocked(); ensureTraefik(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f7cf7cd2cdd..a9d42b97bec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1379,9 +1379,6 @@ importers: '@glint/ember-tsc': specifier: 'catalog:' version: 1.5.0(typescript@5.9.3) - '@rollup/plugin-babel': - specifier: 'catalog:' - version: 6.1.0(@babel/core@7.29.7)(@types/babel__core@7.20.5)(rollup@4.62.0) '@tsconfig/ember': specifier: 3.0.1 version: 3.0.1 @@ -1445,12 +1442,6 @@ importers: prettier-plugin-ember-template-tag: specifier: 'catalog:' version: 2.1.6(prettier@3.8.4) - rollup: - specifier: 'catalog:' - version: 4.62.0 - rollup-plugin-copy: - specifier: 'catalog:' - version: 3.5.0 svgo: specifier: 'catalog:' version: 3.3.3