@shipfox/client-shell 6.0.1 → 8.0.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.
@@ -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;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"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAiB,MAAM,MAAM,CAAC;AAOjD,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,CA0E1C"}
@@ -3,6 +3,7 @@ import { dirname, resolve } from 'node:path';
3
3
  import { composeClientFeatures } from '#compose/compose-client-features.js';
4
4
  import { evaluateFeatures } from './evaluate-features.js';
5
5
  import { generateAppModule } from './generate.js';
6
+ const manifestPluginName = 'shipfox-client-manifest';
6
7
  export function shipfoxClientComposition({ features, out = './src/shipfox-app.gen.ts' }) {
7
8
  let config;
8
9
  let watchedFiles = new Set();
@@ -39,6 +40,9 @@ export function shipfoxClientComposition({ features, out = './src/shipfox-app.ge
39
40
  name: 'shipfox-client-composition',
40
41
  configResolved (resolvedConfig) {
41
42
  config = resolvedConfig;
43
+ if (!resolvedConfig.plugins.some(({ name })=>name === manifestPluginName)) {
44
+ resolvedConfig.logger.warn(`shipfoxClientComposition() is registered without the "${manifestPluginName}" plugin (shipfoxClientManifest()). Add shipfoxClientManifest() to the Vite plugins to serve Shipfox branding assets.`);
45
+ }
42
46
  },
43
47
  async buildStart () {
44
48
  await generate({
@@ -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 {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,oBACbC,YAA2B,EAC3BC,MAA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AG,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"}
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\nconst manifestPluginName = 'shipfox-client-manifest';\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 if (!resolvedConfig.plugins.some(({name}) => name === manifestPluginName)) {\n resolvedConfig.logger.warn(\n `shipfoxClientComposition() is registered without the \"${manifestPluginName}\" plugin (shipfoxClientManifest()). Add shipfoxClientManifest() to the Vite plugins to serve Shipfox branding assets.`,\n );\n }\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","manifestPluginName","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","plugins","some","logger","warn","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,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c;YAC3B/B,SAAS+B;YACT,IAAI,CAACA,eAAeC,OAAO,CAACC,IAAI,CAAC,CAAC,EAACJ,IAAI,EAAC,GAAKA,SAASjC,qBAAqB;gBACzEmC,eAAeG,MAAM,CAACC,IAAI,CACxB,CAAC,sDAAsD,EAAEvC,mBAAmB,qHAAqH,CAAC;YAEtM;QACF;QACA,MAAMwC;YACJ,MAAMpB,SAAS;gBACbC,cAAc,IAAI,CAACA,YAAY,CAACoB,IAAI,CAAC,IAAI;gBACzC5B,cAAc,IAAI,CAACjB,OAAO,CAAC6C,IAAI,CAAC,IAAI;YACtC;QACF;QACA,MAAMC,WAAU,EAACjB,IAAI,EAAEkB,MAAM,EAAC;YAC5B,MAAMC,eAAe,MAAMnD,SAASgC,MAAMK,KAAK,CAAC,IAAMlC,QAAQ6B;YAC9D,IAAI,CAACpB,aAAawC,GAAG,CAACD,eAAe;YACrC,MAAMxB,SAAS;gBACbC,cAAcsB,OAAOG,OAAO,CAACC,GAAG,CAACN,IAAI,CAACE,OAAOG,OAAO;gBACpDjC,cAAc,IAAI,CAACmC,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": "6.0.1",
4
+ "version": "8.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
@@ -30,19 +30,20 @@
30
30
  "./vite": {
31
31
  "types": "./dist/vite/index.d.ts",
32
32
  "default": "./dist/vite/index.js"
33
- }
33
+ },
34
+ "./assets/*": "./assets/*"
34
35
  },
35
36
  "dependencies": {
36
37
  "@swc/helpers": "^0.5.17",
37
38
  "@tanstack/router-core": "^1.171.13",
38
39
  "tsx": "^4.22.4",
39
40
  "framer-motion": "^12.23.24",
40
- "@shipfox/api-workspaces-dto": "9.0.1",
41
+ "@shipfox/api-auth-dto": "9.0.2",
42
+ "@shipfox/api-workspaces-dto": "9.0.2",
41
43
  "@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"
44
+ "@shipfox/client-config": "6.0.2",
45
+ "@shipfox/client-ui": "6.0.2",
46
+ "@shipfox/react-ui": "0.3.7"
46
47
  },
47
48
  "peerDependencies": {
48
49
  "@storybook/react": "^10.4.6",