@shipfox/client-shell 4.0.0 → 6.0.1
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/dist/components/auth-shell.d.ts +13 -0
- package/dist/components/auth-shell.d.ts.map +1 -0
- package/dist/components/auth-shell.js +68 -0
- package/dist/components/auth-shell.js.map +1 -0
- package/dist/components/main-layout.d.ts.map +1 -1
- package/dist/components/main-layout.js +3 -4
- package/dist/components/main-layout.js.map +1 -1
- package/dist/components/nav-tabs.d.ts.map +1 -1
- package/dist/components/nav-tabs.js +3 -4
- package/dist/components/nav-tabs.js.map +1 -1
- package/dist/components/settings-nav.d.ts.map +1 -1
- package/dist/components/settings-nav.js +3 -4
- package/dist/components/settings-nav.js.map +1 -1
- package/dist/compose/compose-client-features.d.ts +11 -0
- package/dist/compose/compose-client-features.d.ts.map +1 -0
- package/dist/compose/compose-client-features.js +19 -0
- package/dist/compose/compose-client-features.js.map +1 -0
- package/dist/compose/compose-routes.d.ts +1 -0
- package/dist/compose/compose-routes.d.ts.map +1 -1
- package/dist/compose/compose-routes.js +4 -2
- package/dist/compose/compose-routes.js.map +1 -1
- package/dist/compose/validate-registries.d.ts +9 -2
- package/dist/compose/validate-registries.d.ts.map +1 -1
- package/dist/compose/validate-registries.js +32 -8
- package/dist/compose/validate-registries.js.map +1 -1
- package/dist/contract.d.ts +6 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js.map +1 -1
- package/dist/core/session.d.ts +20 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +3 -0
- package/dist/core/session.js.map +1 -0
- package/dist/hooks/api/session-auth.d.ts +15 -0
- package/dist/hooks/api/session-auth.d.ts.map +1 -0
- package/dist/hooks/api/session-auth.js +55 -0
- package/dist/hooks/api/session-auth.js.map +1 -0
- package/dist/hooks/api/session-mapper.d.ts +5 -0
- package/dist/hooks/api/session-mapper.d.ts.map +1 -0
- package/dist/hooks/api/session-mapper.js +20 -0
- package/dist/hooks/api/session-mapper.js.map +1 -0
- package/dist/runtime/active-workspace.d.ts.map +1 -1
- package/dist/runtime/active-workspace.js +2 -4
- package/dist/runtime/active-workspace.js.map +1 -1
- package/dist/runtime/auth.d.ts +7 -27
- package/dist/runtime/auth.d.ts.map +1 -1
- package/dist/runtime/auth.js +16 -49
- package/dist/runtime/auth.js.map +1 -1
- package/dist/runtime/compose-client-app.d.ts.map +1 -1
- package/dist/runtime/compose-client-app.js +3 -9
- package/dist/runtime/compose-client-app.js.map +1 -1
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +4 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/route-inputs.d.ts +18 -0
- package/dist/runtime/route-inputs.d.ts.map +1 -0
- package/dist/runtime/route-inputs.js +49 -0
- package/dist/runtime/route-inputs.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/dist/vite/plugin.d.ts.map +1 -1
- package/dist/vite/plugin.js +6 -14
- package/dist/vite/plugin.js.map +1 -1
- package/package.json +10 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAiB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAiB,MAAM,MAAM,CAAC;AAKjD,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAID,wBAAgB,wBAAwB,CAAC,EACvC,QAAQ,EACR,GAAgC,GACjC,EAAE,+BAA+B,GAAG,MAAM,CAqE1C"}
|
package/dist/vite/plugin.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { mkdir, readFile, realpath, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { dirname, resolve } from 'node:path';
|
|
3
|
-
import {
|
|
4
|
-
import { mergeConfigShapes } from '#compose/merge-config.js';
|
|
5
|
-
import { validateProviderIds } from '#compose/validate-providers.js';
|
|
6
|
-
import { validateNavigation, validateSettingsSections } from '#compose/validate-registries.js';
|
|
7
|
-
import { navigationEntries, settingsEntries } from '#runtime/registries.js';
|
|
3
|
+
import { composeClientFeatures } from '#compose/compose-client-features.js';
|
|
8
4
|
import { evaluateFeatures } from './evaluate-features.js';
|
|
9
5
|
import { generateAppModule } from './generate.js';
|
|
10
6
|
export function shipfoxClientComposition({ features, out = './src/shipfox-app.gen.ts' }) {
|
|
@@ -22,18 +18,14 @@ export function shipfoxClientComposition({ features, out = './src/shipfox-app.ge
|
|
|
22
18
|
}
|
|
23
19
|
async function generate({ addWatchFile, resolveRoute }) {
|
|
24
20
|
const evaluated = await evaluateFeatures(featuresPath());
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
validateNavigation(evaluated.features, routes.map((route)=>route.path));
|
|
28
|
-
validateSettingsSections(evaluated.features, routes.map((route)=>route.path));
|
|
29
|
-
mergeConfigShapes(evaluated.features);
|
|
30
|
-
await assertRoutesResolve(resolveRoute, routes);
|
|
21
|
+
const composition = composeClientFeatures(evaluated.features);
|
|
22
|
+
await assertRoutesResolve(resolveRoute, composition.routes);
|
|
31
23
|
watchedFiles = new Set(evaluated.loadedFiles);
|
|
32
24
|
for (const file of watchedFiles)addWatchFile(file);
|
|
33
25
|
const output = generateAppModule({
|
|
34
|
-
routes,
|
|
35
|
-
navigation:
|
|
36
|
-
settingsSections:
|
|
26
|
+
routes: composition.routes,
|
|
27
|
+
navigation: composition.navigation,
|
|
28
|
+
settingsSections: composition.settingsSections
|
|
37
29
|
});
|
|
38
30
|
const path = outputPath();
|
|
39
31
|
const existing = await readFile(path, 'utf8').catch(()=>undefined);
|
package/dist/vite/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/vite/plugin.ts"],"sourcesContent":["import {mkdir, readFile, realpath, writeFile} from 'node:fs/promises';\nimport {dirname, resolve} from 'node:path';\nimport type {Plugin, ResolvedConfig} from 'vite';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/vite/plugin.ts"],"sourcesContent":["import {mkdir, readFile, realpath, writeFile} from 'node:fs/promises';\nimport {dirname, resolve} from 'node:path';\nimport type {Plugin, ResolvedConfig} from 'vite';\nimport {composeClientFeatures} from '#compose/compose-client-features.js';\nimport {evaluateFeatures} from './evaluate-features.js';\nimport {generateAppModule} from './generate.js';\n\nexport interface ShipfoxClientCompositionOptions {\n features: string;\n out?: string;\n}\n\ntype RouteResolver = (source: string, importer?: string) => Promise<{id: string} | null>;\n\nexport function shipfoxClientComposition({\n features,\n out = './src/shipfox-app.gen.ts',\n}: ShipfoxClientCompositionOptions): Plugin {\n let config: ResolvedConfig | undefined;\n let watchedFiles = new Set<string>();\n\n const outputPath = () => resolve(config?.root ?? process.cwd(), out);\n const featuresPath = () => resolve(config?.root ?? process.cwd(), features);\n\n async function assertRoutesResolve(\n resolveRoute: RouteResolver,\n routes: ReturnType<typeof composeClientFeatures>['routes'],\n ): Promise<void> {\n for (const route of routes) {\n const resolvedRoute = await resolveRoute(route.impl, outputPath());\n if (!resolvedRoute) {\n throw new Error(\n `Could not resolve route implementation \"${route.impl}\" for \"${route.path}\".`,\n );\n }\n }\n }\n\n async function generate({\n addWatchFile,\n resolveRoute,\n }: {\n addWatchFile(file: string): void;\n resolveRoute: RouteResolver;\n }): Promise<void> {\n const evaluated = await evaluateFeatures(featuresPath());\n const composition = composeClientFeatures(evaluated.features);\n await assertRoutesResolve(resolveRoute, composition.routes);\n\n watchedFiles = new Set(evaluated.loadedFiles);\n for (const file of watchedFiles) addWatchFile(file);\n\n const output = generateAppModule({\n routes: composition.routes,\n navigation: composition.navigation,\n settingsSections: composition.settingsSections,\n });\n const path = outputPath();\n const existing = await readFile(path, 'utf8').catch(() => undefined);\n if (existing === output) return;\n await mkdir(dirname(path), {recursive: true});\n await writeFile(path, output);\n }\n\n return {\n name: 'shipfox-client-composition',\n configResolved(resolvedConfig) {\n config = resolvedConfig;\n },\n async buildStart() {\n await generate({\n addWatchFile: this.addWatchFile.bind(this),\n resolveRoute: this.resolve.bind(this),\n });\n },\n async hotUpdate({file, server}) {\n const resolvedFile = await realpath(file).catch(() => resolve(file));\n if (!watchedFiles.has(resolvedFile)) return;\n await generate({\n addWatchFile: server.watcher.add.bind(server.watcher),\n resolveRoute: this.environment.pluginContainer.resolveId.bind(\n this.environment.pluginContainer,\n ),\n });\n },\n };\n}\n"],"names":["mkdir","readFile","realpath","writeFile","dirname","resolve","composeClientFeatures","evaluateFeatures","generateAppModule","shipfoxClientComposition","features","out","config","watchedFiles","Set","outputPath","root","process","cwd","featuresPath","assertRoutesResolve","resolveRoute","routes","route","resolvedRoute","impl","Error","path","generate","addWatchFile","evaluated","composition","loadedFiles","file","output","navigation","settingsSections","existing","catch","undefined","recursive","name","configResolved","resolvedConfig","buildStart","bind","hotUpdate","server","resolvedFile","has","watcher","add","environment","pluginContainer","resolveId"],"mappings":"AAAA,SAAQA,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,QAAO,mBAAmB;AACtE,SAAQC,OAAO,EAAEC,OAAO,QAAO,YAAY;AAE3C,SAAQC,qBAAqB,QAAO,sCAAsC;AAC1E,SAAQC,gBAAgB,QAAO,yBAAyB;AACxD,SAAQC,iBAAiB,QAAO,gBAAgB;AAShD,OAAO,SAASC,yBAAyB,EACvCC,QAAQ,EACRC,MAAM,0BAA0B,EACA;IAChC,IAAIC;IACJ,IAAIC,eAAe,IAAIC;IAEvB,MAAMC,aAAa,IAAMV,QAAQO,QAAQI,QAAQC,QAAQC,GAAG,IAAIP;IAChE,MAAMQ,eAAe,IAAMd,QAAQO,QAAQI,QAAQC,QAAQC,GAAG,IAAIR;IAElE,eAAeU,o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,IAAI,CAACpB,aAAaoC,GAAG,CAACD,eAAe;YACrC,MAAMpB,SAAS;gBACbC,cAAckB,OAAOG,OAAO,CAACC,GAAG,CAACN,IAAI,CAACE,OAAOG,OAAO;gBACpD7B,cAAc,IAAI,CAAC+B,WAAW,CAACC,eAAe,CAACC,SAAS,CAACT,IAAI,CAC3D,IAAI,CAACO,WAAW,CAACC,eAAe;YAEpC;QACF;IACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/client-shell",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
"dist",
|
|
15
15
|
"assets"
|
|
16
16
|
],
|
|
17
|
-
"imports": {
|
|
18
|
-
"#*": "./dist/*",
|
|
19
|
-
"#test/*": "./test/*"
|
|
20
|
-
},
|
|
21
17
|
"exports": {
|
|
22
18
|
".": {
|
|
23
19
|
"types": "./dist/index.d.ts",
|
|
@@ -41,12 +37,12 @@
|
|
|
41
37
|
"@tanstack/router-core": "^1.171.13",
|
|
42
38
|
"tsx": "^4.22.4",
|
|
43
39
|
"framer-motion": "^12.23.24",
|
|
44
|
-
"@shipfox/api-
|
|
45
|
-
"@shipfox/api
|
|
46
|
-
"@shipfox/client-
|
|
47
|
-
"@shipfox/
|
|
48
|
-
"@shipfox/client-ui": "
|
|
49
|
-
"@shipfox/
|
|
40
|
+
"@shipfox/api-workspaces-dto": "9.0.1",
|
|
41
|
+
"@shipfox/client-api": "6.0.1",
|
|
42
|
+
"@shipfox/client-config": "6.0.1",
|
|
43
|
+
"@shipfox/react-ui": "0.3.6",
|
|
44
|
+
"@shipfox/client-ui": "6.0.1",
|
|
45
|
+
"@shipfox/api-auth-dto": "9.0.1"
|
|
50
46
|
},
|
|
51
47
|
"peerDependencies": {
|
|
52
48
|
"@storybook/react": "^10.4.6",
|
|
@@ -63,6 +59,9 @@
|
|
|
63
59
|
"optional": true
|
|
64
60
|
}
|
|
65
61
|
},
|
|
62
|
+
"imports": {
|
|
63
|
+
"#*": "./dist/*"
|
|
64
|
+
},
|
|
66
65
|
"scripts": {
|
|
67
66
|
"build": "shipfox-swc",
|
|
68
67
|
"check": "shipfox-biome-check",
|