@ultrst-armada/floks 1.13.21 → 1.14.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/.krusbl-release-attestation.json +3 -3
- package/index.d.ts +3 -3
- package/package.json +14 -11
- package/packages/canvas-ui/dist/MovableSocketView.d.ts +1 -1
- package/packages/canvas-ui/dist/NodeCard.d.ts +1 -1
- package/packages/canvas-ui/dist/NodeDetailsPanel.d.ts +1 -1
- package/packages/canvas-ui/dist/NodeGraphCanvas.d.ts +1 -1
- package/packages/canvas-ui/dist/Viewer2DNodes.d.ts +1 -1
- package/packages/canvas-ui/dist/WireRenderer.d.ts +1 -1
- package/packages/canvas-ui/dist/authoring/UiAuthoringValidationPanel.d.ts +1 -1
- package/packages/canvas-ui/dist/{chunk-RH5NINIT.js → chunk-A7BSZ5QO.js} +28 -103
- package/packages/canvas-ui/dist/chunk-FPRATI44.js +45 -0
- package/packages/canvas-ui/dist/{chunk-ZJXRL74D.js → chunk-KAKAFGVH.js} +22 -16
- package/packages/canvas-ui/dist/{chunk-YHEIL67R.js → chunk-SRGVIYC5.js} +6 -6
- package/packages/canvas-ui/dist/{chunk-7CYX3B6O.js → chunk-TKOMIUCU.js} +1 -1
- package/packages/canvas-ui/dist/{chunk-XVAHT5WE.js → chunk-ZDADZVQ2.js} +363 -59
- package/packages/canvas-ui/dist/{chunk-QRYNQ36L.js → chunk-ZSVXR3HU.js} +1 -1
- package/packages/canvas-ui/dist/editor/MonacoEditor.d.ts +1 -1
- package/packages/canvas-ui/dist/editor/index.js +1 -1
- package/packages/canvas-ui/dist/fod/index.js +3 -3
- package/packages/canvas-ui/dist/frnl-editable-node-graph/FrnlEditableNodeGraph.d.ts +1 -1
- package/packages/canvas-ui/dist/frnl-editable-node-graph/index.js +2 -2
- package/packages/canvas-ui/dist/graph-2d/CanvasBackground2D.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/MagneticTraces2D.d.ts +2 -2
- package/packages/canvas-ui/dist/graph-2d/Node2DBase.d.ts +3 -3
- package/packages/canvas-ui/dist/graph-2d/NodeRenderer2D.d.ts +3 -3
- package/packages/canvas-ui/dist/graph-2d/RecorderWaveformDisplay.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/Socket2D.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/Wire2D.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/index.js +9 -9
- package/packages/canvas-ui/dist/graph-2d/socketCoordinates.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/types.d.ts +1 -1
- package/packages/canvas-ui/dist/graph-2d/useCanvas2DMagnetic.d.ts +4 -4
- package/packages/canvas-ui/dist/index.js +41 -41
- package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostNodeCard.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostSolidifyBar.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/ghost/GhostTraceLayer.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/react-flow/ReactFlowAdapter.d.ts +4 -4
- package/packages/canvas-ui/dist/node-graph-ui/toolbar/GraphToolbar.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/CanvasContextMenu.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/CompatibleNodePicker.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/MagneticTraceLayer.d.ts +1 -1
- package/packages/canvas-ui/dist/node-graph-ui/widgets/NodeSearchPalette.d.ts +1 -1
- package/packages/canvas-ui/dist/predictive/PredictiveGhostNodeCard/PredictiveGhostNodeCard.d.ts +2 -2
- package/packages/canvas-ui/dist/predictive/PredictiveGhostNodeCard/types.d.ts +1 -1
- package/packages/canvas-ui/dist/predictive/PredictiveGhostNodeCard.d.ts +2 -2
- package/packages/canvas-ui/dist/predictive/PredictiveLayer2D.d.ts +1 -2
- package/packages/canvas-ui/dist/predictive/index.js +3 -3
- package/packages/canvas-ui/dist/predictive/usePredictiveGraph2D.d.ts +4 -5
- package/packages/canvas-ui/dist/useGhostRouting.d.ts +1 -1
- package/packages/canvas-ui/dist/useNodeGraph.d.ts +1 -1
- package/packages/canvas-ui/package.json +5 -6
- package/packages/contracts/dist/index.d.ts +396 -1
- package/packages/contracts/dist/index.js +201 -1
- package/packages/contracts/dist/state-graph.d.ts +456 -0
- package/packages/contracts/dist/state-graph.js +282 -0
- package/packages/contracts/package.json +6 -1
- package/packages/ui/dist/{chunk-YQL4AGPU.js → chunk-OMNGRMJY.js} +59 -136
- package/packages/ui/dist/{chunk-3YYPBZS2.js → chunk-W6ENIFEW.js} +3 -3
- package/packages/ui/dist/components/auth/LuthAuthClient.d.ts +4 -4
- package/packages/ui/dist/components/auth/index.js +1 -1
- package/packages/ui/dist/components/auth/luthAuthTypes.d.ts +2 -2
- package/packages/ui/dist/components/workspace/WorkspaceCreateDialog.d.ts +15 -18
- package/packages/ui/dist/components/workspace/WorkspaceTilesMenu.d.ts +3 -5
- package/packages/ui/dist/components/workspace/index.js +1 -1
- package/packages/ui/dist/index.js +2 -2
- package/packages/ui/dist/palette/ThemeContext.d.ts +1 -1
- package/packages/ui/dist/palette/domThemeInjector.d.ts +1 -1
- package/packages/ui/dist/palette/index.d.ts +4 -4
- package/packages/ui/dist/palette/palettes.d.ts +1 -1
- package/packages/ui/dist/palette/palettesBase.d.ts +1 -1
- package/packages/ui/dist/palette/palettesExtended.d.ts +1 -1
- package/packages/ui/dist/runtime-entrypoint.test.d.ts +1 -0
- package/packages/ui/dist/theme/packs/docustack-cyberpunk-neon/index.d.ts +1 -1
- package/packages/ui/dist/theme/packs/docustack-cyberpunk-neon/manifest.json +8 -0
- package/packages/ui/dist/theme/packs/docustack-dark-gold/index.d.ts +1 -1
- package/packages/ui/dist/theme/packs/docustack-dark-gold/manifest.json +8 -0
- package/packages/ui/dist/theme/packs/docustack-warm-coffee/index.d.ts +1 -1
- package/packages/ui/dist/theme/packs/docustack-warm-coffee/manifest.json +8 -0
- package/packages/ui/package.json +3 -3
- package/scripts/normalize-package-declarations.mjs +67 -0
- package/packages/canvas-ui/dist/chunk-U2SC3RMJ.js +0 -391
|
@@ -8,14 +8,10 @@ export interface BackblazeBucket {
|
|
|
8
8
|
bucketName?: string;
|
|
9
9
|
}
|
|
10
10
|
export interface BackblazeAccount {
|
|
11
|
+
/** Opaque account/connection identifier; provider credentials remain server-side. */
|
|
11
12
|
id: string;
|
|
12
13
|
name: string;
|
|
13
14
|
provider?: string;
|
|
14
|
-
credentials?: {
|
|
15
|
-
region?: string;
|
|
16
|
-
endpoint?: string;
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
};
|
|
19
15
|
}
|
|
20
16
|
export interface WorkspaceStorageOption {
|
|
21
17
|
id: string;
|
|
@@ -29,14 +25,9 @@ export interface WorkspaceStorageOption {
|
|
|
29
25
|
localFolderPathHint?: string;
|
|
30
26
|
bucketName?: string;
|
|
31
27
|
b2BucketName?: string;
|
|
32
|
-
b2Endpoint?: string;
|
|
33
|
-
b2Region?: string;
|
|
34
|
-
endpoint?: string;
|
|
35
|
-
region?: string;
|
|
36
28
|
googleEmail?: string;
|
|
37
29
|
googleRootFolderId?: string;
|
|
38
30
|
googleRootFolderName?: string;
|
|
39
|
-
credentials?: Record<string, unknown>;
|
|
40
31
|
}
|
|
41
32
|
export interface WorkspaceStorageSelection {
|
|
42
33
|
provider: WorkspaceStorageProvider;
|
|
@@ -44,8 +35,6 @@ export interface WorkspaceStorageSelection {
|
|
|
44
35
|
localFolderName?: string;
|
|
45
36
|
localFolderKey?: string;
|
|
46
37
|
b2BucketName?: string;
|
|
47
|
-
b2Endpoint?: string;
|
|
48
|
-
b2Region?: string;
|
|
49
38
|
googleEmail?: string;
|
|
50
39
|
googleRootFolderId?: string;
|
|
51
40
|
googleRootFolderName?: string;
|
|
@@ -59,8 +48,6 @@ export interface WorkspaceCreateInput {
|
|
|
59
48
|
localFolderName?: string;
|
|
60
49
|
localFolderKey?: string;
|
|
61
50
|
b2BucketName?: string;
|
|
62
|
-
b2Endpoint?: string;
|
|
63
|
-
b2Region?: string;
|
|
64
51
|
googleEmail?: string;
|
|
65
52
|
googleRootFolderId?: string;
|
|
66
53
|
googleRootFolderName?: string;
|
|
@@ -73,9 +60,15 @@ export interface WorkspaceStorageService {
|
|
|
73
60
|
connectGoogleDrive?: (userId: string) => Promise<WorkspaceStorageOption>;
|
|
74
61
|
listGoogleDriveFolders?: (connectionId: string, parentFolderId?: string) => Promise<GoogleDriveFolder[]>;
|
|
75
62
|
}
|
|
76
|
-
export type WorkspaceCreateDialogHiddenField = 'description' | 'localFolderName' | '
|
|
63
|
+
export type WorkspaceCreateDialogHiddenField = 'description' | 'localFolderName' | 'backblaze' | 'canonicalFolderPreview';
|
|
64
|
+
export interface WorkspaceStoragePolicy {
|
|
65
|
+
/** Ordered allow-list declared by the consuming application. No implicit providers are enabled. */
|
|
66
|
+
providers: WorkspaceStorageProvider[];
|
|
67
|
+
}
|
|
77
68
|
export interface WorkspaceCreateDialogVisibility {
|
|
78
|
-
/**
|
|
69
|
+
/** Canonical application-level storage policy. */
|
|
70
|
+
storagePolicy?: WorkspaceStoragePolicy;
|
|
71
|
+
/** Backwards-compatible explicit allow-list. Prefer storagePolicy.providers. */
|
|
79
72
|
availableStorageProviders?: WorkspaceStorageProvider[];
|
|
80
73
|
/** Providers hidden even when included in availableStorageProviders. */
|
|
81
74
|
hiddenStorageProviders?: WorkspaceStorageProvider[];
|
|
@@ -95,12 +88,16 @@ export interface WorkspaceCreateDialogProps {
|
|
|
95
88
|
storageOptions?: WorkspaceStorageOption[];
|
|
96
89
|
storageService?: WorkspaceStorageService;
|
|
97
90
|
visibility?: WorkspaceCreateDialogVisibility;
|
|
98
|
-
onManageStorage?: () => void;
|
|
99
91
|
onClose: () => void;
|
|
100
92
|
onSubmit: (input: WorkspaceCreateInput) => Promise<void> | void;
|
|
101
93
|
}
|
|
102
94
|
export declare function formatWorkspaceFolderPreview(appName: string, userName: string, workspaceName: string): string;
|
|
103
95
|
export declare function buildWorkspaceCreateInput(name: string, description: string, option: WorkspaceStorageOption): WorkspaceCreateInput;
|
|
96
|
+
/**
|
|
97
|
+
* Floks is a browser UI boundary, not an application backend.
|
|
98
|
+
* Consumers inject a browser-safe Kloks client/service adapter.
|
|
99
|
+
* This compatibility default is intentionally inert and performs no network I/O.
|
|
100
|
+
*/
|
|
104
101
|
export declare const defaultWorkspaceStorageService: WorkspaceStorageService;
|
|
105
102
|
export interface KloksServiceInvoker {
|
|
106
103
|
invoke: (serviceId: string, operation: string, input: Record<string, unknown>) => Promise<unknown>;
|
|
@@ -114,4 +111,4 @@ export interface KloksGoogleDriveWorkspaceApi {
|
|
|
114
111
|
listGoogleDriveFolders: (connectionId: string, parentFolderId?: string) => Promise<GoogleDriveFolder[]>;
|
|
115
112
|
}
|
|
116
113
|
export declare function createKloksWorkspaceStorageService(invoker: KloksServiceInvoker, googleDrive?: KloksGoogleDriveWorkspaceApi): WorkspaceStorageService;
|
|
117
|
-
export declare function WorkspaceCreateDialog({ open, userId, currentUser, appName, storageOptions, storageService, visibility,
|
|
114
|
+
export declare function WorkspaceCreateDialog({ open, userId, currentUser, appName, storageOptions, storageService, visibility, onClose, onSubmit, }: WorkspaceCreateDialogProps): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type WorkspaceCreateInput, type WorkspaceStorageService, type WorkspaceStorageOption } from './WorkspaceCreateDialog.js';
|
|
2
|
+
import { type WorkspaceCreateInput, type WorkspaceStorageService, type WorkspaceCreateDialogVisibility, type WorkspaceStorageOption } from './WorkspaceCreateDialog.js';
|
|
3
3
|
export declare const WORKSPACE_TILES_MENU_REQUIRED_SERVICES: readonly ["auth", "workspace", "storage", "srkl"];
|
|
4
4
|
export interface WorkspaceRecord {
|
|
5
5
|
id: string;
|
|
@@ -10,8 +10,6 @@ export interface WorkspaceRecord {
|
|
|
10
10
|
storageProvider?: string;
|
|
11
11
|
storageConnectionId?: string;
|
|
12
12
|
b2BucketName?: string;
|
|
13
|
-
b2Endpoint?: string;
|
|
14
|
-
b2Region?: string;
|
|
15
13
|
localFolderName?: string;
|
|
16
14
|
metadata?: React.ReactNode;
|
|
17
15
|
}
|
|
@@ -25,7 +23,7 @@ export interface WorkspaceTilesMenuProps {
|
|
|
25
23
|
username?: string;
|
|
26
24
|
} | null;
|
|
27
25
|
storageOptions?: WorkspaceStorageOption[];
|
|
28
|
-
|
|
26
|
+
visibility?: WorkspaceCreateDialogVisibility;
|
|
29
27
|
activeWorkspaceId?: string | null;
|
|
30
28
|
appName?: string;
|
|
31
29
|
storageService?: WorkspaceStorageService;
|
|
@@ -93,4 +91,4 @@ export declare const workspaceTilesMenuDefinition: {
|
|
|
93
91
|
};
|
|
94
92
|
};
|
|
95
93
|
};
|
|
96
|
-
export declare function WorkspaceTilesMenu({ workspaces, userId, currentUser, storageOptions,
|
|
94
|
+
export declare function WorkspaceTilesMenu({ workspaces, userId, currentUser, storageOptions, visibility, activeWorkspaceId, appName, storageService, onSelectWorkspace, onCreateWorkspace, onUpdateWorkspace: _onUpdateWorkspace, onDeleteWorkspace: _onDeleteWorkspace, onLogout, loading, error, }: WorkspaceTilesMenuProps): React.JSX.Element;
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
describeGoogleDriveError,
|
|
16
16
|
formatWorkspaceFolderPreview,
|
|
17
17
|
workspaceTilesMenuDefinition
|
|
18
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-OMNGRMJY.js";
|
|
19
19
|
import "../../chunk-DZTJJOLR.js";
|
|
20
20
|
import "../../chunk-B4XTM5TI.js";
|
|
21
21
|
export {
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
describeGoogleDriveError,
|
|
24
24
|
formatWorkspaceFolderPreview,
|
|
25
25
|
workspaceTilesMenuDefinition
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OMNGRMJY.js";
|
|
27
27
|
import {
|
|
28
28
|
AUTH_PAGE_REQUIRED_SERVICES,
|
|
29
29
|
AuthLoadingScreen,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
resolveLuthEnvironment,
|
|
43
43
|
resolveLuthOrigin,
|
|
44
44
|
useLuthAuth
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-W6ENIFEW.js";
|
|
46
46
|
import {
|
|
47
47
|
ConfirmDialog,
|
|
48
48
|
CopyableErrorAlert,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ColorPalette } from './types';
|
|
2
|
+
import { ColorPalette } from './types.js';
|
|
3
3
|
export declare const THEME_STORAGE_KEY = "floks_color_palette_v1";
|
|
4
4
|
export declare const DEFAULT_PALETTE_ID = "black_and_gold";
|
|
5
5
|
export declare function getActivePalette(): ColorPalette;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorPalette } from './types';
|
|
1
|
+
import { ColorPalette } from './types.js';
|
|
2
2
|
import type { SkipoThemePack } from '../theme/index.js';
|
|
3
3
|
export declare function paletteToSkipoThemePack(palette: ColorPalette): SkipoThemePack;
|
|
4
4
|
export declare function applyPaletteToDocument(palette: ColorPalette): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './palettes';
|
|
3
|
-
export * from './domThemeInjector';
|
|
4
|
-
export * from './ThemeContext';
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './palettes.js';
|
|
3
|
+
export * from './domThemeInjector.js';
|
|
4
|
+
export * from './ThemeContext.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ColorPalette } from "./types";
|
|
1
|
+
import { ColorPalette } from "./types.js";
|
|
2
2
|
export declare const BUILTIN_PALETTES: Record<string, ColorPalette>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ColorPalette } from "./types";
|
|
1
|
+
import { ColorPalette } from "./types.js";
|
|
2
2
|
export declare const BASE_PALETTES: Record<string, ColorPalette>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ColorPalette } from "./types";
|
|
1
|
+
import { ColorPalette } from "./types.js";
|
|
2
2
|
export declare const EXTENDED_PALETTES: Record<string, ColorPalette>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ModularThemePack } from '../../schema/themePack.schema.js';
|
|
2
|
-
import manifest from
|
|
2
|
+
import manifest from "./manifest.json" with { type: "json" };
|
|
3
3
|
export declare const DOCUSTACK_CYBERPUNK_PACK: ModularThemePack;
|
|
4
4
|
export * from './tokens.js';
|
|
5
5
|
export * from './typography.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ModularThemePack } from '../../schema/themePack.schema.js';
|
|
2
|
-
import manifest from
|
|
2
|
+
import manifest from "./manifest.json" with { type: "json" };
|
|
3
3
|
export declare const DOCUSTACK_DARK_GOLD_PACK: ModularThemePack;
|
|
4
4
|
export * from './tokens.js';
|
|
5
5
|
export * from './typography.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ModularThemePack } from '../../schema/themePack.schema.js';
|
|
2
|
-
import manifest from
|
|
2
|
+
import manifest from "./manifest.json" with { type: "json" };
|
|
3
3
|
export declare const DOCUSTACK_WARM_COFFEE_PACK: ModularThemePack;
|
|
4
4
|
export * from './tokens.js';
|
|
5
5
|
export * from './typography.js';
|
package/packages/ui/package.json
CHANGED
|
@@ -107,18 +107,18 @@
|
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
|
-
"build": "tsup src/index.ts src/theme/index.ts src/palette/index.ts src/hierarchy/index.ts src/frnl/index.ts src/frnl/store.ts src/components/base/index.ts src/components/containers/index.ts src/components/composite/index.ts src/components/layout/index.ts src/components/bottom-strip/index.ts src/components/settings/index.ts src/components/auth/index.ts src/components/workspace/index.ts src/components/tiles/index.ts src/components/timeline/index.ts src/components/graph/index.ts src/components/ai/index.ts src/serviceUIComponents/index.ts --format esm --clean --external react --external react-dom --external lucide-react --external @ultrst-armada/frnlts --external @
|
|
110
|
+
"build": "tsup src/index.ts src/theme/index.ts src/palette/index.ts src/hierarchy/index.ts src/frnl/index.ts src/frnl/store.ts src/components/base/index.ts src/components/containers/index.ts src/components/composite/index.ts src/components/layout/index.ts src/components/bottom-strip/index.ts src/components/settings/index.ts src/components/auth/index.ts src/components/workspace/index.ts src/components/tiles/index.ts src/components/timeline/index.ts src/components/graph/index.ts src/components/ai/index.ts src/serviceUIComponents/index.ts --format esm --clean --external react --external react-dom --external lucide-react --external @ultrst-armada/frnlts --external @dinilmusick/gutts",
|
|
111
111
|
"typecheck": "tsc --noEmit",
|
|
112
112
|
"clean": "rm -rf dist",
|
|
113
113
|
"build:types": "tsc --emitDeclarationOnly --outDir dist --declarationMap false"
|
|
114
114
|
},
|
|
115
115
|
"dependencies": {
|
|
116
116
|
"zod": "^3.24.1",
|
|
117
|
-
"@ultrst-armada/frnlts": "^0.5.
|
|
117
|
+
"@ultrst-armada/frnlts": "^0.5.10",
|
|
118
118
|
"zustand": "^5.0.3",
|
|
119
119
|
"@xyflow/react": "^12.8.6",
|
|
120
120
|
"d3-force": "^3.0.0",
|
|
121
|
-
"@
|
|
121
|
+
"@dinilmusick/gutts": "^2.0.3"
|
|
122
122
|
},
|
|
123
123
|
"peerDependencies": {
|
|
124
124
|
"lucide-react": ">=0.300.0",
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { readdir, readFile, writeFile, stat, copyFile, mkdir } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
async function walk(directory) {
|
|
5
|
+
const result = [];
|
|
6
|
+
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
7
|
+
const fullPath = path.join(directory, entry.name);
|
|
8
|
+
if (entry.isDirectory()) result.push(...await walk(fullPath));
|
|
9
|
+
else if (entry.isFile()) result.push(fullPath);
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const packagesDirectory = path.resolve("packages");
|
|
15
|
+
for (const packageName of await readdir(packagesDirectory)) {
|
|
16
|
+
const packageDirectory = path.join(packagesDirectory, packageName);
|
|
17
|
+
if (!(await stat(packageDirectory)).isDirectory()) continue;
|
|
18
|
+
const distDirectory = path.join(packageDirectory, "dist");
|
|
19
|
+
const sourceDirectory = path.join(packageDirectory, "src");
|
|
20
|
+
try {
|
|
21
|
+
await stat(sourceDirectory);
|
|
22
|
+
for (const sourceFile of await walk(sourceDirectory)) {
|
|
23
|
+
if (path.extname(sourceFile) !== ".json") continue;
|
|
24
|
+
const targetFile = path.join(distDirectory, path.relative(sourceDirectory, sourceFile));
|
|
25
|
+
await mkdir(path.dirname(targetFile), { recursive: true });
|
|
26
|
+
await copyFile(sourceFile, targetFile);
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
// Workspace package has no source directory or JSON assets.
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
await stat(distDirectory);
|
|
33
|
+
} catch {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
for (const filePath of await walk(distDirectory)) {
|
|
38
|
+
if (!filePath.endsWith(".js") && !filePath.endsWith(".d.ts")) continue;
|
|
39
|
+
const original = await readFile(filePath, "utf8");
|
|
40
|
+
let normalized = original
|
|
41
|
+
.replaceAll("@kloks/", "@ultrst-armada/kloks/")
|
|
42
|
+
.replaceAll("@floks/", "@ultrst-armada/floks/")
|
|
43
|
+
.replaceAll("@ultrst/kloks/", "@ultrst-armada/kloks/")
|
|
44
|
+
.replaceAll("@ultrst/floks/", "@ultrst-armada/floks/")
|
|
45
|
+
.replaceAll('"kloks/', '"@ultrst-armada/kloks/')
|
|
46
|
+
.replaceAll("'kloks/", "'@ultrst-armada/kloks/")
|
|
47
|
+
.replaceAll('"floks/', '"@ultrst-armada/floks/')
|
|
48
|
+
.replaceAll("'floks/", "'@ultrst-armada/floks/");
|
|
49
|
+
|
|
50
|
+
if (filePath.endsWith(".d.ts")) {
|
|
51
|
+
normalized = normalized.replace(
|
|
52
|
+
/(from[ ]+|import[ ]*[(][ ]*)(["'])([.]{1,2}[/][^"']+)\2/g,
|
|
53
|
+
(match, prefix, quote, specifier) => {
|
|
54
|
+
if (path.extname(specifier)) return match;
|
|
55
|
+
return prefix + quote + specifier + ".js" + quote;
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
normalized = normalized
|
|
59
|
+
.replace(/from '([.]{1,2}[/][^']+[.]json)'(?![ ]+with)/g, 'from "$1" with { type: "json" }')
|
|
60
|
+
.replace(/from "([.]{1,2}[/][^"]+[.]json)"(?![ ]+with)/g, 'from "$1" with { type: "json" }');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (normalized !== original) await writeFile(filePath, normalized);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
console.log("Normalized published package aliases and NodeNext declaration specifiers.");
|