@absolutejs/absolute 0.19.0-beta.1038 → 0.19.0-beta.1039

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.
@@ -0,0 +1,7 @@
1
+ import type { FrameworkKey } from './frameworkKey';
2
+ export type ComponentTemplateContext = {
3
+ kebab: string;
4
+ pascal: string;
5
+ title: string;
6
+ };
7
+ export declare const componentTemplates: Record<FrameworkKey, (ctx: ComponentTemplateContext) => string>;
@@ -0,0 +1,30 @@
1
+ import { type FrameworkKey } from './frameworkKey';
2
+ export type ProjectContext = {
3
+ config: Record<string, unknown>;
4
+ configPath: string | null;
5
+ cwd: string;
6
+ frameworkDirs: Partial<Record<FrameworkKey, string>>;
7
+ serverEntry: string;
8
+ stylesDir: string;
9
+ };
10
+ export declare const configuredFrameworks: (project: ProjectContext) => FrameworkKey[];
11
+ export declare const frontendRootFor: (project: ProjectContext, framework: FrameworkKey) => string;
12
+ export declare const resolveProject: (cwd: string, configOverride?: string) => Promise<{
13
+ config: Record<string, unknown>;
14
+ configPath: string | null;
15
+ cwd: string;
16
+ frameworkDirs: Partial<Record<FrameworkKey, string>>;
17
+ serverEntry: string;
18
+ stylesDir: string;
19
+ }>;
20
+ export declare const selectFramework: (project: ProjectContext, explicit: string | undefined) => {
21
+ message: string;
22
+ ok: false;
23
+ framework?: undefined;
24
+ } | {
25
+ framework: FrameworkKey;
26
+ ok: true;
27
+ message?: undefined;
28
+ };
29
+ export declare const sharedDirFor: (project: ProjectContext, framework: FrameworkKey) => string;
30
+ export declare const toModuleSpecifier: (fromDir: string, toFileNoExt: string) => string;
@@ -0,0 +1,20 @@
1
+ export type CssPlan = {
2
+ assetKey: string;
3
+ cssFileAbs: string;
4
+ contents: string;
5
+ create: boolean;
6
+ shared: boolean;
7
+ };
8
+ export declare const planCss: (routingText: string, stylesDir: string, pascal: string, kebab: string) => {
9
+ assetKey: string;
10
+ contents: string;
11
+ create: boolean;
12
+ cssFileAbs: string;
13
+ shared: true;
14
+ } | {
15
+ assetKey: string;
16
+ contents: string;
17
+ create: boolean;
18
+ cssFileAbs: string;
19
+ shared: false;
20
+ };
@@ -0,0 +1,3 @@
1
+ export type FrameworkKey = 'angular' | 'html' | 'htmx' | 'react' | 'svelte' | 'vue';
2
+ export declare const FRAMEWORK_KEYS: FrameworkKey[];
3
+ export declare const isFrameworkKey: (value: string) => value is FrameworkKey;
@@ -0,0 +1,40 @@
1
+ import type { FrameworkKey } from './frameworkKey';
2
+ export type ConfigDirKey = 'angularDirectory' | 'htmlDirectory' | 'htmxDirectory' | 'reactDirectory' | 'svelteDirectory' | 'vueDirectory';
3
+ export type ImportSpec = {
4
+ kind: 'named';
5
+ module: string;
6
+ name: string;
7
+ } | {
8
+ kind: 'typeDefault';
9
+ local: string;
10
+ module: string;
11
+ } | {
12
+ kind: 'typeNamespace';
13
+ local: string;
14
+ module: string;
15
+ };
16
+ export type RouteContext = {
17
+ cssAssetKey: string;
18
+ indexKey: string;
19
+ manifestKey: string;
20
+ pageSpecifier: string;
21
+ pascal: string;
22
+ route: string;
23
+ title: string;
24
+ };
25
+ type FileNames = {
26
+ kebab: string;
27
+ pascal: string;
28
+ };
29
+ export type FrameworkDef = {
30
+ componentFile: (names: FileNames) => string;
31
+ configDirKey: ConfigDirKey;
32
+ kind: 'manifest' | 'static';
33
+ label: string;
34
+ pageFile: (names: FileNames) => string;
35
+ pageImportExtension: string | null;
36
+ routeExpression: (ctx: RouteContext) => string;
37
+ routeImports: (ctx: RouteContext) => ImportSpec[];
38
+ };
39
+ export declare const frameworks: Record<FrameworkKey, FrameworkDef>;
40
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type ProjectContext } from './context';
2
+ import { type GenerateOutcome } from './outcome';
3
+ export declare const generateApi: (project: ProjectContext, rawName: string) => GenerateOutcome;
@@ -0,0 +1,4 @@
1
+ import type { ProjectContext } from './context';
2
+ import type { FrameworkKey } from './frameworkKey';
3
+ import { type GenerateOutcome } from './outcome';
4
+ export declare const generateComponent: (project: ProjectContext, framework: FrameworkKey, rawName: string) => GenerateOutcome;
@@ -0,0 +1,4 @@
1
+ import { type ProjectContext } from './context';
2
+ import type { FrameworkKey } from './frameworkKey';
3
+ import { type GenerateOutcome } from './outcome';
4
+ export declare const generatePage: (project: ProjectContext, framework: FrameworkKey, rawName: string) => GenerateOutcome;
@@ -0,0 +1,5 @@
1
+ export declare const isValidName: (raw: string | undefined) => raw is string;
2
+ export declare const toCamelCase: (raw: string) => string;
3
+ export declare const toKebabCase: (raw: string) => string;
4
+ export declare const toPascalCase: (raw: string) => string;
5
+ export declare const toTitleCase: (raw: string) => string;
@@ -0,0 +1,10 @@
1
+ export type NavItem = {
2
+ href: string;
3
+ label: string;
4
+ };
5
+ export declare const readNavItems: (navDataPath: string) => NavItem[];
6
+ export declare const upsertNavItem: (navDataPath: string, item: NavItem) => {
7
+ changed: boolean;
8
+ created: boolean;
9
+ items: NavItem[];
10
+ };
@@ -0,0 +1,17 @@
1
+ export type GenerateOutcome = {
2
+ created: string[];
3
+ manual: {
4
+ reason: string;
5
+ snippet: string;
6
+ } | null;
7
+ notes: string[];
8
+ route: string | null;
9
+ updated: string[];
10
+ };
11
+ export declare const emptyOutcome: () => {
12
+ created: never[];
13
+ manual: null;
14
+ notes: never[];
15
+ route: null;
16
+ updated: never[];
17
+ };
@@ -0,0 +1,11 @@
1
+ import type { FrameworkKey } from './frameworkKey';
2
+ import type { NavItem } from './navData';
3
+ export type PageTemplateContext = {
4
+ cssHref: string;
5
+ kebab: string;
6
+ navImportPath: string;
7
+ navItems: NavItem[];
8
+ pascal: string;
9
+ title: string;
10
+ };
11
+ export declare const pageTemplates: Record<FrameworkKey, (ctx: PageTemplateContext) => string>;
@@ -0,0 +1,40 @@
1
+ import type { FrameworkDef } from './frameworks';
2
+ export type WireInput = {
3
+ cssAssetKey: string;
4
+ def: FrameworkDef;
5
+ indexKey: string;
6
+ manifestKey: string;
7
+ pageFileAbs: string;
8
+ pascal: string;
9
+ route: string;
10
+ serverEntry: string;
11
+ title: string;
12
+ };
13
+ export type WireResult = {
14
+ kind: 'edited';
15
+ routingFile: string;
16
+ } | {
17
+ kind: 'manual';
18
+ reason: string;
19
+ snippet: string;
20
+ };
21
+ export declare const findRoutingFile: (serverEntry: string) => string | null;
22
+ export declare const wirePluginUse: (serverEntry: string, pluginName: string, moduleSpecifier: string) => {
23
+ kind: "manual";
24
+ reason: string;
25
+ snippet: string;
26
+ } | {
27
+ kind: "edited";
28
+ routingFile: string;
29
+ };
30
+ export declare const wireRoute: (input: WireInput) => {
31
+ kind: "manual";
32
+ reason: string;
33
+ snippet: string;
34
+ routingFile?: undefined;
35
+ } | {
36
+ kind: "edited";
37
+ routingFile: string;
38
+ reason?: undefined;
39
+ snippet?: undefined;
40
+ };
@@ -0,0 +1,5 @@
1
+ import type { NavItem } from './navData';
2
+ export declare const NAV_MARKER_END = "<!-- /absolute:nav -->";
3
+ export declare const NAV_MARKER_START = "<!-- absolute:nav -->";
4
+ export declare const renderNavBlock: (items: NavItem[], indent: string) => string;
5
+ export declare const syncStaticNav: (html: string, items: NavItem[]) => string | null;
@@ -0,0 +1 @@
1
+ export declare const runGenerate: (args: string[]) => Promise<void>;
package/package.json CHANGED
@@ -411,7 +411,7 @@
411
411
  ]
412
412
  }
413
413
  },
414
- "version": "0.19.0-beta.1038",
414
+ "version": "0.19.0-beta.1039",
415
415
  "workspaces": [
416
416
  "tests/fixtures/*",
417
417
  "tests/fixtures/_packages/*"