@strav/spring 1.0.0-alpha.31 → 1.0.0-alpha.33
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strav/spring",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.33",
|
|
4
4
|
"description": "Strav project scaffolder — `bunx @strav/spring my-app` writes a working app skeleton (bin/, bootstrap/, config/, routes/, …) per spec/directory-structure.md. Two templates: --api (headless REST) and --web (Vue islands + .strav views). Runtime-independent of the framework — no @strav/* runtime deps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
package/src/cli.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { parseArgs, type Template, toSnakeCase } from './args.ts'
|
|
|
12
12
|
import { input, select } from './prompts.ts'
|
|
13
13
|
import { scaffold } from './scaffold.ts'
|
|
14
14
|
import { SpringError } from './spring_error.ts'
|
|
15
|
-
import { STRAV_VERSION } from './version.ts'
|
|
15
|
+
import { SPRING_VERSION, STRAV_VERSION } from './version.ts'
|
|
16
16
|
|
|
17
17
|
const bold = (s: string): string => `\x1b[1m${s}\x1b[0m`
|
|
18
18
|
const dim = (s: string): string => `\x1b[2m${s}\x1b[0m`
|
|
@@ -20,8 +20,6 @@ const green = (s: string): string => `\x1b[32m${s}\x1b[0m`
|
|
|
20
20
|
const red = (s: string): string => `\x1b[31m${s}\x1b[0m`
|
|
21
21
|
const cyan = (s: string): string => `\x1b[36m${s}\x1b[0m`
|
|
22
22
|
|
|
23
|
-
const SPRING_VERSION = '1.0.0-alpha.30'
|
|
24
|
-
|
|
25
23
|
function printUsage(): void {
|
|
26
24
|
process.stdout.write(`
|
|
27
25
|
${bold('@strav/spring')} ${dim(`v${SPRING_VERSION}`)}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { HttpConsoleProvider, HttpProvider } from '@strav/http'
|
|
2
|
-
import { ConfigProvider, LoggerProvider, type
|
|
2
|
+
import { ConfigProvider, LoggerProvider, type ServiceProviderEntry } from '@strav/kernel'
|
|
3
3
|
import { AppProvider } from '../app/providers/app_provider.ts'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Default provider list. Order is not load-bearing — the container does a
|
|
7
|
-
* dependency-aware topo sort at boot.
|
|
8
|
-
*
|
|
7
|
+
* dependency-aware topo sort at boot. Entries can be a `ServiceProvider`
|
|
8
|
+
* instance, a zero-arg constructor, or a closure returning one (used here
|
|
9
|
+
* for `ConfigProvider.fromDirectory`, which is async).
|
|
9
10
|
*
|
|
10
11
|
* `ConfigProvider.fromDirectory('config')` auto-discovers every
|
|
11
12
|
* `config/*.ts` file and keys them by basename — `config/app.ts` →
|
|
@@ -13,12 +14,12 @@ import { AppProvider } from '../app/providers/app_provider.ts'
|
|
|
13
14
|
* a new config slot, drop a file with a `default export` into
|
|
14
15
|
* `config/`. No edits to this list required.
|
|
15
16
|
*/
|
|
16
|
-
export
|
|
17
|
+
export function providers(): ServiceProviderEntry[] {
|
|
17
18
|
return [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
() => ConfigProvider.fromDirectory('config'),
|
|
20
|
+
LoggerProvider,
|
|
21
|
+
HttpProvider,
|
|
22
|
+
HttpConsoleProvider,
|
|
23
|
+
AppProvider,
|
|
23
24
|
]
|
|
24
25
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { HttpConsoleProvider, HttpProvider } from '@strav/http'
|
|
2
|
-
import { ConfigProvider, LoggerProvider, type
|
|
2
|
+
import { ConfigProvider, LoggerProvider, type ServiceProviderEntry } from '@strav/kernel'
|
|
3
3
|
import { ViewConsoleProvider, ViewProvider } from '@strav/view'
|
|
4
4
|
import { AppProvider } from '../app/providers/app_provider.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Default provider list. Order is not load-bearing — the container does a
|
|
8
|
-
* dependency-aware topo sort at boot.
|
|
9
|
-
*
|
|
8
|
+
* dependency-aware topo sort at boot. Entries can be a `ServiceProvider`
|
|
9
|
+
* instance, a zero-arg constructor, or a closure returning one (used here
|
|
10
|
+
* for `ConfigProvider.fromDirectory`, which is async).
|
|
10
11
|
*
|
|
11
12
|
* `ConfigProvider.fromDirectory('config')` auto-discovers every
|
|
12
13
|
* `config/*.ts` file and keys them by basename — `config/view.ts` →
|
|
@@ -18,14 +19,14 @@ import { AppProvider } from '../app/providers/app_provider.ts'
|
|
|
18
19
|
* and registers a route for each at boot. `ViewConsoleProvider` adds the
|
|
19
20
|
* `view:build` / `view:cache` / `view:clear` commands.
|
|
20
21
|
*/
|
|
21
|
-
export
|
|
22
|
+
export function providers(): ServiceProviderEntry[] {
|
|
22
23
|
return [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
() => ConfigProvider.fromDirectory('config'),
|
|
25
|
+
LoggerProvider,
|
|
26
|
+
HttpProvider,
|
|
27
|
+
HttpConsoleProvider,
|
|
28
|
+
ViewProvider,
|
|
29
|
+
ViewConsoleProvider,
|
|
30
|
+
AppProvider,
|
|
30
31
|
]
|
|
31
32
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* `package.json
|
|
2
|
+
* Version constants for `@strav/spring`. Both derive from this package's own
|
|
3
|
+
* `package.json` so a single `./scripts/sync-versions.sh` bump propagates
|
|
4
|
+
* everywhere — no hand-maintained mirrors to drift.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* - `SPRING_VERSION` — printed by `--version` and the banner.
|
|
7
|
+
* - `STRAV_VERSION` — pinned into scaffolded apps' `package.json` as a
|
|
8
|
+
* caret range. Valid only while spring tracks the workspace alpha in
|
|
9
|
+
* lockstep; when spring eventually cuts its own cadence, replace with
|
|
10
|
+
* a hand-maintained constant.
|
|
8
11
|
*/
|
|
9
|
-
|
|
12
|
+
|
|
13
|
+
import pkg from '../package.json' with { type: 'json' }
|
|
14
|
+
|
|
15
|
+
export const SPRING_VERSION: string = pkg.version
|
|
16
|
+
export const STRAV_VERSION = `^${pkg.version}` as const
|