@crossworks/app-build 0.232.153 → 0.232.165

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,22 +1,23 @@
1
1
  {
2
2
  "name": "@crossworks/app-build",
3
- "version": "0.232.153",
3
+ "version": "0.232.165",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
7
7
  "exports": {
8
8
  ".": "./src/index.ts"
9
9
  },
10
+ "files": [
11
+ "src"
12
+ ],
10
13
  "dependencies": {
11
- "@mantle/share-ui": "npm:@crossworks/share-ui@0.232.153",
14
+ "@mantle/share-ui": "npm:@crossworks/share-ui@0.232.165",
12
15
  "@tailwindcss/oxide": "^4.3.3",
13
16
  "esbuild": "^0.28.1",
14
17
  "lucide-react": "^1.25.0",
15
18
  "react": "^19.2.7",
16
19
  "react-dom": "^19.2.7",
17
- "tailwindcss": "^4.3.3",
18
- "@mantle/config": "0.0.1",
19
- "@mantle/std": "0.0.1"
20
+ "tailwindcss": "^4.3.3"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@types/node": "^26.4.0",
package/src/index.ts CHANGED
@@ -15,7 +15,13 @@ import { fileURLToPath } from 'node:url';
15
15
  import esbuild, { type BuildOptions, type Message, type Plugin } from 'esbuild';
16
16
  import { buildAppCss } from './css';
17
17
  import { KIT } from './kit';
18
- import { errorMessage } from '@mantle/std';
18
+ // Local copy of @mantle/std's errorMessage. This package is published as a
19
+ // contract package; it must not depend on private workspace packages, which
20
+ // do not exist on npm (the v0.232.122-153 tarballs shipped an unresolvable
21
+ // @mantle/std@0.0.1 dependency for exactly this import).
22
+ function errorMessage(err: unknown): string {
23
+ return err instanceof Error ? err.message : String(err);
24
+ }
19
25
 
20
26
  /** Specifiers provided by the shared runtime via the iframe import map — marked
21
27
  * external so they stay as bare imports in the app bundle. The react family is
@@ -24,13 +24,16 @@
24
24
  import { readFile } from 'node:fs/promises';
25
25
  import * as path from 'node:path';
26
26
  import { fileURLToPath } from 'node:url';
27
- import { env } from '@mantle/config';
28
27
 
29
28
  const HERE = path.dirname(fileURLToPath(import.meta.url));
30
29
 
31
30
  /** In order of trust: explicit override, package-relative, cwd convention. */
32
31
  export function manifestCandidates(): string[] {
33
- const override = env('MANTLE_APP_RUNTIME_MANIFEST');
32
+ // Raw read on purpose: this package is published to npm and cannot depend
33
+ // on the private @mantle/config package. The name stays in config's
34
+ // inventory so it is documented alongside every other variable.
35
+ // eslint-disable-next-line no-restricted-syntax
36
+ const override = process.env.MANTLE_APP_RUNTIME_MANIFEST;
34
37
  return [
35
38
  ...(override ? [override] : []),
36
39
  // packages/app-build/src → <root>/server/web/public/app-runtime/manifest.json
@@ -1,61 +0,0 @@
1
- /**
2
- * Emits the shared mini-app runtime into an app's `public/app-runtime/`.
3
- * Run with: `node packages/app-build/scripts/build-runtime.ts` from the app
4
- * directory (Node strips the TS types). Invoked from `predev`/`prebuild` in
5
- * server/web and in jackdaw's client/web, so the runtime always exists before
6
- * apps render.
7
- */
8
- import { existsSync } from 'node:fs';
9
- import * as path from 'node:path';
10
- import { buildRuntime } from '../src/build-runtime.ts';
11
- import { env } from '@mantle/config';
12
-
13
- /**
14
- * Where to write. Each Next app serves its own copy — the ACAO:* runtime has
15
- * to exist on every origin that renders sandboxes.
16
- *
17
- * Paths resolve from the CALLER'S CWD, never from this script's own location.
18
- * They used to resolve against `../../..` from here, which is the repo root
19
- * only while this package sits in the repo being built. Published to npm and
20
- * installed by the jackdaw repo, that same expression pointed at the
21
- * consumer's `node_modules/`, so `build-runtime.ts client/web` wrote the
22
- * runtime to `node_modules/client/web/public/app-runtime` — a real directory
23
- * nothing serves. The owner UI shipped with NO `/app-runtime/*` at all (its
24
- * Docker build runs the same prebuild), and nothing failed: the build printed
25
- * a success line naming the wrong path, and only a sandboxed mini-app trying
26
- * to boot would notice.
27
- *
28
- * An ARGUMENT rather than an environment variable, deliberately. The callers
29
- * used to set `APP_RUNTIME_OUT="$PWD/…"` inline, which is POSIX shell syntax;
30
- * pnpm runs package scripts through cmd.exe on Windows, where that is not a
31
- * variable assignment but an unknown command. The desktop build failed on
32
- * windows-latest for four consecutive releases with
33
- * `'APP_RUNTIME_OUT' is not recognized`. An argv entry has no shell semantics
34
- * to get wrong.
35
- *
36
- * `APP_RUNTIME_OUT` still works for a direct absolute-path invocation.
37
- */
38
- const appArg = process.argv[2]?.trim();
39
- const appDir = path.resolve(process.cwd(), appArg ?? '.');
40
- const outDir = env('APP_RUNTIME_OUT')
41
- ? path.resolve(env('APP_RUNTIME_OUT'))
42
- : path.join(appDir, 'public/app-runtime');
43
-
44
- // Tripwire for the failure above: a Next app always has a `public/`, so its
45
- // absence means the resolved app directory is not an app and the runtime is
46
- // about to be written somewhere nothing serves. Fail loudly here rather than
47
- // print a cheerful success line pointing into node_modules. Skipped when
48
- // APP_RUNTIME_OUT names the destination outright.
49
- if (!env('APP_RUNTIME_OUT') && !existsSync(path.join(appDir, 'public'))) {
50
- console.error(
51
- `app-runtime: ${appDir} has no public/ directory, so it is not an app.\n` +
52
- `Run this from the app directory (paths resolve from the cwd), or pass an ` +
53
- `absolute destination as APP_RUNTIME_OUT.`,
54
- );
55
- process.exit(1);
56
- }
57
-
58
- const manifest = await buildRuntime(outDir);
59
- const n = Object.keys(manifest.imports).length;
60
- console.log(`app-runtime: ${n} modules → ${outDir}`);
61
- for (const [spec, url] of Object.entries(manifest.imports)) console.log(` ${spec} → ${url}`);
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "rootDir": "src",
5
- "outDir": "dist",
6
- "types": ["node"],
7
- // build-runtime.ts is executed directly by Node (the build:runtime script),
8
- // which requires explicit `.ts` import specifiers. This package is only ever
9
- // typechecked (--noEmit) or transpiled by Next, never emitted by tsc — so
10
- // allowing the extension keeps the Node-run and tsc paths in agreement.
11
- "allowImportingTsExtensions": true
12
- },
13
- "include": ["src/**/*.ts"]
14
- }