diff --git a/CHANGELOG.md b/CHANGELOG.md index a491fea0e..8de7d7f6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,36 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - +## Unreleased + +### Changed + +- It is now supported _and preferred_ to use `#` as the delimiter between + packages and scripts in dependency specifiers, instead of `:`. For example, + instead of `"../other:build"`, it is now preferred to write + `"../other#build"`. + + The `:` character will continue to work the same indefinitely, but the Wireit + documentation will exclusively show `#`, and upcoming new features for + dependency specifiers will only work with the newer `#` form. + +- **[BREAKING]** Certain special characters must now be escaped with a `\` + (which in JSON is written as `\\`) if they are to be intepreted literally in a + package specifier: + + - `#` + - `\` + - `<` + - `>` + - `.` (only required at the start of the specifier) + - `!` (only required at the start of the specifier) + - `:` (only required when using the legacy delimiter, meaning a `#` does not + appear later in the specifier) + + For example, in the (highly unusual) situation that you depend on a script + like `"../ha#shy:sl\\ashy"`, you should now write `"../ha\\#shy#sl\\\\ashy"` + (note that `\` escapes are _also_ required for JSON, hence the double + escapes). ## [0.14.11] - 2025-02-07 diff --git a/README.md b/README.md index 179c9bafb..e531ea9ab 100644 --- a/README.md +++ b/README.md @@ -171,10 +171,15 @@ other wireit scripts, and can never be run directly. ### Cross-package dependencies Dependencies can refer to scripts in other npm packages by using a relative path -with the syntax `:`. All cross-package dependencies +with the syntax `#`. All cross-package dependencies should start with a `"."`. Cross-package dependencies work well for npm workspaces, as well as in other kinds of monorepos. +> [!NOTE] +> The `:` character can also be used as a delimiter instead of `#` (e.g. +> `"../other-package:build`), but `#` is preferred since February 2025 because +> it is less ambiguous given the prevalence of `:` in npm script names. + ```json { "scripts": { @@ -183,7 +188,7 @@ workspaces, as well as in other kinds of monorepos. "wireit": { "build": { "command": "tsc", - "dependencies": ["../other-package:build"] + "dependencies": ["../other-package#build"] } } } @@ -534,7 +539,7 @@ expected to exit by itself, set `"service": true`. "dependencies": [ "build:server", { - "script": "../assets:build", + "script": "../assets#build", "cascade": false } ] @@ -691,7 +696,7 @@ There are two main reasons you might want to set `cascade` to `false`: "dependencies": [ "build:server", { - "script": "../assets:build", + "script": "../assets#build", "cascade": false } ], @@ -853,7 +858,7 @@ The following properties can be set inside `wireit.