rollup-plugin-solid-styled 0.8.1 → 0.8.2
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/cjs/development/index.cjs +20 -9
- package/dist/cjs/development/index.cjs.map +3 -3
- package/dist/cjs/production/index.cjs +1 -1
- package/dist/esm/development/index.mjs +20 -9
- package/dist/esm/development/index.mjs.map +2 -2
- package/dist/esm/production/index.mjs +1 -1
- package/package.json +8 -9
|
@@ -37,7 +37,6 @@ var import_babel = __toESM(require("solid-styled/babel"), 1);
|
|
|
37
37
|
var import_pluginutils = require("@rollup/pluginutils");
|
|
38
38
|
var babel = __toESM(require("@babel/core"), 1);
|
|
39
39
|
var import_path = __toESM(require("path"), 1);
|
|
40
|
-
var import_preset_typescript = __toESM(require("@babel/preset-typescript"), 1);
|
|
41
40
|
var DEFAULT_INCLUDE = "src/**/*.{jsx,tsx,ts,js,mjs,cjs}";
|
|
42
41
|
var DEFAULT_EXCLUDE = "node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";
|
|
43
42
|
function solidStyledPlugin(options = {}) {
|
|
@@ -49,27 +48,39 @@ function solidStyledPlugin(options = {}) {
|
|
|
49
48
|
return {
|
|
50
49
|
name: "solid-styled",
|
|
51
50
|
async transform(code, id) {
|
|
52
|
-
var _a2, _b2, _c, _d
|
|
51
|
+
var _a2, _b2, _c, _d;
|
|
53
52
|
if (filter(id)) {
|
|
53
|
+
const plugins = ["jsx"];
|
|
54
|
+
if (/\.[mc]tsx?$/i.test(id)) {
|
|
55
|
+
plugins.push("typescript");
|
|
56
|
+
}
|
|
54
57
|
const result = await babel.transformAsync(code, {
|
|
55
58
|
...options.babel,
|
|
56
|
-
presets: [
|
|
57
|
-
[import_preset_typescript.default],
|
|
58
|
-
...(_b2 = (_a2 = options.babel) == null ? void 0 : _a2.presets) != null ? _b2 : []
|
|
59
|
-
],
|
|
60
59
|
plugins: [
|
|
61
60
|
[import_babel.default, {
|
|
62
61
|
verbose: options.verbose,
|
|
63
62
|
prefix: options.prefix,
|
|
64
63
|
source: id
|
|
65
64
|
}],
|
|
66
|
-
...(
|
|
65
|
+
...((_a2 = options.babel) == null ? void 0 : _a2.plugins) || []
|
|
67
66
|
],
|
|
68
|
-
|
|
67
|
+
parserOpts: {
|
|
68
|
+
...((_b2 = options.babel) == null ? void 0 : _b2.parserOpts) || {},
|
|
69
|
+
plugins: [
|
|
70
|
+
...((_d = (_c = options.babel) == null ? void 0 : _c.parserOpts) == null ? void 0 : _d.plugins) || [],
|
|
71
|
+
...plugins
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
filename: import_path.default.basename(id),
|
|
75
|
+
ast: false,
|
|
76
|
+
sourceMaps: true,
|
|
77
|
+
configFile: false,
|
|
78
|
+
babelrc: false,
|
|
79
|
+
sourceFileName: id
|
|
69
80
|
});
|
|
70
81
|
if (result) {
|
|
71
82
|
return {
|
|
72
|
-
code:
|
|
83
|
+
code: result.code || "",
|
|
73
84
|
map: result.map
|
|
74
85
|
};
|
|
75
86
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import solidStyledBabel from 'solid-styled/babel';\nimport { Plugin } from 'rollup';\nimport { createFilter, FilterPattern } from '@rollup/pluginutils';\nimport * as babel from '@babel/core';\nimport path from 'path';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6B;AAE7B,yBAA4C;AAC5C,YAAuB;AACvB,kBAAiB;
|
|
6
|
-
"names": ["_a", "_b", "
|
|
4
|
+
"sourcesContent": ["import solidStyledBabel from 'solid-styled/babel';\nimport { Plugin } from 'rollup';\nimport { createFilter, FilterPattern } from '@rollup/pluginutils';\nimport * as babel from '@babel/core';\nimport path from 'path';\n\nexport interface SolidStyledPluginFilter {\n include?: FilterPattern;\n exclude?: FilterPattern;\n}\n\nexport interface SolidStyledPluginOptions {\n verbose?: boolean;\n prefix?: string;\n filter?: SolidStyledPluginFilter;\n babel?: babel.TransformOptions;\n}\n\nconst DEFAULT_INCLUDE = 'src/**/*.{jsx,tsx,ts,js,mjs,cjs}';\nconst DEFAULT_EXCLUDE = 'node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}';\n\nexport default function solidStyledPlugin(\n options: SolidStyledPluginOptions = {},\n): Plugin {\n const filter = createFilter(\n options.filter?.include || DEFAULT_INCLUDE,\n options.filter?.exclude || DEFAULT_EXCLUDE,\n );\n return {\n name: 'solid-styled',\n async transform(code, id) {\n if (filter(id)) {\n const plugins: NonNullable<NonNullable<babel.TransformOptions['parserOpts']>['plugins']> = ['jsx'];\n if (/\\.[mc]tsx?$/i.test(id)) {\n plugins.push('typescript');\n }\n const result = await babel.transformAsync(code, {\n ...options.babel,\n plugins: [\n [solidStyledBabel, {\n verbose: options.verbose,\n prefix: options.prefix,\n source: id,\n }],\n ...(options.babel?.plugins || []),\n ],\n parserOpts: {\n ...(options.babel?.parserOpts || {}),\n plugins: [\n ...(options.babel?.parserOpts?.plugins || []),\n ...plugins,\n ],\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 }\n return undefined;\n },\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6B;AAE7B,yBAA4C;AAC5C,YAAuB;AACvB,kBAAiB;AAcjB,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AAET,SAAR,kBACL,UAAoC,CAAC,GAC7B;AAvBV;AAwBE,QAAM,aAAS;AAAA,MACb,aAAQ,WAAR,mBAAgB,YAAW;AAAA,MAC3B,aAAQ,WAAR,mBAAgB,YAAW;AAAA,EAC7B;AACA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM,UAAU,MAAM,IAAI;AA9B9B,UAAAA,KAAAC,KAAA;AA+BM,UAAI,OAAO,EAAE,GAAG;AACd,cAAM,UAAqF,CAAC,KAAK;AACjG,YAAI,eAAe,KAAK,EAAE,GAAG;AAC3B,kBAAQ,KAAK,YAAY;AAAA,QAC3B;AACA,cAAM,SAAS,MAAY,qBAAe,MAAM;AAAA,UAC9C,GAAG,QAAQ;AAAA,UACX,SAAS;AAAA,YACP,CAAC,aAAAC,SAAkB;AAAA,cACjB,SAAS,QAAQ;AAAA,cACjB,QAAQ,QAAQ;AAAA,cAChB,QAAQ;AAAA,YACV,CAAC;AAAA,YACD,KAAIF,MAAA,QAAQ,UAAR,gBAAAA,IAAe,YAAW,CAAC;AAAA,UACjC;AAAA,UACA,YAAY;AAAA,YACV,KAAIC,MAAA,QAAQ,UAAR,gBAAAA,IAAe,eAAc,CAAC;AAAA,YAClC,SAAS;AAAA,cACP,KAAI,mBAAQ,UAAR,mBAAe,eAAf,mBAA2B,YAAW,CAAC;AAAA,cAC3C,GAAG;AAAA,YACL;AAAA,UACF;AAAA,UACA,UAAU,YAAAE,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;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["_a", "_b", "solidStyledBabel", "path"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var P=Object.create;var a=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var E=(e,l)=>{for(var r in l)a(e,r,{get:l[r],enumerable:!0})},m=(e,l,r,s)=>{if(l&&typeof l=="object"||typeof l=="function")for(let t of j(l))!N.call(e,t)&&t!==r&&a(e,t,{get:()=>l[t],enumerable:!(s=S(l,t))||s.enumerable});return e};var o=(e,l,r)=>(r=e!=null?P(O(e)):{},m(l||!e||!e.__esModule?a(r,"default",{value:e,enumerable:!0}):r,e)),D=e=>m(a({},"__esModule",{value:!0}),e);var U={};E(U,{default:()=>F});module.exports=D(U);var d=o(require("solid-styled/babel"),1),g=require("@rollup/pluginutils"),x=o(require("@babel/core"),1),y=o(require("path"),1),L="src/**/*.{jsx,tsx,ts,js,mjs,cjs}",T="node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";function F(e={}){var r,s;let l=(0,g.createFilter)(((r=e.filter)==null?void 0:r.include)||L,((s=e.filter)==null?void 0:s.exclude)||T);return{name:"solid-styled",async transform(t,i){var u,f,p,b;if(l(i)){let c=["jsx"];/\.[mc]tsx?$/i.test(i)&&c.push("typescript");let n=await x.transformAsync(t,{...e.babel,plugins:[[d.default,{verbose:e.verbose,prefix:e.prefix,source:i}],...((u=e.babel)==null?void 0:u.plugins)||[]],parserOpts:{...((f=e.babel)==null?void 0:f.parserOpts)||{},plugins:[...((b=(p=e.babel)==null?void 0:p.parserOpts)==null?void 0:b.plugins)||[],...c]},filename:y.default.basename(i),ast:!1,sourceMaps:!0,configFile:!1,babelrc:!1,sourceFileName:i});if(n)return{code:n.code||"",map:n.map}}}}}
|
|
@@ -3,7 +3,6 @@ import solidStyledBabel from "solid-styled/babel";
|
|
|
3
3
|
import { createFilter } from "@rollup/pluginutils";
|
|
4
4
|
import * as babel from "@babel/core";
|
|
5
5
|
import path from "path";
|
|
6
|
-
import ts from "@babel/preset-typescript";
|
|
7
6
|
var DEFAULT_INCLUDE = "src/**/*.{jsx,tsx,ts,js,mjs,cjs}";
|
|
8
7
|
var DEFAULT_EXCLUDE = "node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";
|
|
9
8
|
function solidStyledPlugin(options = {}) {
|
|
@@ -15,27 +14,39 @@ function solidStyledPlugin(options = {}) {
|
|
|
15
14
|
return {
|
|
16
15
|
name: "solid-styled",
|
|
17
16
|
async transform(code, id) {
|
|
18
|
-
var _a2, _b2, _c, _d
|
|
17
|
+
var _a2, _b2, _c, _d;
|
|
19
18
|
if (filter(id)) {
|
|
19
|
+
const plugins = ["jsx"];
|
|
20
|
+
if (/\.[mc]tsx?$/i.test(id)) {
|
|
21
|
+
plugins.push("typescript");
|
|
22
|
+
}
|
|
20
23
|
const result = await babel.transformAsync(code, {
|
|
21
24
|
...options.babel,
|
|
22
|
-
presets: [
|
|
23
|
-
[ts],
|
|
24
|
-
...(_b2 = (_a2 = options.babel) == null ? void 0 : _a2.presets) != null ? _b2 : []
|
|
25
|
-
],
|
|
26
25
|
plugins: [
|
|
27
26
|
[solidStyledBabel, {
|
|
28
27
|
verbose: options.verbose,
|
|
29
28
|
prefix: options.prefix,
|
|
30
29
|
source: id
|
|
31
30
|
}],
|
|
32
|
-
...(
|
|
31
|
+
...((_a2 = options.babel) == null ? void 0 : _a2.plugins) || []
|
|
33
32
|
],
|
|
34
|
-
|
|
33
|
+
parserOpts: {
|
|
34
|
+
...((_b2 = options.babel) == null ? void 0 : _b2.parserOpts) || {},
|
|
35
|
+
plugins: [
|
|
36
|
+
...((_d = (_c = options.babel) == null ? void 0 : _c.parserOpts) == null ? void 0 : _d.plugins) || [],
|
|
37
|
+
...plugins
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
filename: path.basename(id),
|
|
41
|
+
ast: false,
|
|
42
|
+
sourceMaps: true,
|
|
43
|
+
configFile: false,
|
|
44
|
+
babelrc: false,
|
|
45
|
+
sourceFileName: id
|
|
35
46
|
});
|
|
36
47
|
if (result) {
|
|
37
48
|
return {
|
|
38
|
-
code:
|
|
49
|
+
code: result.code || "",
|
|
39
50
|
map: result.map
|
|
40
51
|
};
|
|
41
52
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import solidStyledBabel from 'solid-styled/babel';\nimport { Plugin } from 'rollup';\nimport { createFilter, FilterPattern } from '@rollup/pluginutils';\nimport * as babel from '@babel/core';\nimport path from 'path';\
|
|
5
|
-
"mappings": ";AAAA,OAAO,sBAAsB;AAE7B,SAAS,oBAAmC;AAC5C,YAAY,WAAW;AACvB,OAAO,UAAU;
|
|
4
|
+
"sourcesContent": ["import solidStyledBabel from 'solid-styled/babel';\nimport { Plugin } from 'rollup';\nimport { createFilter, FilterPattern } from '@rollup/pluginutils';\nimport * as babel from '@babel/core';\nimport path from 'path';\n\nexport interface SolidStyledPluginFilter {\n include?: FilterPattern;\n exclude?: FilterPattern;\n}\n\nexport interface SolidStyledPluginOptions {\n verbose?: boolean;\n prefix?: string;\n filter?: SolidStyledPluginFilter;\n babel?: babel.TransformOptions;\n}\n\nconst DEFAULT_INCLUDE = 'src/**/*.{jsx,tsx,ts,js,mjs,cjs}';\nconst DEFAULT_EXCLUDE = 'node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}';\n\nexport default function solidStyledPlugin(\n options: SolidStyledPluginOptions = {},\n): Plugin {\n const filter = createFilter(\n options.filter?.include || DEFAULT_INCLUDE,\n options.filter?.exclude || DEFAULT_EXCLUDE,\n );\n return {\n name: 'solid-styled',\n async transform(code, id) {\n if (filter(id)) {\n const plugins: NonNullable<NonNullable<babel.TransformOptions['parserOpts']>['plugins']> = ['jsx'];\n if (/\\.[mc]tsx?$/i.test(id)) {\n plugins.push('typescript');\n }\n const result = await babel.transformAsync(code, {\n ...options.babel,\n plugins: [\n [solidStyledBabel, {\n verbose: options.verbose,\n prefix: options.prefix,\n source: id,\n }],\n ...(options.babel?.plugins || []),\n ],\n parserOpts: {\n ...(options.babel?.parserOpts || {}),\n plugins: [\n ...(options.babel?.parserOpts?.plugins || []),\n ...plugins,\n ],\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 }\n return undefined;\n },\n };\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,sBAAsB;AAE7B,SAAS,oBAAmC;AAC5C,YAAY,WAAW;AACvB,OAAO,UAAU;AAcjB,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AAET,SAAR,kBACL,UAAoC,CAAC,GAC7B;AAvBV;AAwBE,QAAM,SAAS;AAAA,MACb,aAAQ,WAAR,mBAAgB,YAAW;AAAA,MAC3B,aAAQ,WAAR,mBAAgB,YAAW;AAAA,EAC7B;AACA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM,UAAU,MAAM,IAAI;AA9B9B,UAAAA,KAAAC,KAAA;AA+BM,UAAI,OAAO,EAAE,GAAG;AACd,cAAM,UAAqF,CAAC,KAAK;AACjG,YAAI,eAAe,KAAK,EAAE,GAAG;AAC3B,kBAAQ,KAAK,YAAY;AAAA,QAC3B;AACA,cAAM,SAAS,MAAY,qBAAe,MAAM;AAAA,UAC9C,GAAG,QAAQ;AAAA,UACX,SAAS;AAAA,YACP,CAAC,kBAAkB;AAAA,cACjB,SAAS,QAAQ;AAAA,cACjB,QAAQ,QAAQ;AAAA,cAChB,QAAQ;AAAA,YACV,CAAC;AAAA,YACD,KAAID,MAAA,QAAQ,UAAR,gBAAAA,IAAe,YAAW,CAAC;AAAA,UACjC;AAAA,UACA,YAAY;AAAA,YACV,KAAIC,MAAA,QAAQ,UAAR,gBAAAA,IAAe,eAAc,CAAC;AAAA,YAClC,SAAS;AAAA,cACP,KAAI,mBAAQ,UAAR,mBAAe,eAAf,mBAA2B,YAAW,CAAC;AAAA,cAC3C,GAAG;AAAA,YACL;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;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["_a", "_b"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import c from"solid-styled/babel";import{createFilter as m}from"@rollup/pluginutils";import*as f from"@babel/core";import d from"path";var g="src/**/*.{jsx,tsx,ts,js,mjs,cjs}",x="node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";function y(e={}){var t,s;let p=m(((t=e.filter)==null?void 0:t.include)||g,((s=e.filter)==null?void 0:s.exclude)||x);return{name:"solid-styled",async transform(b,l){var i,a,n,o;if(p(l)){let u=["jsx"];/\.[mc]tsx?$/i.test(l)&&u.push("typescript");let r=await f.transformAsync(b,{...e.babel,plugins:[[c,{verbose:e.verbose,prefix:e.prefix,source:l}],...((i=e.babel)==null?void 0:i.plugins)||[]],parserOpts:{...((a=e.babel)==null?void 0:a.parserOpts)||{},plugins:[...((o=(n=e.babel)==null?void 0:n.parserOpts)==null?void 0:o.plugins)||[],...u]},filename:d.basename(l),ast:!1,sourceMaps:!0,configFile:!1,babelrc:!1,sourceFileName:l});if(r)return{code:r.code||"",map:r.map}}}}}export{y as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup-plugin-solid-styled",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -16,18 +16,17 @@
|
|
|
16
16
|
],
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/babel__core": "^7.20.0",
|
|
19
|
-
"@types/node": "^18.
|
|
20
|
-
"eslint": "^8.
|
|
21
|
-
"eslint-config-lxsmnsyc": "^0.
|
|
22
|
-
"pridepack": "2.4.
|
|
19
|
+
"@types/node": "^18.15.3",
|
|
20
|
+
"eslint": "^8.36.0",
|
|
21
|
+
"eslint-config-lxsmnsyc": "^0.5.1",
|
|
22
|
+
"pridepack": "2.4.2",
|
|
23
23
|
"rollup": "^3.5.1",
|
|
24
|
-
"solid-styled": "0.8.
|
|
24
|
+
"solid-styled": "0.8.2",
|
|
25
25
|
"tslib": "^2.5.0",
|
|
26
26
|
"typescript": "^4.9.5"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@babel/core": "^7.
|
|
30
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
29
|
+
"@babel/core": "^7.21.3",
|
|
31
30
|
"@rollup/pluginutils": "^5.0.2"
|
|
32
31
|
},
|
|
33
32
|
"peerDependencies": {
|
|
@@ -76,5 +75,5 @@
|
|
|
76
75
|
"typesVersions": {
|
|
77
76
|
"*": {}
|
|
78
77
|
},
|
|
79
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "d043eec3dbc1f1d336942d474cb969f94f88dfd1"
|
|
80
79
|
}
|