create-obsidian-arrow 0.2.0 → 0.2.2

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,6 +1,6 @@
1
1
  {
2
2
  "name": "create-obsidian-arrow",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Scaffold an Obsidian-styled Arrow.js UI sandbox (pnpm create obsidian-arrow <dir>).",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,8 +13,8 @@ This file is the hub — everything else is linked from here:
13
13
  obsidian-arrow-sandbox, arrow-js-obsidian-templates, arrow-js-obsidian-patterns,
14
14
  arrow-js-obsidian-porting (sandbox→plugin parity check), obsidian-arrow-maintenance
15
15
  (updating an existing project).
16
- - [`docs/prompts/agent-setup.md`](docs/prompts/agent-setup.md) — prompt for
17
- briefing a fresh agent (scaffold + orient).
16
+ - [`docs/prompts/`](docs/prompts/) — copy-paste agent prompts: `agent-setup.md`
17
+ (scaffold + orient) and `update-existing.md` (update tooling + skills, keep src).
18
18
 
19
19
  Design rationale (why `core`+`framework`, no SSR, how `app.css` is sourced) is
20
20
  summarized in "What this is (and isn't)" below and in the README.
@@ -42,8 +42,9 @@ npx create-obsidian-arrow update --dry-run # preview first
42
42
  > the session**. The scaffolder prints this hint when it detects nesting.
43
43
 
44
44
  > This repo (the full sandbox) is **not** published to npm — only the
45
- > `create-obsidian-arrow/` initializer is. An agent-onboarding prompt lives in
46
- > [`docs/prompts/agent-setup.md`](docs/prompts/agent-setup.md).
45
+ > `create-obsidian-arrow/` initializer is. Copy-paste agent prompts live in
46
+ > [`docs/prompts/`](docs/prompts/): `agent-setup.md` (scaffold + orient) and
47
+ > `update-existing.md` (update tooling + skills, keeping `src/` intact).
47
48
 
48
49
  ## Quick start
49
50
 
@@ -0,0 +1,78 @@
1
+ # Update-existing-project prompt
2
+
3
+ Copy the block below and give it to a coding agent to bring an **existing**
4
+ Obsidian Arrow project fully up to date — tooling, skills, styling — **without
5
+ touching your source code**.
6
+
7
+ ---
8
+
9
+ ```text
10
+ Update this existing Obsidian Arrow project to the latest tooling and agent
11
+ skills. Do NOT change any of my source code.
12
+
13
+ HARD CONSTRAINTS
14
+ - Never modify src/, public/, index.html, vite.config.ts, tsconfig.json, or my
15
+ component/app code. Only managed tooling, skills, and docs may change.
16
+ - Preview before applying anything destructive; don't commit unless I ask.
17
+ - At the end, prove src/ was untouched (`git diff --stat` shows no src/ changes).
18
+
19
+ CONTEXT
20
+ Scaffolded from create-obsidian-arrow. Tooling + agent skills come from the
21
+ published repo kylebrodeur/obsidian-arrow-sandbox; skills install via the
22
+ `skills` CLI and are NOT vendored in the project.
23
+
24
+ STEPS (in order)
25
+
26
+ 1. Locate + nesting check
27
+ - Find the project root (has package.json + scripts/).
28
+ - Is it nested in a larger repo? Compare `git rev-parse --show-toplevel` to the
29
+ project dir. If the OUTER root differs, that's where skills must be installed
30
+ so the session's skill:// registry (repo-root + global only) can find them.
31
+
32
+ 2. Refresh tooling — preserves src/
33
+ - Preview: npx create-obsidian-arrow update --dry-run
34
+ - Apply: npx create-obsidian-arrow update
35
+ - Then: pnpm install
36
+ Refreshes scripts/, docs/, .github/, .husky/, biome.json, AGENTS.md, CLAUDE.md
37
+ and merges package.json scripts/deps. It never touches src/, public/, or configs.
38
+
39
+ 3. Reset agent skills to the current set
40
+ - Audit: npx skills list
41
+ - Remove any stale/old ones (older setups were missing some skills):
42
+ npx skills remove obsidian-arrow-sandbox arrow-js-obsidian-templates \
43
+ arrow-js-obsidian-patterns arrow-js-obsidian-porting obsidian-arrow-maintenance
44
+ - Install the current set from the published repo, AT THE RIGHT ROOT (the OUTER
45
+ repo root if nested):
46
+ npx skills add kylebrodeur/obsidian-arrow-sandbox --all --yes
47
+ (equivalently from the project: pnpm skills:install --yes
48
+ [--project-dir=<outer-repo>])
49
+ - Reload the agent session so skill:// resolves them.
50
+
51
+ 4. Refresh Obsidian styling
52
+ - pnpm pull-css (needs a local Obsidian; macOS auto-detected, else --path)
53
+
54
+ 5. Clean stray install artifacts
55
+ - git status — untracked .agents/ (now git-ignored) or stray skills-lock.json?
56
+ - Broken symlinks: find .agents ~/.claude/skills -type l ! -exec test -e {} \; -print
57
+
58
+ 6. Re-check porting parity (only if you keep a port-parity manifest)
59
+ - node scripts/component-hash.mjs --check port-parity.json
60
+
61
+ 7. Verify
62
+ - pnpm run ci (biome + typecheck + tests + build)
63
+ - pnpm dev and confirm /example renders with a clean console
64
+
65
+ REPORT
66
+ - What `update` changed, which skills are now installed and where, the pull-css
67
+ result, and `git diff --stat` confirming src/ is untouched.
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Notes
73
+ - Skills are pulled from the published repo, so step 3 is location-independent for
74
+ the *source* — only the *install location* matters (run it at the repo root the
75
+ agent uses; reload after).
76
+ - `npx create-obsidian-arrow update` is **create-only-safe**: it refreshes managed
77
+ files and merges `package.json`, but never overwrites `src/`, `public/`,
78
+ `index.html`, or build configs. See the `obsidian-arrow-maintenance` skill.
@@ -1,7 +1,7 @@
1
1
  import { html } from "@arrow-js/core";
2
2
  import type { ArrowExpression } from "@arrow-js/core";
3
- import { ExamplesIndex } from "../examples/ExamplesIndex";
4
- import { examples, findExample } from "../examples/registry";
3
+ import { findExample } from "../examples/registry";
4
+ import { Home } from "../sandbox/home";
5
5
 
6
6
  /**
7
7
  * Single route resolver, shared by every entry point. Returns the page status,
@@ -24,8 +24,8 @@ export function routeToPage(url: string): Page {
24
24
  if (pathname === "/" || pathname === "") {
25
25
  return {
26
26
  status: 200,
27
- title: `Examples · ${APP_NAME}`,
28
- view: ExamplesIndex(examples),
27
+ title: APP_NAME,
28
+ view: Home(),
29
29
  };
30
30
  }
31
31
 
@@ -0,0 +1,106 @@
1
+ import { component, html, reactive } from "@arrow-js/core";
2
+ import type { ArrowTemplate } from "@arrow-js/core";
3
+ import { ExamplesIndex } from "../examples/ExamplesIndex";
4
+ import { examples } from "../examples/registry";
5
+ import { layoutState } from "./layout";
6
+ import { themeState } from "./theme";
7
+
8
+ /**
9
+ * Sandbox landing page at "/": a readiness check + getting-started commands +
10
+ * the examples list. Sandbox chrome — does not port to a plugin.
11
+ *
12
+ * The readiness probe catches the #1 fresh-machine gotcha: running `pnpm dev`
13
+ * before `pnpm pull-css` leaves app.css unloaded, so every `var(--…)` token is
14
+ * empty. We detect that by reading the computed value of a known token.
15
+ */
16
+ const probe = reactive({ tick: 0 });
17
+
18
+ function stylingLoaded(): boolean {
19
+ const generation = probe.tick; // reactive dependency; Re-check bumps it
20
+ const style = getComputedStyle(document.body);
21
+ return (
22
+ generation >= 0 &&
23
+ style.getPropertyValue("--background-primary").trim() !== "" &&
24
+ style.getPropertyValue("--text-accent").trim() !== ""
25
+ );
26
+ }
27
+
28
+ function recheck(): void {
29
+ probe.tick++;
30
+ }
31
+
32
+ const GETTING_STARTED = [
33
+ { cmd: "pnpm pull-css", note: "extract Obsidian's app.css — run once (macOS auto-detect)" },
34
+ { cmd: "pnpm dev", note: "this dev server (Vite + HMR)" },
35
+ { cmd: "pnpm skills:install --yes", note: "install the agent skills from the published repo" },
36
+ { cmd: "pnpm run ci", note: "biome + typecheck + tests + build" },
37
+ ];
38
+
39
+ export const Home = component((): ArrowTemplate => {
40
+ // Re-probe shortly after mount, in case app.css finished loading after the
41
+ // first paint (stylesheets load async).
42
+ setTimeout(recheck, 250);
43
+
44
+ return html`
45
+ <div class="oas-settings">
46
+ <div class="setting-item setting-item-heading">
47
+ <div class="setting-item-info">
48
+ <div class="setting-item-name">Obsidian Arrow Sandbox</div>
49
+ <div class="setting-item-description">
50
+ Prototype Obsidian plugin UI with Arrow.js against Obsidian's real styling.
51
+ </div>
52
+ </div>
53
+ </div>
54
+
55
+ <div class="setting-item">
56
+ <div class="setting-item-info">
57
+ <div class="setting-item-name">Obsidian styling</div>
58
+ <div class="setting-item-description">
59
+ ${() =>
60
+ stylingLoaded()
61
+ ? "app.css loaded — tokens resolve."
62
+ : "Not loaded — run `pnpm pull-css`, then Re-check."}
63
+ </div>
64
+ </div>
65
+ <div class="setting-item-control">
66
+ <span
67
+ style="${() =>
68
+ `color: ${stylingLoaded() ? "var(--text-success)" : "var(--text-error)"}; font-weight: var(--font-semibold);`}"
69
+ >${() => (stylingLoaded() ? "READY" : "MISSING")}</span>
70
+ <button class="oas-recheck" @click="${recheck}">Re-check</button>
71
+ </div>
72
+ </div>
73
+
74
+ <div class="setting-item">
75
+ <div class="setting-item-info">
76
+ <div class="setting-item-name">Theme / panel</div>
77
+ <div class="setting-item-description">
78
+ ${() => `${themeState.theme} · ${layoutState.width}px`}
79
+ </div>
80
+ </div>
81
+ </div>
82
+
83
+ <div class="setting-item setting-item-heading">
84
+ <div class="setting-item-info">
85
+ <div class="setting-item-name">Getting started</div>
86
+ <div class="setting-item-description">
87
+ See AGENTS.md + docs/ for the full flow; agent prompts in docs/prompts/.
88
+ </div>
89
+ </div>
90
+ </div>
91
+ ${GETTING_STARTED.map((step) =>
92
+ html`
93
+ <div class="setting-item">
94
+ <div class="setting-item-info">
95
+ <div class="setting-item-name" style="font-family: var(--font-monospace);">
96
+ ${step.cmd}
97
+ </div>
98
+ <div class="setting-item-description">${step.note}</div>
99
+ </div>
100
+ </div>
101
+ `.key(step.cmd)
102
+ )}
103
+ </div>
104
+ ${ExamplesIndex(examples)}
105
+ `;
106
+ });
@@ -109,6 +109,11 @@ body {
109
109
  align-items: center;
110
110
  }
111
111
 
112
+ .oas-frame .setting-item-control button.oas-recheck {
113
+ margin-left: var(--size-4-2);
114
+ font-size: var(--font-ui-smaller);
115
+ }
116
+
112
117
  /* Drag-to-resize handle on the pane's right edge (Obsidian-like). */
113
118
  .oas-frame .oas-resize-handle {
114
119
  position: absolute;