rollup-plugin-solid-styled 0.8.1 → 0.9.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/README.md CHANGED
@@ -37,6 +37,23 @@ solidStyled({
37
37
  > **Note**
38
38
  > When you are using a SolidJS Rollup plugin, make sure that solid-styled runs first.
39
39
 
40
+ ## Config options
41
+
42
+ ```js
43
+ {
44
+ // Toggle verbose scope names based
45
+ // on the owning component's name,
46
+ // useful for debugging
47
+ // Default: false
48
+ "verbose": true,
49
+
50
+ // Allows prefixing scope names
51
+ // useful for package publishing
52
+ // Default: undefined ('')
53
+ "prefix": "example",
54
+ }
55
+ ```
56
+
40
57
  ## Sponsors
41
58
 
42
59
  ![Sponsors](https://github.com/lxsmnsyc/sponsors/blob/main/sponsors.svg?raw=true)
@@ -30,52 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
- default: () => solidStyledPlugin
33
+ default: () => src_default
34
34
  });
35
35
  module.exports = __toCommonJS(src_exports);
36
- var import_babel = __toESM(require("solid-styled/babel"), 1);
37
- var import_pluginutils = require("@rollup/pluginutils");
38
- var babel = __toESM(require("@babel/core"), 1);
39
- var import_path = __toESM(require("path"), 1);
40
- var import_preset_typescript = __toESM(require("@babel/preset-typescript"), 1);
41
- var DEFAULT_INCLUDE = "src/**/*.{jsx,tsx,ts,js,mjs,cjs}";
42
- var DEFAULT_EXCLUDE = "node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";
43
- function solidStyledPlugin(options = {}) {
44
- var _a, _b;
45
- const filter = (0, import_pluginutils.createFilter)(
46
- ((_a = options.filter) == null ? void 0 : _a.include) || DEFAULT_INCLUDE,
47
- ((_b = options.filter) == null ? void 0 : _b.exclude) || DEFAULT_EXCLUDE
48
- );
49
- return {
50
- name: "solid-styled",
51
- async transform(code, id) {
52
- var _a2, _b2, _c, _d, _e;
53
- if (filter(id)) {
54
- const result = await babel.transformAsync(code, {
55
- ...options.babel,
56
- presets: [
57
- [import_preset_typescript.default],
58
- ...(_b2 = (_a2 = options.babel) == null ? void 0 : _a2.presets) != null ? _b2 : []
59
- ],
60
- plugins: [
61
- [import_babel.default, {
62
- verbose: options.verbose,
63
- prefix: options.prefix,
64
- source: id
65
- }],
66
- ...(_d = (_c = options.babel) == null ? void 0 : _c.plugins) != null ? _d : []
67
- ],
68
- filename: import_path.default.basename(id)
69
- });
70
- if (result) {
71
- return {
72
- code: (_e = result.code) != null ? _e : "",
73
- map: result.map
74
- };
75
- }
76
- }
77
- return void 0;
78
- }
79
- };
80
- }
36
+ var import_unplugin_solid_styled = __toESM(require("unplugin-solid-styled"), 1);
37
+ var solidStyledPlugin = import_unplugin_solid_styled.default.rollup;
38
+ var src_default = solidStyledPlugin;
81
39
  //# sourceMappingURL=index.cjs.map
@@ -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\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 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;AAcf,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AAET,SAAR,kBACL,UAAoC,CAAC,GAC7B;AAxBV;AAyBE,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;AA/B9B,UAAAA,KAAAC,KAAA;AAgCM,UAAI,OAAO,EAAE,GAAG;AACd,cAAM,SAAS,MAAY,qBAAe,MAAM;AAAA,UAC9C,GAAG,QAAQ;AAAA,UACX,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,CAAC;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 solidStyledUnplugin, { SolidStyledPluginOptions } from 'unplugin-solid-styled';\nimport { Plugin } from 'rollup';\n\nexport type { SolidStyledPluginFilter, SolidStyledPluginOptions } from 'unplugin-solid-styled';\n\nconst solidStyledPlugin = (\n solidStyledUnplugin.rollup as (options: SolidStyledPluginOptions) => Plugin\n);\n\nexport default solidStyledPlugin;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAA8D;AAK9D,IAAM,oBACJ,6BAAAA,QAAoB;AAGtB,IAAO,cAAQ;",
6
+ "names": ["solidStyledUnplugin"]
7
7
  }
@@ -1 +1 @@
1
- "use strict";var j=Object.create;var s=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var U=(e,r)=>{for(var t in r)s(e,t,{get:r[t],enumerable:!0})},c=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of E(r))!L.call(e,l)&&l!==t&&s(e,l,{get:()=>r[l],enumerable:!(i=F(r,l))||i.enumerable});return e};var n=(e,r,t)=>(t=e!=null?j(D(e)):{},c(r||!e||!e.__esModule?s(t,"default",{value:e,enumerable:!0}):t,e)),v=e=>c(s({},"__esModule",{value:!0}),e);var T={};U(T,{default:()=>y});module.exports=v(T);var p=n(require("solid-styled/babel"),1),x=require("@rollup/pluginutils"),g=n(require("@babel/core"),1),P=n(require("path"),1),S=n(require("@babel/preset-typescript"),1),A="src/**/*.{jsx,tsx,ts,js,mjs,cjs}",O="node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";function y(e={}){var t,i;let r=(0,x.createFilter)(((t=e.filter)==null?void 0:t.include)||A,((i=e.filter)==null?void 0:i.exclude)||O);return{name:"solid-styled",async transform(l,o){var f,d,m,u,b;if(r(o)){let a=await g.transformAsync(l,{...e.babel,presets:[[S.default],...(d=(f=e.babel)==null?void 0:f.presets)!=null?d:[]],plugins:[[p.default,{verbose:e.verbose,prefix:e.prefix,source:o}],...(u=(m=e.babel)==null?void 0:m.plugins)!=null?u:[]],filename:P.default.basename(o)});if(a)return{code:(b=a.code)!=null?b:"",map:a.map}}}}}
1
+ "use strict";var u=Object.create;var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,r=Object.prototype.hasOwnProperty;var y=(l,i)=>{for(var o in i)n(l,o,{get:i[o],enumerable:!0})},e=(l,i,o,d)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of S(i))!r.call(l,t)&&t!==o&&n(l,t,{get:()=>i[t],enumerable:!(d=s(i,t))||d.enumerable});return l};var P=(l,i,o)=>(o=l!=null?u(g(l)):{},e(i||!l||!l.__esModule?n(o,"default",{value:l,enumerable:!0}):o,l)),m=l=>e(n({},"__esModule",{value:!0}),l);var a={};y(a,{default:()=>O});module.exports=m(a);var p=P(require("unplugin-solid-styled"),1),f=p.default.rollup,O=f;
@@ -1,50 +1,8 @@
1
1
  // src/index.ts
2
- import solidStyledBabel from "solid-styled/babel";
3
- import { createFilter } from "@rollup/pluginutils";
4
- import * as babel from "@babel/core";
5
- import path from "path";
6
- import ts from "@babel/preset-typescript";
7
- var DEFAULT_INCLUDE = "src/**/*.{jsx,tsx,ts,js,mjs,cjs}";
8
- var DEFAULT_EXCLUDE = "node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";
9
- function solidStyledPlugin(options = {}) {
10
- var _a, _b;
11
- const filter = createFilter(
12
- ((_a = options.filter) == null ? void 0 : _a.include) || DEFAULT_INCLUDE,
13
- ((_b = options.filter) == null ? void 0 : _b.exclude) || DEFAULT_EXCLUDE
14
- );
15
- return {
16
- name: "solid-styled",
17
- async transform(code, id) {
18
- var _a2, _b2, _c, _d, _e;
19
- if (filter(id)) {
20
- const result = await babel.transformAsync(code, {
21
- ...options.babel,
22
- presets: [
23
- [ts],
24
- ...(_b2 = (_a2 = options.babel) == null ? void 0 : _a2.presets) != null ? _b2 : []
25
- ],
26
- plugins: [
27
- [solidStyledBabel, {
28
- verbose: options.verbose,
29
- prefix: options.prefix,
30
- source: id
31
- }],
32
- ...(_d = (_c = options.babel) == null ? void 0 : _c.plugins) != null ? _d : []
33
- ],
34
- filename: path.basename(id)
35
- });
36
- if (result) {
37
- return {
38
- code: (_e = result.code) != null ? _e : "",
39
- map: result.map
40
- };
41
- }
42
- }
43
- return void 0;
44
- }
45
- };
46
- }
2
+ import solidStyledUnplugin from "unplugin-solid-styled";
3
+ var solidStyledPlugin = solidStyledUnplugin.rollup;
4
+ var src_default = solidStyledPlugin;
47
5
  export {
48
- solidStyledPlugin as default
6
+ src_default as default
49
7
  };
50
8
  //# sourceMappingURL=index.mjs.map
@@ -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\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 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;AAcf,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AAET,SAAR,kBACL,UAAoC,CAAC,GAC7B;AAxBV;AAyBE,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;AA/B9B,UAAAA,KAAAC,KAAA;AAgCM,UAAI,OAAO,EAAE,GAAG;AACd,cAAM,SAAS,MAAY,qBAAe,MAAM;AAAA,UAC9C,GAAG,QAAQ;AAAA,UACX,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,CAAC;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"]
4
+ "sourcesContent": ["import solidStyledUnplugin, { SolidStyledPluginOptions } from 'unplugin-solid-styled';\nimport { Plugin } from 'rollup';\n\nexport type { SolidStyledPluginFilter, SolidStyledPluginOptions } from 'unplugin-solid-styled';\n\nconst solidStyledPlugin = (\n solidStyledUnplugin.rollup as (options: SolidStyledPluginOptions) => Plugin\n);\n\nexport default solidStyledPlugin;\n"],
5
+ "mappings": ";AAAA,OAAO,yBAAuD;AAK9D,IAAM,oBACJ,oBAAoB;AAGtB,IAAO,cAAQ;",
6
+ "names": []
7
7
  }
@@ -1 +1 @@
1
- import b from"solid-styled/babel";import{createFilter as c}from"@rollup/pluginutils";import*as d from"@babel/core";import p from"path";import x from"@babel/preset-typescript";var g="src/**/*.{jsx,tsx,ts,js,mjs,cjs}",P="node_modules/**/*.{jsx,tsx,ts,js,mjs,cjs}";function S(e={}){var l,i;let m=c(((l=e.filter)==null?void 0:l.include)||g,((i=e.filter)==null?void 0:i.exclude)||P);return{name:"solid-styled",async transform(u,r){var s,n,o,a,f;if(m(r)){let t=await d.transformAsync(u,{...e.babel,presets:[[x],...(n=(s=e.babel)==null?void 0:s.presets)!=null?n:[]],plugins:[[b,{verbose:e.verbose,prefix:e.prefix,source:r}],...(a=(o=e.babel)==null?void 0:o.plugins)!=null?a:[]],filename:p.basename(r)});if(t)return{code:(f=t.code)!=null?f:"",map:t.map}}}}}export{S as default};
1
+ import l from"unplugin-solid-styled";var i=l.rollup,n=i;export{n as default};
@@ -1,14 +1,5 @@
1
+ import { SolidStyledPluginOptions } from 'unplugin-solid-styled';
1
2
  import { Plugin } from 'rollup';
2
- import { FilterPattern } from '@rollup/pluginutils';
3
- import * as babel from '@babel/core';
4
- export interface SolidStyledPluginFilter {
5
- include?: FilterPattern;
6
- exclude?: FilterPattern;
7
- }
8
- export interface SolidStyledPluginOptions {
9
- verbose?: boolean;
10
- prefix?: string;
11
- filter?: SolidStyledPluginFilter;
12
- babel?: babel.TransformOptions;
13
- }
14
- export default function solidStyledPlugin(options?: SolidStyledPluginOptions): Plugin;
3
+ export type { SolidStyledPluginFilter, SolidStyledPluginOptions } from 'unplugin-solid-styled';
4
+ declare const solidStyledPlugin: (options: SolidStyledPluginOptions) => Plugin;
5
+ export default solidStyledPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup-plugin-solid-styled",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -15,24 +15,22 @@
15
15
  "pridepack"
16
16
  ],
17
17
  "devDependencies": {
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",
18
+ "@types/node": "^18.15.3",
19
+ "eslint": "^8.36.0",
20
+ "eslint-config-lxsmnsyc": "^0.5.1",
21
+ "pridepack": "2.4.2",
23
22
  "rollup": "^3.5.1",
24
- "solid-styled": "0.8.1",
23
+ "solid-styled": "0.9.0",
25
24
  "tslib": "^2.5.0",
26
25
  "typescript": "^4.9.5"
27
26
  },
28
27
  "dependencies": {
29
- "@babel/core": "^7.20.12",
30
- "@babel/preset-typescript": "^7.18.6",
31
- "@rollup/pluginutils": "^5.0.2"
28
+ "@rollup/pluginutils": "^5.0.2",
29
+ "unplugin-solid-styled": "0.9.0"
32
30
  },
33
31
  "peerDependencies": {
34
32
  "rollup": "^3",
35
- "solid-styled": ">=0.7"
33
+ "solid-styled": "^0.8"
36
34
  },
37
35
  "scripts": {
38
36
  "prepublishOnly": "pridepack clean && pridepack build",
@@ -42,8 +40,7 @@
42
40
  "clean": "pridepack clean",
43
41
  "watch": "pridepack watch",
44
42
  "start": "pridepack start",
45
- "dev": "pridepack dev",
46
- "test": "vitest"
43
+ "dev": "pridepack dev"
47
44
  },
48
45
  "description": "Rollup plugin for solid-styled",
49
46
  "repository": {
@@ -76,5 +73,5 @@
76
73
  "typesVersions": {
77
74
  "*": {}
78
75
  },
79
- "gitHead": "349472285ff114ba143bc4b258bf476a05834337"
76
+ "gitHead": "d5f189deeca2071f946f8090875aebe442a37f23"
80
77
  }