Commit 0b67350
fix: scaffold .chronicle/ directory for Turbopack compatibility (#21)
* fix: resolve next binary via createRequire instead of hardcoded .bin path
When installed via npx/bunx or as a dependency, next gets hoisted and
node_modules/.bin/next doesn't exist inside the chronicle package dir.
Use createRequire + require.resolve to find next/dist/bin/next via
Node's module resolution which handles hoisting automatically.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: resolve chronicle.yaml from cwd first, then content dir
Allows placing chronicle.yaml in project root when using chronicle
as a library dependency, while still supporting it inside content dir.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ci: add canary release workflow for PR builds
Publishes canary npm release on every PR commit with version
format 0.1.0-canary.<short-sha> using --tag canary.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: scaffold .chronicle/ directory instead of running Next.js from node_modules
Turbopack refuses to compile .ts/.tsx from node_modules. Instead of
running Next.js with cwd: PACKAGE_ROOT (inside node_modules), the CLI
now scaffolds a .chronicle/ directory in the user's project with copied
source files and a content symlink. Next.js runs from .chronicle/ where
Turbopack compiles normally.
- Add scaffold utility that copies src/, source.config.ts, tsconfig.json
and generates next.config.mjs
- Update dev/build/start/serve commands to use scaffold cwd
- Update init command to create package.json with deps, content/
subdirectory, and auto-install via detected package manager
- Default content dir changed from cwd to ./content
- Add .chronicle to .gitignore in init
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: move scaffolding to init, resolve next from cwd, detect package manager via lockfiles
- Move scaffoldDir call from dev/build/start/serve into init command
- Commands now require .chronicle/ to exist (fail with helpful message)
- Remove --content and -d flags from commands and init
- Add resolveNextCli() using createRequire to avoid duplicate Next.js instances
- Detect package manager via npm_config_user_agent then lockfile fallback
- Update Dockerfile to use bun add + chronicle init flow
- Add resolve.ts for PACKAGE_ROOT derivation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: use .npmrc file for npm auth in canary workflow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: write .npmrc to home dir for bun publish auth
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: revert canary publish to bun with NPM_CONFIG_TOKEN
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* debug: add npm whoami step to verify token
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: standalone tsconfig, openapi-types dep, content flag, update docs
- Remove extends @raystack/tools-config from tsconfig.json (standalone)
- Move openapi-types from devDependencies to dependencies
- Add -c/--content flag to init for custom content dir name
- Skip sample index.mdx if content dir already has files
- Update CLI, Docker, and Getting Started docs for new scaffold flow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: resolve config from project root and fix .source import path
Pass CHRONICLE_PROJECT_ROOT env var to Next.js child process so runtime
config loader finds chronicle.yaml at the actual project root instead of
.chronicle/ scaffold dir. Use tsconfig path alias for .source/server
import to resolve correctly in scaffold context.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: merge missing scripts and deps into existing package.json on init
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: remove debug npm whoami step from canary workflow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: set type module and add node_modules/.next to gitignore in init
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: render search highlights using dangerouslySetInnerHTML for mark tags
Fumadocs returns search results with <mark> HTML tags for highlighting.
Render them properly instead of showing raw HTML text.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: remove canary release workflow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address CodeRabbit PR review comments
- Use template literal for chalk error message in config.ts
- Resolve Next.js CLI from Chronicle's PACKAGE_ROOT instead of cwd
- Derive chronicle version from own package.json instead of hardcoding 'latest'
- Add try-catch with user-friendly error for resolveNextCli in all commands
- Add comment explaining PACKAGE_ROOT resolution path
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent ca271b9 commit 0b67350
20 files changed
Lines changed: 463 additions & 124 deletions
File tree
- docs
- packages/chronicle
- bin
- src
- cli
- commands
- utils
- components/ui
- lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 26 | + | |
22 | 27 | | |
23 | | - | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
27 | | - | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
| |||
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
36 | | - | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
40 | | - | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | | - | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 75 | | |
78 | | - | |
| 76 | + | |
79 | 77 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 78 | + | |
83 | 79 | | |
84 | | - | |
| 80 | + | |
| 81 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| |||
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
42 | | - | |
| 50 | + | |
43 | 51 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
| |||
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
74 | 86 | | |
75 | 87 | | |
76 | 88 | | |
| |||
File mode changed.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 6 | + | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
17 | 24 | | |
18 | 25 | | |
19 | | - | |
20 | 26 | | |
21 | | - | |
| 27 | + | |
22 | 28 | | |
23 | | - | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | | - | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 6 | + | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
14 | | - | |
15 | 11 | | |
16 | | - | |
17 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | | - | |
21 | 27 | | |
22 | | - | |
| 28 | + | |
23 | 29 | | |
24 | | - | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | | - | |
| 33 | + | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
| |||
0 commit comments