@jskit-ai/create-app 0.1.40 → 0.1.42
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 +2 -3
- package/src/server/index.js +10 -16
- package/templates/base-shell/config/public.js +0 -10
- package/templates/base-shell/config/surfaceAccessPolicies.js +0 -9
- package/templates/base-shell/package.json +0 -3
- package/templates/base-shell/packages/main/src/client/providers/MainClientProvider.js +4 -17
- package/templates/base-shell/scripts/link-local-jskit-packages.sh +6 -0
- package/templates/base-shell/server.js +1 -2
- package/templates/base-shell/tests/server/minimalShell.validator.test.js +0 -1
- package/templates/base-shell/README.md +0 -39
- package/templates/base-shell/src/pages/console/index.vue +0 -12
- package/templates/base-shell/src/pages/console.vue +0 -13
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/create-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.42",
|
|
4
4
|
"description": "Scaffold minimal JSKIT app shells.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"bin",
|
|
8
8
|
"src",
|
|
9
|
-
"templates"
|
|
10
|
-
"README.md"
|
|
9
|
+
"templates"
|
|
11
10
|
],
|
|
12
11
|
"scripts": {
|
|
13
12
|
"test": "node --test test/*.test.js"
|
package/src/server/index.js
CHANGED
|
@@ -48,12 +48,15 @@ function normalizeTenancyMode(value, { showUsage = true } = {}) {
|
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
function
|
|
51
|
+
function buildInitialSetupCommands(initialBundles) {
|
|
52
52
|
const normalizedPreset = normalizeInitialBundlesPreset(initialBundles, { showUsage: false });
|
|
53
53
|
|
|
54
54
|
const commands = [];
|
|
55
55
|
if (normalizedPreset === "auth") {
|
|
56
|
-
commands.push(
|
|
56
|
+
commands.push(
|
|
57
|
+
"npx jskit add package auth-provider-supabase-core --auth-supabase-url \"https://YOUR-PROJECT.supabase.co\" --auth-supabase-publishable-key \"sb_publishable_...\" --app-public-url \"http://localhost:5173\""
|
|
58
|
+
);
|
|
59
|
+
commands.push("npx jskit add bundle auth-base");
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
return commands;
|
|
@@ -555,7 +558,7 @@ export async function createApp({
|
|
|
555
558
|
template: String(template),
|
|
556
559
|
initialBundles: resolvedInitialBundles,
|
|
557
560
|
tenancyMode: resolvedTenancyMode,
|
|
558
|
-
|
|
561
|
+
selectedSetupCommands: buildInitialSetupCommands(resolvedInitialBundles),
|
|
559
562
|
targetDirectory,
|
|
560
563
|
dryRun,
|
|
561
564
|
touchedFiles
|
|
@@ -625,21 +628,12 @@ export async function runCli(
|
|
|
625
628
|
stdout.write("- npm install\n");
|
|
626
629
|
stdout.write("- npm run dev\n");
|
|
627
630
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
stdout.write(`Initial framework
|
|
631
|
-
for (const command of result.
|
|
631
|
+
if (result.selectedSetupCommands.length > 0) {
|
|
632
|
+
stdout.write("\n");
|
|
633
|
+
stdout.write(`Initial framework setup commands (${result.initialBundles}):\n`);
|
|
634
|
+
for (const command of result.selectedSetupCommands) {
|
|
632
635
|
stdout.write(`- ${command}\n`);
|
|
633
636
|
}
|
|
634
|
-
} else {
|
|
635
|
-
stdout.write("First of all run npm install.:\n");
|
|
636
|
-
stdout.write("Then add framework capabilities:\n");
|
|
637
|
-
stdout.write("- npx jskit add auth-base\n");
|
|
638
|
-
stdout.write("- npx jskit list\n");
|
|
639
|
-
stdout.write("Run server and client to see it in action:\n");
|
|
640
|
-
stdout.write("- npm run dev\n");
|
|
641
|
-
stdout.write("- npx run server\n");
|
|
642
|
-
|
|
643
637
|
}
|
|
644
638
|
}
|
|
645
639
|
|
|
@@ -18,13 +18,3 @@ config.surfaceDefinitions.home = {
|
|
|
18
18
|
accessPolicyId: "public",
|
|
19
19
|
origin: ""
|
|
20
20
|
};
|
|
21
|
-
config.surfaceDefinitions.console = {
|
|
22
|
-
id: "console",
|
|
23
|
-
label: "Console",
|
|
24
|
-
pagesRoot: "console",
|
|
25
|
-
enabled: true,
|
|
26
|
-
requiresAuth: true,
|
|
27
|
-
requiresWorkspace: false,
|
|
28
|
-
accessPolicyId: "console_owner",
|
|
29
|
-
origin: ""
|
|
30
|
-
};
|
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
export const surfaceAccessPolicies = {};
|
|
2
2
|
|
|
3
3
|
surfaceAccessPolicies.public = {};
|
|
4
|
-
|
|
5
|
-
surfaceAccessPolicies.authenticated = {
|
|
6
|
-
requireAuth: true
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
surfaceAccessPolicies.console_owner = {
|
|
10
|
-
requireAuth: true,
|
|
11
|
-
requireFlagsAll: ["console_owner"]
|
|
12
|
-
};
|
|
@@ -11,17 +11,14 @@
|
|
|
11
11
|
"server": "node ./bin/server.js",
|
|
12
12
|
"server:all": "node ./bin/server.js",
|
|
13
13
|
"server:home": "SERVER_SURFACE=home node ./bin/server.js",
|
|
14
|
-
"server:console": "SERVER_SURFACE=console node ./bin/server.js",
|
|
15
14
|
"start": "node ./bin/server.js",
|
|
16
15
|
"devlinks": "bash ./scripts/link-local-jskit-packages.sh",
|
|
17
16
|
"dev": "vite",
|
|
18
17
|
"dev:all": "vite",
|
|
19
18
|
"dev:home": "VITE_SURFACE=home vite",
|
|
20
|
-
"dev:console": "VITE_SURFACE=console vite",
|
|
21
19
|
"build": "vite build",
|
|
22
20
|
"build:all": "vite build",
|
|
23
21
|
"build:home": "VITE_SURFACE=home vite build",
|
|
24
|
-
"build:console": "VITE_SURFACE=console vite build",
|
|
25
22
|
"preview": "vite preview",
|
|
26
23
|
"lint": "eslint .",
|
|
27
24
|
"test": "node --test",
|
|
@@ -1,28 +1,15 @@
|
|
|
1
1
|
const mainClientComponents = [];
|
|
2
2
|
|
|
3
|
-
function registerMainClientComponent(
|
|
4
|
-
|
|
5
|
-
if (!token || typeof resolveComponent !== "function") {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
mainClientComponents.push(
|
|
9
|
-
Object.freeze({
|
|
10
|
-
token,
|
|
11
|
-
resolveComponent
|
|
12
|
-
})
|
|
13
|
-
);
|
|
3
|
+
function registerMainClientComponent(token, resolveComponent) {
|
|
4
|
+
mainClientComponents.push({ token, resolveComponent });
|
|
14
5
|
}
|
|
15
6
|
|
|
16
7
|
class MainClientProvider {
|
|
17
8
|
static id = "local.main.client";
|
|
18
9
|
|
|
19
10
|
register(app) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
for (const entry of mainClientComponents) {
|
|
25
|
-
app.singleton(entry.token, entry.resolveComponent);
|
|
11
|
+
for (const { token, resolveComponent } of mainClientComponents) {
|
|
12
|
+
app.singleton(token, resolveComponent);
|
|
26
13
|
}
|
|
27
14
|
}
|
|
28
15
|
}
|
|
@@ -9,6 +9,7 @@ set -euo pipefail
|
|
|
9
9
|
|
|
10
10
|
APP_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
11
11
|
SCOPE_DIR="$APP_ROOT/node_modules/@jskit-ai"
|
|
12
|
+
VITE_CACHE_DIR="$APP_ROOT/node_modules/.vite"
|
|
12
13
|
|
|
13
14
|
is_valid_jskit_repo_root() {
|
|
14
15
|
local candidate_root="$1"
|
|
@@ -197,4 +198,9 @@ while IFS=$'\t' read -r package_dir_name source_dir; do
|
|
|
197
198
|
linked_count=$((linked_count + 1))
|
|
198
199
|
done < <(discover_local_package_map)
|
|
199
200
|
|
|
201
|
+
if [[ -d "$VITE_CACHE_DIR" ]]; then
|
|
202
|
+
rm -rf "$VITE_CACHE_DIR"
|
|
203
|
+
echo "[link-local] cleared Vite cache at $VITE_CACHE_DIR"
|
|
204
|
+
fi
|
|
205
|
+
|
|
200
206
|
echo "[link-local] done. linked=$linked_count"
|
|
@@ -104,8 +104,7 @@ async function createServer() {
|
|
|
104
104
|
appRoot,
|
|
105
105
|
profile: resolveRuntimeProfileFromSurface({
|
|
106
106
|
surfaceRuntime,
|
|
107
|
-
serverSurface: runtimeEnv.SERVER_SURFACE
|
|
108
|
-
defaultProfile: "app"
|
|
107
|
+
serverSurface: runtimeEnv.SERVER_SURFACE
|
|
109
108
|
}),
|
|
110
109
|
env: runtimeEnv,
|
|
111
110
|
logger: app.log,
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# __APP_TITLE__
|
|
2
|
-
|
|
3
|
-
Generated with `jskit-create-app` (template: `base-shell`).
|
|
4
|
-
|
|
5
|
-
## Quickstart
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install
|
|
9
|
-
npm run dev
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Refresh JSKIT dependencies to the latest published versions:
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm run jskit:update
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Automate update + PR + merge release flow:
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
npm run release
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Server
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npm run server
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
App configuration files:
|
|
31
|
-
|
|
32
|
-
- `config/public.js` for client-visible feature toggles, including surface definitions.
|
|
33
|
-
- `config/server.js` for server-only toggles/secrets wiring.
|
|
34
|
-
|
|
35
|
-
## Add Capabilities
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npx jskit add auth-base
|
|
39
|
-
```
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-card class="mx-auto" max-width="960" rounded="xl" border elevation="1">
|
|
3
|
-
<v-card-item class="px-6 py-5 px-md-8 py-md-7">
|
|
4
|
-
<v-card-title class="text-h4">console</v-card-title>
|
|
5
|
-
<v-card-subtitle class="text-subtitle-1 mt-2">operations surface</v-card-subtitle>
|
|
6
|
-
</v-card-item>
|
|
7
|
-
<v-divider />
|
|
8
|
-
<v-card-text class="px-6 py-5 px-md-8 py-md-7 text-body-1 text-medium-emphasis">
|
|
9
|
-
This surface is intended for operational tooling.
|
|
10
|
-
</v-card-text>
|
|
11
|
-
</v-card>
|
|
12
|
-
</template>
|