@powerlines/plugin-satori 0.1.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 +201 -0
- package/README.md +294 -0
- package/dist/plugin-CvJ3nAda.d.cts +1341 -0
- package/dist/plugin-CvJ3nAda.d.ts +1341 -0
- package/dist/src/index.cjs +7 -0
- package/dist/src/index.d.cts +35 -0
- package/dist/src/index.d.ts +35 -0
- package/dist/src/index.js +7 -0
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +24 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/index.js +1 -0
- package/dist/types/module.cjs +1 -0
- package/dist/types/module.d.cts +9 -0
- package/dist/types/module.d.ts +9 -0
- package/dist/types/module.js +0 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +22 -0
- package/dist/types/plugin.d.ts +22 -0
- package/dist/types/plugin.js +0 -0
- package/package.json +129 -0
|
@@ -0,0 +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'),resolve=require('powerlines/lib/utilities/resolve'),paths=require('powerlines/plugin-utils/paths'),d=require('satori'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var u__default=/*#__PURE__*/_interopDefault(u);var d__default=/*#__PURE__*/_interopDefault(d);/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
var f=Object.defineProperty;var e=(i,o)=>f(i,"name",{value:o,configurable:true});const P=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 resolve.resolve(this,o);if(t&&t.default){const r=await d__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 A=P;exports.default=A;exports.plugin=P;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]}})});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { c as SatoriPluginContext, S as SatoriPluginOptions, P as Plugin } from '../plugin-CvJ3nAda.cjs';
|
|
2
|
+
export { b as SatoriPluginResolvedConfig, a as SatoriPluginUserConfig } from '../plugin-CvJ3nAda.cjs';
|
|
3
|
+
export { SatoriComponentModule } from '../types/module.cjs';
|
|
4
|
+
import '@storm-software/build-tools/types';
|
|
5
|
+
import '@storm-software/config-tools/types';
|
|
6
|
+
import '@storm-software/config/types';
|
|
7
|
+
import '@stryke/types/base';
|
|
8
|
+
import '@stryke/types/configuration';
|
|
9
|
+
import '@stryke/types/file';
|
|
10
|
+
import 'vite';
|
|
11
|
+
import '@stryke/env/get-env-paths';
|
|
12
|
+
import '@stryke/types/package-json';
|
|
13
|
+
import 'jiti';
|
|
14
|
+
import 'oxc-parser';
|
|
15
|
+
import 'semver';
|
|
16
|
+
import 'unplugin';
|
|
17
|
+
import '@stryke/types/tsconfig';
|
|
18
|
+
import 'typescript';
|
|
19
|
+
import '@stryke/json/types';
|
|
20
|
+
import 'memfs';
|
|
21
|
+
import 'node:fs';
|
|
22
|
+
import 'unionfs';
|
|
23
|
+
import '@stryke/types/array';
|
|
24
|
+
import 'satori';
|
|
25
|
+
import 'react';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A Powerlines plugin to use Untyped for code generation based on user-defined schemas.
|
|
29
|
+
*
|
|
30
|
+
* @param options - The plugin options.
|
|
31
|
+
* @returns A Powerlines plugin instance.
|
|
32
|
+
*/
|
|
33
|
+
declare const plugin: <TContext extends SatoriPluginContext = SatoriPluginContext>(options: SatoriPluginOptions) => Plugin<TContext>;
|
|
34
|
+
|
|
35
|
+
export { SatoriPluginContext, SatoriPluginOptions, plugin as default, plugin };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { c as SatoriPluginContext, S as SatoriPluginOptions, P as Plugin } from '../plugin-CvJ3nAda.js';
|
|
2
|
+
export { b as SatoriPluginResolvedConfig, a as SatoriPluginUserConfig } from '../plugin-CvJ3nAda.js';
|
|
3
|
+
export { SatoriComponentModule } from '../types/module.js';
|
|
4
|
+
import '@storm-software/build-tools/types';
|
|
5
|
+
import '@storm-software/config-tools/types';
|
|
6
|
+
import '@storm-software/config/types';
|
|
7
|
+
import '@stryke/types/base';
|
|
8
|
+
import '@stryke/types/configuration';
|
|
9
|
+
import '@stryke/types/file';
|
|
10
|
+
import 'vite';
|
|
11
|
+
import '@stryke/env/get-env-paths';
|
|
12
|
+
import '@stryke/types/package-json';
|
|
13
|
+
import 'jiti';
|
|
14
|
+
import 'oxc-parser';
|
|
15
|
+
import 'semver';
|
|
16
|
+
import 'unplugin';
|
|
17
|
+
import '@stryke/types/tsconfig';
|
|
18
|
+
import 'typescript';
|
|
19
|
+
import '@stryke/json/types';
|
|
20
|
+
import 'memfs';
|
|
21
|
+
import 'node:fs';
|
|
22
|
+
import 'unionfs';
|
|
23
|
+
import '@stryke/types/array';
|
|
24
|
+
import 'satori';
|
|
25
|
+
import 'react';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A Powerlines plugin to use Untyped for code generation based on user-defined schemas.
|
|
29
|
+
*
|
|
30
|
+
* @param options - The plugin options.
|
|
31
|
+
* @returns A Powerlines plugin instance.
|
|
32
|
+
*/
|
|
33
|
+
declare const plugin: <TContext extends SatoriPluginContext = SatoriPluginContext>(options: SatoriPluginOptions) => Plugin<TContext>;
|
|
34
|
+
|
|
35
|
+
export { SatoriPluginContext, SatoriPluginOptions, plugin as default, plugin };
|
|
@@ -0,0 +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 {resolve}from'powerlines/lib/utilities/resolve';import {replacePathTokens}from'powerlines/plugin-utils/paths';import d from'satori';export*from'./types';/*****************************************
|
|
2
|
+
*
|
|
3
|
+
* ⚡ Built by Storm Software
|
|
4
|
+
*
|
|
5
|
+
*****************************************/
|
|
6
|
+
|
|
7
|
+
var f=Object.defineProperty;var e=(i,o)=>f(i,"name",{value:o,configurable:true});const P=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 resolve(this,o);if(t&&t.default){const r=await d(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 B=P;export{B as default,P as plugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var module$1=require('./module'),plugin=require('./plugin');Object.keys(module$1).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return module$1[k]}})});Object.keys(plugin).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return plugin[k]}})});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { SatoriComponentModule } from './module.cjs';
|
|
2
|
+
export { c as SatoriPluginContext, S as SatoriPluginOptions, b as SatoriPluginResolvedConfig, a as SatoriPluginUserConfig } from '../plugin-CvJ3nAda.cjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'satori';
|
|
5
|
+
import '@storm-software/build-tools/types';
|
|
6
|
+
import '@storm-software/config-tools/types';
|
|
7
|
+
import '@storm-software/config/types';
|
|
8
|
+
import '@stryke/types/base';
|
|
9
|
+
import '@stryke/types/configuration';
|
|
10
|
+
import '@stryke/types/file';
|
|
11
|
+
import 'vite';
|
|
12
|
+
import '@stryke/env/get-env-paths';
|
|
13
|
+
import '@stryke/types/package-json';
|
|
14
|
+
import 'jiti';
|
|
15
|
+
import 'oxc-parser';
|
|
16
|
+
import 'semver';
|
|
17
|
+
import 'unplugin';
|
|
18
|
+
import '@stryke/types/tsconfig';
|
|
19
|
+
import 'typescript';
|
|
20
|
+
import '@stryke/json/types';
|
|
21
|
+
import 'memfs';
|
|
22
|
+
import 'node:fs';
|
|
23
|
+
import 'unionfs';
|
|
24
|
+
import '@stryke/types/array';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { SatoriComponentModule } from './module.js';
|
|
2
|
+
export { c as SatoriPluginContext, S as SatoriPluginOptions, b as SatoriPluginResolvedConfig, a as SatoriPluginUserConfig } from '../plugin-CvJ3nAda.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'satori';
|
|
5
|
+
import '@storm-software/build-tools/types';
|
|
6
|
+
import '@storm-software/config-tools/types';
|
|
7
|
+
import '@storm-software/config/types';
|
|
8
|
+
import '@stryke/types/base';
|
|
9
|
+
import '@stryke/types/configuration';
|
|
10
|
+
import '@stryke/types/file';
|
|
11
|
+
import 'vite';
|
|
12
|
+
import '@stryke/env/get-env-paths';
|
|
13
|
+
import '@stryke/types/package-json';
|
|
14
|
+
import 'jiti';
|
|
15
|
+
import 'oxc-parser';
|
|
16
|
+
import 'semver';
|
|
17
|
+
import 'unplugin';
|
|
18
|
+
import '@stryke/types/tsconfig';
|
|
19
|
+
import 'typescript';
|
|
20
|
+
import '@stryke/json/types';
|
|
21
|
+
import 'memfs';
|
|
22
|
+
import 'node:fs';
|
|
23
|
+
import 'unionfs';
|
|
24
|
+
import '@stryke/types/array';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from'./module';export*from'./plugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { c as SatoriPluginContext, S as SatoriPluginOptions, b as SatoriPluginResolvedConfig, a as SatoriPluginUserConfig } from '../plugin-CvJ3nAda.cjs';
|
|
2
|
+
import 'satori';
|
|
3
|
+
import '@storm-software/build-tools/types';
|
|
4
|
+
import '@storm-software/config-tools/types';
|
|
5
|
+
import '@storm-software/config/types';
|
|
6
|
+
import '@stryke/types/base';
|
|
7
|
+
import '@stryke/types/configuration';
|
|
8
|
+
import '@stryke/types/file';
|
|
9
|
+
import 'vite';
|
|
10
|
+
import '@stryke/env/get-env-paths';
|
|
11
|
+
import '@stryke/types/package-json';
|
|
12
|
+
import 'jiti';
|
|
13
|
+
import 'oxc-parser';
|
|
14
|
+
import 'semver';
|
|
15
|
+
import 'unplugin';
|
|
16
|
+
import '@stryke/types/tsconfig';
|
|
17
|
+
import 'typescript';
|
|
18
|
+
import '@stryke/json/types';
|
|
19
|
+
import 'memfs';
|
|
20
|
+
import 'node:fs';
|
|
21
|
+
import 'unionfs';
|
|
22
|
+
import '@stryke/types/array';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { c as SatoriPluginContext, S as SatoriPluginOptions, b as SatoriPluginResolvedConfig, a as SatoriPluginUserConfig } from '../plugin-CvJ3nAda.js';
|
|
2
|
+
import 'satori';
|
|
3
|
+
import '@storm-software/build-tools/types';
|
|
4
|
+
import '@storm-software/config-tools/types';
|
|
5
|
+
import '@storm-software/config/types';
|
|
6
|
+
import '@stryke/types/base';
|
|
7
|
+
import '@stryke/types/configuration';
|
|
8
|
+
import '@stryke/types/file';
|
|
9
|
+
import 'vite';
|
|
10
|
+
import '@stryke/env/get-env-paths';
|
|
11
|
+
import '@stryke/types/package-json';
|
|
12
|
+
import 'jiti';
|
|
13
|
+
import 'oxc-parser';
|
|
14
|
+
import 'semver';
|
|
15
|
+
import 'unplugin';
|
|
16
|
+
import '@stryke/types/tsconfig';
|
|
17
|
+
import 'typescript';
|
|
18
|
+
import '@stryke/json/types';
|
|
19
|
+
import 'memfs';
|
|
20
|
+
import 'node:fs';
|
|
21
|
+
import 'unionfs';
|
|
22
|
+
import '@stryke/types/array';
|
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@powerlines/plugin-satori",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A Powerlines plugin to use Satori to generate SVG files from jsx/tsx components.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "github",
|
|
8
|
+
"url": "https://github.com/storm-software/powerlines.git",
|
|
9
|
+
"directory": "packages/plugin-satori"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://stormsoftware.com",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://stormsoftware.com/support",
|
|
14
|
+
"email": "support@stormsoftware.com"
|
|
15
|
+
},
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Storm Software",
|
|
18
|
+
"email": "contact@stormsoftware.com",
|
|
19
|
+
"url": "https://stormsoftware.com"
|
|
20
|
+
},
|
|
21
|
+
"maintainers": [
|
|
22
|
+
{
|
|
23
|
+
"name": "Storm Software",
|
|
24
|
+
"email": "contact@stormsoftware.com",
|
|
25
|
+
"url": "https://stormsoftware.com"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"contributors": [
|
|
29
|
+
{
|
|
30
|
+
"name": "Storm Software",
|
|
31
|
+
"email": "contact@stormsoftware.com",
|
|
32
|
+
"url": "https://stormsoftware.com"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"funding": {
|
|
36
|
+
"type": "github",
|
|
37
|
+
"url": "https://github.com/sponsors/storm-software"
|
|
38
|
+
},
|
|
39
|
+
"license": "Apache-2.0",
|
|
40
|
+
"private": false,
|
|
41
|
+
"main": "dist/index.cjs",
|
|
42
|
+
"module": "dist/index.js",
|
|
43
|
+
"exports": {
|
|
44
|
+
"./package.json": "./package.json",
|
|
45
|
+
".": {
|
|
46
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./dist/index.d.cts",
|
|
49
|
+
"default": "./dist/index.cjs"
|
|
50
|
+
},
|
|
51
|
+
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
|
|
52
|
+
},
|
|
53
|
+
"./index": {
|
|
54
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
|
|
55
|
+
"require": {
|
|
56
|
+
"types": "./dist/index.d.cts",
|
|
57
|
+
"default": "./dist/index.cjs"
|
|
58
|
+
},
|
|
59
|
+
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
|
|
60
|
+
},
|
|
61
|
+
"./plugin": {
|
|
62
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
|
|
63
|
+
"require": {
|
|
64
|
+
"types": "./dist/index.d.cts",
|
|
65
|
+
"default": "./dist/index.cjs"
|
|
66
|
+
},
|
|
67
|
+
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
|
|
68
|
+
},
|
|
69
|
+
"./types": {
|
|
70
|
+
"import": {
|
|
71
|
+
"types": "./dist/types/index.d.ts",
|
|
72
|
+
"default": "./dist/types/index.js"
|
|
73
|
+
},
|
|
74
|
+
"require": {
|
|
75
|
+
"types": "./dist/types/index.d.cts",
|
|
76
|
+
"default": "./dist/types/index.cjs"
|
|
77
|
+
},
|
|
78
|
+
"default": {
|
|
79
|
+
"types": "./dist/types/index.d.ts",
|
|
80
|
+
"default": "./dist/types/index.js"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"./types/*": {
|
|
84
|
+
"import": {
|
|
85
|
+
"types": "./dist/types/*.d.ts",
|
|
86
|
+
"default": "./dist/types/*.js"
|
|
87
|
+
},
|
|
88
|
+
"require": {
|
|
89
|
+
"types": "./dist/types/*.d.cts",
|
|
90
|
+
"default": "./dist/types/*.cjs"
|
|
91
|
+
},
|
|
92
|
+
"default": {
|
|
93
|
+
"types": "./dist/types/*.d.ts",
|
|
94
|
+
"default": "./dist/types/*.js"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"typings": "dist/index.d.ts",
|
|
99
|
+
"files": ["dist/**/*"],
|
|
100
|
+
"keywords": ["satori", "powerlines", "storm-software", "powerlines-plugin"],
|
|
101
|
+
"peerDependencies": { "react": ">=19.0.0", "react-dom": ">=19.0.0" },
|
|
102
|
+
"peerDependenciesMeta": {
|
|
103
|
+
"react": { "optional": true },
|
|
104
|
+
"react-dom": { "optional": true }
|
|
105
|
+
},
|
|
106
|
+
"dependencies": {
|
|
107
|
+
"@stryke/convert": "^0.6.0",
|
|
108
|
+
"@stryke/fs": "^0.32.10",
|
|
109
|
+
"@stryke/helpers": "^0.9.2",
|
|
110
|
+
"@stryke/json": "^0.9.3",
|
|
111
|
+
"@stryke/path": "^0.18.5",
|
|
112
|
+
"@stryke/type-checks": "^0.3.10",
|
|
113
|
+
"@stryke/types": "^0.10.0",
|
|
114
|
+
"defu": "^6.1.4",
|
|
115
|
+
"jiti": "^2.6.1",
|
|
116
|
+
"powerlines": "^0.16.0",
|
|
117
|
+
"satori": "^0.18.3"
|
|
118
|
+
},
|
|
119
|
+
"devDependencies": {
|
|
120
|
+
"@powerlines/nx": "^0.10.1",
|
|
121
|
+
"@powerlines/plugin-plugin": "^0.11.9",
|
|
122
|
+
"@storm-software/config": "^1.134.19",
|
|
123
|
+
"@types/node": "^22.19.0",
|
|
124
|
+
"@types/react": "^19.2.2",
|
|
125
|
+
"@types/react-dom": "^19.2.2"
|
|
126
|
+
},
|
|
127
|
+
"publishConfig": { "access": "public" },
|
|
128
|
+
"gitHead": "097e9f257b733719a3aead815ef79686f4c46f25"
|
|
129
|
+
}
|