rollup-plugin-solid-styled 0.8.0 → 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/README.md CHANGED
@@ -37,6 +37,10 @@ solidStyled({
37
37
  > **Note**
38
38
  > When you are using a SolidJS Rollup plugin, make sure that solid-styled runs first.
39
39
 
40
+ ## Sponsors
41
+
42
+ ![Sponsors](https://github.com/lxsmnsyc/sponsors/blob/main/sponsors.svg?raw=true)
43
+
40
44
  ## License
41
45
 
42
46
  MIT © [lxsmnsyc](https://github.com/lxsmnsyc)
@@ -1,27 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
8
  var __export = (target, all) => {
26
9
  for (var name in all)
27
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -54,36 +37,50 @@ var import_babel = __toESM(require("solid-styled/babel"), 1);
54
37
  var import_pluginutils = require("@rollup/pluginutils");
55
38
  var babel = __toESM(require("@babel/core"), 1);
56
39
  var import_path = __toESM(require("path"), 1);
57
- var import_preset_typescript = __toESM(require("@babel/preset-typescript"), 1);
40
+ var DEFAULT_INCLUDE = "src/**/*.{jsx,tsx,ts,js,mjs,cjs}";
41
+ var DEFAULT_EXCLUDE = "node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";
58
42
  function solidStyledPlugin(options = {}) {
59
43
  var _a, _b;
60
44
  const filter = (0, import_pluginutils.createFilter)(
61
- (_a = options.filter) == null ? void 0 : _a.include,
62
- (_b = options.filter) == null ? void 0 : _b.exclude
45
+ ((_a = options.filter) == null ? void 0 : _a.include) || DEFAULT_INCLUDE,
46
+ ((_b = options.filter) == null ? void 0 : _b.exclude) || DEFAULT_EXCLUDE
63
47
  );
64
48
  return {
65
49
  name: "solid-styled",
66
50
  async transform(code, id) {
67
- var _a2, _b2, _c, _d, _e;
51
+ var _a2, _b2, _c, _d;
68
52
  if (filter(id)) {
69
- const result = await babel.transformAsync(code, __spreadProps(__spreadValues({}, options.babel), {
70
- presets: [
71
- [import_preset_typescript.default],
72
- ...(_b2 = (_a2 = options.babel) == null ? void 0 : _a2.presets) != null ? _b2 : []
73
- ],
53
+ const plugins = ["jsx"];
54
+ if (/\.[mc]tsx?$/i.test(id)) {
55
+ plugins.push("typescript");
56
+ }
57
+ const result = await babel.transformAsync(code, {
58
+ ...options.babel,
74
59
  plugins: [
75
60
  [import_babel.default, {
76
61
  verbose: options.verbose,
77
62
  prefix: options.prefix,
78
63
  source: id
79
64
  }],
80
- ...(_d = (_c = options.babel) == null ? void 0 : _c.plugins) != null ? _d : []
65
+ ...((_a2 = options.babel) == null ? void 0 : _a2.plugins) || []
81
66
  ],
82
- filename: import_path.default.basename(id)
83
- }));
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
80
+ });
84
81
  if (result) {
85
82
  return {
86
- code: (_e = result.code) != null ? _e : "",
83
+ code: result.code || "",
87
84
  map: result.map
88
85
  };
89
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';\nimport ts from '@babel/preset-typescript';\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\nexport default function solidStyledPlugin(\n options: SolidStyledPluginOptions = {},\n): Plugin {\n const filter = createFilter(\n options.filter?.include,\n options.filter?.exclude,\n );\n return {\n name: 'solid-styled',\n async transform(code, id) {\n if (filter(id)) {\n const result = await babel.transformAsync(code, {\n ...options.babel,\n presets: [\n [ts],\n ...(options.babel?.presets ?? []),\n ],\n plugins: [\n [solidStyledBabel, {\n verbose: options.verbose,\n prefix: options.prefix,\n source: id,\n }],\n ...(options.babel?.plugins ?? []),\n ],\n filename: path.basename(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,+BAAe;AAcA,SAAR,kBACL,UAAoC,CAAC,GAC7B;AArBV;AAsBE,QAAM,aAAS;AAAA,KACb,aAAQ,WAAR,mBAAgB;AAAA,KAChB,aAAQ,WAAR,mBAAgB;AAAA,EAClB;AACA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM,UAAU,MAAM,IAAI;AA5B9B,UAAAA,KAAAC,KAAA;AA6BM,UAAI,OAAO,EAAE,GAAG;AACd,cAAM,SAAS,MAAY,qBAAe,MAAM,iCAC3C,QAAQ,QADmC;AAAA,UAE9C,SAAS;AAAA,YACP,CAAC,yBAAAC,OAAE;AAAA,YACH,IAAID,OAAAD,MAAA,QAAQ,UAAR,gBAAAA,IAAe,YAAf,OAAAC,MAA0B,CAAC;AAAA,UACjC;AAAA,UACA,SAAS;AAAA,YACP,CAAC,aAAAE,SAAkB;AAAA,cACjB,SAAS,QAAQ;AAAA,cACjB,QAAQ,QAAQ;AAAA,cAChB,QAAQ;AAAA,YACV,CAAC;AAAA,YACD,IAAI,mBAAQ,UAAR,mBAAe,YAAf,YAA0B,CAAC;AAAA,UACjC;AAAA,UACA,UAAU,YAAAC,QAAK,SAAS,EAAE;AAAA,QAC5B,EAAC;AAED,YAAI,QAAQ;AACV,iBAAO;AAAA,YACL,OAAM,YAAO,SAAP,YAAe;AAAA,YACrB,KAAK,OAAO;AAAA,UACd;AAAA,QACF;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;",
6
- "names": ["_a", "_b", "ts", "solidStyledBabel", "path"]
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 A=Object.create;var n=Object.defineProperty,B=Object.defineProperties,T=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,q=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var c=(e,r,l)=>r in e?n(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l,P=(e,r)=>{for(var l in r||(r={}))g.call(r,l)&&c(e,l,r[l]);if(p)for(var l of p(r))z.call(r,l)&&c(e,l,r[l]);return e},S=(e,r)=>B(e,j(r));var C=(e,r)=>{for(var l in r)n(e,l,{get:r[l],enumerable:!0})},y=(e,r,l,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of k(r))!g.call(e,t)&&t!==l&&n(e,t,{get:()=>r[t],enumerable:!(i=T(r,t))||i.enumerable});return e};var a=(e,r,l)=>(l=e!=null?A(q(e)):{},y(r||!e||!e.__esModule?n(l,"default",{value:e,enumerable:!0}):l,e)),D=e=>y(n({},"__esModule",{value:!0}),e);var E={};C(E,{default:()=>w});module.exports=D(E);var x=a(require("solid-styled/babel"),1),F=require("@rollup/pluginutils"),v=a(require("@babel/core"),1),O=a(require("path"),1),h=a(require("@babel/preset-typescript"),1);function w(e={}){var l,i;let r=(0,F.createFilter)((l=e.filter)==null?void 0:l.include,(i=e.filter)==null?void 0:i.exclude);return{name:"solid-styled",async transform(t,o){var s,d,u,b,m;if(r(o)){let f=await v.transformAsync(t,S(P({},e.babel),{presets:[[h.default],...(d=(s=e.babel)==null?void 0:s.presets)!=null?d:[]],plugins:[[x.default,{verbose:e.verbose,prefix:e.prefix,source:o}],...(b=(u=e.babel)==null?void 0:u.plugins)!=null?b:[]],filename:O.default.basename(o)}));if(f)return{code:(m=f.code)!=null?m:"",map:f.map}}}}}
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}}}}}
@@ -1,58 +1,52 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
-
21
1
  // src/index.ts
22
2
  import solidStyledBabel from "solid-styled/babel";
23
3
  import { createFilter } from "@rollup/pluginutils";
24
4
  import * as babel from "@babel/core";
25
5
  import path from "path";
26
- import ts from "@babel/preset-typescript";
6
+ var DEFAULT_INCLUDE = "src/**/*.{jsx,tsx,ts,js,mjs,cjs}";
7
+ var DEFAULT_EXCLUDE = "node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";
27
8
  function solidStyledPlugin(options = {}) {
28
9
  var _a, _b;
29
10
  const filter = createFilter(
30
- (_a = options.filter) == null ? void 0 : _a.include,
31
- (_b = options.filter) == null ? void 0 : _b.exclude
11
+ ((_a = options.filter) == null ? void 0 : _a.include) || DEFAULT_INCLUDE,
12
+ ((_b = options.filter) == null ? void 0 : _b.exclude) || DEFAULT_EXCLUDE
32
13
  );
33
14
  return {
34
15
  name: "solid-styled",
35
16
  async transform(code, id) {
36
- var _a2, _b2, _c, _d, _e;
17
+ var _a2, _b2, _c, _d;
37
18
  if (filter(id)) {
38
- const result = await babel.transformAsync(code, __spreadProps(__spreadValues({}, options.babel), {
39
- presets: [
40
- [ts],
41
- ...(_b2 = (_a2 = options.babel) == null ? void 0 : _a2.presets) != null ? _b2 : []
42
- ],
19
+ const plugins = ["jsx"];
20
+ if (/\.[mc]tsx?$/i.test(id)) {
21
+ plugins.push("typescript");
22
+ }
23
+ const result = await babel.transformAsync(code, {
24
+ ...options.babel,
43
25
  plugins: [
44
26
  [solidStyledBabel, {
45
27
  verbose: options.verbose,
46
28
  prefix: options.prefix,
47
29
  source: id
48
30
  }],
49
- ...(_d = (_c = options.babel) == null ? void 0 : _c.plugins) != null ? _d : []
31
+ ...((_a2 = options.babel) == null ? void 0 : _a2.plugins) || []
50
32
  ],
51
- filename: path.basename(id)
52
- }));
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
46
+ });
53
47
  if (result) {
54
48
  return {
55
- code: (_e = result.code) != null ? _e : "",
49
+ code: result.code || "",
56
50
  map: result.map
57
51
  };
58
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';\nimport ts from '@babel/preset-typescript';\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\nexport default function solidStyledPlugin(\n options: SolidStyledPluginOptions = {},\n): Plugin {\n const filter = createFilter(\n options.filter?.include,\n options.filter?.exclude,\n );\n return {\n name: 'solid-styled',\n async transform(code, id) {\n if (filter(id)) {\n const result = await babel.transformAsync(code, {\n ...options.babel,\n presets: [\n [ts],\n ...(options.babel?.presets ?? []),\n ],\n plugins: [\n [solidStyledBabel, {\n verbose: options.verbose,\n prefix: options.prefix,\n source: id,\n }],\n ...(options.babel?.plugins ?? []),\n ],\n filename: path.basename(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,OAAO,QAAQ;AAcA,SAAR,kBACL,UAAoC,CAAC,GAC7B;AArBV;AAsBE,QAAM,SAAS;AAAA,KACb,aAAQ,WAAR,mBAAgB;AAAA,KAChB,aAAQ,WAAR,mBAAgB;AAAA,EAClB;AACA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM,UAAU,MAAM,IAAI;AA5B9B,UAAAA,KAAAC,KAAA;AA6BM,UAAI,OAAO,EAAE,GAAG;AACd,cAAM,SAAS,MAAY,qBAAe,MAAM,iCAC3C,QAAQ,QADmC;AAAA,UAE9C,SAAS;AAAA,YACP,CAAC,EAAE;AAAA,YACH,IAAIA,OAAAD,MAAA,QAAQ,UAAR,gBAAAA,IAAe,YAAf,OAAAC,MAA0B,CAAC;AAAA,UACjC;AAAA,UACA,SAAS;AAAA,YACP,CAAC,kBAAkB;AAAA,cACjB,SAAS,QAAQ;AAAA,cACjB,QAAQ,QAAQ;AAAA,cAChB,QAAQ;AAAA,YACV,CAAC;AAAA,YACD,IAAI,mBAAQ,UAAR,mBAAe,YAAf,YAA0B,CAAC;AAAA,UACjC;AAAA,UACA,UAAU,KAAK,SAAS,EAAE;AAAA,QAC5B,EAAC;AAED,YAAI,QAAQ;AACV,iBAAO;AAAA,YACL,OAAM,YAAO,SAAP,YAAe;AAAA,YACrB,KAAK,OAAO;AAAA,UACd;AAAA,QACF;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;",
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
- var P=Object.defineProperty,S=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var b=(e,r,l)=>r in e?P(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l,m=(e,r)=>{for(var l in r||(r={}))x.call(r,l)&&b(e,l,r[l]);if(u)for(var l of u(r))F.call(r,l)&&b(e,l,r[l]);return e},p=(e,r)=>S(e,y(r));import v from"solid-styled/babel";import{createFilter as O}from"@rollup/pluginutils";import*as c from"@babel/core";import h from"path";import w from"@babel/preset-typescript";function A(e={}){var l,n;let r=O((l=e.filter)==null?void 0:l.include,(n=e.filter)==null?void 0:n.exclude);return{name:"solid-styled",async transform(g,t){var a,o,f,s,d;if(r(t)){let i=await c.transformAsync(g,p(m({},e.babel),{presets:[[w],...(o=(a=e.babel)==null?void 0:a.presets)!=null?o:[]],plugins:[[v,{verbose:e.verbose,prefix:e.prefix,source:t}],...(s=(f=e.babel)==null?void 0:f.plugins)!=null?s:[]],filename:h.basename(t)}));if(i)return{code:(d=i.code)!=null?d:"",map:i.map}}}}}export{A as default};
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.0",
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.13.0",
20
- "eslint": "^8.33.0",
21
- "eslint-config-lxsmnsyc": "^0.4.8",
22
- "pridepack": "2.4.0",
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.0",
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.20.12",
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": "e660e48fb004b94cf5c99f2bc72107d88ac787a4"
78
+ "gitHead": "d043eec3dbc1f1d336942d474cb969f94f88dfd1"
80
79
  }