@jskit-ai/create-app 0.1.125 → 0.1.127
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 +4 -2
- package/src/server/index.js +17 -0
- package/templates/base-shell/tests/server/minimalShell.validator.test.js +6 -2
- package/templates/minimal-shell/tests/server/minimalShell.validator.test.js +6 -2
- package/templates/base-shell/.github/workflows/verify.yml +0 -29
- package/templates/minimal-shell/.github/workflows/verify.yml +0 -29
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/create-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.127",
|
|
4
4
|
"description": "Scaffold JSKIT app shells.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
"./server": "./src/server/index.js",
|
|
20
20
|
"./client": "./src/client/index.js"
|
|
21
21
|
},
|
|
22
|
-
"dependencies": {
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@jskit-ai/jskit-cli": "0.2.130"
|
|
24
|
+
},
|
|
23
25
|
"engines": {
|
|
24
26
|
"node": ">=20 <23"
|
|
25
27
|
},
|
package/src/server/index.js
CHANGED
|
@@ -3,6 +3,10 @@ import path from "node:path";
|
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { createInterface } from "node:readline/promises";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
+
import {
|
|
7
|
+
JSKIT_CI_WORKFLOW_RELATIVE_PATH,
|
|
8
|
+
synchronizeAppCiWorkflow
|
|
9
|
+
} from "@jskit-ai/jskit-cli/server";
|
|
6
10
|
import { createCliError } from "./cliError.js";
|
|
7
11
|
import { shellQuote } from "./cliEntrypoint.js";
|
|
8
12
|
|
|
@@ -589,6 +593,19 @@ export async function createApp({
|
|
|
589
593
|
replacements,
|
|
590
594
|
dryRun
|
|
591
595
|
});
|
|
596
|
+
if (touchedFiles.includes(path.join(".jskit", "lock.json"))) {
|
|
597
|
+
if (!dryRun) {
|
|
598
|
+
const ciSync = await synchronizeAppCiWorkflow({
|
|
599
|
+
appRoot: targetDirectory,
|
|
600
|
+
allowManagedOverwrite: false
|
|
601
|
+
});
|
|
602
|
+
if (ciSync.workflowChanged) {
|
|
603
|
+
touchedFiles.push(ciSync.path);
|
|
604
|
+
}
|
|
605
|
+
} else {
|
|
606
|
+
touchedFiles.push(JSKIT_CI_WORKFLOW_RELATIVE_PATH);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
592
609
|
|
|
593
610
|
return {
|
|
594
611
|
appName: resolvedAppName,
|
|
@@ -100,12 +100,16 @@ test("latest JSKIT scaffold files are present at the app root", async () => {
|
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
test("starter shell keeps
|
|
104
|
-
const workflowSource = await readFile(path.join(APP_ROOT, ".github", "workflows", "verify.yml"), "utf8");
|
|
103
|
+
test("starter shell keeps one JSKIT-managed hosted CI workflow", async () => {
|
|
104
|
+
const workflowSource = await readFile(path.join(APP_ROOT, ".github", "workflows", "jskit-verify.yml"), "utf8");
|
|
105
105
|
|
|
106
|
+
assert.match(workflowSource, /Generated and managed by JSKIT/);
|
|
107
|
+
assert.match(workflowSource, /run: npm ci/);
|
|
106
108
|
assert.match(workflowSource, /run: npm run verify/);
|
|
109
|
+
assert.ok(workflowSource.indexOf("run: npm ci") < workflowSource.indexOf("run: npm run verify"));
|
|
107
110
|
assert.doesNotMatch(workflowSource, /jskit app verify --against/);
|
|
108
111
|
assert.doesNotMatch(workflowSource, /jskit app verify-ui/);
|
|
112
|
+
await assert.rejects(access(path.join(APP_ROOT, ".github", "workflows", "verify.yml")), /ENOENT/);
|
|
109
113
|
});
|
|
110
114
|
|
|
111
115
|
test("starter shell does not include the app.manifest scaffold", async () => {
|
|
@@ -100,12 +100,16 @@ test("latest JSKIT scaffold files are present at the app root", async () => {
|
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
test("starter shell keeps
|
|
104
|
-
const workflowSource = await readFile(path.join(APP_ROOT, ".github", "workflows", "verify.yml"), "utf8");
|
|
103
|
+
test("starter shell keeps one JSKIT-managed hosted CI workflow", async () => {
|
|
104
|
+
const workflowSource = await readFile(path.join(APP_ROOT, ".github", "workflows", "jskit-verify.yml"), "utf8");
|
|
105
105
|
|
|
106
|
+
assert.match(workflowSource, /Generated and managed by JSKIT/);
|
|
107
|
+
assert.match(workflowSource, /run: npm ci/);
|
|
106
108
|
assert.match(workflowSource, /run: npm run verify/);
|
|
109
|
+
assert.ok(workflowSource.indexOf("run: npm ci") < workflowSource.indexOf("run: npm run verify"));
|
|
107
110
|
assert.doesNotMatch(workflowSource, /jskit app verify --against/);
|
|
108
111
|
assert.doesNotMatch(workflowSource, /jskit app verify-ui/);
|
|
112
|
+
await assert.rejects(access(path.join(APP_ROOT, ".github", "workflows", "verify.yml")), /ENOENT/);
|
|
109
113
|
});
|
|
110
114
|
|
|
111
115
|
test("starter shell does not include the app.manifest scaffold", async () => {
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
name: Verify
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
push:
|
|
6
|
-
branches:
|
|
7
|
-
- main
|
|
8
|
-
|
|
9
|
-
permissions:
|
|
10
|
-
contents: read
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
verify:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
steps:
|
|
16
|
-
- name: Checkout
|
|
17
|
-
uses: actions/checkout@v4
|
|
18
|
-
|
|
19
|
-
- name: Setup Node
|
|
20
|
-
uses: actions/setup-node@v4
|
|
21
|
-
with:
|
|
22
|
-
node-version: 20
|
|
23
|
-
cache: npm
|
|
24
|
-
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
run: npm ci
|
|
27
|
-
|
|
28
|
-
- name: Run verify
|
|
29
|
-
run: npm run verify
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
name: Verify
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
push:
|
|
6
|
-
branches:
|
|
7
|
-
- main
|
|
8
|
-
|
|
9
|
-
permissions:
|
|
10
|
-
contents: read
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
verify:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
steps:
|
|
16
|
-
- name: Checkout
|
|
17
|
-
uses: actions/checkout@v4
|
|
18
|
-
|
|
19
|
-
- name: Setup Node
|
|
20
|
-
uses: actions/setup-node@v4
|
|
21
|
-
with:
|
|
22
|
-
node-version: 20
|
|
23
|
-
cache: npm
|
|
24
|
-
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
run: npm ci
|
|
27
|
-
|
|
28
|
-
- name: Run verify
|
|
29
|
-
run: npm run verify
|