unplugin-solid-labels 0.17.0 → 1.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/LICENSE CHANGED
@@ -1,7 +1,21 @@
1
- MIT License Copyright (c) 2023 Alexis Munsayac
1
+ MIT License
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ Copyright (c) 2025 Alexis Munsayac
4
4
 
5
- The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
6
11
 
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -27,12 +27,6 @@ import solidLabels from 'unplugin-solid-labels';
27
27
  solidLabels.vite({
28
28
  dev: true, // defaults to false
29
29
  disabled: {
30
- labels: {
31
- signal: true,
32
- },
33
- pragma: {
34
- '@signal': true,
35
- },
36
30
  ctf: {
37
31
  $signal: true,
38
32
  },
@@ -41,9 +35,52 @@ solidLabels.vite({
41
35
  include: 'src/**/*.{ts,js,tsx,jsx}',
42
36
  exclude: 'node_modules/**/*.{ts,js,tsx,jsx}',
43
37
  },
44
- })
38
+ });
39
+ ```
40
+
41
+ ### Bun
42
+
43
+ `solidLabels.bun(options)` needs Bun 1.2.22 or later.
44
+
45
+ Bun uses the first `onLoad` that returns contents for a file. Two separate Bun plugins, `solidLabels.bun()` and a Solid JSX plugin, never chain, in either order. The second one never receives the output of the first.
46
+
47
+ Plugins returned from one unplugin factory run their `transform` hooks in order inside a single `onLoad`, and their source maps are combined. Put solid-labels and the JSX step in one factory:
48
+
49
+ ```ts
50
+ import { transformAsync } from '@solidjs/compiler';
51
+ import { createUnplugin } from 'unplugin';
52
+ import type { UnpluginOptions } from 'unplugin';
53
+ import solidLabels from 'unplugin-solid-labels';
54
+
55
+ const solidJsx: UnpluginOptions = {
56
+ name: 'solid-jsx',
57
+ transform: {
58
+ filter: { id: /\/src\/.*\.[jt]sx$/ },
59
+ async handler(code, id) {
60
+ const result = await transformAsync(code, { filename: id, generate: 'dom', sourceMap: true });
61
+ return { code: result.code, map: result.map };
62
+ },
63
+ },
64
+ };
65
+
66
+ const solidBun = createUnplugin((_options: undefined, meta) => [
67
+ solidLabels.raw({ filter: { include: '**/src/**/*.{ts,tsx}' } }, meta),
68
+ solidJsx,
69
+ ]).bun;
70
+
71
+ await Bun.build({
72
+ entrypoints: ['./src/main.tsx'],
73
+ outdir: './dist',
74
+ sourcemap: 'external',
75
+ plugins: [solidBun()],
76
+ });
45
77
  ```
46
78
 
79
+ - Solid 2.0 has no maintained Bun plugin. `@solidjs/compiler` is the compiler that `@solidjs/vite-plugin` uses.
80
+ - Bun plugins such as `bun-plugin-solid` and `@angius/bun-plugin-solid` use `babel-preset-solid` 1.x, which emits Solid 1 output.
81
+
82
+ See [`examples/bun`](https://github.com/lxsmnsyc/solid-labels/tree/main/examples/bun) for a full build and a check that runs the bundle.
83
+
47
84
  ## Sponsors
48
85
 
49
86
  ![Sponsors](https://github.com/lxsmnsyc/sponsors/blob/main/sponsors.svg?raw=true)
@@ -0,0 +1,12 @@
1
+ import { Options } from "solid-labels/compiler";
2
+ import { FilterPattern } from "@rollup/pluginutils";
3
+ interface SolidLabelsPluginFilter {
4
+ include?: FilterPattern;
5
+ exclude?: FilterPattern;
6
+ }
7
+ export interface SolidLabelsPluginOptions extends Options {
8
+ filter?: SolidLabelsPluginFilter;
9
+ }
10
+ declare const solidLabelsPlugin: import("unplugin").UnpluginInstance<SolidLabelsPluginOptions | undefined, boolean>;
11
+ export { type SolidLabelsPluginFilter, solidLabelsPlugin as default };
12
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/filter.ts","../src/index.ts"],"mappings":";;UAGiB;EACf,UAAU;EACV,UAAU;;iBCKK,iCAAiC;EAChD,SAAS;;cA0BL,sCAAiB,iBAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,69 @@
1
+ import { compile } from "solid-labels/compiler";
2
+ import { createUnplugin } from "unplugin";
3
+ import { createFilter } from "@rollup/pluginutils";
4
+ // src/filter.ts
5
+ const DEFAULT_INCLUDE = "src/**/*.{jsx,tsx,ts,js,mjs,cjs}";
6
+ const DEFAULT_EXCLUDE = "node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";
7
+ function removeQuery(id) {
8
+ const index = id.indexOf("?");
9
+ return index === -1 ? id : id.slice(0, index);
10
+ }
11
+ function createIdFilter(options) {
12
+ const filter = createFilter(options?.include ?? DEFAULT_INCLUDE, options?.exclude ?? DEFAULT_EXCLUDE);
13
+ return (id) => filter(removeQuery(id));
14
+ }
15
+ // src/index.ts
16
+ function repushPlugin(plugins, pluginName, pluginNames) {
17
+ const namesSet = new Set(pluginNames);
18
+ let baseIndex = -1;
19
+ let targetIndex = -1;
20
+ let targetPlugin;
21
+ for (let i = 0, len = plugins.length; i < len; i += 1) {
22
+ const current = plugins[i];
23
+ if (namesSet.has(current.name) && baseIndex === -1) baseIndex = i;
24
+ if (current.name === pluginName) {
25
+ targetIndex = i;
26
+ targetPlugin = current;
27
+ }
28
+ }
29
+ if (targetPlugin && baseIndex !== -1 && targetIndex !== -1 && baseIndex < targetIndex) {
30
+ plugins.splice(targetIndex, 1);
31
+ plugins.splice(baseIndex, 0, targetPlugin);
32
+ }
33
+ }
34
+ const solidLabelsPlugin = createUnplugin((rawOptions) => {
35
+ const options = rawOptions ?? {};
36
+ const filter = createIdFilter(options.filter);
37
+ let env;
38
+ return {
39
+ name: "solid-labels",
40
+ transformInclude(id) {
41
+ return filter(id);
42
+ },
43
+ transform(code, id) {
44
+ const result = compile(id, code, {
45
+ disabled: options.disabled,
46
+ dev: env === "development" || options.dev
47
+ });
48
+ if (result === null) return null;
49
+ return {
50
+ code: result.code,
51
+ map: result.map
52
+ };
53
+ },
54
+ vite: {
55
+ enforce: "pre",
56
+ configResolved(config) {
57
+ env = config.mode === "production" ? "production" : "development";
58
+ repushPlugin(config.plugins, "solid-labels", [
59
+ "astro:jsx",
60
+ "solid",
61
+ "solid-start-file-system-router"
62
+ ]);
63
+ }
64
+ }
65
+ };
66
+ });
67
+ export { solidLabelsPlugin as default };
68
+
69
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/filter.ts","../src/index.ts"],"sourcesContent":["import type { FilterPattern } from '@rollup/pluginutils';\nimport { createFilter } from '@rollup/pluginutils';\n\nexport interface SolidLabelsPluginFilter {\n include?: FilterPattern;\n exclude?: FilterPattern;\n}\n\nconst DEFAULT_INCLUDE = 'src/**/*.{jsx,tsx,ts,js,mjs,cjs}';\nconst DEFAULT_EXCLUDE = 'node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}';\n\nfunction removeQuery(id: string): string {\n const index = id.indexOf('?');\n return index === -1 ? id : id.slice(0, index);\n}\n\nexport function createIdFilter(options?: SolidLabelsPluginFilter): (id: string) => boolean {\n const filter = createFilter(\n options?.include ?? DEFAULT_INCLUDE,\n options?.exclude ?? DEFAULT_EXCLUDE,\n );\n return (id) =>\n // Bundlers can add a query to a module id, as SolidStart does with\n // `?pick=` for route files. Match the file path without it.\n filter(removeQuery(id));\n}\n","import type { Options } from 'solid-labels/compiler';\nimport { compile } from 'solid-labels/compiler';\nimport type { TransformResult } from 'unplugin';\nimport { createUnplugin } from 'unplugin';\nimport type { Plugin } from 'vite';\nimport type { SolidLabelsPluginFilter } from './filter';\nimport { createIdFilter } from './filter';\n\nexport type { SolidLabelsPluginFilter };\n\nexport interface SolidLabelsPluginOptions extends Options {\n filter?: SolidLabelsPluginFilter;\n}\n\n// From: https://github.com/bluwy/whyframe/blob/master/packages/jsx/src/index.js#L27-L37\nfunction repushPlugin(plugins: Plugin[], pluginName: string, pluginNames: string[]): void {\n const namesSet = new Set(pluginNames);\n\n let baseIndex = -1;\n let targetIndex = -1;\n let targetPlugin: Plugin | undefined;\n for (let i = 0, len = plugins.length; i < len; i += 1) {\n const current = plugins[i];\n if (namesSet.has(current.name) && baseIndex === -1) {\n baseIndex = i;\n }\n if (current.name === pluginName) {\n targetIndex = i;\n targetPlugin = current;\n }\n }\n if (targetPlugin && baseIndex !== -1 && targetIndex !== -1 && baseIndex < targetIndex) {\n plugins.splice(targetIndex, 1);\n plugins.splice(baseIndex, 0, targetPlugin);\n }\n}\n\nconst solidLabelsPlugin = createUnplugin((rawOptions?: SolidLabelsPluginOptions) => {\n const options = rawOptions ?? {};\n const filter = createIdFilter(options.filter);\n\n let env: string;\n\n return {\n name: 'solid-labels',\n transformInclude(id): boolean {\n return filter(id);\n },\n transform(code, id): TransformResult | null {\n const result = compile(id, code, {\n disabled: options.disabled,\n dev: env === 'development' || options.dev,\n });\n\n // Nothing to compile: keep the original code and map.\n if (result === null) {\n return null;\n }\n\n return {\n code: result.code,\n map: result.map,\n };\n },\n vite: {\n enforce: 'pre',\n configResolved(config): void {\n env = config.mode === 'production' ? 'production' : 'development';\n\n // run our plugin before the following plugins:\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n repushPlugin(config.plugins as Plugin[], 'solid-labels', [\n // https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-jsx/index.ts#L173\n 'astro:jsx',\n // https://github.com/solidjs/vite-plugin-solid/blob/master/src/index.ts#L305\n 'solid',\n // https://github.com/solidjs/solid-start/blob/main/packages/start/vite/plugin.js#L118\n 'solid-start-file-system-router',\n ]);\n },\n },\n };\n});\n\nexport default solidLabelsPlugin;\n"],"mappings":";;;;AAQA,MAAM,kBAAkB;AACxB,MAAM,kBAAkB;AAExB,SAAS,YAAY,IAAoB;CACvC,MAAM,QAAQ,GAAG,QAAQ,GAAG;CAC5B,OAAO,UAAU,KAAK,KAAK,GAAG,MAAM,GAAG,KAAK;AAC9C;AAEA,SAAgB,eAAe,SAA4D;CACzF,MAAM,SAAS,aACb,SAAS,WAAW,iBACpB,SAAS,WAAW,eACtB;CACA,QAAQ,OAGN,OAAO,YAAY,EAAE,CAAC;AAC1B;;ACVA,SAAS,aAAa,SAAmB,YAAoB,aAA6B;CACxF,MAAM,WAAW,IAAI,IAAI,WAAW;CAEpC,IAAI,YAAY;CAChB,IAAI,cAAc;CAClB,IAAI;CACJ,KAAK,IAAI,IAAI,GAAG,MAAM,QAAQ,QAAQ,IAAI,KAAK,KAAK,GAAG;EACrD,MAAM,UAAU,QAAQ;EACxB,IAAI,SAAS,IAAI,QAAQ,IAAI,KAAK,cAAc,IAC9C,YAAY;EAEd,IAAI,QAAQ,SAAS,YAAY;GAC/B,cAAc;GACd,eAAe;EACjB;CACF;CACA,IAAI,gBAAgB,cAAc,MAAM,gBAAgB,MAAM,YAAY,aAAa;EACrF,QAAQ,OAAO,aAAa,CAAC;EAC7B,QAAQ,OAAO,WAAW,GAAG,YAAY;CAC3C;AACF;AAEA,MAAM,oBAAoB,gBAAgB,eAA0C;CAClF,MAAM,UAAU,cAAc,CAAC;CAC/B,MAAM,SAAS,eAAe,QAAQ,MAAM;CAE5C,IAAI;CAEJ,OAAO;EACL,MAAM;EACN,iBAAiB,IAAa;GAC5B,OAAO,OAAO,EAAE;EAClB;EACA,UAAU,MAAM,IAA4B;GAC1C,MAAM,SAAS,QAAQ,IAAI,MAAM;IAC/B,UAAU,QAAQ;IAClB,KAAK,QAAQ,iBAAiB,QAAQ;GACxC,CAAC;GAGD,IAAI,WAAW,MACb,OAAO;GAGT,OAAO;IACL,MAAM,OAAO;IACb,KAAK,OAAO;GACd;EACF;EACA,MAAM;GACJ,SAAS;GACT,eAAe,QAAc;IAC3B,MAAM,OAAO,SAAS,eAAe,eAAe;IAIpD,aAAa,OAAO,SAAqB,gBAAgB;KAEvD;KAEA;KAEA;IACF,CAAC;GACH;EACF;CACF;AACF,CAAC"}
package/package.json CHANGED
@@ -1,38 +1,55 @@
1
1
  {
2
2
  "name": "unplugin-solid-labels",
3
- "version": "0.17.0",
4
- "type": "module",
5
- "files": [
6
- "dist",
7
- "babel",
8
- "core"
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "description": "Unplugin for solid-labels",
6
+ "keywords": [
7
+ "rollup",
8
+ "solid-js",
9
+ "solid-labels",
10
+ "unplugin",
11
+ "vite"
9
12
  ],
10
- "engines": {
11
- "node": ">=10"
13
+ "homepage": "https://github.com/lxsmnsyc/solid-labels/tree/main/packages/unplugin",
14
+ "bugs": {
15
+ "url": "https://github.com/lxsmnsyc/solid-labels/issues"
12
16
  },
13
17
  "license": "MIT",
14
- "keywords": [
15
- "pridepack"
18
+ "author": "Alexis Munsayac",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/lxsmnsyc/solid-labels.git"
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "src"
16
26
  ],
17
- "devDependencies": {
18
- "@types/babel__core": "^7.20.5",
19
- "@types/node": "^22.13.4",
20
- "pridepack": "2.6.1",
21
- "rollup": "^4.34.8",
22
- "solid-labels": "0.17.0",
23
- "tslib": "^2.8.1",
24
- "typescript": "^5.8.2",
25
- "vite": "^6.1.1"
27
+ "type": "module",
28
+ "exports": {
29
+ ".": "./dist/index.mjs",
30
+ "./package.json": "./package.json"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
26
34
  },
27
35
  "dependencies": {
28
- "@babel/core": "^7.26.9",
29
- "@rollup/pluginutils": "^5.1.4",
30
- "unplugin": "^2.2.0"
36
+ "@rollup/pluginutils": "^5.5.1",
37
+ "unplugin": "^3.7.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "^26.6.6",
41
+ "rollup": "^4.67.5",
42
+ "solid-labels": "1.0.0",
43
+ "tsdown": "^0.23.7",
44
+ "tslib": "^2.9.1",
45
+ "typescript": "^7.0.2",
46
+ "vite": "^8.3.6",
47
+ "vitest": "^5.1.0"
31
48
  },
32
49
  "peerDependencies": {
33
50
  "rollup": "^3 || 4",
34
- "solid-labels": "^0.16",
35
- "vite": "^3 || ^4 || ^5"
51
+ "solid-labels": "^1.0.0",
52
+ "vite": "^3 || ^4 || ^5 || ^6 || ^7 || ^8"
36
53
  },
37
54
  "peerDependenciesMeta": {
38
55
  "vite": {
@@ -42,46 +59,12 @@
42
59
  "optional": true
43
60
  }
44
61
  },
45
- "scripts": {
46
- "prepublishOnly": "pridepack clean && pridepack build",
47
- "build": "pridepack build",
48
- "type-check": "pridepack check",
49
- "lint": "pridepack lint",
50
- "clean": "pridepack clean",
51
- "watch": "pridepack watch",
52
- "start": "pridepack start",
53
- "dev": "pridepack dev"
54
- },
55
- "description": "Rollup plugin for solid-styled",
56
- "repository": {
57
- "url": "https://github.com/lxsmnsyc/solid-styled.git",
58
- "type": "git"
59
- },
60
- "homepage": "https://github.com/lxsmnsyc/solid-styled/packages/rollup",
61
- "bugs": {
62
- "url": "https://github.com/lxsmnsyc/solid-styled/issues"
63
- },
64
- "publishConfig": {
65
- "access": "public"
66
- },
67
- "author": "Alexis Munsayac",
68
- "private": false,
69
- "types": "./dist/types/index.d.ts",
70
- "main": "./dist/cjs/production/index.cjs",
71
- "module": "./dist/esm/production/index.mjs",
72
- "exports": {
73
- ".": {
74
- "development": {
75
- "require": "./dist/cjs/development/index.cjs",
76
- "import": "./dist/esm/development/index.mjs"
77
- },
78
- "require": "./dist/cjs/production/index.cjs",
79
- "import": "./dist/esm/production/index.mjs",
80
- "types": "./dist/types/index.d.ts"
81
- }
82
- },
83
- "typesVersions": {
84
- "*": {}
62
+ "engines": {
63
+ "node": ">=18"
85
64
  },
86
- "gitHead": "0a0a153d092072f2ee2ad017831c68addf698f70"
87
- }
65
+ "scripts": {
66
+ "build": "tsdown",
67
+ "watch": "tsdown --watch",
68
+ "test": "vitest run"
69
+ }
70
+ }
package/src/filter.ts ADDED
@@ -0,0 +1,26 @@
1
+ import type { FilterPattern } from '@rollup/pluginutils';
2
+ import { createFilter } from '@rollup/pluginutils';
3
+
4
+ export interface SolidLabelsPluginFilter {
5
+ include?: FilterPattern;
6
+ exclude?: FilterPattern;
7
+ }
8
+
9
+ const DEFAULT_INCLUDE = 'src/**/*.{jsx,tsx,ts,js,mjs,cjs}';
10
+ const DEFAULT_EXCLUDE = 'node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}';
11
+
12
+ function removeQuery(id: string): string {
13
+ const index = id.indexOf('?');
14
+ return index === -1 ? id : id.slice(0, index);
15
+ }
16
+
17
+ export function createIdFilter(options?: SolidLabelsPluginFilter): (id: string) => boolean {
18
+ const filter = createFilter(
19
+ options?.include ?? DEFAULT_INCLUDE,
20
+ options?.exclude ?? DEFAULT_EXCLUDE,
21
+ );
22
+ return (id) =>
23
+ // Bundlers can add a query to a module id, as SolidStart does with
24
+ // `?pick=` for route files. Match the file path without it.
25
+ filter(removeQuery(id));
26
+ }
package/src/index.ts ADDED
@@ -0,0 +1,85 @@
1
+ import type { Options } from 'solid-labels/compiler';
2
+ import { compile } from 'solid-labels/compiler';
3
+ import type { TransformResult } from 'unplugin';
4
+ import { createUnplugin } from 'unplugin';
5
+ import type { Plugin } from 'vite';
6
+ import type { SolidLabelsPluginFilter } from './filter';
7
+ import { createIdFilter } from './filter';
8
+
9
+ export type { SolidLabelsPluginFilter };
10
+
11
+ export interface SolidLabelsPluginOptions extends Options {
12
+ filter?: SolidLabelsPluginFilter;
13
+ }
14
+
15
+ // From: https://github.com/bluwy/whyframe/blob/master/packages/jsx/src/index.js#L27-L37
16
+ function repushPlugin(plugins: Plugin[], pluginName: string, pluginNames: string[]): void {
17
+ const namesSet = new Set(pluginNames);
18
+
19
+ let baseIndex = -1;
20
+ let targetIndex = -1;
21
+ let targetPlugin: Plugin | undefined;
22
+ for (let i = 0, len = plugins.length; i < len; i += 1) {
23
+ const current = plugins[i];
24
+ if (namesSet.has(current.name) && baseIndex === -1) {
25
+ baseIndex = i;
26
+ }
27
+ if (current.name === pluginName) {
28
+ targetIndex = i;
29
+ targetPlugin = current;
30
+ }
31
+ }
32
+ if (targetPlugin && baseIndex !== -1 && targetIndex !== -1 && baseIndex < targetIndex) {
33
+ plugins.splice(targetIndex, 1);
34
+ plugins.splice(baseIndex, 0, targetPlugin);
35
+ }
36
+ }
37
+
38
+ const solidLabelsPlugin = createUnplugin((rawOptions?: SolidLabelsPluginOptions) => {
39
+ const options = rawOptions ?? {};
40
+ const filter = createIdFilter(options.filter);
41
+
42
+ let env: string;
43
+
44
+ return {
45
+ name: 'solid-labels',
46
+ transformInclude(id): boolean {
47
+ return filter(id);
48
+ },
49
+ transform(code, id): TransformResult | null {
50
+ const result = compile(id, code, {
51
+ disabled: options.disabled,
52
+ dev: env === 'development' || options.dev,
53
+ });
54
+
55
+ // Nothing to compile: keep the original code and map.
56
+ if (result === null) {
57
+ return null;
58
+ }
59
+
60
+ return {
61
+ code: result.code,
62
+ map: result.map,
63
+ };
64
+ },
65
+ vite: {
66
+ enforce: 'pre',
67
+ configResolved(config): void {
68
+ env = config.mode === 'production' ? 'production' : 'development';
69
+
70
+ // run our plugin before the following plugins:
71
+ // oxlint-disable-next-line typescript/no-unsafe-type-assertion
72
+ repushPlugin(config.plugins as Plugin[], 'solid-labels', [
73
+ // https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-jsx/index.ts#L173
74
+ 'astro:jsx',
75
+ // https://github.com/solidjs/vite-plugin-solid/blob/master/src/index.ts#L305
76
+ 'solid',
77
+ // https://github.com/solidjs/solid-start/blob/main/packages/start/vite/plugin.js#L118
78
+ 'solid-start-file-system-router',
79
+ ]);
80
+ },
81
+ },
82
+ };
83
+ });
84
+
85
+ export default solidLabelsPlugin;
@@ -1,128 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
33
- default: () => src_default
34
- });
35
- module.exports = __toCommonJS(src_exports);
36
- var babel = __toESM(require("@babel/core"), 1);
37
- var import_pluginutils = require("@rollup/pluginutils");
38
- var import_node_path = __toESM(require("node:path"), 1);
39
- var import_babel = __toESM(require("solid-labels/babel"), 1);
40
- var import_unplugin = require("unplugin");
41
- function repushPlugin(plugins, pluginName, pluginNames) {
42
- const namesSet = new Set(pluginNames);
43
- let baseIndex = -1;
44
- let targetIndex = -1;
45
- let targetPlugin;
46
- for (let i = 0, len = plugins.length; i < len; i += 1) {
47
- const current = plugins[i];
48
- if (namesSet.has(current.name) && baseIndex === -1) {
49
- baseIndex = i;
50
- }
51
- if (current.name === pluginName) {
52
- targetIndex = i;
53
- targetPlugin = current;
54
- }
55
- }
56
- if (targetPlugin && baseIndex !== -1 && targetIndex !== -1 && baseIndex < targetIndex) {
57
- plugins.splice(targetIndex, 1);
58
- plugins.splice(baseIndex, 0, targetPlugin);
59
- }
60
- }
61
- var DEFAULT_INCLUDE = "src/**/*.{jsx,tsx,ts,js,mjs,cjs}";
62
- var DEFAULT_EXCLUDE = "node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";
63
- var FILE_FILTER = /\.[mc]?tsx?$/i;
64
- var solidLabelsPlugin = (0, import_unplugin.createUnplugin)(
65
- (options = {}) => {
66
- var _a, _b;
67
- const filter = (0, import_pluginutils.createFilter)(
68
- ((_a = options.filter) == null ? void 0 : _a.include) || DEFAULT_INCLUDE,
69
- ((_b = options.filter) == null ? void 0 : _b.exclude) || DEFAULT_EXCLUDE
70
- );
71
- let env;
72
- return {
73
- name: "solid-labels",
74
- transformInclude(id) {
75
- return filter(id);
76
- },
77
- async transform(code, id) {
78
- const plugins = ["jsx"];
79
- if (FILE_FILTER.test(id)) {
80
- plugins.push("typescript");
81
- }
82
- const result = await babel.transformAsync(code, {
83
- plugins: [
84
- [
85
- import_babel.default,
86
- {
87
- disabled: options.disabled,
88
- dev: env === "development" || options.dev
89
- }
90
- ]
91
- ],
92
- parserOpts: {
93
- plugins
94
- },
95
- filename: import_node_path.default.basename(id),
96
- ast: false,
97
- sourceMaps: true,
98
- configFile: false,
99
- babelrc: false,
100
- sourceFileName: id
101
- });
102
- if (result) {
103
- return {
104
- code: result.code || "",
105
- map: result.map
106
- };
107
- }
108
- return void 0;
109
- },
110
- vite: {
111
- enforce: "pre",
112
- configResolved(config) {
113
- env = config.mode !== "production" ? "development" : "production";
114
- repushPlugin(config.plugins, "solid-labels", [
115
- // https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-jsx/index.ts#L173
116
- "astro:jsx",
117
- // https://github.com/solidjs/vite-plugin-solid/blob/master/src/index.ts#L305
118
- "solid",
119
- // https://github.com/solidjs/solid-start/blob/main/packages/start/vite/plugin.js#L118
120
- "solid-start-file-system-router"
121
- ]);
122
- }
123
- }
124
- };
125
- }
126
- );
127
- var src_default = solidLabelsPlugin;
128
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/index.ts"],
4
- "sourcesContent": ["import * as babel from '@babel/core';\nimport type { FilterPattern } from '@rollup/pluginutils';\nimport { createFilter } from '@rollup/pluginutils';\nimport path from 'node:path';\nimport type { Options } from 'solid-labels/babel';\nimport solidLabelsBabel from 'solid-labels/babel';\nimport type { TransformResult } from 'unplugin';\nimport { createUnplugin } from 'unplugin';\nimport type { Plugin } from 'vite';\n\nexport interface SolidLabelsPluginFilter {\n include?: FilterPattern;\n exclude?: FilterPattern;\n}\n\nexport interface SolidLabelsPluginOptions extends Options {\n filter?: SolidLabelsPluginFilter;\n}\n\n// From: https://github.com/bluwy/whyframe/blob/master/packages/jsx/src/index.js#L27-L37\nfunction repushPlugin(\n plugins: Plugin[],\n pluginName: string,\n pluginNames: string[],\n): void {\n const namesSet = new Set(pluginNames);\n\n let baseIndex = -1;\n let targetIndex = -1;\n let targetPlugin: Plugin | undefined;\n for (let i = 0, len = plugins.length; i < len; i += 1) {\n const current = plugins[i];\n if (namesSet.has(current.name) && baseIndex === -1) {\n baseIndex = i;\n }\n if (current.name === pluginName) {\n targetIndex = i;\n targetPlugin = current;\n }\n }\n if (\n targetPlugin &&\n baseIndex !== -1 &&\n targetIndex !== -1 &&\n baseIndex < targetIndex\n ) {\n plugins.splice(targetIndex, 1);\n plugins.splice(baseIndex, 0, targetPlugin);\n }\n}\n\nconst DEFAULT_INCLUDE = 'src/**/*.{jsx,tsx,ts,js,mjs,cjs}';\nconst DEFAULT_EXCLUDE = 'node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}';\n\nconst FILE_FILTER = /\\.[mc]?tsx?$/i;\n\nconst solidLabelsPlugin = createUnplugin(\n (options: SolidLabelsPluginOptions = {}) => {\n const filter = createFilter(\n options.filter?.include || DEFAULT_INCLUDE,\n options.filter?.exclude || DEFAULT_EXCLUDE,\n );\n\n let env: string;\n\n return {\n name: 'solid-labels',\n transformInclude(id): boolean {\n return filter(id);\n },\n async transform(code, id): Promise<TransformResult> {\n const plugins: NonNullable<\n NonNullable<babel.TransformOptions['parserOpts']>['plugins']\n > = ['jsx'];\n if (FILE_FILTER.test(id)) {\n plugins.push('typescript');\n }\n const result = await babel.transformAsync(code, {\n plugins: [\n [\n solidLabelsBabel,\n {\n disabled: options.disabled,\n dev: env === 'development' || options.dev,\n },\n ],\n ],\n parserOpts: {\n plugins,\n },\n filename: path.basename(id),\n ast: false,\n sourceMaps: true,\n configFile: false,\n babelrc: false,\n sourceFileName: id,\n });\n\n if (result) {\n return {\n code: result.code || '',\n map: result.map,\n };\n }\n return undefined;\n },\n vite: {\n enforce: 'pre',\n configResolved(config): void {\n env = config.mode !== 'production' ? 'development' : 'production';\n\n // run our plugin before the following plugins:\n repushPlugin(config.plugins as Plugin[], 'solid-labels', [\n // https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-jsx/index.ts#L173\n 'astro:jsx',\n // https://github.com/solidjs/vite-plugin-solid/blob/master/src/index.ts#L305\n 'solid',\n // https://github.com/solidjs/solid-start/blob/main/packages/start/vite/plugin.js#L118\n 'solid-start-file-system-router',\n ]);\n },\n },\n };\n },\n);\n\nexport default solidLabelsPlugin;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AAEvB,yBAA6B;AAC7B,uBAAiB;AAEjB,mBAA6B;AAE7B,sBAA+B;AAa/B,SAAS,aACP,SACA,YACA,aACM;AACN,QAAM,WAAW,IAAI,IAAI,WAAW;AAEpC,MAAI,YAAY;AAChB,MAAI,cAAc;AAClB,MAAI;AACJ,WAAS,IAAI,GAAG,MAAM,QAAQ,QAAQ,IAAI,KAAK,KAAK,GAAG;AACrD,UAAM,UAAU,QAAQ,CAAC;AACzB,QAAI,SAAS,IAAI,QAAQ,IAAI,KAAK,cAAc,IAAI;AAClD,kBAAY;AAAA,IACd;AACA,QAAI,QAAQ,SAAS,YAAY;AAC/B,oBAAc;AACd,qBAAe;AAAA,IACjB;AAAA,EACF;AACA,MACE,gBACA,cAAc,MACd,gBAAgB,MAChB,YAAY,aACZ;AACA,YAAQ,OAAO,aAAa,CAAC;AAC7B,YAAQ,OAAO,WAAW,GAAG,YAAY;AAAA,EAC3C;AACF;AAEA,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AAExB,IAAM,cAAc;AAEpB,IAAM,wBAAoB;AAAA,EACxB,CAAC,UAAoC,CAAC,MAAM;AAzD9C;AA0DI,UAAM,aAAS;AAAA,QACb,aAAQ,WAAR,mBAAgB,YAAW;AAAA,QAC3B,aAAQ,WAAR,mBAAgB,YAAW;AAAA,IAC7B;AAEA,QAAI;AAEJ,WAAO;AAAA,MACL,MAAM;AAAA,MACN,iBAAiB,IAAa;AAC5B,eAAO,OAAO,EAAE;AAAA,MAClB;AAAA,MACA,MAAM,UAAU,MAAM,IAA8B;AAClD,cAAM,UAEF,CAAC,KAAK;AACV,YAAI,YAAY,KAAK,EAAE,GAAG;AACxB,kBAAQ,KAAK,YAAY;AAAA,QAC3B;AACA,cAAM,SAAS,MAAY,qBAAe,MAAM;AAAA,UAC9C,SAAS;AAAA,YACP;AAAA,cACE,aAAAA;AAAA,cACA;AAAA,gBACE,UAAU,QAAQ;AAAA,gBAClB,KAAK,QAAQ,iBAAiB,QAAQ;AAAA,cACxC;AAAA,YACF;AAAA,UACF;AAAA,UACA,YAAY;AAAA,YACV;AAAA,UACF;AAAA,UACA,UAAU,iBAAAC,QAAK,SAAS,EAAE;AAAA,UAC1B,KAAK;AAAA,UACL,YAAY;AAAA,UACZ,YAAY;AAAA,UACZ,SAAS;AAAA,UACT,gBAAgB;AAAA,QAClB,CAAC;AAED,YAAI,QAAQ;AACV,iBAAO;AAAA,YACL,MAAM,OAAO,QAAQ;AAAA,YACrB,KAAK,OAAO;AAAA,UACd;AAAA,QACF;AACA,eAAO;AAAA,MACT;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,eAAe,QAAc;AAC3B,gBAAM,OAAO,SAAS,eAAe,gBAAgB;AAGrD,uBAAa,OAAO,SAAqB,gBAAgB;AAAA;AAAA,YAEvD;AAAA;AAAA,YAEA;AAAA;AAAA,YAEA;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,cAAQ;",
6
- "names": ["solidLabelsBabel", "path"]
7
- }
@@ -1 +0,0 @@
1
- "use strict";var P=Object.create;var u=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var s in t)u(e,s,{get:t[s],enumerable:!0})},d=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of L(t))!v.call(e,l)&&l!==s&&u(e,l,{get:()=>t[l],enumerable:!(n=F(t,l))||n.enumerable});return e};var p=(e,t,s)=>(s=e!=null?P(j(e)):{},d(t||!e||!e.__esModule?u(s,"default",{value:e,enumerable:!0}):s,e)),E=e=>d(u({},"__esModule",{value:!0}),e);var U={};y(U,{default:()=>h});module.exports=E(U);var c=p(require("@babel/core"),1),f=require("@rollup/pluginutils"),b=p(require("node:path"),1),g=p(require("solid-labels/babel"),1),x=require("unplugin");function O(e,t,s){let n=new Set(s),l=-1,r=-1,o;for(let i=0,a=e.length;i<a;i+=1){let m=e[i];n.has(m.name)&&l===-1&&(l=i),m.name===t&&(r=i,o=m)}o&&l!==-1&&r!==-1&&l<r&&(e.splice(r,1),e.splice(l,0,o))}var I="src/**/*.{jsx,tsx,ts,js,mjs,cjs}",N="node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}",S=/\.[mc]?tsx?$/i,T=(0,x.createUnplugin)((e={})=>{var n,l;let t=(0,f.createFilter)(((n=e.filter)==null?void 0:n.include)||I,((l=e.filter)==null?void 0:l.exclude)||N),s;return{name:"solid-labels",transformInclude(r){return t(r)},async transform(r,o){let i=["jsx"];S.test(o)&&i.push("typescript");let a=await c.transformAsync(r,{plugins:[[g.default,{disabled:e.disabled,dev:s==="development"||e.dev}]],parserOpts:{plugins:i},filename:b.default.basename(o),ast:!1,sourceMaps:!0,configFile:!1,babelrc:!1,sourceFileName:o});if(a)return{code:a.code||"",map:a.map}},vite:{enforce:"pre",configResolved(r){s=r.mode!=="production"?"development":"production",O(r.plugins,"solid-labels",["astro:jsx","solid","solid-start-file-system-router"])}}}}),h=T;
@@ -1,97 +0,0 @@
1
- // src/index.ts
2
- import * as babel from "@babel/core";
3
- import { createFilter } from "@rollup/pluginutils";
4
- import path from "node:path";
5
- import solidLabelsBabel from "solid-labels/babel";
6
- import { createUnplugin } from "unplugin";
7
- function repushPlugin(plugins, pluginName, pluginNames) {
8
- const namesSet = new Set(pluginNames);
9
- let baseIndex = -1;
10
- let targetIndex = -1;
11
- let targetPlugin;
12
- for (let i = 0, len = plugins.length; i < len; i += 1) {
13
- const current = plugins[i];
14
- if (namesSet.has(current.name) && baseIndex === -1) {
15
- baseIndex = i;
16
- }
17
- if (current.name === pluginName) {
18
- targetIndex = i;
19
- targetPlugin = current;
20
- }
21
- }
22
- if (targetPlugin && baseIndex !== -1 && targetIndex !== -1 && baseIndex < targetIndex) {
23
- plugins.splice(targetIndex, 1);
24
- plugins.splice(baseIndex, 0, targetPlugin);
25
- }
26
- }
27
- var DEFAULT_INCLUDE = "src/**/*.{jsx,tsx,ts,js,mjs,cjs}";
28
- var DEFAULT_EXCLUDE = "node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";
29
- var FILE_FILTER = /\.[mc]?tsx?$/i;
30
- var solidLabelsPlugin = createUnplugin(
31
- (options = {}) => {
32
- var _a, _b;
33
- const filter = createFilter(
34
- ((_a = options.filter) == null ? void 0 : _a.include) || DEFAULT_INCLUDE,
35
- ((_b = options.filter) == null ? void 0 : _b.exclude) || DEFAULT_EXCLUDE
36
- );
37
- let env;
38
- return {
39
- name: "solid-labels",
40
- transformInclude(id) {
41
- return filter(id);
42
- },
43
- async transform(code, id) {
44
- const plugins = ["jsx"];
45
- if (FILE_FILTER.test(id)) {
46
- plugins.push("typescript");
47
- }
48
- const result = await babel.transformAsync(code, {
49
- plugins: [
50
- [
51
- solidLabelsBabel,
52
- {
53
- disabled: options.disabled,
54
- dev: env === "development" || options.dev
55
- }
56
- ]
57
- ],
58
- parserOpts: {
59
- plugins
60
- },
61
- filename: path.basename(id),
62
- ast: false,
63
- sourceMaps: true,
64
- configFile: false,
65
- babelrc: false,
66
- sourceFileName: id
67
- });
68
- if (result) {
69
- return {
70
- code: result.code || "",
71
- map: result.map
72
- };
73
- }
74
- return void 0;
75
- },
76
- vite: {
77
- enforce: "pre",
78
- configResolved(config) {
79
- env = config.mode !== "production" ? "development" : "production";
80
- repushPlugin(config.plugins, "solid-labels", [
81
- // https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-jsx/index.ts#L173
82
- "astro:jsx",
83
- // https://github.com/solidjs/vite-plugin-solid/blob/master/src/index.ts#L305
84
- "solid",
85
- // https://github.com/solidjs/solid-start/blob/main/packages/start/vite/plugin.js#L118
86
- "solid-start-file-system-router"
87
- ]);
88
- }
89
- }
90
- };
91
- }
92
- );
93
- var src_default = solidLabelsPlugin;
94
- export {
95
- src_default as default
96
- };
97
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/index.ts"],
4
- "sourcesContent": ["import * as babel from '@babel/core';\nimport type { FilterPattern } from '@rollup/pluginutils';\nimport { createFilter } from '@rollup/pluginutils';\nimport path from 'node:path';\nimport type { Options } from 'solid-labels/babel';\nimport solidLabelsBabel from 'solid-labels/babel';\nimport type { TransformResult } from 'unplugin';\nimport { createUnplugin } from 'unplugin';\nimport type { Plugin } from 'vite';\n\nexport interface SolidLabelsPluginFilter {\n include?: FilterPattern;\n exclude?: FilterPattern;\n}\n\nexport interface SolidLabelsPluginOptions extends Options {\n filter?: SolidLabelsPluginFilter;\n}\n\n// From: https://github.com/bluwy/whyframe/blob/master/packages/jsx/src/index.js#L27-L37\nfunction repushPlugin(\n plugins: Plugin[],\n pluginName: string,\n pluginNames: string[],\n): void {\n const namesSet = new Set(pluginNames);\n\n let baseIndex = -1;\n let targetIndex = -1;\n let targetPlugin: Plugin | undefined;\n for (let i = 0, len = plugins.length; i < len; i += 1) {\n const current = plugins[i];\n if (namesSet.has(current.name) && baseIndex === -1) {\n baseIndex = i;\n }\n if (current.name === pluginName) {\n targetIndex = i;\n targetPlugin = current;\n }\n }\n if (\n targetPlugin &&\n baseIndex !== -1 &&\n targetIndex !== -1 &&\n baseIndex < targetIndex\n ) {\n plugins.splice(targetIndex, 1);\n plugins.splice(baseIndex, 0, targetPlugin);\n }\n}\n\nconst DEFAULT_INCLUDE = 'src/**/*.{jsx,tsx,ts,js,mjs,cjs}';\nconst DEFAULT_EXCLUDE = 'node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}';\n\nconst FILE_FILTER = /\\.[mc]?tsx?$/i;\n\nconst solidLabelsPlugin = createUnplugin(\n (options: SolidLabelsPluginOptions = {}) => {\n const filter = createFilter(\n options.filter?.include || DEFAULT_INCLUDE,\n options.filter?.exclude || DEFAULT_EXCLUDE,\n );\n\n let env: string;\n\n return {\n name: 'solid-labels',\n transformInclude(id): boolean {\n return filter(id);\n },\n async transform(code, id): Promise<TransformResult> {\n const plugins: NonNullable<\n NonNullable<babel.TransformOptions['parserOpts']>['plugins']\n > = ['jsx'];\n if (FILE_FILTER.test(id)) {\n plugins.push('typescript');\n }\n const result = await babel.transformAsync(code, {\n plugins: [\n [\n solidLabelsBabel,\n {\n disabled: options.disabled,\n dev: env === 'development' || options.dev,\n },\n ],\n ],\n parserOpts: {\n plugins,\n },\n filename: path.basename(id),\n ast: false,\n sourceMaps: true,\n configFile: false,\n babelrc: false,\n sourceFileName: id,\n });\n\n if (result) {\n return {\n code: result.code || '',\n map: result.map,\n };\n }\n return undefined;\n },\n vite: {\n enforce: 'pre',\n configResolved(config): void {\n env = config.mode !== 'production' ? 'development' : 'production';\n\n // run our plugin before the following plugins:\n repushPlugin(config.plugins as Plugin[], 'solid-labels', [\n // https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-jsx/index.ts#L173\n 'astro:jsx',\n // https://github.com/solidjs/vite-plugin-solid/blob/master/src/index.ts#L305\n 'solid',\n // https://github.com/solidjs/solid-start/blob/main/packages/start/vite/plugin.js#L118\n 'solid-start-file-system-router',\n ]);\n },\n },\n };\n },\n);\n\nexport default solidLabelsPlugin;\n"],
5
- "mappings": ";AAAA,YAAY,WAAW;AAEvB,SAAS,oBAAoB;AAC7B,OAAO,UAAU;AAEjB,OAAO,sBAAsB;AAE7B,SAAS,sBAAsB;AAa/B,SAAS,aACP,SACA,YACA,aACM;AACN,QAAM,WAAW,IAAI,IAAI,WAAW;AAEpC,MAAI,YAAY;AAChB,MAAI,cAAc;AAClB,MAAI;AACJ,WAAS,IAAI,GAAG,MAAM,QAAQ,QAAQ,IAAI,KAAK,KAAK,GAAG;AACrD,UAAM,UAAU,QAAQ,CAAC;AACzB,QAAI,SAAS,IAAI,QAAQ,IAAI,KAAK,cAAc,IAAI;AAClD,kBAAY;AAAA,IACd;AACA,QAAI,QAAQ,SAAS,YAAY;AAC/B,oBAAc;AACd,qBAAe;AAAA,IACjB;AAAA,EACF;AACA,MACE,gBACA,cAAc,MACd,gBAAgB,MAChB,YAAY,aACZ;AACA,YAAQ,OAAO,aAAa,CAAC;AAC7B,YAAQ,OAAO,WAAW,GAAG,YAAY;AAAA,EAC3C;AACF;AAEA,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AAExB,IAAM,cAAc;AAEpB,IAAM,oBAAoB;AAAA,EACxB,CAAC,UAAoC,CAAC,MAAM;AAzD9C;AA0DI,UAAM,SAAS;AAAA,QACb,aAAQ,WAAR,mBAAgB,YAAW;AAAA,QAC3B,aAAQ,WAAR,mBAAgB,YAAW;AAAA,IAC7B;AAEA,QAAI;AAEJ,WAAO;AAAA,MACL,MAAM;AAAA,MACN,iBAAiB,IAAa;AAC5B,eAAO,OAAO,EAAE;AAAA,MAClB;AAAA,MACA,MAAM,UAAU,MAAM,IAA8B;AAClD,cAAM,UAEF,CAAC,KAAK;AACV,YAAI,YAAY,KAAK,EAAE,GAAG;AACxB,kBAAQ,KAAK,YAAY;AAAA,QAC3B;AACA,cAAM,SAAS,MAAY,qBAAe,MAAM;AAAA,UAC9C,SAAS;AAAA,YACP;AAAA,cACE;AAAA,cACA;AAAA,gBACE,UAAU,QAAQ;AAAA,gBAClB,KAAK,QAAQ,iBAAiB,QAAQ;AAAA,cACxC;AAAA,YACF;AAAA,UACF;AAAA,UACA,YAAY;AAAA,YACV;AAAA,UACF;AAAA,UACA,UAAU,KAAK,SAAS,EAAE;AAAA,UAC1B,KAAK;AAAA,UACL,YAAY;AAAA,UACZ,YAAY;AAAA,UACZ,SAAS;AAAA,UACT,gBAAgB;AAAA,QAClB,CAAC;AAED,YAAI,QAAQ;AACV,iBAAO;AAAA,YACL,MAAM,OAAO,QAAQ;AAAA,YACrB,KAAK,OAAO;AAAA,UACd;AAAA,QACF;AACA,eAAO;AAAA,MACT;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,eAAe,QAAc;AAC3B,gBAAM,OAAO,SAAS,eAAe,gBAAgB;AAGrD,uBAAa,OAAO,SAAqB,gBAAgB;AAAA;AAAA,YAEvD;AAAA;AAAA,YAEA;AAAA;AAAA,YAEA;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,cAAQ;",
6
- "names": []
7
- }
@@ -1 +0,0 @@
1
- import*as m from"@babel/core";import{createFilter as p}from"@rollup/pluginutils";import d from"node:path";import c from"solid-labels/babel";import{createUnplugin as f}from"unplugin";function b(t,a,n){let o=new Set(n),l=-1,e=-1,r;for(let s=0,i=t.length;s<i;s+=1){let u=t[s];o.has(u.name)&&l===-1&&(l=s),u.name===a&&(e=s,r=u)}r&&l!==-1&&e!==-1&&l<e&&(t.splice(e,1),t.splice(l,0,r))}var g="src/**/*.{jsx,tsx,ts,js,mjs,cjs}",x="node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}",P=/\.[mc]?tsx?$/i,F=f((t={})=>{var o,l;let a=p(((o=t.filter)==null?void 0:o.include)||g,((l=t.filter)==null?void 0:l.exclude)||x),n;return{name:"solid-labels",transformInclude(e){return a(e)},async transform(e,r){let s=["jsx"];P.test(r)&&s.push("typescript");let i=await m.transformAsync(e,{plugins:[[c,{disabled:t.disabled,dev:n==="development"||t.dev}]],parserOpts:{plugins:s},filename:d.basename(r),ast:!1,sourceMaps:!0,configFile:!1,babelrc:!1,sourceFileName:r});if(i)return{code:i.code||"",map:i.map}},vite:{enforce:"pre",configResolved(e){n=e.mode!=="production"?"development":"production",b(e.plugins,"solid-labels",["astro:jsx","solid","solid-start-file-system-router"])}}}}),E=F;export{E as default};
@@ -1,12 +0,0 @@
1
- import type { FilterPattern } from '@rollup/pluginutils';
2
- import type { Options } from 'solid-labels/babel';
3
- export interface SolidLabelsPluginFilter {
4
- include?: FilterPattern;
5
- exclude?: FilterPattern;
6
- }
7
- export interface SolidLabelsPluginOptions extends Options {
8
- filter?: SolidLabelsPluginFilter;
9
- }
10
- declare const solidLabelsPlugin: import("unplugin").UnpluginInstance<SolidLabelsPluginOptions, boolean>;
11
- export default solidLabelsPlugin;
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAMlD,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,wBAAyB,SAAQ,OAAO;IACvD,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAuCD,QAAA,MAAM,iBAAiB,wEAoEtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}