@_linked/cli 1.30.1 → 1.31.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 +39 -0
- package/defaults/package/gitignore.template +3 -0
- package/defaults/package/package.json +2 -1
- package/defaults/package/src/index.ts +5 -1
- package/defaults/package/src/ontologies/example-ontology.ts +1 -1
- package/defaults/package/tsconfig.json +14 -2
- package/lib/esm/cli-methods.d.ts.map +1 -1
- package/lib/esm/cli-methods.js +8 -1
- package/lib/esm/cli-methods.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.31.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#157](https://github.com/linked-fw/cli/pull/157) [`5197e61`](https://github.com/linked-fw/cli/commit/5197e61dc3226ba89402adf34b9ca445631424be) Thanks [@flyon](https://github.com/flyon)! - `create-package` now produces a package that is correct the moment it exists.
|
|
8
|
+
|
|
9
|
+
Three defects, fixed together because fixing one alone turns a silent defect into a hard
|
|
10
|
+
build failure:
|
|
11
|
+
|
|
12
|
+
- **The ontology register sibling was never wired up.** The template's `src/index.ts`
|
|
13
|
+
imported the terms module rather than `<name>.register.js`, and `createPackage` omitted
|
|
14
|
+
`example-ontology.register.ts` from both its substitution list and its rename list. A new
|
|
15
|
+
package therefore kept a stray `example-ontology.register.ts` full of unsubstituted
|
|
16
|
+
`${...}` placeholders, and nothing imported either register file — so `linkedOntology()`
|
|
17
|
+
never ran and the ontology was never registered. `createOntology` now adds the register
|
|
18
|
+
import to the index too.
|
|
19
|
+
- **The template still shipped an entry-graph compile** (`files: [types.ts, index.ts]`,
|
|
20
|
+
`include: [backend.ts]`). It now uses the whole-folder shape the fleet converged on:
|
|
21
|
+
`files: ["./src/index.ts"]`, `include: ["./src/**/*.ts", "./src/backend.ts"]`, with tests
|
|
22
|
+
excluded. This had to follow the fix above: a whole-folder compile would otherwise reach
|
|
23
|
+
the unsubstituted placeholder and fail.
|
|
24
|
+
- **A new package had no `.gitignore`**, so `lib/` and `node_modules/` were committable from
|
|
25
|
+
minute one. The template now ships `gitignore.template` (`lib`, `node_modules`,
|
|
26
|
+
`*.tsbuildinfo`), renamed by the existing dotfile pass.
|
|
27
|
+
|
|
28
|
+
- **`"types"` produced a double mapping.** The template declared
|
|
29
|
+
`"types": "lib/esm/index.d.ts"` alongside `typesVersions: {"*":{"*":["lib/esm/*"]}}`,
|
|
30
|
+
which TypeScript applies to the `types` field too — so it asked for
|
|
31
|
+
`lib/esm/lib/esm/index.d.ts` and `node10` resolution failed outright. Restored to
|
|
32
|
+
`"types": "index.d.ts"`, the convention the shipped packages already use, with a `//types`
|
|
33
|
+
note in the file saying why it is correct as written.
|
|
34
|
+
|
|
35
|
+
Also fixes the `data.defauilt` typo in the example ontology's ESM JSON import, which made
|
|
36
|
+
`loadData()` resolve to `undefined` under ESM.
|
|
37
|
+
|
|
38
|
+
A new gated suite, `tests/template/package.full.test.ts` (`npm run test:template`),
|
|
39
|
+
scaffolds with the built CLI, installs, builds, and asserts each of these as a property
|
|
40
|
+
rather than a claim.
|
|
41
|
+
|
|
3
42
|
## 1.30.1
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"linkedPackage": true,
|
|
15
15
|
"main": "lib/cjs/index.js",
|
|
16
16
|
"module": "lib/esm/index.js",
|
|
17
|
-
"types": "lib/esm/index.d.ts",
|
|
17
|
+
"//types": "Correct as written, do not 'fix' it: typesVersions below is applied to the types field too, so \"index.d.ts\" resolves to lib/esm/index.d.ts. Writing that literal path applies the mapping twice (lib/esm/lib/esm/index.d.ts) and breaks node10 resolution. Verify with ts.resolveModuleName under node10 AND bundler, not by looking for the file on disk.",
|
|
18
|
+
"types": "index.d.ts",
|
|
18
19
|
"license": "ISC",
|
|
19
20
|
"scripts": {
|
|
20
21
|
"start": "linked dev",
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import './types.js';
|
|
2
|
-
|
|
2
|
+
// Registers the ontology. This MUST be the `.register.js` sibling, not the terms module
|
|
3
|
+
// itself: importing the terms module alone never calls `linkedOntology()`, so the ontology
|
|
4
|
+
// is silently never registered. See the comment in the register file for why registration
|
|
5
|
+
// cannot live in the terms module.
|
|
6
|
+
import './ontologies/${hyphen_name}.register.js';
|
|
3
7
|
|
|
4
8
|
//SHAPES FIRST — all shapes register via the barrel
|
|
5
9
|
import './shapes/index.js';
|
|
@@ -11,7 +11,7 @@ export var loadData = () => {
|
|
|
11
11
|
} else {
|
|
12
12
|
// ESM import
|
|
13
13
|
//@ts-ignore
|
|
14
|
-
return import('../data/${hyphen_name}.json',{ with: { type: "json" } }).then((data) => data.
|
|
14
|
+
return import('../data/${hyphen_name}.json',{ with: { type: "json" } }).then((data) => data.default);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -9,10 +9,22 @@
|
|
|
9
9
|
"resolveJsonModule": true,
|
|
10
10
|
"esModuleInterop": true,
|
|
11
11
|
"pretty": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
12
13
|
"jsx": "react",
|
|
13
14
|
"types": ["node"]
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
|
-
"./src/
|
|
17
|
-
|
|
17
|
+
"./src/index.ts"
|
|
18
|
+
],
|
|
19
|
+
"include": [
|
|
20
|
+
"./src/**/*.ts",
|
|
21
|
+
"./src/backend.ts"
|
|
22
|
+
],
|
|
23
|
+
"exclude": [
|
|
24
|
+
"**/*.test.ts",
|
|
25
|
+
"**/*.test.tsx",
|
|
26
|
+
"./src/__tests__/**",
|
|
27
|
+
"./src/tests/**",
|
|
28
|
+
"./src/test-helpers/**"
|
|
29
|
+
]
|
|
18
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-methods.d.ts","sourceRoot":"","sources":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,SAAI,EACJ,UAAK,EACL,UAAK,EACL,oBAAe,oBAmEhB,CAAC;AAEF,eAAO,IAAI,YAAY,GACrB,SAAI,EACJ,WAAM,EACN,YAAO,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
|
@@ -1065,7 +1065,9 @@ export const createOntology = (prefix_1, uriBase_1, ...args_1) => __awaiter(void
|
|
|
1065
1065
|
//if this is not a lincd app (but a lincd package instead)
|
|
1066
1066
|
if (!sourceFolder.includes('frontend')) {
|
|
1067
1067
|
//then also add an import to index
|
|
1068
|
-
|
|
1068
|
+
// Import the register sibling, not the terms module: only the sibling calls
|
|
1069
|
+
// linkedOntology(). See the comment in example-ontology.register.ts.
|
|
1070
|
+
let indexPath = addLineToIndex(`import './ontologies/${hyphenName}.register.js';`, 'ontologies');
|
|
1069
1071
|
log(`Added an import of this file from ${chalk.magenta(indexPath)}`);
|
|
1070
1072
|
}
|
|
1071
1073
|
});
|
|
@@ -1865,6 +1867,7 @@ export const createPackage = (name_1, uriBase_1, ...args_1) => __awaiter(void 0,
|
|
|
1865
1867
|
'Gruntfile.js',
|
|
1866
1868
|
'src/package.ts',
|
|
1867
1869
|
'src/ontologies/example-ontology.ts',
|
|
1870
|
+
'src/ontologies/example-ontology.register.ts',
|
|
1868
1871
|
'src/data/example-ontology.json',
|
|
1869
1872
|
]
|
|
1870
1873
|
.map((f) => path.join(targetFolder, f))
|
|
@@ -1874,6 +1877,10 @@ export const createPackage = (name_1, uriBase_1, ...args_1) => __awaiter(void 0,
|
|
|
1874
1877
|
//rename these to a file name similar to the pkg name
|
|
1875
1878
|
[
|
|
1876
1879
|
'src/ontologies/example-ontology.ts',
|
|
1880
|
+
// The register sibling is what index.ts imports; without it here the scaffold keeps a
|
|
1881
|
+
// literal `example-ontology.register.ts` full of unsubstituted `${...}` placeholders and
|
|
1882
|
+
// nothing ever calls linkedOntology().
|
|
1883
|
+
'src/ontologies/example-ontology.register.ts',
|
|
1877
1884
|
'src/data/example-ontology.json',
|
|
1878
1885
|
'src/data/example-ontology.json.d.ts',
|
|
1879
1886
|
].forEach((f) => {
|