@powerlines/plugin-satori 0.1.0 → 0.1.1
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/src/index.cjs +2 -2
- package/dist/src/index.js +2 -2
- package/package.json +5 -5
package/dist/src/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var types$1=require('@storm-software/config-tools/types'),toArray=require('@stryke/convert/to-array'),exists=require('@stryke/fs/exists'),listFiles=require('@stryke/fs/list-files'),filePathFns=require('@stryke/path/file-path-fns'),joinPaths=require('@stryke/path/join-paths'),replace=require('@stryke/path/replace'),u=require('defu'),
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var types$1=require('@storm-software/config-tools/types'),toArray=require('@stryke/convert/to-array'),exists=require('@stryke/fs/exists'),listFiles=require('@stryke/fs/list-files'),filePathFns=require('@stryke/path/file-path-fns'),joinPaths=require('@stryke/path/join-paths'),replace=require('@stryke/path/replace'),u=require('defu'),paths=require('powerlines/plugin-utils/paths'),h=require('satori'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var u__default=/*#__PURE__*/_interopDefault(u);var h__default=/*#__PURE__*/_interopDefault(h);/*****************************************
|
|
2
2
|
*
|
|
3
3
|
* ⚡ Built by Storm Software
|
|
4
4
|
*
|
|
5
5
|
*****************************************/
|
|
6
6
|
|
|
7
|
-
var f=Object.defineProperty;var e=(i,o)=>f(i,"name",{value:o,configurable:true});const
|
|
7
|
+
var f=Object.defineProperty;var e=(i,o)=>f(i,"name",{value:o,configurable:true});const d=e(i=>({name:"satori",config(){return {satori:{defaultOptions:{},width:1200,height:630,fonts:[],...i}}},async configResolved(){if(!this.config.satori.path)throw new Error("The Powerlines Satori plugin requires a `path` option to be specified.");this.config.satori.inputs=(await Promise.all(toArray.toArray(this.config.satori.path).map(async o=>o.includes("*")?listFiles.listFiles(paths.replacePathTokens(this,o)):paths.replacePathTokens(this,o)))).flat().filter(o=>o&&["jsx","tsx"].includes(filePathFns.findFileExtensionSafe(o))&&exists.existsSync(o));},async prepare(){await Promise.all(this.config.satori.inputs.map(async o=>{try{const t=await this.resolver.import(o);if(t&&t.default){const r=await h__default.default(t.default,u__default.default(t.options??{},this.config.satori.defaultOptions));r&&await this.fs.writeFile(this.config.satori.outputPath?joinPaths.joinPaths(this.config.satori.outputPath,replace.replacePath(o,joinPaths.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot))):o.replace(filePathFns.findFileExtensionSafe(o),"svg"),r);}}catch(t){this.log(types$1.LogLevelLabel.DEBUG,`Failed to load Satori schema from ${o}: ${t.message}`);}}));}}),"plugin");var $=d;exports.default=$;exports.plugin=d;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {LogLevelLabel}from'@storm-software/config-tools/types';import {toArray}from'@stryke/convert/to-array';import {existsSync}from'@stryke/fs/exists';import {listFiles}from'@stryke/fs/list-files';import {findFileExtensionSafe}from'@stryke/path/file-path-fns';import {joinPaths}from'@stryke/path/join-paths';import {replacePath}from'@stryke/path/replace';import u from'defu';import {
|
|
1
|
+
import {LogLevelLabel}from'@storm-software/config-tools/types';import {toArray}from'@stryke/convert/to-array';import {existsSync}from'@stryke/fs/exists';import {listFiles}from'@stryke/fs/list-files';import {findFileExtensionSafe}from'@stryke/path/file-path-fns';import {joinPaths}from'@stryke/path/join-paths';import {replacePath}from'@stryke/path/replace';import u from'defu';import {replacePathTokens}from'powerlines/plugin-utils/paths';import h from'satori';export*from'./types';/*****************************************
|
|
2
2
|
*
|
|
3
3
|
* ⚡ Built by Storm Software
|
|
4
4
|
*
|
|
5
5
|
*****************************************/
|
|
6
6
|
|
|
7
|
-
var f=Object.defineProperty;var e=(i,o)=>f(i,"name",{value:o,configurable:true});const
|
|
7
|
+
var f=Object.defineProperty;var e=(i,o)=>f(i,"name",{value:o,configurable:true});const d=e(i=>({name:"satori",config(){return {satori:{defaultOptions:{},width:1200,height:630,fonts:[],...i}}},async configResolved(){if(!this.config.satori.path)throw new Error("The Powerlines Satori plugin requires a `path` option to be specified.");this.config.satori.inputs=(await Promise.all(toArray(this.config.satori.path).map(async o=>o.includes("*")?listFiles(replacePathTokens(this,o)):replacePathTokens(this,o)))).flat().filter(o=>o&&["jsx","tsx"].includes(findFileExtensionSafe(o))&&existsSync(o));},async prepare(){await Promise.all(this.config.satori.inputs.map(async o=>{try{const t=await this.resolver.import(o);if(t&&t.default){const r=await h(t.default,u(t.options??{},this.config.satori.defaultOptions));r&&await this.fs.writeFile(this.config.satori.outputPath?joinPaths(this.config.satori.outputPath,replacePath(o,joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot))):o.replace(findFileExtensionSafe(o),"svg"),r);}}catch(t){this.log(LogLevelLabel.DEBUG,`Failed to load Satori schema from ${o}: ${t.message}`);}}));}}),"plugin");var q=d;export{q as default,d as plugin};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-satori",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to use Satori to generate SVG files from jsx/tsx components.",
|
|
6
6
|
"repository": {
|
|
@@ -113,17 +113,17 @@
|
|
|
113
113
|
"@stryke/types": "^0.10.0",
|
|
114
114
|
"defu": "^6.1.4",
|
|
115
115
|
"jiti": "^2.6.1",
|
|
116
|
-
"powerlines": "^0.
|
|
116
|
+
"powerlines": "^0.17.0",
|
|
117
117
|
"satori": "^0.18.3"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@powerlines/nx": "^0.10.
|
|
121
|
-
"@powerlines/plugin-plugin": "^0.11.
|
|
120
|
+
"@powerlines/nx": "^0.10.2",
|
|
121
|
+
"@powerlines/plugin-plugin": "^0.11.10",
|
|
122
122
|
"@storm-software/config": "^1.134.19",
|
|
123
123
|
"@types/node": "^22.19.0",
|
|
124
124
|
"@types/react": "^19.2.2",
|
|
125
125
|
"@types/react-dom": "^19.2.2"
|
|
126
126
|
},
|
|
127
127
|
"publishConfig": { "access": "public" },
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "27064ac269a2d34c5b9371105cdd58bf6ebe85b4"
|
|
129
129
|
}
|