@_linked/cli 1.8.1 → 1.8.2
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 +29 -0
- package/defaults/app-with-backend/.env.example +20 -0
- package/defaults/app-with-backend/gitignore.template +3 -1
- package/defaults/app-with-backend/linked.config.js +2 -0
- package/defaults/app-with-backend/package.json +12 -7
- package/defaults/app-with-backend/vite.config.ts +13 -0
- package/defaults/setup-publish/dual-branch/github/workflows/publish.yml +3 -0
- package/defaults/setup-publish/github/workflows/publish.yml +3 -0
- package/defaults/shape.ts +8 -2
- package/lib/cjs/cli-methods.d.ts +11 -3
- package/lib/cjs/cli-methods.d.ts.map +1 -1
- package/lib/cjs/cli-methods.js +55 -118
- package/lib/cjs/cli-methods.js.map +1 -1
- package/lib/cjs/cli.js +30 -6
- package/lib/cjs/cli.js.map +1 -1
- package/lib/cjs/commands/start.d.ts +6 -0
- package/lib/cjs/commands/start.d.ts.map +1 -0
- package/lib/cjs/commands/start.js +337 -0
- package/lib/cjs/commands/start.js.map +1 -0
- package/lib/cjs/config-webpack-app.d.ts +1 -1
- package/lib/cjs/config-webpack-app.d.ts.map +1 -1
- package/lib/cjs/config-webpack-app.js +1 -1
- package/lib/cjs/config-webpack-app.js.map +1 -1
- package/lib/cjs/config-webpack.d.ts +1 -1
- package/lib/cjs/config-webpack.d.ts.map +1 -1
- package/lib/cjs/config-webpack.js +10 -10
- package/lib/cjs/config-webpack.js.map +1 -1
- package/lib/cjs/defineConfig.d.ts +1 -1
- package/lib/cjs/defineConfig.d.ts.map +1 -1
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces.d.ts +9 -0
- package/lib/cjs/interfaces.d.ts.map +1 -1
- package/lib/cjs/lifecycle.d.ts +24 -0
- package/lib/cjs/lifecycle.d.ts.map +1 -0
- package/lib/cjs/lifecycle.js +187 -0
- package/lib/cjs/lifecycle.js.map +1 -0
- package/lib/cjs/loaders/ts-loader.d.mts.map +1 -1
- package/lib/cjs/loaders/ts-loader.mjs +11 -2
- package/lib/cjs/loaders/ts-loader.mjs.map +1 -1
- package/lib/cjs/package.json +6 -1
- package/lib/cjs/utils.d.ts +1 -1
- package/lib/cjs/utils.d.ts.map +1 -1
- package/lib/cjs/utils.js +9 -3
- package/lib/cjs/utils.js.map +1 -1
- package/lib/cjs/vite-config.d.ts +20 -0
- package/lib/cjs/vite-config.d.ts.map +1 -0
- package/lib/cjs/vite-config.js +401 -0
- package/lib/cjs/vite-config.js.map +1 -0
- package/lib/esm/cli-methods.d.ts +11 -3
- package/lib/esm/cli-methods.d.ts.map +1 -1
- package/lib/esm/cli-methods.js +36 -102
- package/lib/esm/cli-methods.js.map +1 -1
- package/lib/esm/cli.js +32 -8
- package/lib/esm/cli.js.map +1 -1
- package/lib/esm/commands/start.d.ts +6 -0
- package/lib/esm/commands/start.d.ts.map +1 -0
- package/lib/esm/commands/start.js +311 -0
- package/lib/esm/commands/start.js.map +1 -0
- package/lib/esm/config-webpack-app.d.ts +1 -1
- package/lib/esm/config-webpack-app.d.ts.map +1 -1
- package/lib/esm/config-webpack-app.js +1 -1
- package/lib/esm/config-webpack-app.js.map +1 -1
- package/lib/esm/config-webpack.d.ts +1 -1
- package/lib/esm/config-webpack.d.ts.map +1 -1
- package/lib/esm/config-webpack.js +4 -4
- package/lib/esm/config-webpack.js.map +1 -1
- package/lib/esm/defineConfig.d.ts +1 -1
- package/lib/esm/defineConfig.d.ts.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces.d.ts +9 -0
- package/lib/esm/interfaces.d.ts.map +1 -1
- package/lib/esm/lifecycle.d.ts +24 -0
- package/lib/esm/lifecycle.d.ts.map +1 -0
- package/lib/esm/lifecycle.js +156 -0
- package/lib/esm/lifecycle.js.map +1 -0
- package/lib/esm/loaders/ts-loader.d.mts.map +1 -1
- package/lib/esm/loaders/ts-loader.mjs +11 -2
- package/lib/esm/loaders/ts-loader.mjs.map +1 -1
- package/lib/esm/package.json +6 -1
- package/lib/esm/utils.d.ts +1 -1
- package/lib/esm/utils.d.ts.map +1 -1
- package/lib/esm/utils.js +9 -3
- package/lib/esm/utils.js.map +1 -1
- package/lib/esm/vite-config.d.ts +20 -0
- package/lib/esm/vite-config.d.ts.map +1 -0
- package/lib/esm/vite-config.js +377 -0
- package/lib/esm/vite-config.js.map +1 -0
- package/package.json +6 -1
- package/test-results/.last-run.json +6 -0
- package/test-results/create-app-Person-fixture-add-/342/206/222-edit-/342/206/222-delete-round-trip/error-context.md +16 -0
- package/test-results/create-app-Person-fixture-add-/342/206/222-edit-/342/206/222-delete-round-trip/trace.zip +0 -0
- package/tsconfig-esm.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#57](https://github.com/linked-cm/cli/pull/57) [`e8385bd`](https://github.com/linked-cm/cli/commit/e8385bd4d4287afd85fbb86d6d4d20b1ea7152a7) Thanks [@flyon](https://github.com/flyon)! - CLI sub-template imports updated to use `@_linked/core` instead of legacy
|
|
8
|
+
`lincd/...`:
|
|
9
|
+
|
|
10
|
+
- `defaults/shape.ts` — `Shape` + `NamedNode` from `@_linked/core`
|
|
11
|
+
- `defaults/package/src/package.ts` — `linkedPackage` from `@_linked/core/utils/Package` (clean 1:1 swap; `@_linked/core` exports it identically)
|
|
12
|
+
- `defaults/package/src/ontologies/example-ontology.ts` — `NamedNode` + `createNameSpace` from `@_linked/core` (unused `lincd-jsonld` import dropped)
|
|
13
|
+
|
|
14
|
+
**Important caveat — TODO comments inline in the template files explain**:
|
|
15
|
+
the `package.ts` template is a clean working swap. The `shape.ts` and
|
|
16
|
+
`ontologies/example-ontology.ts` templates' generated output **will fail
|
|
17
|
+
to compile** because `@_linked/core` doesn't export `NamedNode` or
|
|
18
|
+
`Literal` as runtime classes — the new framework architecture moved past
|
|
19
|
+
direct node construction. Templates need a rewrite to emit the modern
|
|
20
|
+
getter-only `@_linked/*` shape pattern (see `@_linked/schema/shapes/Person.ts`).
|
|
21
|
+
The import-path change is a deliberate signal-of-intent that lands
|
|
22
|
+
incomplete; the actual template rewrite is tracked as downstream
|
|
23
|
+
Shape-Builder / Ontology-Manager review work.
|
|
24
|
+
|
|
25
|
+
Users of `linked create shape Foo` and `linked create package Bar`: if you
|
|
26
|
+
hit "Cannot find name NamedNode" or "Cannot find name Literal" errors
|
|
27
|
+
in scaffolded files, you've hit the documented gap. The fix path is the
|
|
28
|
+
template rewrite, not reverting to legacy lincd.
|
|
29
|
+
|
|
30
|
+
Context: see create-now plan-011 report (docs/reports/009-legacy-lincd-eradication.md).
|
|
31
|
+
|
|
3
32
|
## 1.8.1
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# App environment. Copy this file to `.env` and adjust for local dev.
|
|
2
|
+
# `linked start` loads `.env` automatically (Node 20.12+ process.loadEnvFile).
|
|
3
|
+
#
|
|
4
|
+
# When CN hosts this app, CN INJECTS the dynamic per-(project, branch) vars below
|
|
5
|
+
# at spawn time (PORT, FUSEKI_DATASET, the admin secret, the EG gateway) — those
|
|
6
|
+
# take precedence over anything in this file. Vars in the "app config" section are
|
|
7
|
+
# yours to own (CN may also write them here when it manages the app).
|
|
8
|
+
|
|
9
|
+
# --- Data store (CN injects per branch; these are standalone-dev defaults) ------
|
|
10
|
+
FUSEKI_BASE_URL=http://localhost:3030
|
|
11
|
+
FUSEKI_DATASET=my-app-main
|
|
12
|
+
FUSEKI_USER=admin
|
|
13
|
+
FUSEKI_PASSWORD=admin
|
|
14
|
+
|
|
15
|
+
# --- Runtime (CN injects PORT + CN_APP_ADMIN_SECRET when it spawns the app) -----
|
|
16
|
+
PORT=4000
|
|
17
|
+
# NODE_ENV=development
|
|
18
|
+
|
|
19
|
+
# --- App config (yours — e.g. your public site root / production domain) --------
|
|
20
|
+
SITE_ROOT=http://localhost:4000
|
|
@@ -12,14 +12,20 @@
|
|
|
12
12
|
"email": ""
|
|
13
13
|
},
|
|
14
14
|
"engines": {
|
|
15
|
-
"node": ">=20.
|
|
15
|
+
"node": ">=20.12.0"
|
|
16
16
|
},
|
|
17
17
|
"main": "scripts/start-server.js",
|
|
18
|
+
"exports": {
|
|
19
|
+
"./backend": {
|
|
20
|
+
"development": "./src/backend.ts",
|
|
21
|
+
"default": "./src/backend.ts"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
18
24
|
"license": "MIT",
|
|
19
25
|
"scripts": {
|
|
20
|
-
"start": "linked start
|
|
26
|
+
"start": "linked start",
|
|
21
27
|
"build": "linked build-app --env production",
|
|
22
|
-
"server:prod": "linked start
|
|
28
|
+
"server:prod": "NODE_ENV=production linked start",
|
|
23
29
|
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
24
30
|
"lint:fix": "npm run lint -- --fix",
|
|
25
31
|
"prettier": "prettier \"src/**/*.{js,jsx,ts,tsx,css,scss}\" --check",
|
|
@@ -36,11 +42,11 @@
|
|
|
36
42
|
"web3"
|
|
37
43
|
],
|
|
38
44
|
"dependencies": {
|
|
39
|
-
"@_linked/core": "^2.
|
|
45
|
+
"@_linked/core": "^2.10",
|
|
40
46
|
"@_linked/server": "^2.0",
|
|
41
47
|
"@_linked/server-utils": "^1.0.6",
|
|
42
48
|
"@_linked/schema": "^1.0.6",
|
|
43
|
-
"@_linked/fuseki": "^
|
|
49
|
+
"@_linked/fuseki": "^1.0",
|
|
44
50
|
"@_linked/primitives": "^1.0.6",
|
|
45
51
|
"@_linked/react": "^1.3",
|
|
46
52
|
"react": "^18.2",
|
|
@@ -49,13 +55,12 @@
|
|
|
49
55
|
"react-router-dom": "^6.3.0"
|
|
50
56
|
},
|
|
51
57
|
"devDependencies": {
|
|
52
|
-
"@_linked/cli": "^1.
|
|
58
|
+
"@_linked/cli": "^1.8",
|
|
53
59
|
"@types/node": "^20.12.7",
|
|
54
60
|
"@types/react": "^18.0.17",
|
|
55
61
|
"@types/react-dom": "^18.0.6",
|
|
56
62
|
"@typescript-eslint/eslint-plugin": "latest",
|
|
57
63
|
"@typescript-eslint/parser": "latest",
|
|
58
|
-
"env-cmd": "^10.1.0",
|
|
59
64
|
"eslint": "latest",
|
|
60
65
|
"eslint-config-prettier": "^8.9.0",
|
|
61
66
|
"eslint-import-resolver-typescript": "^3.5.5",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Vite config for new linked apps. Uses the shared createViteConfig
|
|
2
|
+
// helper from @_linked/cli/vite-config so future Vite upgrades propagate
|
|
3
|
+
// to every linked app via a cli bump.
|
|
4
|
+
//
|
|
5
|
+
// Run with:
|
|
6
|
+
// yarn start (Vite dev — plan-010 default once stable)
|
|
7
|
+
// yarn start:webpack (legacy webpack path — migration escape hatch)
|
|
8
|
+
import {createViteConfig} from '@_linked/cli/vite-config';
|
|
9
|
+
|
|
10
|
+
export default createViteConfig({
|
|
11
|
+
port: 4040,
|
|
12
|
+
cssMode: 'tailwind',
|
|
13
|
+
});
|
|
@@ -51,6 +51,9 @@ jobs:
|
|
|
51
51
|
publish: npx changeset publish
|
|
52
52
|
title: "chore: release"
|
|
53
53
|
commit: "chore: release"
|
|
54
|
+
# npm auth uses the npm token below. Do NOT switch to OIDC trusted publishing
|
|
55
|
+
# (id-token: write + publishConfig.provenance) unless you FIRST register this package's
|
|
56
|
+
# trusted publisher on npmjs.com — otherwise publishes fail with 404 / permission errors.
|
|
54
57
|
env:
|
|
55
58
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
56
59
|
NODE_AUTH_TOKEN: ${{ secrets.{{NPM_SECRET_NAME}} }}
|
|
@@ -48,6 +48,9 @@ jobs:
|
|
|
48
48
|
publish: npx changeset publish
|
|
49
49
|
title: 'chore: release'
|
|
50
50
|
commit: 'chore: release'
|
|
51
|
+
# npm auth uses the npm token below. Do NOT switch to OIDC trusted publishing
|
|
52
|
+
# (id-token: write + publishConfig.provenance) unless you FIRST register this package's
|
|
53
|
+
# trusted publisher on npmjs.com — otherwise publishes fail with 404 / permission errors.
|
|
51
54
|
env:
|
|
52
55
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
53
56
|
NODE_AUTH_TOKEN: ${{ secrets.{{NPM_SECRET_NAME}} }}
|
package/defaults/shape.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// TODO(plan-1.5 / Phase 3 — Shape Builder review): @_linked/core does
|
|
2
|
+
// not export NamedNode as a class. The template needs to be rewritten to
|
|
3
|
+
// match the modern @_linked/* shape pattern — see packages/schema/src/
|
|
4
|
+
// shapes/Person.ts (getter-only, no NamedNode annotation). Import paths
|
|
5
|
+
// updated to @_linked/core to flag intent; current generated output
|
|
6
|
+
// won't compile until the template + downstream tooling are updated.
|
|
7
|
+
import {Shape} from '@_linked/core/shapes/Shape';
|
|
8
|
+
import {NamedNode} from '@_linked/core';
|
|
3
9
|
import {linkedShape} from '../package.js';
|
|
4
10
|
|
|
5
11
|
@linkedShape
|
package/lib/cjs/cli-methods.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import { PackageDetails } from './interfaces';
|
|
1
|
+
import type { PackageDetails } from './interfaces.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dynamically import the app's backend storage configuration. Tries the
|
|
4
|
+
* canonical `linked.backend.storage.{ts,js}` at app root first, then the
|
|
5
|
+
* earlier `backend-storage-config.{ts,js}` (Iter3), then the legacy
|
|
6
|
+
* `scripts/storage-config.js` (pre-rename). The fallback chain lets older
|
|
7
|
+
* app clones keep booting through the rename.
|
|
8
|
+
*/
|
|
9
|
+
import { ensureEnvironmentLoaded, loadBackendStorageConfig, getLincdPackages } from './lifecycle.js';
|
|
10
|
+
export { ensureEnvironmentLoaded, loadBackendStorageConfig, getLincdPackages };
|
|
2
11
|
export declare const createApp: (name: any, basePath?: string, options?: {
|
|
3
12
|
appName?: string;
|
|
4
13
|
appPrefix?: string;
|
|
@@ -10,8 +19,8 @@ export declare function logError(...errors: any[]): void;
|
|
|
10
19
|
export declare function developPackage(target: any, mode: any): void;
|
|
11
20
|
export declare function runOnPackagesGroupedByDependencies(lincdPackages: any, onBuildStack: (packageGroup: any, dependencies: any) => (pkg: PackageDetails) => Promise<any>, onStackEnd: any, sync?: boolean): Promise<void>;
|
|
12
21
|
export declare function buildAll(options: any): void;
|
|
13
|
-
export declare function getLincdPackages(rootPath?: string): PackageDetails[];
|
|
14
22
|
export declare const createOntology: (prefix: any, uriBase?: any, basePath?: string) => Promise<void>;
|
|
23
|
+
export declare const addLineToIndex: (line: any, insertMatchString: string, root?: string, insertAtStart?: boolean) => string;
|
|
15
24
|
export declare const setNameVariables: (name: any) => {
|
|
16
25
|
hyphenName: any;
|
|
17
26
|
camelCaseName: any;
|
|
@@ -32,7 +41,6 @@ invalidImports?: Map<string, {
|
|
|
32
41
|
}[]>) => Promise<boolean>;
|
|
33
42
|
export declare const depCheckStaged: () => Promise<void>;
|
|
34
43
|
export declare const depCheck: (packagePath?: string) => Promise<unknown>;
|
|
35
|
-
export declare const ensureEnvironmentLoaded: () => Promise<void>;
|
|
36
44
|
export declare const runScript: (scriptName: string, options: {
|
|
37
45
|
spawn: boolean;
|
|
38
46
|
}) => Promise<never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-methods.d.ts","sourceRoot":"","sources":["../../src/cli-methods.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAC,cAAc,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"cli-methods.d.ts","sourceRoot":"","sources":["../../src/cli-methods.ts"],"names":[],"mappings":"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"}
|
package/lib/cjs/cli-methods.js
CHANGED
|
@@ -36,13 +36,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.removeOldFiles = exports.executeCommandForPackage = exports.addCapacitor = exports.addLinesToFile = exports.executeCommandForEachPackage = exports.buildUpdated = exports.publishPackage = exports.publishUpdated = exports.compilePackageCJS = exports.compilePackageESM = exports.compilePackage = exports.buildPackage = exports.register = exports.createPackage = exports.upgradePackages = exports.buildBackend = exports.buildFrontend = exports.buildApp = exports.startServer = exports.runMethod = exports.runScript = exports.
|
|
39
|
+
exports.removeOldFiles = exports.executeCommandForPackage = exports.addCapacitor = exports.addLinesToFile = exports.executeCommandForEachPackage = exports.buildUpdated = exports.publishPackage = exports.publishUpdated = exports.compilePackageCJS = exports.compilePackageESM = exports.compilePackage = exports.buildPackage = exports.register = exports.createPackage = exports.upgradePackages = exports.buildBackend = exports.buildFrontend = exports.buildApp = exports.startServer = exports.runMethod = exports.runScript = exports.depCheck = exports.depCheckStaged = exports.checkImports = exports.createComponent = exports.createSetComponent = exports.createShape = exports.getScriptDir = exports.setNameVariables = exports.addLineToIndex = exports.createOntology = exports.createApp = exports.getLincdPackages = exports.loadBackendStorageConfig = exports.ensureEnvironmentLoaded = void 0;
|
|
40
40
|
exports.warn = warn;
|
|
41
41
|
exports.logError = logError;
|
|
42
42
|
exports.developPackage = developPackage;
|
|
43
43
|
exports.runOnPackagesGroupedByDependencies = runOnPackagesGroupedByDependencies;
|
|
44
44
|
exports.buildAll = buildAll;
|
|
45
|
-
exports.getLincdPackages = getLincdPackages;
|
|
46
45
|
const chalk_1 = __importDefault(require("chalk"));
|
|
47
46
|
const child_process_1 = require("child_process");
|
|
48
47
|
const depcheck_1 = __importDefault(require("depcheck"));
|
|
@@ -73,28 +72,14 @@ let dirname__ = typeof __dirname !== 'undefined'
|
|
|
73
72
|
* `scripts/storage-config.js` (pre-rename). The fallback chain lets older
|
|
74
73
|
* app clones keep booting through the rename.
|
|
75
74
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
path_1.default.join(cwd, 'backend-storage-config.js'),
|
|
85
|
-
path_1.default.join(cwd, 'scripts', 'backend-storage-config.js'),
|
|
86
|
-
path_1.default.join(cwd, 'scripts', 'backend-storage-config.ts'),
|
|
87
|
-
// legacy pre-rename:
|
|
88
|
-
path_1.default.join(cwd, 'scripts', 'storage-config.js'),
|
|
89
|
-
];
|
|
90
|
-
for (const candidate of candidates) {
|
|
91
|
-
if (fs_extra_1.default.existsSync(candidate)) {
|
|
92
|
-
return Promise.resolve(`${candidate}`).then(s => __importStar(require(s)));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
console.warn(chalk_1.default.yellow('[linked.backend.storage] no linked.backend.storage.{ts,js} found at app root.'));
|
|
96
|
-
return undefined;
|
|
97
|
-
}
|
|
75
|
+
// Plan-011: extracted to ./lifecycle.ts so the Vite SSR loader doesn't
|
|
76
|
+
// have to graph-walk the rest of cli-methods.ts (which contains many
|
|
77
|
+
// dynamic imports Vite can't analyze). We import for internal callers
|
|
78
|
+
// AND re-export so external consumers can keep importing from here.
|
|
79
|
+
const lifecycle_js_1 = require("./lifecycle.js");
|
|
80
|
+
Object.defineProperty(exports, "ensureEnvironmentLoaded", { enumerable: true, get: function () { return lifecycle_js_1.ensureEnvironmentLoaded; } });
|
|
81
|
+
Object.defineProperty(exports, "loadBackendStorageConfig", { enumerable: true, get: function () { return lifecycle_js_1.loadBackendStorageConfig; } });
|
|
82
|
+
Object.defineProperty(exports, "getLincdPackages", { enumerable: true, get: function () { return lifecycle_js_1.getLincdPackages; } });
|
|
98
83
|
var variables = {};
|
|
99
84
|
/**
|
|
100
85
|
* Prompt user for input
|
|
@@ -864,7 +849,7 @@ function getDependentPackages(dependencies, pkg) {
|
|
|
864
849
|
*/
|
|
865
850
|
function getLocalLincdPackageMap(rootPath = './') {
|
|
866
851
|
let map = new Map();
|
|
867
|
-
getLincdPackages(rootPath).forEach((pkg) => {
|
|
852
|
+
(0, lifecycle_js_1.getLincdPackages)(rootPath).forEach((pkg) => {
|
|
868
853
|
if (pkg.path.indexOf('../') === -1 && pkg.path.indexOf('..\\') === -1) {
|
|
869
854
|
// console.log(package.path);
|
|
870
855
|
map.set(pkg.packageName, pkg);
|
|
@@ -873,33 +858,11 @@ function getLocalLincdPackageMap(rootPath = './') {
|
|
|
873
858
|
return map;
|
|
874
859
|
}
|
|
875
860
|
function getLocalLincdModules(rootPath = './') {
|
|
876
|
-
return getLincdPackages(rootPath).filter((pkg) => {
|
|
861
|
+
return (0, lifecycle_js_1.getLincdPackages)(rootPath).filter((pkg) => {
|
|
877
862
|
return pkg.path.indexOf('..\\') === -1;
|
|
878
863
|
});
|
|
879
864
|
}
|
|
880
|
-
|
|
881
|
-
let pack = (0, utils_js_1.getPackageJSON)(rootPath);
|
|
882
|
-
if (!pack || !pack.workspaces) {
|
|
883
|
-
const originalRoot = rootPath;
|
|
884
|
-
for (let i = 0; i <= 3; i++) {
|
|
885
|
-
rootPath = path_1.default.join(originalRoot, ...Array(i).fill('..'));
|
|
886
|
-
pack = (0, utils_js_1.getPackageJSON)(rootPath);
|
|
887
|
-
if (pack && pack.workspaces) {
|
|
888
|
-
// log('Found workspace at '+packagePath);
|
|
889
|
-
break;
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
if (!pack || !pack.workspaces) {
|
|
894
|
-
// Standalone apps (scaffolded with `linked create-app`) don't have
|
|
895
|
-
// workspaces — that's expected, just no local packages to scan.
|
|
896
|
-
return [];
|
|
897
|
-
}
|
|
898
|
-
// console.log(pack.workspaces);
|
|
899
|
-
let res = [];
|
|
900
|
-
checkWorkspaces(rootPath, pack.workspaces, res);
|
|
901
|
-
return res;
|
|
902
|
-
}
|
|
865
|
+
// getLincdPackages moved to ./lifecycle.ts and re-exported above.
|
|
903
866
|
function setVariable(name, replacement) {
|
|
904
867
|
//prepare name for regexp
|
|
905
868
|
name = name.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
@@ -958,11 +921,13 @@ const createOntology = async (prefix, uriBase, basePath = process.cwd()) => {
|
|
|
958
921
|
//if this is not a lincd app (but a lincd package instead)
|
|
959
922
|
if (!sourceFolder.includes('frontend')) {
|
|
960
923
|
//then also add an import to index
|
|
961
|
-
let indexPath = addLineToIndex(`import './ontologies/${hyphenName}.js';`, 'ontologies');
|
|
924
|
+
let indexPath = (0, exports.addLineToIndex)(`import './ontologies/${hyphenName}.js';`, 'ontologies');
|
|
962
925
|
log(`Added an import of this file from ${chalk_1.default.magenta(indexPath)}`);
|
|
963
926
|
}
|
|
964
927
|
};
|
|
965
928
|
exports.createOntology = createOntology;
|
|
929
|
+
// Exported for Shape-Builder reuse (plan-010 T1d.4): CodeShapeSyncService adds
|
|
930
|
+
// the `import './shapes/<Shape>.js';` line to a generated app package's index.
|
|
966
931
|
const addLineToIndex = function (line, insertMatchString, root = process.cwd(), insertAtStart = false) {
|
|
967
932
|
//import ontology in index
|
|
968
933
|
let indexPath = ['index.ts', 'index.tsx']
|
|
@@ -972,6 +937,11 @@ const addLineToIndex = function (line, insertMatchString, root = process.cwd(),
|
|
|
972
937
|
});
|
|
973
938
|
if (indexPath) {
|
|
974
939
|
let indexContents = fs_extra_1.default.readFileSync(indexPath, 'utf-8');
|
|
940
|
+
// Idempotent: if the exact line is already present, do nothing (re-running
|
|
941
|
+
// a shape edit must not append a duplicate import).
|
|
942
|
+
if (indexContents.split(/\n/g).some((l) => l.trim() === line.trim())) {
|
|
943
|
+
return indexPath;
|
|
944
|
+
}
|
|
975
945
|
let lines = indexContents.split(/\n/g);
|
|
976
946
|
let newContents;
|
|
977
947
|
for (var key in lines) {
|
|
@@ -997,6 +967,7 @@ const addLineToIndex = function (line, insertMatchString, root = process.cwd(),
|
|
|
997
967
|
}
|
|
998
968
|
return indexPath;
|
|
999
969
|
};
|
|
970
|
+
exports.addLineToIndex = addLineToIndex;
|
|
1000
971
|
const replaceVariablesInFiles = function (...files) {
|
|
1001
972
|
return Promise.all(files.map((file) => {
|
|
1002
973
|
return replaceVariablesInFile(file);
|
|
@@ -1137,7 +1108,7 @@ const createShape = async (name, basePath = process.cwd()) => {
|
|
|
1137
1108
|
//if this is NOT a lincd app (but a lincd package)
|
|
1138
1109
|
let indexPath;
|
|
1139
1110
|
if (!sourceFolder.includes('frontend')) {
|
|
1140
|
-
indexPath = addLineToIndex(`import './shapes/${hyphenName}.js';`, 'shapes');
|
|
1111
|
+
indexPath = (0, exports.addLineToIndex)(`import './shapes/${hyphenName}.js';`, 'shapes');
|
|
1141
1112
|
log(`Added an import of this file from ${chalk_1.default.magenta(indexPath)}`);
|
|
1142
1113
|
}
|
|
1143
1114
|
};
|
|
@@ -1153,7 +1124,7 @@ const createSetComponent = async (name, basePath = process.cwd()) => {
|
|
|
1153
1124
|
fs_extra_1.default.copySync(path_1.default.join((0, exports.getScriptDir)(), '..', '..', 'defaults', 'component.scss'), targetFile2);
|
|
1154
1125
|
//replace variables in some of the copied files
|
|
1155
1126
|
await replaceVariablesInFiles(targetFile, targetFile2);
|
|
1156
|
-
let indexPath = addLineToIndex(`import './components/${hyphenName}.js';`, 'components');
|
|
1127
|
+
let indexPath = (0, exports.addLineToIndex)(`import './components/${hyphenName}.js';`, 'components');
|
|
1157
1128
|
log(`Created a new set component in ${chalk_1.default.magenta(targetFile.replace(basePath, ''))}`, `Created a new stylesheet in ${chalk_1.default.magenta(targetFile2.replace(basePath, ''))}`, `Added an import of this file from ${chalk_1.default.magenta(indexPath)}`);
|
|
1158
1129
|
};
|
|
1159
1130
|
exports.createSetComponent = createSetComponent;
|
|
@@ -1173,7 +1144,7 @@ const createComponent = async (name, basePath = process.cwd()) => {
|
|
|
1173
1144
|
//if this is not a lincd app (but a lincd package instead)
|
|
1174
1145
|
if (!sourceFolder.includes('frontend')) {
|
|
1175
1146
|
//then also add an import to index
|
|
1176
|
-
let indexPath = addLineToIndex(`import './components/${hyphenName}.js';`, 'components');
|
|
1147
|
+
let indexPath = (0, exports.addLineToIndex)(`import './components/${hyphenName}.js';`, 'components');
|
|
1177
1148
|
log(`Added an import of this file from ${chalk_1.default.magenta(indexPath)}`);
|
|
1178
1149
|
}
|
|
1179
1150
|
};
|
|
@@ -1191,6 +1162,17 @@ invalidImports = new Map()) => {
|
|
|
1191
1162
|
// Start checking each file in the source folder
|
|
1192
1163
|
for (const file of dir) {
|
|
1193
1164
|
const filename = path_1.default.join(sourceFolder, file);
|
|
1165
|
+
// plan-011 §P7 — skip test sources. Test files (and their helpers/probes)
|
|
1166
|
+
// are not part of the shipped ESM contract, so the missing-extension rule
|
|
1167
|
+
// isn't load-bearing for them; enforcing it only blocks `linked build`
|
|
1168
|
+
// (the real ESM-output gate stays in force for shipped source). This is
|
|
1169
|
+
// what makes `linked build` green for packages whose tests use
|
|
1170
|
+
// extensionless imports (e.g. @_linked/core).
|
|
1171
|
+
if (/(?:^|[\\/])(?:tests?|__tests__|test-helpers)(?:[\\/]|$)/.test(filename) ||
|
|
1172
|
+
/\.(?:test|spec)\.tsx?$/.test(file) ||
|
|
1173
|
+
/^type-probe.*\.tsx?$/.test(file)) {
|
|
1174
|
+
continue;
|
|
1175
|
+
}
|
|
1194
1176
|
// File is either a directory, or not a .ts(x)
|
|
1195
1177
|
// INFO: For future use - if this part fails, it could be due to user permissions
|
|
1196
1178
|
// i.e. the program not having access to check the file metadata
|
|
@@ -1343,60 +1325,11 @@ const depCheck = async (packagePath = process.cwd()) => {
|
|
|
1343
1325
|
});
|
|
1344
1326
|
};
|
|
1345
1327
|
exports.depCheck = depCheck;
|
|
1346
|
-
|
|
1347
|
-
if (!process.env.ENV_VARS_LOADED) {
|
|
1348
|
-
//load env-cmd for development environment
|
|
1349
|
-
let { GetEnvVars } = await Promise.resolve().then(() => __importStar(require('env-cmd')));
|
|
1350
|
-
let envCmdrcPath = path_1.default.join(process.cwd(), '.env-cmdrc.json');
|
|
1351
|
-
if (!fs_extra_1.default.existsSync(envCmdrcPath)) {
|
|
1352
|
-
console.warn('No .env-cmdrc.json found in this folder. Are you running this command from the root of a LINCD app?');
|
|
1353
|
-
process.exit();
|
|
1354
|
-
}
|
|
1355
|
-
let vars = await GetEnvVars({
|
|
1356
|
-
envFile: {
|
|
1357
|
-
filePath: envCmdrcPath,
|
|
1358
|
-
},
|
|
1359
|
-
});
|
|
1360
|
-
let environments = Object.keys(vars);
|
|
1361
|
-
// Snapshot the original shell environment so it always takes highest priority
|
|
1362
|
-
let shellEnv = { ...process.env };
|
|
1363
|
-
//if _main is present, load it first
|
|
1364
|
-
if (environments.includes('_main')) {
|
|
1365
|
-
process.env = { ...process.env, ...vars._main };
|
|
1366
|
-
}
|
|
1367
|
-
//if --env is passed, load that environment
|
|
1368
|
-
let args = process.argv.splice(2);
|
|
1369
|
-
if (args.includes('--env')) {
|
|
1370
|
-
let envIndex = args.indexOf('--env');
|
|
1371
|
-
let env = args[envIndex + 1];
|
|
1372
|
-
env.split(',').forEach((singleEnvironment) => {
|
|
1373
|
-
if (environments.includes(singleEnvironment)) {
|
|
1374
|
-
console.log('Environment: ' + singleEnvironment);
|
|
1375
|
-
process.env = { ...process.env, ...vars[singleEnvironment] };
|
|
1376
|
-
}
|
|
1377
|
-
else {
|
|
1378
|
-
console.warn('Environment ' +
|
|
1379
|
-
singleEnvironment +
|
|
1380
|
-
' not found in .env-cmdrc.json. Available environments: ' +
|
|
1381
|
-
environments.join(', '));
|
|
1382
|
-
}
|
|
1383
|
-
});
|
|
1384
|
-
}
|
|
1385
|
-
else {
|
|
1386
|
-
//chose development by default
|
|
1387
|
-
process.env = { ...process.env, ...vars.development };
|
|
1388
|
-
console.log('No environment specified, using development');
|
|
1389
|
-
}
|
|
1390
|
-
// Re-apply original shell env vars so they always win over .env-cmdrc.json
|
|
1391
|
-
process.env = { ...process.env, ...shellEnv };
|
|
1392
|
-
process.env.ENV_VARS_LOADED = 'true';
|
|
1393
|
-
}
|
|
1394
|
-
};
|
|
1395
|
-
exports.ensureEnvironmentLoaded = ensureEnvironmentLoaded;
|
|
1328
|
+
// ensureEnvironmentLoaded moved to ./lifecycle.ts and re-exported above.
|
|
1396
1329
|
const runScript = async (scriptName, options) => {
|
|
1397
1330
|
//if spawn is not defined, default to true
|
|
1398
1331
|
const spawn = options.spawn !== undefined ? options.spawn : true;
|
|
1399
|
-
await (0,
|
|
1332
|
+
await (0, lifecycle_js_1.ensureEnvironmentLoaded)();
|
|
1400
1333
|
if (spawn) {
|
|
1401
1334
|
await (0, exports.startServer)(true);
|
|
1402
1335
|
}
|
|
@@ -1413,7 +1346,7 @@ const runScript = async (scriptName, options) => {
|
|
|
1413
1346
|
};
|
|
1414
1347
|
exports.runScript = runScript;
|
|
1415
1348
|
const runMethod = async (packageName, method, options) => {
|
|
1416
|
-
await (0,
|
|
1349
|
+
await (0, lifecycle_js_1.ensureEnvironmentLoaded)();
|
|
1417
1350
|
if (options.spawn) {
|
|
1418
1351
|
let linkedConfig = (await Promise.resolve(`${path_1.default.join(process.cwd(), 'linked.config.js')}`).then(s => __importStar(require(s)))).default;
|
|
1419
1352
|
// Set default loadAppComponent if not provided
|
|
@@ -1428,9 +1361,9 @@ const runMethod = async (packageName, method, options) => {
|
|
|
1428
1361
|
linkedConfig.server.loadRoutes = async () => await Promise.resolve(`${path_1.default.join(process.cwd(), 'src', 'routes.tsx')}`).then(s => __importStar(require(s)));
|
|
1429
1362
|
}
|
|
1430
1363
|
//@ts-ignore
|
|
1431
|
-
const ServerClass = (await Promise.resolve().then(() => __importStar(require('@_linked/server/shapes/
|
|
1432
|
-
.
|
|
1433
|
-
await loadBackendStorageConfig();
|
|
1364
|
+
const ServerClass = (await Promise.resolve().then(() => __importStar(require('@_linked/server/shapes/LinkedServer'))))
|
|
1365
|
+
.LinkedServer;
|
|
1366
|
+
await (0, lifecycle_js_1.loadBackendStorageConfig)();
|
|
1434
1367
|
let server = new ServerClass(linkedConfig);
|
|
1435
1368
|
//init the server
|
|
1436
1369
|
console.log('Initializing server...');
|
|
@@ -1468,7 +1401,7 @@ const runMethod = async (packageName, method, options) => {
|
|
|
1468
1401
|
});
|
|
1469
1402
|
}
|
|
1470
1403
|
else {
|
|
1471
|
-
//reuse the existing running
|
|
1404
|
+
//reuse the existing running LinkedServer instance.
|
|
1472
1405
|
//make a HTTP call
|
|
1473
1406
|
//'/call/:pkg/:method',
|
|
1474
1407
|
fetch(process.env.SITE_ROOT + '/call/' + packageName + '/' + method, {
|
|
@@ -1503,7 +1436,7 @@ const runMethod = async (packageName, method, options) => {
|
|
|
1503
1436
|
};
|
|
1504
1437
|
exports.runMethod = runMethod;
|
|
1505
1438
|
const startServer = async (initOnly = false, ServerClass = null) => {
|
|
1506
|
-
await (0,
|
|
1439
|
+
await (0, lifecycle_js_1.ensureEnvironmentLoaded)();
|
|
1507
1440
|
let linkedConfig = (await Promise.resolve(`${path_1.default.join(process.cwd(), 'linked.config.js')}`).then(s => __importStar(require(s))))
|
|
1508
1441
|
.default;
|
|
1509
1442
|
// function scssLoadcall(source, filename) {
|
|
@@ -1518,9 +1451,9 @@ const startServer = async (initOnly = false, ServerClass = null) => {
|
|
|
1518
1451
|
// hook.hook('.module.css', scssLoadcall);
|
|
1519
1452
|
if (!ServerClass) {
|
|
1520
1453
|
//@ts-ignore
|
|
1521
|
-
ServerClass = (await Promise.resolve().then(() => __importStar(require('@_linked/server/shapes/
|
|
1454
|
+
ServerClass = (await Promise.resolve().then(() => __importStar(require('@_linked/server/shapes/LinkedServer')))).LinkedServer;
|
|
1522
1455
|
}
|
|
1523
|
-
await loadBackendStorageConfig();
|
|
1456
|
+
await (0, lifecycle_js_1.loadBackendStorageConfig)();
|
|
1524
1457
|
// Set default loadAppComponent if not provided
|
|
1525
1458
|
if (!linkedConfig.server) {
|
|
1526
1459
|
linkedConfig.server = {};
|
|
@@ -1570,8 +1503,12 @@ const buildApp = async () => {
|
|
|
1570
1503
|
};
|
|
1571
1504
|
exports.buildApp = buildApp;
|
|
1572
1505
|
const buildFrontend = async () => {
|
|
1573
|
-
await (0,
|
|
1574
|
-
|
|
1506
|
+
await (0, lifecycle_js_1.ensureEnvironmentLoaded)();
|
|
1507
|
+
// @vite-ignore — the webpack build path is legacy code, only reached
|
|
1508
|
+
// by `linked build-frontend` which is not part of the Vite dev/SSR
|
|
1509
|
+
// flow. Tell Vite not to graph-walk into it so we don't emit
|
|
1510
|
+
// import-analysis warnings for a file we never load via SSR.
|
|
1511
|
+
const webpackAppConfig = await (await Promise.resolve().then(() => __importStar(require(/* @vite-ignore */ './config-webpack-app.js')))).getWebpackAppConfig();
|
|
1575
1512
|
console.log(chalk_1.default.magenta(`🛠 Building ${process.env.NODE_ENV} frontend bundles`));
|
|
1576
1513
|
await new Promise((resolve, reject) => {
|
|
1577
1514
|
(0, webpack_1.default)(webpackAppConfig, async (err, stats) => {
|
|
@@ -1621,7 +1558,7 @@ const buildFrontend = async () => {
|
|
|
1621
1558
|
// process.exit();
|
|
1622
1559
|
}
|
|
1623
1560
|
// load the storage config
|
|
1624
|
-
const storageConfig = await loadBackendStorageConfig();
|
|
1561
|
+
const storageConfig = await (0, lifecycle_js_1.loadBackendStorageConfig)();
|
|
1625
1562
|
// check if LincdFileStorage has a default FileStore
|
|
1626
1563
|
// if yes: copy all the files in the build folder over with LincdFileStorage
|
|
1627
1564
|
if (LinkedFileStorage_1.LinkedFileStorage.getDefaultDataset()) {
|
|
@@ -1662,7 +1599,7 @@ exports.buildFrontend = buildFrontend;
|
|
|
1662
1599
|
const buildBackend = async () => {
|
|
1663
1600
|
console.log(chalk_1.default.magenta(`🛠 Preparing ${process.env.NODE_ENV} backend`));
|
|
1664
1601
|
//run tsc in the backend folder
|
|
1665
|
-
await (0,
|
|
1602
|
+
await (0, lifecycle_js_1.ensureEnvironmentLoaded)();
|
|
1666
1603
|
const sourceFolder = path_1.default.join(process.cwd(), 'src');
|
|
1667
1604
|
const targetFolder = path_1.default.join(process.cwd(), 'lib');
|
|
1668
1605
|
// Step 1: Clear lib folder
|
|
@@ -1721,7 +1658,7 @@ const buildBackend = async () => {
|
|
|
1721
1658
|
};
|
|
1722
1659
|
exports.buildBackend = buildBackend;
|
|
1723
1660
|
const upgradePackages = async () => {
|
|
1724
|
-
await (0,
|
|
1661
|
+
await (0, lifecycle_js_1.ensureEnvironmentLoaded)();
|
|
1725
1662
|
// let packages = getLincdPackages();
|
|
1726
1663
|
// let packages = getLocalLincdModules();
|
|
1727
1664
|
let packages = getLocalLincdPackageMap();
|
|
@@ -2662,7 +2599,7 @@ var addCapacitor = async function (basePath = process.cwd()) {
|
|
|
2662
2599
|
};
|
|
2663
2600
|
exports.addCapacitor = addCapacitor;
|
|
2664
2601
|
var executeCommandForPackage = function (packageName, command) {
|
|
2665
|
-
let packageDetails = getLincdPackages().find((modDetails) => modDetails.packageName.indexOf(packageName) !== -1 ||
|
|
2602
|
+
let packageDetails = (0, lifecycle_js_1.getLincdPackages)().find((modDetails) => modDetails.packageName.indexOf(packageName) !== -1 ||
|
|
2666
2603
|
modDetails.packageName.indexOf(packageName) !== -1);
|
|
2667
2604
|
if (packageDetails) {
|
|
2668
2605
|
log("Executing 'cd " +
|