@asterflow/cli 2.0.1 → 2.1.0

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.
@@ -5,4 +5,4 @@ export interface PackageJsonOptions {
5
5
  adapter: AdapterDefinition;
6
6
  plugins: PluginDefinition[];
7
7
  }
8
- export declare function generatePackage({ name, adapter, plugins }: PackageJsonOptions): string;
8
+ export declare function generatePackage({ name, adapter, plugins }: PackageJsonOptions): Promise<string>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Resolves the safest install range for an AsterFlow-ecosystem package: the latest
3
+ * published patch within this CLI's own major.minor line, e.g. `^2.0.4` when the CLI
4
+ * itself is `2.0.1`. Every asterflow package moves in lockstep (see VERSIONING.md) and
5
+ * only the patch digit (Z) is guaranteed to carry zero API/type surface impact - a
6
+ * minor bump can break types, a major can break runtime - so floating past the CLI's
7
+ * own X.Y would risk reintroducing the exact cross-package mismatch (e.g. scaffolding
8
+ * `asterflow@0.0.5` next to `@asterflow/fs@1.0.7`) this resolver exists to prevent.
9
+ * Falls back to the CLI's own version when the registry can't be reached, so scaffolding
10
+ * still works offline - just without picking up any patch released since this CLI build.
11
+ */
12
+ export declare function resolveAsterflowVersion(packageName: string): Promise<string>;
13
+ /**
14
+ * Resolves the `^latest` install range for a regular (non-AsterFlow-ecosystem)
15
+ * npm package, e.g. `tsdown`. Unlike `resolveAsterflowVersion`, this isn't
16
+ * pinned to the CLI's own major.minor - it just reads the registry's `latest`
17
+ * dist-tag. Falls back to `fallbackVersion` when the registry can't be reached.
18
+ */
19
+ export declare function resolveLatestVersion(packageName: string, fallbackVersion: string): Promise<string>;
@@ -11,6 +11,8 @@ export interface AdapterDefinition {
11
11
  preamble: string | null;
12
12
  /** Everything after `.listen` - arguments and callback - appended to the exported chain. */
13
13
  listenCall: string;
14
+ /** Binary used to run the bundled `dist/index.mjs` in the `start` script - `bun` needs Bun's globals, everything else runs under plain Node. */
15
+ runCommand: 'bun' | 'node';
14
16
  }
15
17
  export declare const ADAPTER_REGISTRY: Record<string, AdapterDefinition>;
16
18
  export declare const ADAPTER_IDS: string[];
@@ -1,7 +1,6 @@
1
1
  export interface PluginDefinition {
2
2
  id: string;
3
3
  packageName: string;
4
- version: string;
5
4
  description: string;
6
5
  /** Binding name imported from the plugin's package, e.g. `multipartPlugin`. */
7
6
  importName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asterflow/cli",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "CLI for scaffolding AsterFlow projects, adding plugins, and generating the static fs-routing manifest.",
5
5
  "keywords": [
6
6
  "asterflow",
@@ -40,7 +40,7 @@
40
40
  "dev": "bun run src/index.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@asterflow/fs": "^2.0.1",
43
+ "@asterflow/fs": "^2.1.0",
44
44
  "@clack/prompts": "^0.9.1",
45
45
  "chalk": "^4.1.2",
46
46
  "ci-info": "^4.1.0",
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'tsdown'
2
+
3
+ export default defineConfig({
4
+ entry: ['src/index.ts'],
5
+ format: ['esm'],
6
+ platform: 'node',
7
+ clean: true
8
+ })