@nubisco/ui 5.27.1 → 5.27.3
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/plugins/fonts.d.ts +1 -1
- package/dist/plugins/fonts.d.ts.map +1 -1
- package/dist/plugins/fonts.js +1 -1
- package/dist/plugins/vite/glyphs.d.ts +2 -1
- package/dist/plugins/vite/glyphs.d.ts.map +1 -1
- package/dist/plugins/vite/glyphs.js +7 -2
- package/dist/plugins/vite/imports.d.ts +2 -1
- package/dist/plugins/vite/imports.d.ts.map +1 -1
- package/dist/plugins/vite/imports.js +7 -2
- package/dist/plugins/vite/index.js +1 -1
- package/dist/plugins/vite/vendor-capsize-font-metrics.js +168350 -0
- package/dist/plugins/vite/vendor-fonts.d.ts +311 -0
- package/dist/plugins/vite/vendor.d.ts +6 -0
- package/dist/plugins/vite/vendor.js +38642 -0
- package/package.json +5 -12
- package/src/plugins/fonts.ts +1 -1
- package/src/plugins/vite/glyphs.ts +8 -2
- package/src/plugins/vite/imports.ts +8 -2
- package/src/plugins/vite/index.ts +1 -1
- package/src/plugins/vite/vendor.ts +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubisco/ui",
|
|
3
|
-
"version": "5.27.
|
|
3
|
+
"version": "5.27.3",
|
|
4
4
|
"description": "Vue 3 UI component library",
|
|
5
5
|
"packageManager": "pnpm@12.3.4+sha512.961aa41fb077da3a04a441d9f8e15ebc0c96da8ef710b2eb67bf9ee7cb0610eabd48f1fd85f51cffe73846785fa0f87c56a3a872a1d893f8446741b5cce45457",
|
|
6
6
|
"repository": {
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"build": "pnpm run build:lib && pnpm run build:types && pnpm run build:plugins && node scripts/finalize-dist.mjs && pnpm run verify:types",
|
|
140
140
|
"build:lib": "vite build",
|
|
141
141
|
"build:types": "vue-tsc --noEmit false --declaration --emitDeclarationOnly --outDir dist && node scripts/copy-type-modules.mjs && node scripts/rewrite-dist-aliases.mjs dist",
|
|
142
|
-
"build:plugins": "tsc --project tsconfig.plugins.json",
|
|
142
|
+
"build:plugins": "tsc --project tsconfig.plugins.json && node scripts/bundle-plugin-vendor.mjs",
|
|
143
143
|
"verify:types": "pnpm run verify:dist-types && pnpm run verify:consumer-types && pnpm run verify:consumer-globals && pnpm run verify:resolution && pnpm run verify:styles && pnpm run verify:glyph-defaults && pnpm run verify:theme-export",
|
|
144
144
|
"verify:dist-types": "node scripts/verify-dist-types.mjs dist",
|
|
145
145
|
"verify:consumer-types": "node scripts/verify-consumer-types.mjs",
|
|
@@ -180,15 +180,9 @@
|
|
|
180
180
|
},
|
|
181
181
|
"peerDependencies": {
|
|
182
182
|
"pixi.js": "^8.0.0",
|
|
183
|
-
"unplugin-fonts": ">=1.4.0",
|
|
184
183
|
"vue": "^3.5.30",
|
|
185
184
|
"vue-i18n": "^11.3.0"
|
|
186
185
|
},
|
|
187
|
-
"peerDependenciesMeta": {
|
|
188
|
-
"unplugin-fonts": {
|
|
189
|
-
"optional": true
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
186
|
"devDependencies": {
|
|
193
187
|
"@eslint/js": "^10.0.1",
|
|
194
188
|
"@fontsource/fira-code": "^5.2.7",
|
|
@@ -207,6 +201,7 @@
|
|
|
207
201
|
"eslint-plugin-vue": "^10.8.0",
|
|
208
202
|
"jsdom": "^29.0.1",
|
|
209
203
|
"lint-staged": "^16.4.0",
|
|
204
|
+
"magic-string": "^1.2.3",
|
|
210
205
|
"markdown-it-container": "^4.0.0",
|
|
211
206
|
"mermaid": "^11.13.0",
|
|
212
207
|
"pixi.js": "^8.19.0",
|
|
@@ -217,6 +212,8 @@
|
|
|
217
212
|
"tinycolor2": "^1.6.0",
|
|
218
213
|
"typescript": "^5.9.3",
|
|
219
214
|
"typescript-eslint": "^8.57.2",
|
|
215
|
+
"unplugin-fonts": "2.0.0",
|
|
216
|
+
"unplugin-vue-components": "^32.1.0",
|
|
220
217
|
"vite": "^8.0.2",
|
|
221
218
|
"vite-svg-loader": "^5.1.1",
|
|
222
219
|
"vitepress": "^1.6.4",
|
|
@@ -248,9 +245,5 @@
|
|
|
248
245
|
}
|
|
249
246
|
]
|
|
250
247
|
]
|
|
251
|
-
},
|
|
252
|
-
"dependencies": {
|
|
253
|
-
"magic-string": "^1.2.3",
|
|
254
|
-
"unplugin-vue-components": "^32.1.0"
|
|
255
248
|
}
|
|
256
249
|
}
|
package/src/plugins/fonts.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { readFile } from 'node:fs/promises'
|
|
|
2
2
|
import { existsSync } from 'node:fs'
|
|
3
3
|
import path from 'node:path'
|
|
4
4
|
import { fileURLToPath } from 'node:url'
|
|
5
|
-
import
|
|
5
|
+
import type { Rollup } from 'vite'
|
|
6
|
+
import { MagicString } from './vendor.js'
|
|
6
7
|
import { parse, babelParse } from 'vue/compiler-sfc'
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -462,7 +463,12 @@ export function nubiscoGlyphs(options: IGlyphOptions = {}) {
|
|
|
462
463
|
|
|
463
464
|
return {
|
|
464
465
|
code: magic.toString(),
|
|
465
|
-
|
|
466
|
+
// Typed as Vite's own source map input, so the published declarations
|
|
467
|
+
// do not name magic-string, which is bundled and not installed.
|
|
468
|
+
map: magic.generateMap({
|
|
469
|
+
hires: true,
|
|
470
|
+
source: file,
|
|
471
|
+
}) as Rollup.SourceMapInput,
|
|
466
472
|
}
|
|
467
473
|
},
|
|
468
474
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { Rollup } from 'vite'
|
|
2
|
+
import { MagicString } from './vendor.js'
|
|
2
3
|
import { parse, babelParse } from 'vue/compiler-sfc'
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -185,7 +186,12 @@ export function nubiscoImports(options: INubiscoImportOptions) {
|
|
|
185
186
|
|
|
186
187
|
return {
|
|
187
188
|
code: magic.toString(),
|
|
188
|
-
|
|
189
|
+
// Typed as Vite's own source map input, so the published declarations
|
|
190
|
+
// do not name magic-string, which is bundled and not installed.
|
|
191
|
+
map: magic.generateMap({
|
|
192
|
+
hires: true,
|
|
193
|
+
source: file,
|
|
194
|
+
}) as Rollup.SourceMapInput,
|
|
189
195
|
}
|
|
190
196
|
},
|
|
191
197
|
}
|
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync } from 'node:fs'
|
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
import { fileURLToPath } from 'node:url'
|
|
4
4
|
import type { Plugin } from 'vite'
|
|
5
|
-
import Components from '
|
|
5
|
+
import { Components } from './vendor.js'
|
|
6
6
|
import { COMPONENT_MANIFEST } from '../../components/manifest.js'
|
|
7
7
|
import { nubiscoGlyphs, type IGlyphOptions } from './glyphs.js'
|
|
8
8
|
import { nubiscoImports } from './imports.js'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The third-party code `@nubisco/ui/vite` and `@nubisco/ui/plugins/fonts` run
|
|
3
|
+
* on, in one module.
|
|
4
|
+
*
|
|
5
|
+
* All three packages are build-time tooling. As dependencies of the library
|
|
6
|
+
* they put Vite, PostCSS, Sass and the rest of a bundler into the production
|
|
7
|
+
* dependency tree of every app that installs `@nubisco/ui`, and declaring them
|
|
8
|
+
* as optional peers does not help, because pnpm resolves an optional peer the
|
|
9
|
+
* consumer has installed under the library and reports it there. A peer also
|
|
10
|
+
* lets each app run a different version of the code behind the same plugin.
|
|
11
|
+
*
|
|
12
|
+
* So the library build inlines this module, with everything it imports, into
|
|
13
|
+
* `dist/plugins/vite/vendor.js` (see `scripts/bundle-plugin-vendor.mjs`). The
|
|
14
|
+
* packages stay devDependencies of the library, pinned where the output they
|
|
15
|
+
* produce is part of the contract (`unplugin-fonts`), and never reach a
|
|
16
|
+
* consumer's dependency tree. In the source tree, and in tests, this is a
|
|
17
|
+
* plain re-export.
|
|
18
|
+
*/
|
|
19
|
+
export { default as Components } from 'unplugin-vue-components/vite'
|
|
20
|
+
export { default as MagicString } from 'magic-string'
|
|
21
|
+
export { default as Unfonts } from 'unplugin-fonts/vite'
|