@analogjs/platform 3.0.1-beta.1 → 3.0.1-beta.3
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/AGENTS.md +76 -0
- package/README.md +5 -0
- package/package.json +2 -2
- package/plugin.json +13 -0
- package/skills/analogjs/SKILL.md +80 -0
- package/src/lib/nx-plugin/src/utils/versions/versions.d.ts +6 -6
- package/src/lib/nx-plugin/src/utils/versions/versions.js +6 -6
- package/src/lib/nx-plugin/src/utils/versions/versions.js.map +1 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# AnalogJS — conventions for AI coding assistants
|
|
2
|
+
|
|
3
|
+
This file ships with `@analogjs/platform` and documents how to work in an [AnalogJS](https://analogjs.org) app (an Angular meta-framework, powered by Vite). A generated app's root `AGENTS.md` points here so the guidance stays in sync with the installed version.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
- `npm start` / `npm run dev` — start the dev server (Vite)
|
|
8
|
+
- `npm run build` — production build
|
|
9
|
+
- `npm test` — run unit tests (Vitest)
|
|
10
|
+
- `npm run preview` — run the built server locally
|
|
11
|
+
|
|
12
|
+
## Project structure
|
|
13
|
+
|
|
14
|
+
- `src/app/pages/` — file-based routes (see Routing below)
|
|
15
|
+
- `src/app/` — components and app config (`app.config.ts`, `app.config.server.ts`)
|
|
16
|
+
- `src/server/routes/` — server and API routes (Nitro + h3)
|
|
17
|
+
- `src/main.ts` / `src/main.server.ts` — client and server bootstrap
|
|
18
|
+
- `vite.config.ts` — Vite + Analog plugin and Vitest config
|
|
19
|
+
|
|
20
|
+
## Routing
|
|
21
|
+
|
|
22
|
+
Routes are file-based. A file in `src/app/pages/` ending in `.page.ts` becomes a route, and it must `export default` a standalone Angular component.
|
|
23
|
+
|
|
24
|
+
- `index.page.ts` → `/`
|
|
25
|
+
- `about.page.ts` → `/about`
|
|
26
|
+
- `products/index.page.ts` → `/products`
|
|
27
|
+
- `products/[productId].page.ts` → `/products/:productId` (dynamic segment)
|
|
28
|
+
- `(auth).page.ts` + `(auth)/*.page.ts` → pathless layout: `(auth).page.ts` renders a `<router-outlet />` and wraps its child routes (e.g. `(auth)/login.page.ts` → `/login`, `(auth)/signup.page.ts` → `/signup`) without adding a path segment
|
|
29
|
+
- `[...not-found].page.ts` → catch-all / 404
|
|
30
|
+
|
|
31
|
+
Read route params with `inject(ActivatedRoute)` from `@angular/router`.
|
|
32
|
+
|
|
33
|
+
Define per-route metadata (title, meta tags, guards, resolvers) by exporting a `routeMeta` that satisfies `RouteMeta`:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { RouteMeta } from '@analogjs/router';
|
|
37
|
+
|
|
38
|
+
export const routeMeta = {
|
|
39
|
+
title: 'Products',
|
|
40
|
+
} satisfies RouteMeta;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Prefer `satisfies` over a `RouteMeta` annotation, which widens `data` and `resolve` types.
|
|
44
|
+
|
|
45
|
+
## Server & API routes
|
|
46
|
+
|
|
47
|
+
Server routes live in `src/server/routes/` and use [h3](https://h3.dev). API routes are conventionally under `src/server/routes/api/`.
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { defineEventHandler } from 'h3';
|
|
51
|
+
|
|
52
|
+
export default defineEventHandler(() => ({ message: 'Hello World' }));
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Filenames encode the HTTP method and params: `hello.get.ts`, `users.post.ts`, `users/[id].get.ts`.
|
|
56
|
+
|
|
57
|
+
## Data fetching
|
|
58
|
+
|
|
59
|
+
- **Page load functions:** add a sibling `.server.ts` `load` function and read its result in the page with `injectLoad` from `@analogjs/router`.
|
|
60
|
+
- **Server functions:** define functions in `.server.ts` files and call them from the client with `injectServerFn`.
|
|
61
|
+
|
|
62
|
+
## Content routes
|
|
63
|
+
|
|
64
|
+
Markdown content is supported via `@analogjs/content`: `injectContent` / `injectContentFiles` to load content, and `MarkdownComponent` (`analog-markdown`) to render it. Content files live in `src/content/`.
|
|
65
|
+
|
|
66
|
+
## Conventions
|
|
67
|
+
|
|
68
|
+
- Use modern Angular: standalone components, `inject()`, signals, and the built-in control flow (`@if`, `@for`, `@switch`).
|
|
69
|
+
- Page components are **default-exported**.
|
|
70
|
+
- Tests are colocated as `*.spec.ts` and run under Vitest (jsdom environment).
|
|
71
|
+
- Prefer existing Angular and Analog APIs over hand-rolled equivalents.
|
|
72
|
+
|
|
73
|
+
## More
|
|
74
|
+
|
|
75
|
+
Full documentation: https://analogjs.org/docs
|
|
76
|
+
LLM-friendly docs index: https://analogjs.org/llms.txt
|
package/README.md
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@analogjs/platform",
|
|
3
|
-
"version": "3.0.1-beta.
|
|
3
|
+
"version": "3.0.1-beta.3",
|
|
4
4
|
"description": "The fullstack meta-framework for Angular",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"url": "https://github.com/sponsors/brandonroberts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@analogjs/vite-plugin-angular": "3.0.1-beta.
|
|
34
|
+
"@analogjs/vite-plugin-angular": "3.0.1-beta.3",
|
|
35
35
|
"es-toolkit": "^1.45.1",
|
|
36
36
|
"front-matter": "^4.0.2",
|
|
37
37
|
"magic-string": "^0.30.21",
|
package/plugin.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
|
+
"name": "analogjs",
|
|
4
|
+
"description": "AnalogJS framework conventions for AI coding assistants — file-based routing, server and API routes, data fetching, and content routes.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Brandon Roberts",
|
|
7
|
+
"email": "robertsbt@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://analogjs.org",
|
|
10
|
+
"repository": "https://github.com/analogjs/analog",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": ["analog", "angular", "vite", "meta-framework"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: analogjs
|
|
3
|
+
description: Conventions for working in an AnalogJS app (an Angular meta-framework powered by Vite) — file-based routing with `.page.ts` files, `RouteMeta`, server and API routes on Nitro/h3, page load functions and server functions in `.server.ts` files, markdown content routes, and the modern Angular style Analog expects. Use when reading or writing code in a project that depends on `@analogjs/platform`.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AnalogJS — conventions for AI coding assistants
|
|
8
|
+
|
|
9
|
+
This skill ships with `@analogjs/platform` and documents how to work in an [AnalogJS](https://analogjs.org) app (an Angular meta-framework, powered by Vite). It mirrors the `AGENTS.md` published alongside it, so the guidance stays in sync with the installed version.
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
- `npm start` / `npm run dev` — start the dev server (Vite)
|
|
14
|
+
- `npm run build` — production build
|
|
15
|
+
- `npm test` — run unit tests (Vitest)
|
|
16
|
+
- `npm run preview` — run the built server locally
|
|
17
|
+
|
|
18
|
+
## Project structure
|
|
19
|
+
|
|
20
|
+
- `src/app/pages/` — file-based routes (see Routing below)
|
|
21
|
+
- `src/app/` — components and app config (`app.config.ts`, `app.config.server.ts`)
|
|
22
|
+
- `src/server/routes/` — server and API routes (Nitro + h3)
|
|
23
|
+
- `src/main.ts` / `src/main.server.ts` — client and server bootstrap
|
|
24
|
+
- `vite.config.ts` — Vite + Analog plugin and Vitest config
|
|
25
|
+
|
|
26
|
+
## Routing
|
|
27
|
+
|
|
28
|
+
Routes are file-based. A file in `src/app/pages/` ending in `.page.ts` becomes a route, and it must `export default` a standalone Angular component.
|
|
29
|
+
|
|
30
|
+
- `index.page.ts` → `/`
|
|
31
|
+
- `about.page.ts` → `/about`
|
|
32
|
+
- `products/index.page.ts` → `/products`
|
|
33
|
+
- `products/[productId].page.ts` → `/products/:productId` (dynamic segment)
|
|
34
|
+
- `(auth).page.ts` + `(auth)/*.page.ts` → pathless layout: `(auth).page.ts` renders a `<router-outlet />` and wraps its child routes (e.g. `(auth)/login.page.ts` → `/login`, `(auth)/signup.page.ts` → `/signup`) without adding a path segment
|
|
35
|
+
- `[...not-found].page.ts` → catch-all / 404
|
|
36
|
+
|
|
37
|
+
Read route params with `inject(ActivatedRoute)` from `@angular/router`.
|
|
38
|
+
|
|
39
|
+
Define per-route metadata (title, meta tags, guards, resolvers) by exporting a `RouteMeta`:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { RouteMeta } from '@analogjs/router';
|
|
43
|
+
|
|
44
|
+
export const routeMeta: RouteMeta = {
|
|
45
|
+
title: 'Products',
|
|
46
|
+
};
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Server & API routes
|
|
50
|
+
|
|
51
|
+
Server routes live in `src/server/routes/` and use [h3](https://h3.dev). API routes are conventionally under `src/server/routes/api/`.
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { defineEventHandler } from 'h3';
|
|
55
|
+
|
|
56
|
+
export default defineEventHandler(() => ({ message: 'Hello World' }));
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Filenames encode the HTTP method and params: `hello.get.ts`, `users.post.ts`, `users/[id].get.ts`.
|
|
60
|
+
|
|
61
|
+
## Data fetching
|
|
62
|
+
|
|
63
|
+
- **Page load functions:** add a sibling `.server.ts` `load` function and read its result in the page with `injectLoad` from `@analogjs/router`.
|
|
64
|
+
- **Server functions:** define functions in `.server.ts` files and call them from the client with `injectServerFn`.
|
|
65
|
+
|
|
66
|
+
## Content routes
|
|
67
|
+
|
|
68
|
+
Markdown content is supported via `@analogjs/content`: `injectContent` / `injectContentFiles` to load content, and `MarkdownComponent` (`analog-markdown`) to render it. Content files live in `src/content/`.
|
|
69
|
+
|
|
70
|
+
## Conventions
|
|
71
|
+
|
|
72
|
+
- Use modern Angular: standalone components, `inject()`, signals, and the built-in control flow (`@if`, `@for`, `@switch`).
|
|
73
|
+
- Page components are **default-exported**.
|
|
74
|
+
- Tests are colocated as `*.spec.ts` and run under Vitest (jsdom environment).
|
|
75
|
+
- Prefer existing Angular and Analog APIs over hand-rolled equivalents.
|
|
76
|
+
|
|
77
|
+
## More
|
|
78
|
+
|
|
79
|
+
Full documentation: https://analogjs.org/docs
|
|
80
|
+
LLM-friendly docs index: https://analogjs.org/llms.txt
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export declare const ANALOG_JS_ROUTER = "^3.0.1-beta.
|
|
2
|
-
export declare const ANALOG_JS_CONTENT = "^3.0.1-beta.
|
|
1
|
+
export declare const ANALOG_JS_ROUTER = "^3.0.1-beta.3";
|
|
2
|
+
export declare const ANALOG_JS_CONTENT = "^3.0.1-beta.3";
|
|
3
3
|
export declare const MARKED = "^18.0.0";
|
|
4
4
|
export declare const MARKED_GFM_HEADING_ID = "^4.1.1";
|
|
5
5
|
export declare const MARKED_HIGHLIGHT = "^2.2.1";
|
|
6
6
|
export declare const MARKED_MANGLE = "^1.1.10";
|
|
7
7
|
export declare const PRISMJS = "^1.29.0";
|
|
8
8
|
export declare const H3 = "^1.15.11";
|
|
9
|
-
export declare const ANALOG_JS_PLATFORM = "^3.0.1-beta.
|
|
10
|
-
export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.1-beta.
|
|
11
|
-
export declare const ANALOG_JS_VITEST_ANGULAR = "^3.0.1-beta.
|
|
12
|
-
export declare const ANALOG_JS_VITE_PLUGIN_NITRO = "^3.0.1-beta.
|
|
9
|
+
export declare const ANALOG_JS_PLATFORM = "^3.0.1-beta.3";
|
|
10
|
+
export declare const ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.1-beta.3";
|
|
11
|
+
export declare const ANALOG_JS_VITEST_ANGULAR = "^3.0.1-beta.3";
|
|
12
|
+
export declare const ANALOG_JS_VITE_PLUGIN_NITRO = "^3.0.1-beta.3";
|
|
13
13
|
export declare const JSDOM = "^22.0.0";
|
|
14
14
|
export declare const VITE_TSCONFIG_PATHS = "^4.2.0";
|
|
15
15
|
export declare const VITE = "^8.0.0";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// packages/nx-plugin/src/utils/versions/versions.ts
|
|
2
|
-
var ANALOG_JS_ROUTER = "^3.0.1-beta.
|
|
3
|
-
var ANALOG_JS_CONTENT = "^3.0.1-beta.
|
|
2
|
+
var ANALOG_JS_ROUTER = "^3.0.1-beta.3";
|
|
3
|
+
var ANALOG_JS_CONTENT = "^3.0.1-beta.3";
|
|
4
4
|
var MARKED = "^18.0.0";
|
|
5
5
|
var MARKED_GFM_HEADING_ID = "^4.1.1";
|
|
6
6
|
var MARKED_HIGHLIGHT = "^2.2.1";
|
|
7
7
|
var MARKED_MANGLE = "^1.1.10";
|
|
8
8
|
var PRISMJS = "^1.29.0";
|
|
9
9
|
var H3 = "^1.15.11";
|
|
10
|
-
var ANALOG_JS_PLATFORM = "^3.0.1-beta.
|
|
11
|
-
var ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.1-beta.
|
|
12
|
-
var ANALOG_JS_VITEST_ANGULAR = "^3.0.1-beta.
|
|
13
|
-
var ANALOG_JS_VITE_PLUGIN_NITRO = "^3.0.1-beta.
|
|
10
|
+
var ANALOG_JS_PLATFORM = "^3.0.1-beta.3";
|
|
11
|
+
var ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.1-beta.3";
|
|
12
|
+
var ANALOG_JS_VITEST_ANGULAR = "^3.0.1-beta.3";
|
|
13
|
+
var ANALOG_JS_VITE_PLUGIN_NITRO = "^3.0.1-beta.3";
|
|
14
14
|
var JSDOM = "^22.0.0";
|
|
15
15
|
var VITE_TSCONFIG_PATHS = "^4.2.0";
|
|
16
16
|
var VITE = "^8.0.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../../nx-plugin/src/utils/versions/versions.ts"],"sourcesContent":["// dependencies\nexport const ANALOG_JS_ROUTER = '^3.0.1-beta.
|
|
1
|
+
{"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../../nx-plugin/src/utils/versions/versions.ts"],"sourcesContent":["// dependencies\nexport const ANALOG_JS_ROUTER = '^3.0.1-beta.3';\nexport const ANALOG_JS_CONTENT = '^3.0.1-beta.3';\nexport const MARKED = '^18.0.0';\nexport const MARKED_GFM_HEADING_ID = '^4.1.1';\nexport const MARKED_HIGHLIGHT = '^2.2.1';\nexport const MARKED_MANGLE = '^1.1.10';\nexport const PRISMJS = '^1.29.0';\nexport const H3 = '^1.15.11';\n\n// devDependencies\nexport const ANALOG_JS_PLATFORM = '^3.0.1-beta.3';\nexport const ANALOG_JS_VITE_PLUGIN_ANGULAR = '^3.0.1-beta.3';\nexport const ANALOG_JS_VITEST_ANGULAR = '^3.0.1-beta.3';\nexport const ANALOG_JS_VITE_PLUGIN_NITRO = '^3.0.1-beta.3';\nexport const JSDOM = '^22.0.0';\nexport const VITE_TSCONFIG_PATHS = '^4.2.0';\nexport const VITE = '^8.0.0';\nexport const VITE_7 = '^7.0.0';\nexport const VITE_6 = '^6.4.0';\nexport const VITEST = '^5.0.0';\n"],"mappings":";AACA,IAAa,mBAAmB;AAChC,IAAa,oBAAoB;AACjC,IAAa,SAAS;AACtB,IAAa,wBAAwB;AACrC,IAAa,mBAAmB;AAChC,IAAa,gBAAgB;AAC7B,IAAa,UAAU;AACvB,IAAa,KAAK;AAGlB,IAAa,qBAAqB;AAClC,IAAa,gCAAgC;AAC7C,IAAa,2BAA2B;AACxC,IAAa,8BAA8B;AAC3C,IAAa,QAAQ;AACrB,IAAa,sBAAsB;AACnC,IAAa,OAAO;AACpB,IAAa,SAAS;AACtB,IAAa,SAAS;AACtB,IAAa,SAAS"}
|