@absolutejs/absolute 0.20.0-beta.76 → 0.20.0-beta.78

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.
@@ -1,2 +1,3 @@
1
+ export declare const collectTransitiveImports: (specs: Iterable<string>, alreadyVendored: Set<string>, alreadyScanned: Set<string>) => Promise<Set<string>>;
1
2
  export declare const buildDepVendor: (buildDir: string, directories: string[], files?: string[]) => Promise<Record<string, string>>;
2
3
  export declare const computeDepVendorPaths: (directories: string[], files?: string[]) => Promise<Record<string, string>>;
@@ -0,0 +1,2 @@
1
+ /** Report what a migration would involve, without changing anything. */
2
+ export declare const migrate: (root?: string) => void;
@@ -8,5 +8,19 @@ export declare const findSharedWorkspaceBuildDirectories: (services: WorkspaceCo
8
8
  buildDirectory: string;
9
9
  names: string[];
10
10
  }[];
11
+ /** Start every service, and tear down whatever already started if any of them
12
+ * never becomes ready.
13
+ *
14
+ * Without this a readiness timeout rejects out of the whole command while the
15
+ * children it already spawned keep running. The result is worse than a clean
16
+ * failure: an orphaned server still holding the port, with no supervisor and
17
+ * no hot reload, which looks like a working server right up until an edit
18
+ * never lands or a click hits a stale bundle. Failing to start must leave
19
+ * nothing behind. */
20
+ export declare const startWorkspaceOrShutDown: ({ onFailure, shutdown, start }: {
21
+ onFailure: (message: string) => void;
22
+ shutdown: (exitCode: number) => Promise<void> | void;
23
+ start: () => Promise<void>;
24
+ }) => Promise<boolean>;
11
25
  export declare const workspace: (subcommand: string | undefined, options: WorkspaceDevOptions) => Promise<void>;
12
26
  export {};
@@ -11,6 +11,10 @@ type ModuleServerConfig = {
11
11
  };
12
12
  stylePreprocessors?: StylePreprocessorConfig;
13
13
  };
14
+ /** The named bindings of an import clause, so a stub can export exactly what
15
+ * the importer expects. Aliases keep the source name (`{ a as b }` needs `a`
16
+ * exported); a namespace or default import needs nothing extra. */
17
+ export declare const importedBindingNames: (clause: string) => string[];
14
18
  export declare const isReactFastRefreshSupported: () => boolean;
15
19
  export declare const warnIfReactFastRefreshUnsupported: () => void;
16
20
  export declare const warmCompilers: (frameworks: {
@@ -0,0 +1,25 @@
1
+ import type { StackDetection } from './types';
2
+ /** Below this, a caller should ask rather than assume. A single weak signal
3
+ * — say a `vite` devDependency in an otherwise unrecognisable repo — is a
4
+ * hint, not a verdict. */
5
+ export declare const CONFIDENT = 0.7;
6
+ type Manifest = {
7
+ dependencies?: Record<string, string>;
8
+ devDependencies?: Record<string, string>;
9
+ peerDependencies?: Record<string, string>;
10
+ scripts?: Record<string, string>;
11
+ };
12
+ export type DetectionInput = {
13
+ /** Parsed package.json, or null when the repo has none. */
14
+ manifest: Manifest | null;
15
+ /** Repo-relative paths of files at or near the root. Directory entries
16
+ * may be included; only names are ever compared. */
17
+ files: readonly string[];
18
+ };
19
+ /** Identify the framework a project is built on.
20
+ *
21
+ * Returns `unknown` with zero confidence rather than guessing when nothing
22
+ * matches — a wrong stack sends a migration down a path that cannot work,
23
+ * which is worse than admitting ignorance and asking. */
24
+ export declare const detectStack: ({ manifest, files }: DetectionInput) => StackDetection;
25
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type CatalogEntryLike, type SubstitutionRule } from './substitutions';
2
+ import type { MigrationPlan } from './types';
3
+ /** Repo-relative paths, skipping build output and vendored code. */
4
+ export declare const listProjectFiles: (root: string, limit?: number) => string[];
5
+ /** Which files import each of `packages`. A plain substring test over the
6
+ * quoted specifier: an import map does not need a parser, and being wrong
7
+ * here costs a slightly long list, not a bad edit. */
8
+ export declare const findImporters: (root: string, files: readonly string[], packages: readonly string[]) => Record<string, string[]>;
9
+ export type ScanOptions = {
10
+ catalog?: readonly CatalogEntryLike[];
11
+ rules?: readonly SubstitutionRule[];
12
+ };
13
+ /** Read a project and produce the plan. Does not modify anything. */
14
+ export declare const scanProject: (root: string, { catalog, rules }?: ScanOptions) => MigrationPlan;
@@ -0,0 +1,37 @@
1
+ export type SubstitutionRule = {
2
+ /** The third-party dependency, as it appears in package.json. */
3
+ from: string;
4
+ /** The first-party package that covers it. */
5
+ to: string;
6
+ /** One line a reader can judge without opening documentation. */
7
+ rationale: string;
8
+ };
9
+ /** Minimum a caller must tell us about the catalog. Deliberately structural
10
+ * rather than an import of Studio's generated type: the CLI ships a
11
+ * snapshot, Studio passes its live catalog, and neither should have to
12
+ * match the other's exact shape. */
13
+ export type CatalogEntryLike = {
14
+ name: string;
15
+ };
16
+ export declare const DEFAULT_SUBSTITUTION_RULES: readonly SubstitutionRule[];
17
+ export type SubstitutionInput = {
18
+ /** Dependency names declared by the project, any section. */
19
+ dependencies: readonly string[];
20
+ /** Repo-relative files importing each dependency. A dependency absent
21
+ * from this map is reported with an empty `usedIn` — declared but never
22
+ * imported is still worth knowing, for a different reason. */
23
+ importsByPackage?: Readonly<Record<string, readonly string[]>>;
24
+ /** The packages that actually exist. Suggestions are filtered to these. */
25
+ catalog: readonly CatalogEntryLike[];
26
+ rules?: readonly SubstitutionRule[];
27
+ };
28
+ /** Find dependencies that have a first-party equivalent.
29
+ *
30
+ * Ordered by how much evidence there is that the dependency is really in
31
+ * use, so a caller rendering the top few shows the ones that matter. */
32
+ export declare const planSubstitutions: ({ dependencies, importsByPackage, catalog, rules }: SubstitutionInput) => {
33
+ from: string;
34
+ rationale: string;
35
+ to: string;
36
+ usedIn: string[];
37
+ }[];
@@ -0,0 +1,40 @@
1
+ /** Frameworks the detector can recognise in a project it did not create. */
2
+ export type StackKind = 'absolutejs' | 'astro' | 'create-react-app' | 'nextjs' | 'nuxt' | 'remix' | 'sveltekit' | 'unknown' | 'vite';
3
+ /** Why the detector reached its conclusion, so a human (or a model) can
4
+ * disagree with it on evidence rather than on trust. */
5
+ export type StackEvidence = {
6
+ /** Repo-relative path the signal came from. */
7
+ source: string;
8
+ /** What was found there, in one line. */
9
+ detail: string;
10
+ };
11
+ export type StackDetection = {
12
+ kind: StackKind;
13
+ /** 0-1. Below `CONFIDENT` the caller should ask rather than assume. */
14
+ confidence: number;
15
+ evidence: StackEvidence[];
16
+ /** Every stack that matched at all, strongest first — a Next.js app that
17
+ * also uses Vite should not silently lose the second fact. */
18
+ alternates: StackKind[];
19
+ };
20
+ /** A dependency that has a first-party equivalent. Suggestion only: the
21
+ * engine never rewrites imports on its own, because silently swapping
22
+ * somebody's auth library is not a refactor, it is a surprise. */
23
+ export type PackageSubstitution = {
24
+ /** The dependency currently in package.json. */
25
+ from: string;
26
+ /** The `@absolutejs/*` package that covers it. */
27
+ to: string;
28
+ /** Where `from` is required, repo-relative. Empty when it is declared but
29
+ * never imported — still worth reporting, for a different reason. */
30
+ usedIn: string[];
31
+ /** One line a human can judge without opening docs. */
32
+ rationale: string;
33
+ };
34
+ /** How a caller wants edits applied. Mirrors the shape people already know
35
+ * from an editor agent: propose and wait, or apply and let them review. */
36
+ export type ApplyMode = 'apply' | 'propose';
37
+ export type MigrationPlan = {
38
+ detection: StackDetection;
39
+ substitutions: PackageSubstitution[];
40
+ };
package/package.json CHANGED
@@ -7,8 +7,8 @@
7
7
  "url": "https://github.com/absolutejs/absolutejs/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@absolutejs/auth": "0.75.0",
11
- "@absolutejs/beacon": "0.7.0-beta.4",
10
+ "@absolutejs/auth": ">=0.75.0 <0.77.0",
11
+ "@absolutejs/beacon": ">=0.7.0-beta.4 <0.8.0",
12
12
  "@absolutejs/devices": "0.7.0",
13
13
  "@absolutejs/devices-capacitor": "0.8.0",
14
14
  "@absolutejs/devices-expo": "0.0.2",
@@ -515,7 +515,7 @@
515
515
  ]
516
516
  }
517
517
  },
518
- "version": "0.20.0-beta.76",
518
+ "version": "0.20.0-beta.78",
519
519
  "workspaces": [
520
520
  "tests/fixtures/*",
521
521
  "tests/fixtures/_packages/*"