@trebired/frontend 6.16.0 → 7.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.
- package/CHANGELOG.md +6 -0
- package/README.md +3 -3
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +5 -5
- package/dist/config/index.js.map +1 -1
- package/dist/src/config/index.d.ts +4 -4
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable package changes are documented here.
|
|
4
4
|
|
|
5
|
+
## 7.0.0
|
|
6
|
+
|
|
7
|
+
- Renamed the public frontend config definer and loader helpers to `defineConfig()`, `findConfig()`, and `loadConfig()`.
|
|
8
|
+
- Updated generated namespace loading to use `@trebired/bundler/config`.
|
|
9
|
+
- Replaced the Code Discipline preset dependency with `@trebired/configs`.
|
|
10
|
+
|
|
5
11
|
## 6.16.0
|
|
6
12
|
|
|
7
13
|
- Added package-owned frontend request logging middleware for document requests, static-success suppression, and generic browser probe suppression.
|
package/README.md
CHANGED
|
@@ -29,9 +29,9 @@ Feature binders such as `bindActionForms()`, `bindTooltips()`, `bindModals()`, a
|
|
|
29
29
|
Projects configure package-owned systems through the frontend config file consumed by the bundler.
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
|
-
import {
|
|
32
|
+
import { defineConfig } from "<package-name>/config";
|
|
33
33
|
|
|
34
|
-
export default
|
|
34
|
+
export default defineConfig({
|
|
35
35
|
prefix: "tbf",
|
|
36
36
|
assets: {
|
|
37
37
|
icons: {
|
|
@@ -68,7 +68,7 @@ export default defineFrontendConfig({
|
|
|
68
68
|
});
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
The config entrypoint exports `
|
|
71
|
+
The config entrypoint exports `defineConfig()`, `normalizeFrontendConfig()`, `loadConfig()`, `findConfig()`, `generateFrontendScss()`, `collectConfigDependencies()`, and `THEME_MODE_ATTRIBUTE`.
|
|
72
72
|
|
|
73
73
|
## Components
|
|
74
74
|
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { LoadFrontendConfigOptions, LoadedFrontendConfig, FrontendConfig } from "./types.js";
|
|
2
|
-
declare const
|
|
3
|
-
declare function
|
|
4
|
-
declare function
|
|
2
|
+
declare const defineConfig: <T extends FrontendConfig>(config: T) => T;
|
|
3
|
+
declare function findConfig(startDir?: string, boundaryDir?: string): Promise<string | null>;
|
|
4
|
+
declare function loadConfig(projectRoot?: string, options?: LoadFrontendConfigOptions): Promise<LoadedFrontendConfig>;
|
|
5
5
|
export { DEFAULT_FRONTEND_CONFIG, SUPPORTED_ICON_PACKS, SYSTEM_ORDER, THEME_MODE_ATTRIBUTE, FRONTEND_CONFIG_PATH, normalizeFrontendConfig, } from "./normalize.js";
|
|
6
6
|
export { generateFrontendScss } from "./scss.js";
|
|
7
7
|
export { collectConfigDependencies } from "./module.js";
|
|
8
8
|
export { createFrontendTokenHelpers } from "./tokens.js";
|
|
9
|
-
export {
|
|
9
|
+
export { defineConfig, findConfig, loadConfig };
|
|
10
10
|
export type { LoadFrontendConfigOptions, LoadedFrontendConfig, NormalizedFrontendActivePressInteractionConfig, NormalizedFrontendAssetsConfig, NormalizedFrontendConfig, NormalizedFrontendComponentsConfig, NormalizedFrontendDesignConfig, NormalizedFrontendDesignInteractionsConfig, NormalizedFrontendFontConfig, NormalizedFrontendFontFamilyConfig, NormalizedFrontendPaletteConfig, NormalizedFrontendPaletteMode, NormalizedFrontendPaletteSemantic, NormalizedFrontendRuntimeConfig, NormalizedFrontendScalesConfig, NormalizedFrontendThemeConfig, NormalizedFrontendThemeMode, NormalizedFrontendZIndexScaleConfig, FrontendConfig, FrontendActivePressInteractionConfig, FrontendAssetsConfig, FrontendComponentTokens, FrontendComponentsConfig, FrontendDataComponentsConfig, FrontendDesignConfig, FrontendDesignInteractionsConfig, FrontendFeedbackComponentsConfig, FrontendFontConfig, FrontendFontDisplay, FrontendFontFamilyConfig, FrontendFontStyle, FrontendIconAliasValue, FrontendIconPack, FrontendOverlayComponentsConfig, FrontendPaletteConfig, FrontendPaletteFamilies, FrontendPaletteMode, FrontendPaletteScale, FrontendPaletteSemanticRef, FrontendPrimitiveComponentsConfig, FrontendRuntimeConfig, FrontendScaleSteps, FrontendScalesConfig, FrontendShellComponentsConfig, FrontendSurfaceComponentsConfig, FrontendSystemKey, FrontendThemeConfig, FrontendThemeMode, FrontendThemeModeScheme, FrontendThemeTokens, FrontendZIndexScaleConfig, } from "./types.js";
|
|
11
11
|
export type { FrontendConfigTokenHelpers, FrontendConfigVariableHelper, FrontendCssVariable, FrontendCssVariableWithFallback, FrontendPaletteFamily, FrontendPaletteModeKey, FrontendPaletteSemanticToken, FrontendPaletteStep, } from "./tokens.js";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACpB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,QAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACpB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,QAAA,MAAM,YAAY,EAAkB,CAAC,CAAC,SAAS,cAAc,EAAI,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;AAEjF,iBAAe,UAAU,CACvB,QAAQ,GAAE,MAAsB,EAChC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,GAAC,IAAI,CAAC,CAStB;AAYD,iBAAe,UAAU,CACvB,W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AC1B,4BAA4B,EAC5B,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
package/dist/config/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import { defineValue } from "../components/index.js";
|
|
|
3
3
|
import { collectConfigDependencies, importConfigModule, pathExists } from "./module.js";
|
|
4
4
|
import { FRONTEND_CONFIG_PATH, normalizeFrontendConfig } from "./normalize.js";
|
|
5
5
|
import { generateFrontendScss } from "./scss.js";
|
|
6
|
-
const
|
|
7
|
-
async function
|
|
6
|
+
const defineConfig = defineValue;
|
|
7
|
+
async function findConfig(startDir = process.cwd(), boundaryDir) {
|
|
8
8
|
const boundary = path.resolve(boundaryDir || path.parse(path.resolve(startDir)).root);
|
|
9
9
|
let current = path.resolve(startDir);
|
|
10
10
|
for (;;) {
|
|
@@ -25,11 +25,11 @@ function createDefaultLoadedConfig() {
|
|
|
25
25
|
generatedScss: generateFrontendScss(config),
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
async function
|
|
28
|
+
async function loadConfig(projectRoot = process.cwd(), options = {}) {
|
|
29
29
|
const root = path.resolve(projectRoot);
|
|
30
30
|
const resolvedPath = options.configPath
|
|
31
31
|
? path.resolve(root, options.configPath)
|
|
32
|
-
: await
|
|
32
|
+
: await findConfig(options.searchFrom || root);
|
|
33
33
|
if (!resolvedPath) {
|
|
34
34
|
if (options.defaultIfMissing === false) {
|
|
35
35
|
throw new Error(`frontend-config-not-found :: ${FRONTEND_CONFIG_PATH}`);
|
|
@@ -52,5 +52,5 @@ export { DEFAULT_FRONTEND_CONFIG, SUPPORTED_ICON_PACKS, SYSTEM_ORDER, THEME_MODE
|
|
|
52
52
|
export { generateFrontendScss } from "./scss.js";
|
|
53
53
|
export { collectConfigDependencies } from "./module.js";
|
|
54
54
|
export { createFrontendTokenHelpers } from "./tokens.js";
|
|
55
|
-
export {
|
|
55
|
+
export { defineConfig, findConfig, loadConfig };
|
|
56
56
|
//# sourceMappingURL=index.js.map
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAOjD,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAOjD,MAAM,YAAY,GAAG,WAA2D,CAAC;AAEjF,KAAK,UAAU,UAAU,CACvB,WAAmB,OAAO,CAAC,GAAG,EAAE,EAChC,WAAoB;IAEpB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACtF,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,SAAU,CAAC;QACT,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,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AC,YAAY,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,uBAAuB,CAAC,MAAM,kBAAkB,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;IACnG,OAAO;QACL,MAAM;QACN,UAAU,EAAE,YAAY;QACxB,YAAY;QACZ,aAAa,EAAE,oBAAoB,CAAC,MAAM,CAAC;KAC5C,CAAC;AACJ,CAAC;AAED,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { LoadFrontendConfigOptions, LoadedFrontendConfig, FrontendConfig } from "./types.js";
|
|
2
|
-
declare const
|
|
3
|
-
declare function
|
|
4
|
-
declare function
|
|
2
|
+
declare const defineConfig: <T extends FrontendConfig>(config: T) => T;
|
|
3
|
+
declare function findConfig(startDir?: string, boundaryDir?: string): Promise<string | null>;
|
|
4
|
+
declare function loadConfig(projectRoot?: string, options?: LoadFrontendConfigOptions): Promise<LoadedFrontendConfig>;
|
|
5
5
|
export { DEFAULT_FRONTEND_CONFIG, SUPPORTED_ICON_PACKS, SYSTEM_ORDER, THEME_MODE_ATTRIBUTE, FRONTEND_CONFIG_PATH, normalizeFrontendConfig, } from "./normalize.js";
|
|
6
6
|
export { generateFrontendScss } from "./scss.js";
|
|
7
7
|
export { collectConfigDependencies } from "./module.js";
|
|
8
8
|
export { createFrontendTokenHelpers } from "./tokens.js";
|
|
9
|
-
export {
|
|
9
|
+
export { defineConfig, findConfig, loadConfig };
|
|
10
10
|
export type { LoadFrontendConfigOptions, LoadedFrontendConfig, NormalizedFrontendActivePressInteractionConfig, NormalizedFrontendAssetsConfig, NormalizedFrontendConfig, NormalizedFrontendComponentsConfig, NormalizedFrontendDesignConfig, NormalizedFrontendDesignInteractionsConfig, NormalizedFrontendFontConfig, NormalizedFrontendFontFamilyConfig, NormalizedFrontendPaletteConfig, NormalizedFrontendPaletteMode, NormalizedFrontendPaletteSemantic, NormalizedFrontendRuntimeConfig, NormalizedFrontendScalesConfig, NormalizedFrontendThemeConfig, NormalizedFrontendThemeMode, NormalizedFrontendZIndexScaleConfig, FrontendConfig, FrontendActivePressInteractionConfig, FrontendAssetsConfig, FrontendComponentTokens, FrontendComponentsConfig, FrontendDataComponentsConfig, FrontendDesignConfig, FrontendDesignInteractionsConfig, FrontendFeedbackComponentsConfig, FrontendFontConfig, FrontendFontDisplay, FrontendFontFamilyConfig, FrontendFontStyle, FrontendIconAliasValue, FrontendIconPack, FrontendOverlayComponentsConfig, FrontendPaletteConfig, FrontendPaletteFamilies, FrontendPaletteMode, FrontendPaletteScale, FrontendPaletteSemanticRef, FrontendPrimitiveComponentsConfig, FrontendRuntimeConfig, FrontendScaleSteps, FrontendScalesConfig, FrontendShellComponentsConfig, FrontendSurfaceComponentsConfig, FrontendSystemKey, FrontendThemeConfig, FrontendThemeMode, FrontendThemeModeScheme, FrontendThemeTokens, FrontendZIndexScaleConfig, } from "./types.js";
|
|
11
11
|
export type { FrontendConfigTokenHelpers, FrontendConfigVariableHelper, FrontendCssVariable, FrontendCssVariableWithFallback, FrontendPaletteFamily, FrontendPaletteModeKey, FrontendPaletteSemanticToken, FrontendPaletteStep, } from "./tokens.js";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACpB,cAAc,EACf,MA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5B,oBAAoB,EACpB,gCAAgC,EAChC,gCAAgC,EAChC,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,+BAA+B,EAC/B,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,iCAAiC,EACjC,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,6BAA6B,EAC7B,+BAA+B,EAC/B,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,0BAA0B,EAC1B,4BAA4B,EAC5B,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
package/dist/src/config/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import { defineValue } from "../../components/index.js";
|
|
|
3
3
|
import { collectConfigDependencies, importConfigModule, pathExists } from "./module.js";
|
|
4
4
|
import { FRONTEND_CONFIG_PATH, normalizeFrontendConfig } from "./normalize.js";
|
|
5
5
|
import { generateFrontendScss } from "./scss.js";
|
|
6
|
-
const
|
|
7
|
-
async function
|
|
6
|
+
const defineConfig = defineValue;
|
|
7
|
+
async function findConfig(startDir = process.cwd(), boundaryDir) {
|
|
8
8
|
const boundary = path.resolve(boundaryDir || path.parse(path.resolve(startDir)).root);
|
|
9
9
|
let current = path.resolve(startDir);
|
|
10
10
|
for (;;) {
|
|
@@ -25,11 +25,11 @@ function createDefaultLoadedConfig() {
|
|
|
25
25
|
generatedScss: generateFrontendScss(config),
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
async function
|
|
28
|
+
async function loadConfig(projectRoot = process.cwd(), options = {}) {
|
|
29
29
|
const root = path.resolve(projectRoot);
|
|
30
30
|
const resolvedPath = options.configPath
|
|
31
31
|
? path.resolve(root, options.configPath)
|
|
32
|
-
: await
|
|
32
|
+
: await findConfig(options.searchFrom || root);
|
|
33
33
|
if (!resolvedPath) {
|
|
34
34
|
if (options.defaultIfMissing === false) {
|
|
35
35
|
throw new Error(`frontend-config-not-found :: ${FRONTEND_CONFIG_PATH}`);
|
|
@@ -52,5 +52,5 @@ export { DEFAULT_FRONTEND_CONFIG, SUPPORTED_ICON_PACKS, SYSTEM_ORDER, THEME_MODE
|
|
|
52
52
|
export { generateFrontendScss } from "./scss.js";
|
|
53
53
|
export { collectConfigDependencies } from "./module.js";
|
|
54
54
|
export { createFrontendTokenHelpers } from "./tokens.js";
|
|
55
|
-
export {
|
|
55
|
+
export { defineConfig, findConfig, loadConfig };
|
|
56
56
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAOjD,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,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CAAC,UAAU,IAAI,IAAI,CAAC,CAAC;IAE/C,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,IAAI,OAAO,CAAC,gBAAgB,KAAK,KAAK,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,gCAAgC,oBAAoB,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,OAAO,yBAAyB,EAAE,CAAC;IACrC,CAAC;IAED,IAAI,CAAC,MAAM,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,gCAAgC,YAAY,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,yBAAyB,CAAC,YAAY,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,uBAAuB,CAAC,MAAM,kBAAkB,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;IACnG,OAAO;QACL,MAAM;QACN,UAAU,EAAE,YAAY;QACxB,YAAY;QACZ,aAAa,EAAE,oBAAoB,CAAC,MAAM,CAAC;KAC5C,CAAC;AACJ,CAAC;AAED,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trebired/frontend",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Generic browser runtime systems for Trebired frontend packages and applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"socket.io-client": "^4.8.3"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@trebired/bundler": "^
|
|
66
|
+
"@trebired/bundler": "^5.0.0",
|
|
67
67
|
"@trebired/code-discipline": "^6.0.11",
|
|
68
|
-
"@trebired/
|
|
68
|
+
"@trebired/configs": "^0.1.0",
|
|
69
69
|
"@types/bun": "^1.3.14",
|
|
70
70
|
"@types/node": "^24.13.3",
|
|
71
71
|
"@types/react": "^19.2.18",
|