@bagelink/workspace 1.15.15 → 1.15.27

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 CHANGED
@@ -62,12 +62,22 @@ 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/;
65
66
  function bagelink(options) {
66
67
  const { workspace, config = {} } = options;
67
68
  let workspaceConfig;
68
69
  return {
69
70
  name: "vite-plugin-bagelink",
70
71
  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
+ },
71
81
  configResolved(resolved) {
72
82
  workspaceConfig = workspace(resolved.mode);
73
83
  },
package/dist/vite.d.cts CHANGED
@@ -49,46 +49,6 @@ 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
- */
92
52
  declare function bagelink(options: {
93
53
  workspace: (mode: WorkspaceEnvironment) => WorkspaceConfig;
94
54
  config?: BagelinkPluginOptions;
package/dist/vite.d.mts CHANGED
@@ -49,46 +49,6 @@ 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
- */
92
52
  declare function bagelink(options: {
93
53
  workspace: (mode: WorkspaceEnvironment) => WorkspaceConfig;
94
54
  config?: BagelinkPluginOptions;
package/dist/vite.d.ts CHANGED
@@ -49,46 +49,6 @@ 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
- */
92
52
  declare function bagelink(options: {
93
53
  workspace: (mode: WorkspaceEnvironment) => WorkspaceConfig;
94
54
  config?: BagelinkPluginOptions;
package/dist/vite.mjs CHANGED
@@ -57,12 +57,22 @@ 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/;
60
61
  function bagelink(options) {
61
62
  const { workspace, config = {} } = options;
62
63
  let workspaceConfig;
63
64
  return {
64
65
  name: "vite-plugin-bagelink",
65
66
  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
+ },
66
76
  configResolved(resolved) {
67
77
  workspaceConfig = workspace(resolved.mode);
68
78
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/workspace",
3
3
  "type": "module",
4
- "version": "1.15.15",
4
+ "version": "1.15.27",
5
5
  "description": "Monorepo workspace tooling for Bagel projects with proxy and config management",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
package/src/vite.ts CHANGED
@@ -75,6 +75,17 @@ 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
+
78
89
  export function bagelink(options: {
79
90
  workspace: (mode: WorkspaceEnvironment) => WorkspaceConfig
80
91
  config?: BagelinkPluginOptions
@@ -87,6 +98,12 @@ export function bagelink(options: {
87
98
  name: 'vite-plugin-bagelink',
88
99
  enforce: 'pre',
89
100
 
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
+
90
107
  configResolved(resolved) {
91
108
  resolvedConfig = resolved
92
109
  workspaceConfig = workspace(resolved.mode as WorkspaceEnvironment)