Skip to content

Commit 1e5ddaf

Browse files
committed
fix
1 parent 2977e40 commit 1e5ddaf

3 files changed

Lines changed: 17 additions & 19 deletions

File tree

docs/docs/contribution/build-system.mdx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ npm run start # Runs: copy:assets, watch, serve in parallel
3535

3636
### Core Build Script
3737

38-
The main build script is located at [`scripts/build.js`](../../../scripts/build.js). It orchestrates all build tasks:
38+
The main build script is located at `scripts/build.js`. It orchestrates all build tasks:
3939

4040
### Build Phases
4141

@@ -72,7 +72,6 @@ and other lazy-loaded modules, including:
7272
- Import/export modules
7373

7474
Configuration:
75-
- Target: `es2020`
7675
- Format: `esm`
7776
- Minification: enabled in production
7877

@@ -101,7 +100,7 @@ Workers are wrapped in IIFE format for compatibility.
101100

102101
#### 5. Styles Build (`stylesBuild`)
103102

104-
Located in [`scripts/styles.js`](../../../scripts/styles.js):
103+
Located in `scripts/styles.js`:
105104

106105
- Compiles SCSS files from `src/livecodes/styles/` to CSS
107106
- Uses Sass compiler
@@ -130,17 +129,17 @@ Type declarations are generated via TypeScript compiler (`tsconfig.sdk.json`), t
130129

131130
#### 7. I18n Build (`buildI18n`)
132131

133-
Located in[`scripts/i18n.js`](../../../scripts/i18n.js):
132+
Located in `scripts/i18n.js`:
134133

135134
- Compiles locale files from `src/livecodes/i18n/locales/*/`
136135
- Outputs JSON files: `build/livecodes/i18n-{locale}-{namespace}.json`
137136
- Generates locale path loader for dynamic imports
138137

139-
See [i18n.mdx](i18n.mdx) for details.
138+
See [i18n.mdx](./i18n.mdx) for details.
140139

141140
### Post-Build Processing
142141

143-
#### Hash Application ([`scripts/hash.js`](../../../scripts/hash.js))
142+
#### Hash Application (`scripts/hash.js`)
144143

145144
Applies content-based MD5 hashes to filenames for cache busting:
146145

@@ -156,9 +155,9 @@ Benefits:
156155
- Aggressive caching (1 year) with cache invalidation on change
157156
- Consistent hashes for unchanged files across builds
158157

159-
#### CSS Injection ([`scripts/inject-css.js`](../../../scripts/inject-css.js))
158+
#### CSS Injection (`scripts/inject-css.js`)
160159

161-
- Inlines [`index.css`](../../../src/livecodes/styles/index.css) content directly into [`index.html`](../../../src/index.html)
160+
- Inlines `src/livecodes/styles/index.css` content directly into `src/index.html`
162161
- Reduces HTTP requests for critical CSS
163162

164163
## Output Structure
@@ -227,7 +226,7 @@ build/
227226

228227
## Environment Variables
229228

230-
Build-time environment variables (set in [`getEnvVars()`](../../../scripts/utils.js)):
229+
Build-time environment variables (set in `getEnvVars()` in `scripts/utils.js`):
231230

232231
| Variable | Description |
233232
|----------|-------------|
@@ -258,7 +257,6 @@ See [Docker Setup](https://livecodes.io/docs/advanced/docker#environment-variabl
258257
- Base options:
259258
- Bundle: `true`
260259
- Minify: `false` in dev, `true` in production
261-
- Target: `es2020` (app), `es2018` (SDK)
262260
- Format: `esm` or `iife`
263261
- Loader: `.html``text`, `.ttf``file`
264262
- External: `codemirror`, `@codemirror/*`, `@lezer/*`, `@replit/codemirror-*`
@@ -308,10 +306,10 @@ npm run e2e # Run Playwright e2e tests
308306

309307
## Type Bundling
310308

311-
The SDK type declarations are processed by [`scripts/bundle-types.js`](../../../scripts/bundle-types.js):
309+
The SDK type declarations are processed by `scripts/bundle-types.js`:
312310

313311
1. TypeScript generates `.d.ts` files
314-
2. `dts-bundle` merges them into single `livecodes.d.ts`
312+
2. `dts-bundle` merges them into single `build/sdk/types/livecodes.d.ts`
315313
3. Patches applied to fix module paths and remove unused exports
316314

317315
## CI/CD

docs/docs/contribution/editor-system.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ flowchart TD
1919
A[Mode?] --> B{Headless?}
2020
B -->|Yes| C[fake editor]
2121
B -->|No| D{Result mode<br/>non-console/compiled?}
22-
22+
2323
D -->|Yes| C
2424
D -->|No| E{Simple mode?}
25-
25+
2626
E -->|Yes| F{Active editor?}
2727
F -->|Yes| G[codemirror]
2828
F -->|No| C
29-
29+
3030
E -->|No| H{Codeblock or Lite mode?}
3131
H -->|Yes| I[codejar]
32-
32+
3333
H -->|No| J{Explicit selection?}
3434
J -->|Yes| K[Selected editor<br/>monaco/codemirror/codejar]
35-
35+
3636
J -->|No| L{Mobile?}
3737
L -->|Yes| G
3838
L -->|No| M[monaco]
@@ -109,7 +109,7 @@ Uses a WebWorker loaded from the compiler iframe for TypeScript features:
109109

110110
A [custom build](https://github.com/live-codes/codemirror) is used for CodeMirror editor, which allows:
111111

112-
- Bundling and minification of the core modules (e.g. `state`, `view`, etc) and language support for common languages (`html`, `css`, `js`, `json`) to avoid unnecessary network requests and larger module size. Extensions in this bundle are marked as external during build of other modules. This allows all of them to point to the same URL using importmaps (see [app.html](../../../src/livecodes/html/app.html)).
112+
- Bundling and minification of the core modules (e.g. `state`, `view`, etc) and language support for common languages (`html`, `css`, `js`, `json`) to avoid unnecessary network requests and larger module size. Extensions in this bundle are marked as external during build of other modules. This allows all of them to point to the same URL using importmaps (see [app.html](https://github.com/live-codes/livecodes/blob/develop/src/livecodes/html/app.html)).
113113
- Other extensions are lazy-loaded on-demand.
114114

115115
---

docs/docs/contribution/export-system.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,5 +338,5 @@ src/livecodes/export/
338338
- [Import System](./import-system.mdx) - Importing projects
339339
- [Configuration System](./config-system.mdx) - Configuration object
340340
- [Storage System](./storage-system.mdx) - Project storage
341-
- [Result Page](./result-page.md) - Result generation
341+
- [Result Page](./result-page.mdx) - Result generation
342342
- [User Docs: Export](https://livecodes.io/docs/features/export) - User-facing documentation

0 commit comments

Comments
 (0)