@ethlete/cli 2.1.0-next.7 → 2.1.0-next.9
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/CHANGELOG.md +24 -0
- package/README.md +35 -0
- package/design/define-call.ts +92 -0
- package/design/web/env.d.ts +11 -0
- package/design/web/frame.html +17 -0
- package/design/web/frame.ts +38 -0
- package/design/web/host.css +494 -0
- package/design/web/host.ts +445 -0
- package/design/web/index.html +11 -0
- package/package.json +12 -1
- package/src/index.js +25 -0
- package/src/index.js.map +1 -1
- package/src/lib/config/diagnose.js +9 -0
- package/src/lib/config/diagnose.js.map +1 -1
- package/src/lib/config/local-config.d.ts +2 -0
- package/src/lib/config/local-config.js +6 -1
- package/src/lib/config/local-config.js.map +1 -1
- package/src/lib/design/calls-tsconfig.d.ts +6 -0
- package/src/lib/design/calls-tsconfig.js +37 -0
- package/src/lib/design/calls-tsconfig.js.map +1 -0
- package/src/lib/design/check.d.ts +11 -0
- package/src/lib/design/check.js +192 -0
- package/src/lib/design/check.js.map +1 -0
- package/src/lib/design/design-command.d.ts +10 -0
- package/src/lib/design/design-command.js +32 -0
- package/src/lib/design/design-command.js.map +1 -0
- package/src/lib/design/index.d.ts +5 -0
- package/src/lib/design/index.js +9 -0
- package/src/lib/design/index.js.map +1 -0
- package/src/lib/design/paths.d.ts +24 -0
- package/src/lib/design/paths.js +31 -0
- package/src/lib/design/paths.js.map +1 -0
- package/src/lib/design/serve.d.ts +7 -0
- package/src/lib/design/serve.js +144 -0
- package/src/lib/design/serve.js.map +1 -0
- package/src/lib/doctor/doctor-command.d.ts +3 -1
- package/src/lib/doctor/doctor-command.js +5 -5
- package/src/lib/doctor/doctor-command.js.map +1 -1
- package/src/lib/index.d.ts +2 -0
- package/src/lib/index.js +2 -0
- package/src/lib/index.js.map +1 -1
- package/src/lib/release.js +21 -3
- package/src/lib/release.js.map +1 -1
- package/src/lib/update/ai.d.ts +30 -0
- package/src/lib/update/ai.js +44 -0
- package/src/lib/update/ai.js.map +1 -0
- package/src/lib/update/args.d.ts +21 -0
- package/src/lib/update/args.js +89 -0
- package/src/lib/update/args.js.map +1 -0
- package/src/lib/update/index.d.ts +12 -0
- package/src/lib/update/index.js +16 -0
- package/src/lib/update/index.js.map +1 -0
- package/src/lib/update/migration-manifest.d.ts +40 -0
- package/src/lib/update/migration-manifest.js +137 -0
- package/src/lib/update/migration-manifest.js.map +1 -0
- package/src/lib/update/package-manager.d.ts +23 -0
- package/src/lib/update/package-manager.js +47 -0
- package/src/lib/update/package-manager.js.map +1 -0
- package/src/lib/update/packages.d.ts +65 -0
- package/src/lib/update/packages.js +147 -0
- package/src/lib/update/packages.js.map +1 -0
- package/src/lib/update/pending.d.ts +21 -0
- package/src/lib/update/pending.js +41 -0
- package/src/lib/update/pending.js.map +1 -0
- package/src/lib/update/plan.d.ts +51 -0
- package/src/lib/update/plan.js +101 -0
- package/src/lib/update/plan.js.map +1 -0
- package/src/lib/update/registry.d.ts +31 -0
- package/src/lib/update/registry.js +54 -0
- package/src/lib/update/registry.js.map +1 -0
- package/src/lib/update/run-migrations.d.ts +44 -0
- package/src/lib/update/run-migrations.js +73 -0
- package/src/lib/update/run-migrations.js.map +1 -0
- package/src/lib/update/semver.d.ts +19 -0
- package/src/lib/update/semver.js +79 -0
- package/src/lib/update/semver.js.map +1 -0
- package/src/lib/update/tasks.d.ts +58 -0
- package/src/lib/update/tasks.js +174 -0
- package/src/lib/update/tasks.js.map +1 -0
- package/src/lib/update/update-command.d.ts +12 -0
- package/src/lib/update/update-command.js +304 -0
- package/src/lib/update/update-command.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @ethlete/cli
|
|
2
2
|
|
|
3
|
+
## 2.1.0-next.9
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- `et update` now writes the new range into every `package.json` in the repo, not only the root one, and refuses a dist tag that points at an older version than the repo is on.
|
|
8
|
+
- `et design [checkout]` serves the design page of any repository that keeps a `.ethlete/design`
|
|
9
|
+
folder, and `et design check` says why a call does not render.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- `et release` now works with Changesets 3 and aborts when there are no pending changesets.
|
|
14
|
+
- `et design` now rules a drawing with its own Tailwind 4 pipeline, so a repository on Tailwind 3, or none at all, can hold design calls.
|
|
15
|
+
- `et design check --call` now reports `NO BROWSER` when neither the checkout nor the package
|
|
16
|
+
resolves `playwright`, instead of throwing the module loader's own error.
|
|
17
|
+
|
|
18
|
+
## 2.1.0-next.8
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- [#3075](https://github.com/ethlete-io/ethdk/pull/3075) [`004c32d`](https://github.com/ethlete-io/ethdk/commit/004c32d0ada3d7862947843dd6e8b204876160fe) Thanks [@github-actions](https://github.com/apps/github-actions)! - `doctorCommand` accepts an optional `composeTools` override for the container-engine check.
|
|
23
|
+
|
|
24
|
+
- [#3075](https://github.com/ethlete-io/ethdk/pull/3075) [`1d38e7e`](https://github.com/ethlete-io/ethdk/commit/1d38e7e0a025769f065d8ca7d506cb75ad89139a) Thanks [@github-actions](https://github.com/apps/github-actions)! - `et update` moves the `@ethlete/*` packages to a newer version, runs the codemods those versions
|
|
25
|
+
declare in their own `migrations.json`, and reports what needs a decision or an agent.
|
|
26
|
+
|
|
3
27
|
## 2.1.0-next.7
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -34,6 +34,40 @@ The token is checked against the host first: once for the token itself, and once
|
|
|
34
34
|
`403` there, and nothing is written. A token the file already holds for that host is replaced only
|
|
35
35
|
after a question. `--force` skips both.
|
|
36
36
|
|
|
37
|
+
## `et update`
|
|
38
|
+
|
|
39
|
+
Moves this repo's `@ethlete/*` dependencies to a newer version and runs the migrations those versions
|
|
40
|
+
ship.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
yarn et update --check # what would change; exits 1 while an update is pending
|
|
44
|
+
yarn et update # bump, install, run the codemods, report the rest
|
|
45
|
+
yarn et update core # only @ethlete/core
|
|
46
|
+
yarn et update --tag latest # leave the prerelease line
|
|
47
|
+
yarn et update core --to 5.0.0-next.55 # an exact version for the package you name
|
|
48
|
+
yarn et update --continue # finish a run that stopped
|
|
49
|
+
yarn et update --ai # hand every agent-assisted task to an agent
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The target follows the dist tag the installed version is on, so a repo on a `-next` prerelease stays
|
|
53
|
+
on `next`. The working tree must be clean, because the codemods rewrite files; `--force` skips that
|
|
54
|
+
check.
|
|
55
|
+
|
|
56
|
+
The install runs before the migrations are read, because the migrations of a version ship inside that
|
|
57
|
+
version. A run that stops leaves `.ethlete/update/pending.json` behind, and `--continue` picks it up -
|
|
58
|
+
starting over would skip every migration the stopped run had not reached.
|
|
59
|
+
|
|
60
|
+
Everything a codemod cannot decide is written to `.ethlete/update`: `tasks.md` for you, `tasks.json`
|
|
61
|
+
for an agent, and one file per task holding the instructions the package ships. A task is `manual` (it
|
|
62
|
+
needs a decision), `assisted` (written as a prompt for an agent) or `unsupported` (a codemod this repo
|
|
63
|
+
has no Nx to run, with the command to run it by hand).
|
|
64
|
+
|
|
65
|
+
`--ai` hands each assisted task to the command in `updateAgentCommand` in
|
|
66
|
+
`ethlete.config.local.json`, one run per task. No agent is detected automatically.
|
|
67
|
+
|
|
68
|
+
A package declares its migrations in `migrations.json` at its own root, pointed at from `package.json`
|
|
69
|
+
with `"ethlete": { "migrations": "./migrations.json" }`. The full format is on the docs site.
|
|
70
|
+
|
|
37
71
|
## `et api`
|
|
38
72
|
|
|
39
73
|
Runs the API an app in this repo talks to, from a checkout on your own machine.
|
|
@@ -141,3 +175,4 @@ fallback with a warning. Add `ethlete.config.local.json` to your `.gitignore`.
|
|
|
141
175
|
Full command reference on the docs site:
|
|
142
176
|
|
|
143
177
|
- [Overview & usage](https://ethlete-sdk-docs.web.app/cli/)
|
|
178
|
+
- [Updating the SDK](https://ethlete-sdk-docs.web.app/cli/update)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value inside a template. An array joins with nothing between, and `null`, `undefined` and
|
|
3
|
+
* `false` write nothing, so `${rows.map(row)}` and `${isOn && html`…`}` both read as they look.
|
|
4
|
+
*/
|
|
5
|
+
const flatten = (value: unknown): string => {
|
|
6
|
+
if (Array.isArray(value)) return value.map(flatten).join('');
|
|
7
|
+
if (value === null || value === undefined || value === false) return '';
|
|
8
|
+
|
|
9
|
+
return String(value);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const join = (strings: TemplateStringsArray, values: unknown[]) =>
|
|
13
|
+
strings.reduce((out, part, index) => out + flatten(values[index - 1]) + part);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Marks a template literal as HTML, so Prettier formats it and an editor highlights it. It escapes
|
|
17
|
+
* nothing: a drawing writes its own markup, and nothing a call draws comes from outside the
|
|
18
|
+
* repository.
|
|
19
|
+
*/
|
|
20
|
+
export const html = (strings: TemplateStringsArray, ...values: unknown[]) => join(strings, values);
|
|
21
|
+
|
|
22
|
+
/** Marks a template literal as CSS, for the same reason `html` does it for markup. */
|
|
23
|
+
export const css = (strings: TemplateStringsArray, ...values: unknown[]) => join(strings, values);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* One drawn answer, as the frame renders it: the markup that goes in the frame root, and the CSS
|
|
27
|
+
* that styles it. A drawing runs no logic, so it is a value the module builds when the frame
|
|
28
|
+
* imports it, not a component the frame has to instantiate.
|
|
29
|
+
*/
|
|
30
|
+
export type Drawing = {
|
|
31
|
+
body: string;
|
|
32
|
+
styles: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** Types a drawing where it is written, so a mistake reads in its own file and not in `call.ts`. */
|
|
36
|
+
export const drawing = (drawn: Drawing): Drawing => drawn;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* One drawn answer to a call. `load` resolves the module whose default export is the
|
|
40
|
+
* drawing that answers it, so a broken option breaks its own frame only.
|
|
41
|
+
*/
|
|
42
|
+
export type CallOption = {
|
|
43
|
+
key: string;
|
|
44
|
+
name: string;
|
|
45
|
+
/** Left out by a view: a single drawing answers no question, so it argues nothing. */
|
|
46
|
+
claim?: string;
|
|
47
|
+
cost?: string;
|
|
48
|
+
/** Left out while the call is open. The user sets it, never the drawing. */
|
|
49
|
+
verdict?: 'chosen' | 'rejected';
|
|
50
|
+
/** The `key` of the round that drew it. Left out by a call that runs no rounds. */
|
|
51
|
+
round?: string;
|
|
52
|
+
load: () => Promise<{ default: Drawing }>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* One pass over a call: the options drawn together, and what came out of them. A round
|
|
57
|
+
* whose options all carry a verdict is settled, and the page folds it down to its winner.
|
|
58
|
+
*/
|
|
59
|
+
export type CallRound = {
|
|
60
|
+
key: string;
|
|
61
|
+
/** What this pass asked, in a few words. */
|
|
62
|
+
title: string;
|
|
63
|
+
/** What it answered. Write it once the user has ruled, so the next round reads as a reply. */
|
|
64
|
+
note: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* How a call is drawn. A wireframe shows the bare workflow with mocked values, and draws no
|
|
69
|
+
* logic and no interaction state. A design call draws the real thing.
|
|
70
|
+
*/
|
|
71
|
+
export type CallMode = 'wireframe' | 'design';
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* One open question of an exploration, with every option drawn at the same geometry.
|
|
75
|
+
* A call with one option and no claim is a view: one reference picture, drawn full width.
|
|
76
|
+
*/
|
|
77
|
+
export type Call = {
|
|
78
|
+
/** The feature this call belongs to, for example 'the hour strip'. Left out by a loose call. */
|
|
79
|
+
feature?: string;
|
|
80
|
+
eyebrow: string;
|
|
81
|
+
headline: string;
|
|
82
|
+
intro: string;
|
|
83
|
+
/** The width every option frame gets, in px. The geometry the thing ships in. */
|
|
84
|
+
frameWidth: number;
|
|
85
|
+
/** Left out by a call that draws the real thing, which is what `design` means. */
|
|
86
|
+
mode?: CallMode;
|
|
87
|
+
/** Left out by a short call. With rounds, the intro says only what the call is about. */
|
|
88
|
+
rounds?: CallRound[];
|
|
89
|
+
options: CallOption[];
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const defineCall = (call: Call): Call => call;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare module 'virtual:design-explore' {
|
|
2
|
+
import type { Call } from '@design-explore';
|
|
3
|
+
|
|
4
|
+
export const calls: Record<string, () => Promise<{ default: Call }>>;
|
|
5
|
+
export const defaultCall: string | null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module 'virtual:design-explore/env' {
|
|
9
|
+
/** Loads the stylesheet the project draws under. A project the config names not draws bare. */
|
|
10
|
+
export const loadEnv: (project: string) => Promise<unknown>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<!--head-->
|
|
6
|
+
<style>
|
|
7
|
+
html,
|
|
8
|
+
body {
|
|
9
|
+
margin: 0;
|
|
10
|
+
}
|
|
11
|
+
</style>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div id="root"></div>
|
|
15
|
+
<script type="module" src="./frame.ts"></script>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { calls } from 'virtual:design-explore';
|
|
2
|
+
import { loadEnv } from 'virtual:design-explore/env';
|
|
3
|
+
|
|
4
|
+
const params = new URLSearchParams(location.search);
|
|
5
|
+
const slug = params.get('call') ?? '';
|
|
6
|
+
const key = params.get('option') ?? '';
|
|
7
|
+
|
|
8
|
+
await loadEnv(slug.split('/')[0] ?? '');
|
|
9
|
+
|
|
10
|
+
const root = document.querySelector('#root') as HTMLElement;
|
|
11
|
+
|
|
12
|
+
const fail = (message: string) => {
|
|
13
|
+
root.textContent = message;
|
|
14
|
+
root.setAttribute('style', 'padding:16px;font:14px monospace;color:#f0a0a0;background:#1a1414');
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const call = calls[slug];
|
|
18
|
+
if (!call) fail(`design-explore: no call "${slug}"`);
|
|
19
|
+
else {
|
|
20
|
+
const option = (await call()).default.options.find((o) => o.key === key);
|
|
21
|
+
if (!option) fail(`design-explore: call "${slug}" has no option "${key}"`);
|
|
22
|
+
else {
|
|
23
|
+
const loaded = (await option.load()).default;
|
|
24
|
+
const style = document.createElement('style');
|
|
25
|
+
|
|
26
|
+
style.textContent = loaded.styles;
|
|
27
|
+
document.head.append(style);
|
|
28
|
+
root.innerHTML = loaded.body;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const report = () => {
|
|
33
|
+
const height = Math.ceil(document.documentElement.getBoundingClientRect().height);
|
|
34
|
+
parent.postMessage({ type: 'design-explore:height', option: key, height }, '*');
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
new ResizeObserver(report).observe(document.documentElement);
|
|
38
|
+
report();
|