Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ jobs:
restore-keys: |
${{ runner.os }}-elm-

- name: Download dependencies
run: npm ci

- name: Build
run: npm run build --if-present

Expand Down
20 changes: 9 additions & 11 deletions .mise/tasks/build/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ import { elmMake, log, PATHS } from "../_lib.ts";

log("build:cli", "Compiling CLI Elm modules...");

// Build both CLI and DevCLI in parallel
await Promise.all([
elmMake(["src/Morphir/Elm/CLI.elm"], {
cwd: PATHS.cli,
output: "Morphir.Elm.CLI.js",
}),
elmMake(["src/Morphir/Elm/DevCLI.elm"], {
cwd: PATHS.cli,
output: "Morphir.Elm.DevCLI.js",
}),
]);
// Sequential: concurrent elm make on a cold ~/.elm cache causes race conditions on Windows
await elmMake(["src/Morphir/Elm/CLI.elm"], {
cwd: PATHS.cli,
output: "Morphir.Elm.CLI.js",
});
await elmMake(["src/Morphir/Elm/DevCLI.elm"], {
cwd: PATHS.cli,
output: "Morphir.Elm.DevCLI.js",
});

log("build:cli", "Done");
2 changes: 1 addition & 1 deletion .mise/tasks/build/cli2.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bun
//MISE description="Build CLI2 (TypeScript + Elm in parallel)"
//MISE depends=["build:check-elm-docs"]
//MISE depends=["build:cli"]

import { elmMake, log, PATHS, join } from "../_lib.ts";
import { mkdir, rm } from "fs/promises";
Expand Down
2 changes: 1 addition & 1 deletion .mise/tasks/build/dev-server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bun
//MISE description="Build development server Elm components"
//MISE depends=["build:check-elm-docs"]
//MISE depends=["build:cli"]

import { elmMake, log, PATHS } from "../_lib.ts";

Expand Down
2 changes: 1 addition & 1 deletion .mise/tasks/build/morphir-ts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bun
//MISE description="Build Morphir TypeScript library"
//MISE depends=["build:cli"]
//MISE depends=["build:cli", "build:cli2"]

import { del, morphirMake, morphirGen, exec, log, PATHS, ROOT_DIR, copyGlob, join } from "../_lib.ts";

Expand Down
2 changes: 1 addition & 1 deletion .mise/tasks/build/try-morphir.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bun
//MISE description="Build Try Morphir web app"
//MISE depends=["build:check-elm-docs"]
//MISE depends=["build:cli"]

import { elmMake, log, PATHS } from "../_lib.ts";

Expand Down
7 changes: 5 additions & 2 deletions .mise/tasks/default.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/env bun
//MISE description="Full build pipeline (clean, check, setup, build)"
//MISE depends=["clean", "test:check-package-lock", "test:check-node-version", "setup", "build"]
//MISE depends=["clean", "test:check-package-lock", "test:check-node-version", "setup"]

import { log } from "./_lib.ts";
import { exec, log, ROOT_DIR } from "./_lib.ts";

// setup has completed — now run build phase (elm requires node_modules from setup)
await exec("mise", ["run", "build"], { cwd: ROOT_DIR });

log("default", "Full build pipeline completed");
2 changes: 1 addition & 1 deletion .mise/tasks/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bun
//MISE description="Run all setup tasks"
//MISE depends=["setup:elm-tooling", "setup:morphir-jvm"]
//MISE depends=["setup:npm", "setup:elm-tooling", "setup:morphir-jvm"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Make build wait for npm setup

Adding setup:npm only under the setup aggregate does not make the build branch of mise run default wait for npm dependencies: default.ts still depends on setup and build as independent siblings, and mise run --dry-run default prints build:check-elm-docs before setup:npm. On a fresh clone or in the updated CI workflow where the explicit npm ci step was removed, the build can invoke elm/npx before node_modules/.bin exists, so the default pipeline can still fail instead of becoming self-bootstrapping.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 4869003 — added //MISE depends=["setup:elm-tooling"] to build:check-elm-docs.ts. All other elm build tasks already chain through build:check-elm-docs, so this single dep propagates the ordering constraint through the full build chain. Also added build:build.ts depends=[setup,...] as an explicit guard, and removed the standalone npm ci CI step that was masking the race.


import { log } from "./_lib.ts";

Expand Down
1 change: 1 addition & 0 deletions .mise/tasks/setup/elm-tooling.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bun
//MISE description="Install Elm tooling"
//MISE depends=["setup:npm"]

import { exec, log } from "../_lib.ts";

Expand Down
8 changes: 8 additions & 0 deletions .mise/tasks/setup/npm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bun
//MISE description="Install npm dependencies (npm ci)"

import { exec, log } from "../_lib.ts";

log("setup:npm", "Installing npm dependencies...");
await exec("npm", ["ci"]);
log("setup:npm", "Done");
13 changes: 5 additions & 8 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ curl https://mise.run | sh
# Trust the project configuration
mise trust

# Install tools (node, bun) and dependencies
mise install
npm ci

# Run the full build pipeline
# Install tools (node, bun) and all dependencies (npm ci, elm-tooling, etc.)
mise run default
```

Expand Down Expand Up @@ -70,6 +66,7 @@ This project uses [mise](https://mise.jdx.dev/) with [Bun](https://bun.sh/) for

| Task | Description |
|------|-------------|
| `mise run setup:npm` | Install npm dependencies (`npm ci`) |
| `mise run setup:elm-tooling` | Install Elm tooling binaries |
| `mise run setup:morphir-jvm` | Clone and setup Morphir JVM SDK assets |

Expand All @@ -86,8 +83,8 @@ npm run build:cli # Build CLI only
npm run build:cli2 # Build CLI2 only
```

`npm ci` automatically runs `setup-elm-tooling` via the `prepare` hook,
which installs `elm`, `elm-test`, `elm-format`, and `elm-json` into
`mise run setup` handles all npm and tooling setup, including running the
`prepare` hook which installs `elm`, `elm-test`, `elm-format`, and `elm-json` into
`node_modules/.bin/`. `mise.toml` prepends `./node_modules/.bin` to
PATH so mise tasks resolve those binaries.

Expand Down Expand Up @@ -118,6 +115,7 @@ test file.
│ │ ├── integration.ts
│ │ └── ...
│ └── setup/ # Setup subtasks
│ ├── npm.ts
│ ├── elm-tooling.ts
│ └── morphir-jvm.ts
cli/ # CLI v1 (Elm + JavaScript)
Expand Down Expand Up @@ -184,7 +182,6 @@ mise run setup:elm-tooling
### Missing dependencies

```bash
npm ci
mise run setup
```

Expand Down
2 changes: 1 addition & 1 deletion elm-tooling.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"tools": {
"elm": "0.19.1",
"elm-format": "0.8.7",
"elm-format": "0.8.8",
"elm-json": "0.2.13",
"elm-test-rs": "3.0.0"
}
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@typespec/compiler": "^0.59.1",
"del-cli": "^5.1.0",
"elm-test": "^0.19.1-revision6",
"elm-tooling": "^1.15.0",
"elm-tooling": "^1.17.0",
"json-schema": "^0.4.0",
"node-elm-compiler": "^5.0.6",
"package-json": "^8.1.1",
Expand Down
Loading