@antelopejs/core 1.18.2 → 1.19.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.
- package/README.md +3 -3
- package/dist/cli/commands/project/build-action.d.ts +1 -0
- package/dist/cli/commands/project/build-action.js +9 -0
- package/dist/cli/commands/project/build-action.js.map +1 -1
- package/dist/cli/commands/project/build.js +6 -1
- package/dist/cli/commands/project/build.js.map +1 -1
- package/dist/cli/commands/project/modules/add-action.d.ts +2 -1
- package/dist/cli/commands/project/modules/add-action.js +9 -20
- package/dist/cli/commands/project/modules/add-action.js.map +1 -1
- package/dist/cli/commands/project/modules/install-action.js +37 -17
- package/dist/cli/commands/project/modules/install-action.js.map +1 -1
- package/dist/cli/commands/project/modules/module-locks.d.ts +24 -0
- package/dist/cli/commands/project/modules/module-locks.js +117 -0
- package/dist/cli/commands/project/modules/module-locks.js.map +1 -0
- package/dist/cli/commands/project/modules/remove-action.js +2 -0
- package/dist/cli/commands/project/modules/remove-action.js.map +1 -1
- package/dist/cli/commands/project/modules/update-action.js +27 -4
- package/dist/cli/commands/project/modules/update-action.js.map +1 -1
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/core/build/index.d.ts +1 -0
- package/dist/core/build/index.js +37 -2
- package/dist/core/build/index.js.map +1 -1
- package/dist/core/build/interface-ranges.d.ts +2 -0
- package/dist/core/build/interface-ranges.js +19 -0
- package/dist/core/build/interface-ranges.js.map +1 -0
- package/dist/core/downloaders/index.d.ts +1 -0
- package/dist/core/downloaders/index.js +1 -0
- package/dist/core/downloaders/index.js.map +1 -1
- package/dist/core/downloaders/package-locks.d.ts +18 -0
- package/dist/core/downloaders/package-locks.js +106 -0
- package/dist/core/downloaders/package-locks.js.map +1 -0
- package/dist/core/downloaders/package.d.ts +2 -0
- package/dist/core/downloaders/package.js +18 -6
- package/dist/core/downloaders/package.js.map +1 -1
- package/dist/core/embedded/prepare-embedded.js +1 -1
- package/dist/core/embedded/prepare-embedded.js.map +1 -1
- package/dist/core/modules/index.d.ts +1 -0
- package/dist/core/modules/index.js +1 -0
- package/dist/core/modules/index.js.map +1 -1
- package/dist/core/modules/module-locks.d.ts +38 -0
- package/dist/core/modules/module-locks.js +205 -0
- package/dist/core/modules/module-locks.js.map +1 -0
- package/dist/core/modules/module-manager-context.d.ts +8 -2
- package/dist/core/modules/module-manager-context.js +1 -0
- package/dist/core/modules/module-manager-context.js.map +1 -1
- package/dist/core/modules/module-manager-lifecycle.js +16 -2
- package/dist/core/modules/module-manager-lifecycle.js.map +1 -1
- package/dist/core/modules/module-manager-packages.d.ts +1 -0
- package/dist/core/modules/module-manager-packages.js +21 -9
- package/dist/core/modules/module-manager-packages.js.map +1 -1
- package/dist/core/modules/module-manager.d.ts +2 -0
- package/dist/core/modules/module-manager.js +4 -0
- package/dist/core/modules/module-manager.js.map +1 -1
- package/dist/core/output/failures.js +24 -7
- package/dist/core/output/failures.js.map +1 -1
- package/dist/core/output/interface-conflicts.d.ts +1 -1
- package/dist/core/output/interface-conflicts.js +2 -1
- package/dist/core/output/interface-conflicts.js.map +1 -1
- package/dist/core/output/interface-resolution-error.d.ts +2 -0
- package/dist/core/output/interface-resolution-error.js +5 -1
- package/dist/core/output/interface-resolution-error.js.map +1 -1
- package/dist/core/output/package-manager.d.ts +2 -0
- package/dist/core/output/package-manager.js +17 -3
- package/dist/core/output/package-manager.js.map +1 -1
- package/dist/core/runtime/launch-sequence.js +5 -2
- package/dist/core/runtime/launch-sequence.js.map +1 -1
- package/dist/core/runtime/module-interfaces.d.ts +11 -0
- package/dist/core/runtime/module-interfaces.js +65 -5
- package/dist/core/runtime/module-interfaces.js.map +1 -1
- package/dist/core/runtime/module-loading.d.ts +5 -1
- package/dist/core/runtime/module-loading.js +31 -5
- package/dist/core/runtime/module-loading.js.map +1 -1
- package/dist/core/runtime/runtime-bootstrap.js +3 -0
- package/dist/core/runtime/runtime-bootstrap.js.map +1 -1
- package/dist/core/runtime/runtime-types.d.ts +5 -1
- package/package.json +1 -1
- package/skills/ajs-cli/SKILL.md +7 -3
- package/skills/ajs-cli/cases.json +15 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-bootstrap.js","sourceRoot":"","sources":["../../../src/core/runtime/runtime-bootstrap.ts"],"names":[],"mappings":";;;;;AA0EA,sEAUC;AAED,oDA0BC;AAED,sEAOC;AAED,wDAcC;AAED,oDAQC;AAED,sDAcC;AAMD,8CAYC;AAED,
|
|
1
|
+
{"version":3,"file":"runtime-bootstrap.js","sourceRoot":"","sources":["../../../src/core/runtime/runtime-bootstrap.ts"],"names":[],"mappings":";;;;;AA0EA,sEAUC;AAED,oDA0BC;AAED,sEAOC;AAED,wDAcC;AAED,oDAQC;AAED,sDAcC;AAMD,8CAYC;AAED,4DAiBC;AAxMD,+DAA6E;AAC7E,gEAA6D;AAC7D,8DAAuC;AACvC,0DAA6B;AAE7B,2CAA8E;AAE9E,sCAA4D;AAC5D,8CAA+C;AAQ/C,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,IAAI,oBAAoB,GAAG,KAAK,CAAC;AACjC,IAAI,wBAAwB,GAAG,CAAC,CAAC;AACjC,MAAM,gBAAgB,GAAsB,EAAE,CAAC;AAE/C,SAAS,eAAe,CAAC,QAAgB;IACvC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,IAAI,qBAAqB,EAAE,CAAC;QAC1B,KAAK,qBAAqB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC9C,OAAO;IACT,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,uBAAuB,CAC9B,MAAwD;IAExD,OAAO,CACL,wBAAwB,GAAG,CAAC;QAC5B,MAAM,YAAY,KAAK;QACvB,MAAM,IAA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,GAAG,YAAY;QACf,OAAO,EAAE,YAAY,CAAC,OAAO,IAAI,EAAE;QACnC,WAAW,EAAE,aAAa;QAC1B,aAAa,EAAE,mBAAI,CAAC,OAAO,CAAC,aAAa,CAAC;KAC3C,CAAC;AACJ,CAAC;AAMM,KAAK,UAAU,iBAAiB,CACrC,aAAqB,EACrB,GAAW;IAEX,MAAM,EAAE,GAAG,IAAI,2BAAc,EAAE,CAAC;IAChC,MAAM,MAAM,GAAG,IAAI,qBAAY,CAAC,EAAE,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;IAE3D,OAAO;QACL,EAAE;QACF,gBAAgB,EAAE,qBAAqB,CAAC,YAAY,EAAE,aAAa,CAAC;KACrE,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,wBAAwB,CAC5C,aAAqB,EACrB,GAAW,EACX,OAAqC,EACrC,eAAiC;IAEjC,oBAAoB,CAAC,eAAe,CAAC,CAAC;IAEtC,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;IAC3D,IAAI,eAAe,IAAI,OAAO,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;QACxD,MAAM,CAAC,gBAAgB,CAAC,WAAW,GAAG,QAAQ,CAAC;IACjD,CAAC;IAED,IAAA,qCAA2B,EAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7D,oBAAoB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { AntelopeLogging } from "@antelopejs/interface-core/config";
|
|
|
2
2
|
import type { ExpandedModuleConfig, LoadedConfig } from "../config";
|
|
3
3
|
import type { DownloaderRegistry } from "../downloaders";
|
|
4
4
|
import type { NodeFileSystem } from "../filesystem";
|
|
5
|
-
import type { ModuleCache, ModuleConfig, ModuleManager, ModuleManifest } from "../modules";
|
|
5
|
+
import type { ModuleCache, ModuleConfig, ModuleLockMode, ModuleLockStore, ModuleManager, ModuleManifest } from "../modules";
|
|
6
6
|
import type { RuntimePolicy } from "./runtime-policy";
|
|
7
7
|
import type { ShutdownManager } from "./shutdown/index";
|
|
8
8
|
export interface ModuleOverrideRef {
|
|
@@ -16,11 +16,13 @@ export interface ModuleManifestEntry {
|
|
|
16
16
|
}
|
|
17
17
|
export interface BuildOptions {
|
|
18
18
|
verbose?: string[];
|
|
19
|
+
frozenModules?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export interface NormalizedLoadedConfig extends LoadedConfig {
|
|
21
22
|
cacheFolder: string;
|
|
22
23
|
projectFolder: string;
|
|
23
24
|
modules: Record<string, ExpandedModuleConfig>;
|
|
25
|
+
moduleLocks?: ModuleLockMode;
|
|
24
26
|
}
|
|
25
27
|
export interface ProjectRuntimeConfig {
|
|
26
28
|
fs: NodeFileSystem;
|
|
@@ -29,12 +31,14 @@ export interface ProjectRuntimeConfig {
|
|
|
29
31
|
export interface LoaderConfig {
|
|
30
32
|
cacheFolder: string;
|
|
31
33
|
projectFolder: string;
|
|
34
|
+
moduleLocks?: ModuleLockMode;
|
|
32
35
|
}
|
|
33
36
|
export interface LoaderContext {
|
|
34
37
|
fs: NodeFileSystem;
|
|
35
38
|
cache: ModuleCache;
|
|
36
39
|
registry: DownloaderRegistry;
|
|
37
40
|
projectFolder: string;
|
|
41
|
+
locks?: ModuleLockStore;
|
|
38
42
|
}
|
|
39
43
|
export type LoaderContextProvider = () => Promise<LoaderContext>;
|
|
40
44
|
export interface PreparedProject {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "TypeScript framework extending hexagonal architecture across your application and its ecosystem through explicit contracts and replaceable modules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
package/skills/ajs-cli/SKILL.md
CHANGED
|
@@ -16,7 +16,7 @@ ajs project dev --watch # reload modules when their files change (-w)
|
|
|
16
16
|
ajs project dev -e production # select an environment of antelope.config.ts (env: ANTELOPEJS_LAUNCH_ENV)
|
|
17
17
|
ajs project dev -i # REPL with the project loaded
|
|
18
18
|
ajs project dev --inspect # Node inspector (default 127.0.0.1:9229)
|
|
19
|
-
ajs project build # download & install modules, check they load, write .antelope/build/build.json
|
|
19
|
+
ajs project build # download & install modules, check they load and interface ranges, write .antelope/build/build.json (--frozen-modules in CI)
|
|
20
20
|
ajs project start # launch from the build artifact; --refresh-config re-resolves the config at start
|
|
21
21
|
ajs project logging show|set # view/change logging settings
|
|
22
22
|
```
|
|
@@ -31,16 +31,20 @@ ajs project logging show|set # view/change logging settings
|
|
|
31
31
|
ajs project modules list # configured modules + their sources (alias: ls; -j for JSON)
|
|
32
32
|
ajs project modules add <modules...> # add & download modules you name (-m, --mode package|git|local|dir; default package = npm)
|
|
33
33
|
ajs project modules remove <modules...> # remove from config (alias: rm; -f, --force)
|
|
34
|
-
ajs project modules update [modules...] # bump npm modules to their latest versions (--dry-run)
|
|
34
|
+
ajs project modules update [modules...] # bump npm modules to their latest versions and resolve their locks again (--dry-run)
|
|
35
35
|
ajs project modules install # add a provider module for every unresolved interface (-y: never ask)
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
`add` in package mode accepts `<name>@<exact|range|dist-tag>`; without a spec it writes a caret range of the latest version. `add` does no interface resolution.
|
|
39
39
|
|
|
40
|
-
`modules install` (not `add`) fixes **unresolved imports**, and despite its name it installs no npm dependencies: it finds the interfaces no loaded module implements, looks up their implementing modules in the interface repository, and writes the chosen one into `antelope.config.ts`. A single implementer is added without a question; with several it asks, or takes the first with `-y`.
|
|
40
|
+
`modules install` (not `add`) fixes **unresolved imports**, and despite its name it installs no npm dependencies: it finds the interfaces no loaded module implements, looks up their implementing modules in the interface repository, and writes the chosen one into `antelope.config.ts`. A single implementer is added without a question; with several it asks, or takes the first with `-y`. It then checks interface ranges like `build`.
|
|
41
|
+
|
|
42
|
+
`build` and `modules install` fail (exit `1`, no `build.json` written) with `Incompatible interface package resolution` when a module's declared range of an interface package excludes the shared copy, the same error `start` and `dev` raise. Fix it as the error says: update that module, or widen its range to the shared version (`^<version>`) and reinstall, or keep the module that provides the shared copy on a version within the range. Do not skip the build check. A module marked `optional: true` that would conflict only produces a warning, as `start` runs without it.
|
|
41
43
|
|
|
42
44
|
Modules declared in `antelope.config.ts` are downloaded into `.antelope/cache` by `dev`, `build`, and `modules add`; a module's own npm dependencies install inside its cache folder.
|
|
43
45
|
|
|
46
|
+
**Module locks.** The lockfile an npm module's package manager writes in its cache folder is recorded in `antelope-lock/<package>@<version>/` (`pnpm-lock.yaml`, `package-lock.json` or `yarn.lock`), and replayed on every later install, so the same commit installs the same dependency versions on every machine and every day. Commit `antelope-lock/` with `antelope.config.ts`. A locked range (`^1.0.0`) stays on its recorded version. Only `modules update` resolves the dependencies again (and drops the locks no environment uses, as `modules remove` does): that is how a dependency fix reaches the project, and its diff is the review. In CI and image builds run `ajs project build --frozen-modules` (env `ANTELOPEJS_FROZEN_MODULES`): it installs only from the locks and fails on an npm module without one. Git and local modules carry their own lockfiles and are not locked here.
|
|
47
|
+
|
|
44
48
|
## Embedded mode: no `ajs project`
|
|
45
49
|
|
|
46
50
|
In **embedded** mode the host application (AdonisJS, Express, Fastify…) owns the process and starts the runtime itself with `createRuntime({ projectFolder, modules, uses })` from `@antelopejs/core`, calling `start()` and `stop()` from its own lifecycle (in AdonisJS, a service provider). Recognize it before running any `ajs project` command: **no `antelope.config.*`**, and a host file calls `createRuntime`.
|
|
@@ -99,6 +99,21 @@
|
|
|
99
99
|
"acceptable": ["antelopejs"],
|
|
100
100
|
"mustMention": ["ajs project build", "ajs project start"]
|
|
101
101
|
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "ajs-cli-module-locks-ci",
|
|
105
|
+
"area": "framework",
|
|
106
|
+
"style": "clean",
|
|
107
|
+
"prompt": "My antelope.config.ts pins @antelopejs/api to an exact version, yet a clean CI build installs newer interface packages than my laptop did yesterday. How do I make module installs reproducible?",
|
|
108
|
+
"expect": {
|
|
109
|
+
"skills": ["ajs-cli"],
|
|
110
|
+
"acceptable": ["antelopejs"],
|
|
111
|
+
"mustMention": [
|
|
112
|
+
"antelope-lock",
|
|
113
|
+
"--frozen-modules",
|
|
114
|
+
"ajs project modules update"
|
|
115
|
+
]
|
|
116
|
+
}
|
|
102
117
|
}
|
|
103
118
|
]
|
|
104
119
|
}
|