@bagelink/workspace 1.15.27 → 1.15.29
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/vite.cjs +0 -10
- package/dist/vite.d.cts +40 -0
- package/dist/vite.d.mts +40 -0
- package/dist/vite.d.ts +40 -0
- package/dist/vite.mjs +0 -10
- package/package.json +1 -1
- package/src/vite.ts +0 -17
package/dist/vite.cjs
CHANGED
|
@@ -62,22 +62,12 @@ function createCustomProxy(paths, target, options = {}) {
|
|
|
62
62
|
return proxy;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const BAGELINK_VUE_STYLE_RE = /[\\/](?:bagelink[\\/]packages[\\/]vue|@bagelink[\\/]vue)[\\/]src[\\/].*\.vue\?(?:.*&)?type=style/;
|
|
66
65
|
function bagelink(options) {
|
|
67
66
|
const { workspace, config = {} } = options;
|
|
68
67
|
let workspaceConfig;
|
|
69
68
|
return {
|
|
70
69
|
name: "vite-plugin-bagelink",
|
|
71
70
|
enforce: "pre",
|
|
72
|
-
transform(code, id) {
|
|
73
|
-
if (!BAGELINK_VUE_STYLE_RE.test(id)) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
if (code.includes("@layer bgl-components")) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
return { code: `@layer bgl-components{${code}}`, map: null };
|
|
80
|
-
},
|
|
81
71
|
configResolved(resolved) {
|
|
82
72
|
workspaceConfig = workspace(resolved.mode);
|
|
83
73
|
},
|
package/dist/vite.d.cts
CHANGED
|
@@ -49,6 +49,46 @@ interface BagelinkPluginOptions {
|
|
|
49
49
|
*/
|
|
50
50
|
configureProxy?: boolean;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Vite plugin for Bagelink workspace integration
|
|
54
|
+
* Automatically configures proxy and path aliases based on bgl.config.ts
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* import { defineConfig } from 'vite'
|
|
59
|
+
* import vue from '@vitejs/plugin-vue'
|
|
60
|
+
* import { bagelink } from '@bagelink/workspace/vite'
|
|
61
|
+
* import workspace from './bgl.config'
|
|
62
|
+
*
|
|
63
|
+
* export default defineConfig({
|
|
64
|
+
* plugins: [
|
|
65
|
+
* vue(),
|
|
66
|
+
* bagelink({ workspace })
|
|
67
|
+
* ]
|
|
68
|
+
* })
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @example With custom options
|
|
72
|
+
* ```ts
|
|
73
|
+
* import { defineConfig } from 'vite'
|
|
74
|
+
* import vue from '@vitejs/plugin-vue'
|
|
75
|
+
* import { bagelink } from '@bagelink/workspace/vite'
|
|
76
|
+
* import workspace from './bgl.config'
|
|
77
|
+
*
|
|
78
|
+
* export default defineConfig({
|
|
79
|
+
* plugins: [
|
|
80
|
+
* vue(),
|
|
81
|
+
* bagelink({
|
|
82
|
+
* workspace,
|
|
83
|
+
* sharedPath: '../packages/shared',
|
|
84
|
+
* additionalAliases: {
|
|
85
|
+
* '@utils': fileURLToPath(new URL('./src/utils', import.meta.url))
|
|
86
|
+
* }
|
|
87
|
+
* })
|
|
88
|
+
* ]
|
|
89
|
+
* })
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
52
92
|
declare function bagelink(options: {
|
|
53
93
|
workspace: (mode: WorkspaceEnvironment) => WorkspaceConfig;
|
|
54
94
|
config?: BagelinkPluginOptions;
|
package/dist/vite.d.mts
CHANGED
|
@@ -49,6 +49,46 @@ interface BagelinkPluginOptions {
|
|
|
49
49
|
*/
|
|
50
50
|
configureProxy?: boolean;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Vite plugin for Bagelink workspace integration
|
|
54
|
+
* Automatically configures proxy and path aliases based on bgl.config.ts
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* import { defineConfig } from 'vite'
|
|
59
|
+
* import vue from '@vitejs/plugin-vue'
|
|
60
|
+
* import { bagelink } from '@bagelink/workspace/vite'
|
|
61
|
+
* import workspace from './bgl.config'
|
|
62
|
+
*
|
|
63
|
+
* export default defineConfig({
|
|
64
|
+
* plugins: [
|
|
65
|
+
* vue(),
|
|
66
|
+
* bagelink({ workspace })
|
|
67
|
+
* ]
|
|
68
|
+
* })
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @example With custom options
|
|
72
|
+
* ```ts
|
|
73
|
+
* import { defineConfig } from 'vite'
|
|
74
|
+
* import vue from '@vitejs/plugin-vue'
|
|
75
|
+
* import { bagelink } from '@bagelink/workspace/vite'
|
|
76
|
+
* import workspace from './bgl.config'
|
|
77
|
+
*
|
|
78
|
+
* export default defineConfig({
|
|
79
|
+
* plugins: [
|
|
80
|
+
* vue(),
|
|
81
|
+
* bagelink({
|
|
82
|
+
* workspace,
|
|
83
|
+
* sharedPath: '../packages/shared',
|
|
84
|
+
* additionalAliases: {
|
|
85
|
+
* '@utils': fileURLToPath(new URL('./src/utils', import.meta.url))
|
|
86
|
+
* }
|
|
87
|
+
* })
|
|
88
|
+
* ]
|
|
89
|
+
* })
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
52
92
|
declare function bagelink(options: {
|
|
53
93
|
workspace: (mode: WorkspaceEnvironment) => WorkspaceConfig;
|
|
54
94
|
config?: BagelinkPluginOptions;
|
package/dist/vite.d.ts
CHANGED
|
@@ -49,6 +49,46 @@ interface BagelinkPluginOptions {
|
|
|
49
49
|
*/
|
|
50
50
|
configureProxy?: boolean;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Vite plugin for Bagelink workspace integration
|
|
54
|
+
* Automatically configures proxy and path aliases based on bgl.config.ts
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* import { defineConfig } from 'vite'
|
|
59
|
+
* import vue from '@vitejs/plugin-vue'
|
|
60
|
+
* import { bagelink } from '@bagelink/workspace/vite'
|
|
61
|
+
* import workspace from './bgl.config'
|
|
62
|
+
*
|
|
63
|
+
* export default defineConfig({
|
|
64
|
+
* plugins: [
|
|
65
|
+
* vue(),
|
|
66
|
+
* bagelink({ workspace })
|
|
67
|
+
* ]
|
|
68
|
+
* })
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @example With custom options
|
|
72
|
+
* ```ts
|
|
73
|
+
* import { defineConfig } from 'vite'
|
|
74
|
+
* import vue from '@vitejs/plugin-vue'
|
|
75
|
+
* import { bagelink } from '@bagelink/workspace/vite'
|
|
76
|
+
* import workspace from './bgl.config'
|
|
77
|
+
*
|
|
78
|
+
* export default defineConfig({
|
|
79
|
+
* plugins: [
|
|
80
|
+
* vue(),
|
|
81
|
+
* bagelink({
|
|
82
|
+
* workspace,
|
|
83
|
+
* sharedPath: '../packages/shared',
|
|
84
|
+
* additionalAliases: {
|
|
85
|
+
* '@utils': fileURLToPath(new URL('./src/utils', import.meta.url))
|
|
86
|
+
* }
|
|
87
|
+
* })
|
|
88
|
+
* ]
|
|
89
|
+
* })
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
52
92
|
declare function bagelink(options: {
|
|
53
93
|
workspace: (mode: WorkspaceEnvironment) => WorkspaceConfig;
|
|
54
94
|
config?: BagelinkPluginOptions;
|
package/dist/vite.mjs
CHANGED
|
@@ -57,22 +57,12 @@ function createCustomProxy(paths, target, options = {}) {
|
|
|
57
57
|
return proxy;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
const BAGELINK_VUE_STYLE_RE = /[\\/](?:bagelink[\\/]packages[\\/]vue|@bagelink[\\/]vue)[\\/]src[\\/].*\.vue\?(?:.*&)?type=style/;
|
|
61
60
|
function bagelink(options) {
|
|
62
61
|
const { workspace, config = {} } = options;
|
|
63
62
|
let workspaceConfig;
|
|
64
63
|
return {
|
|
65
64
|
name: "vite-plugin-bagelink",
|
|
66
65
|
enforce: "pre",
|
|
67
|
-
transform(code, id) {
|
|
68
|
-
if (!BAGELINK_VUE_STYLE_RE.test(id)) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
if (code.includes("@layer bgl-components")) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
return { code: `@layer bgl-components{${code}}`, map: null };
|
|
75
|
-
},
|
|
76
66
|
configResolved(resolved) {
|
|
77
67
|
workspaceConfig = workspace(resolved.mode);
|
|
78
68
|
},
|
package/package.json
CHANGED
package/src/vite.ts
CHANGED
|
@@ -75,17 +75,6 @@ export interface BagelinkPluginOptions {
|
|
|
75
75
|
* })
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
-
/**
|
|
79
|
-
* Matches SFC style requests coming from @bagelink/vue *source* (sibling-repo
|
|
80
|
-
* dev alias or node_modules src import). The published dist CSS already ships
|
|
81
|
-
* layered; this covers the case where the consumer's vite compiles the
|
|
82
|
-
* library's .vue files directly and would otherwise inject their styles
|
|
83
|
-
* unlayered — letting e.g. Card's built-in `padding: 2rem` beat the `p-0`
|
|
84
|
-
* utility. App SFCs are intentionally NOT matched: consumer styles must stay
|
|
85
|
-
* unlayered so they win over all bagelink CSS.
|
|
86
|
-
*/
|
|
87
|
-
const BAGELINK_VUE_STYLE_RE = /[\\/](?:bagelink[\\/]packages[\\/]vue|@bagelink[\\/]vue)[\\/]src[\\/].*\.vue\?(?:.*&)?type=style/
|
|
88
|
-
|
|
89
78
|
export function bagelink(options: {
|
|
90
79
|
workspace: (mode: WorkspaceEnvironment) => WorkspaceConfig
|
|
91
80
|
config?: BagelinkPluginOptions
|
|
@@ -98,12 +87,6 @@ export function bagelink(options: {
|
|
|
98
87
|
name: 'vite-plugin-bagelink',
|
|
99
88
|
enforce: 'pre',
|
|
100
89
|
|
|
101
|
-
transform(code, id) {
|
|
102
|
-
if (!BAGELINK_VUE_STYLE_RE.test(id)) { return null }
|
|
103
|
-
if (code.includes('@layer bgl-components')) { return null }
|
|
104
|
-
return { code: `@layer bgl-components{${code}}`, map: null }
|
|
105
|
-
},
|
|
106
|
-
|
|
107
90
|
configResolved(resolved) {
|
|
108
91
|
resolvedConfig = resolved
|
|
109
92
|
workspaceConfig = workspace(resolved.mode as WorkspaceEnvironment)
|