@_linked/cli 1.29.0 → 1.30.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/CHANGELOG.md +27 -0
- package/lib/esm/cli-methods.d.ts.map +1 -1
- package/lib/esm/cli-methods.js +8 -0
- package/lib/esm/cli-methods.js.map +1 -1
- package/lib/esm/utils/shapeNames.d.ts +2 -0
- package/lib/esm/utils/shapeNames.d.ts.map +1 -1
- package/lib/esm/utils/shapeNames.js +8 -0
- package/lib/esm/utils/shapeNames.js.map +1 -1
- package/lib/esm/utils/shapeReferences.d.ts +97 -0
- package/lib/esm/utils/shapeReferences.d.ts.map +1 -0
- package/lib/esm/utils/shapeReferences.js +308 -0
- package/lib/esm/utils/shapeReferences.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.30.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#175](https://github.com/linked-fw/cli/pull/175) [`816f961`](https://github.com/linked-fw/cli/commit/816f961709b03ea05341f1a2f62713f721f0e20a) Thanks [@flyon](https://github.com/flyon)! - `linked build` now checks that loading a shape module registers every shape its properties point at.
|
|
8
|
+
|
|
9
|
+
A property that names its value shape by `[package, name]` (`shape: ['@_linked/schema', 'ImageObject']`)
|
|
10
|
+
does not load that shape, and consumers deep-import single shape modules. So a package could ship a
|
|
11
|
+
module whose query `workspace.image.contentUrl` threw `Shape class not found for …/ImageObject` in a
|
|
12
|
+
production bundle where nothing else happened to load ImageObject — which is how Create Now came to
|
|
13
|
+
show "No organizations found". `@_linked/sioc` also named shapes under its old package name
|
|
14
|
+
(`lincd-sioc`), which could never resolve.
|
|
15
|
+
|
|
16
|
+
The new step, **Checking shape references**, runs after the ESM output is final. It loads every module
|
|
17
|
+
under `lib/esm/shapes/` (and any other module that declares a `@linkedShape`) in a `node` process of
|
|
18
|
+
its own, with nothing imported first, and then **fails the build** for:
|
|
19
|
+
|
|
20
|
+
- a module that throws when loaded on its own (e.g. `Cannot access 'X' before initialization`);
|
|
21
|
+
- a property of one of the package's shapes whose value shape is not registered — naming the
|
|
22
|
+
property, the missing shape's IRI and the modules that showed it, and whether the target package's
|
|
23
|
+
entry registers it (a missing import), does not (a wrong name), or the IRI belongs to no dependency
|
|
24
|
+
(an old package name).
|
|
25
|
+
|
|
26
|
+
`*.class.js` modules are skipped: they are the class half of a split shape module and are checked
|
|
27
|
+
through the public module that re-exports them. Asset imports (`.css`, images, fonts) load as stubs.
|
|
28
|
+
`@_linked/core`'s `PropertyShape.in → List` is a known, tracked gap and warns instead of failing.
|
|
29
|
+
|
|
3
30
|
## 1.29.0
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-methods.d.ts","sourceRoot":"","sources":["../../src/cli-methods.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-methods.d.ts","sourceRoot":"","sources":["../../src/cli-methods.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAepD;;;;;;GAMG;AAKH,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,GACb,CAAC;AAoBF,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,cAAc,CAAC;AAEjD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAU,SAAI,EAAE,i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AAO,EACP,wBAAuB,OAAe,EACtC,OAAM,OAAe,kBAiHtB,CAAC;AAeF,eAAO,IAAI,4BAA4B,GACrC,aAAQ,EACR,YAAO,EACP,iBAAY,EACZ,gBAAW,qBA4CZ,CAAC;AAOF,eAAO,IAAI,cAAc,GAAa,aAAQ,EAAE,YAAO,SAMtD,CAAC;AACF,eAAO,IAAI,YAAY,GAAmB,iBAAwB,kBA8FjE,CAAC;AAEF,eAAO,IAAI,wBAAwB,GAAa,gBAAW,EAAE,YAAO,SAsCnE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAU,gBAAW,qBA8B/C,CAAC"}
|
package/lib/esm/cli-methods.js
CHANGED
|
@@ -20,6 +20,7 @@ import { planPackageSetup } from './utils/packageSetup.js';
|
|
|
20
20
|
import { detectPackageManager, execBinCommand, runScriptCommand, } from './utils/packageManager.js';
|
|
21
21
|
import { rewriteExtensionlessImports } from './utils/esmSpecifiers.js';
|
|
22
22
|
import { checkShapeNames } from './utils/shapeNames.js';
|
|
23
|
+
import { checkShapeReferences } from './utils/shapeReferences.js';
|
|
23
24
|
import { spawn as spawnChild } from 'child_process';
|
|
24
25
|
import { findNearestPackageJson } from 'find-nearest-package-json';
|
|
25
26
|
import { statSync } from 'fs';
|
|
@@ -2273,6 +2274,13 @@ export const planBuildSteps = (pkgJson, packagePath) => [
|
|
|
2273
2274
|
name: 'Checking shape names',
|
|
2274
2275
|
apply: () => checkShapeNames(packagePath),
|
|
2275
2276
|
},
|
|
2277
|
+
{
|
|
2278
|
+
// Loads each compiled shape module on its own, so it needs the final
|
|
2279
|
+
// lib/esm too. Fails the build: an unresolved reference is a query that
|
|
2280
|
+
// throws "Shape class not found" in a consumer's bundle.
|
|
2281
|
+
name: 'Checking shape references',
|
|
2282
|
+
apply: () => checkShapeReferences(packagePath),
|
|
2283
|
+
},
|
|
2276
2284
|
{
|
|
2277
2285
|
name: 'Checking dependencies',
|
|
2278
2286
|
apply: () => depCheck(packagePath),
|