@powerlines/plugin-satori 0.1.127 → 0.1.128
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/index.cjs +5 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/node_modules/.pnpm/@storm-software_config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.cjs +16 -0
- package/dist/node_modules/.pnpm/@storm-software_config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.mjs +15 -0
- package/dist/{powerlines → packages/powerlines}/src/internal/helpers/hooks.d.mts +0 -2
- package/dist/{powerlines → packages/powerlines}/src/types/commands.d.mts +0 -1
- package/dist/{powerlines → packages/powerlines}/src/types/config.d.mts +2 -2
- package/dist/{powerlines → packages/powerlines}/src/types/unplugin.d.mts +0 -1
- package/dist/types/plugin.d.mts +3 -3
- package/package.json +4 -5
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -36
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -35
- package/dist/powerlines/src/types/babel.d.mts +0 -2
- /package/dist/{powerlines → packages/powerlines}/src/types/api.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/build.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/context.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/fs.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/hooks.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/plugin.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/resolved.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/tsconfig.d.mts +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
-
const
|
|
4
|
-
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
3
|
+
const require_chunk_POXTJ6GF = require('./node_modules/.pnpm/@storm-software_config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.cjs');
|
|
5
4
|
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
6
5
|
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
7
6
|
let __stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
@@ -10,6 +9,7 @@ let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
|
10
9
|
let __stryke_path_replace = require("@stryke/path/replace");
|
|
11
10
|
let defu = require("defu");
|
|
12
11
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
12
|
+
let powerlines_plugin_utils_paths = require("powerlines/plugin-utils/paths");
|
|
13
13
|
let satori = require("satori");
|
|
14
14
|
satori = require_rolldown_runtime.__toESM(satori);
|
|
15
15
|
|
|
@@ -35,8 +35,8 @@ const plugin = (options) => {
|
|
|
35
35
|
async configResolved() {
|
|
36
36
|
if (!this.config.satori.path) throw new Error("The Powerlines Satori plugin requires a `path` option to be specified.");
|
|
37
37
|
this.config.satori.inputs = (await Promise.all((0, __stryke_convert_to_array.toArray)(this.config.satori.path).map(async (path) => {
|
|
38
|
-
if (path.includes("*")) return (0, __stryke_fs_list_files.listFiles)(
|
|
39
|
-
return
|
|
38
|
+
if (path.includes("*")) return (0, __stryke_fs_list_files.listFiles)((0, powerlines_plugin_utils_paths.replacePathTokens)(this, path));
|
|
39
|
+
return (0, powerlines_plugin_utils_paths.replacePathTokens)(this, path);
|
|
40
40
|
}))).flat().filter((path) => path && ["jsx", "tsx"].includes((0, __stryke_path_file_path_fns.findFileExtensionSafe)(path)) && (0, __stryke_fs_exists.existsSync)(path));
|
|
41
41
|
},
|
|
42
42
|
async prepare() {
|
|
@@ -48,7 +48,7 @@ const plugin = (options) => {
|
|
|
48
48
|
if (result) await this.fs.write(this.config.satori.outputPath ? (0, __stryke_path_join_paths.joinPaths)(this.config.satori.outputPath, (0, __stryke_path_replace.replacePath)(input, (0, __stryke_path_join_paths.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.projectRoot))) : input.replace((0, __stryke_path_file_path_fns.findFileExtensionSafe)(input), "svg"), result);
|
|
49
49
|
}
|
|
50
50
|
} catch (error) {
|
|
51
|
-
this.log(
|
|
51
|
+
this.log(require_chunk_POXTJ6GF.LogLevelLabel.DEBUG, `Failed to load Satori schema from ${input}: ${error.message}`);
|
|
52
52
|
}
|
|
53
53
|
}));
|
|
54
54
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin } from "./powerlines/src/types/plugin.mjs";
|
|
1
|
+
import { Plugin } from "./packages/powerlines/src/types/plugin.mjs";
|
|
2
2
|
import { SatoriPluginContext, SatoriPluginOptions, SatoriPluginResolvedConfig, SatoriPluginUserConfig, __ΩSatoriPluginContext, __ΩSatoriPluginOptions, __ΩSatoriPluginResolvedConfig, __ΩSatoriPluginUserConfig } from "./types/plugin.mjs";
|
|
3
3
|
import { SatoriComponentModule, __ΩSatoriComponentModule } from "./types/module.mjs";
|
|
4
4
|
import "./types/index.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
1
|
+
import { LogLevelLabel } from "./node_modules/.pnpm/@storm-software_config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.mjs";
|
|
3
2
|
import { toArray } from "@stryke/convert/to-array";
|
|
4
3
|
import { existsSync } from "@stryke/fs/exists";
|
|
5
4
|
import { listFiles } from "@stryke/fs/list-files";
|
|
@@ -7,6 +6,7 @@ import { findFileExtensionSafe } from "@stryke/path/file-path-fns";
|
|
|
7
6
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
8
7
|
import { replacePath } from "@stryke/path/replace";
|
|
9
8
|
import defu from "defu";
|
|
9
|
+
import { replacePathTokens } from "powerlines/plugin-utils/paths";
|
|
10
10
|
import satori from "satori";
|
|
11
11
|
|
|
12
12
|
//#region src/index.ts
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.js
|
|
3
|
+
var LogLevelLabel = {
|
|
4
|
+
SILENT: "silent",
|
|
5
|
+
FATAL: "fatal",
|
|
6
|
+
ERROR: "error",
|
|
7
|
+
WARN: "warn",
|
|
8
|
+
SUCCESS: "success",
|
|
9
|
+
INFO: "info",
|
|
10
|
+
DEBUG: "debug",
|
|
11
|
+
TRACE: "trace",
|
|
12
|
+
ALL: "all"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.LogLevelLabel = LogLevelLabel;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.188.75_magicast@0.5.1/node_modules/@storm-software/config-tools/dist/chunk-POXTJ6GF.js
|
|
2
|
+
var LogLevelLabel = {
|
|
3
|
+
SILENT: "silent",
|
|
4
|
+
FATAL: "fatal",
|
|
5
|
+
ERROR: "error",
|
|
6
|
+
WARN: "warn",
|
|
7
|
+
SUCCESS: "success",
|
|
8
|
+
INFO: "info",
|
|
9
|
+
DEBUG: "debug",
|
|
10
|
+
TRACE: "trace",
|
|
11
|
+
ALL: "all"
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { LogLevelLabel };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { BuildConfig, BuildResolvedConfig, ESBuildBuildConfig, ESBuildResolvedBuildConfig, FarmBuildConfig, FarmResolvedBuildConfig, RolldownBuildConfig, RolldownResolvedBuildConfig, RollupBuildConfig, RollupResolvedBuildConfig, RspackBuildConfig, RspackResolvedBuildConfig, TsdownBuildConfig, TsdownResolvedBuildConfig, TsupBuildConfig, TsupResolvedBuildConfig, UnbuildBuildConfig, UnbuildResolvedBuildConfig, ViteBuildConfig, ViteResolvedBuildConfig, WebpackBuildConfig, WebpackResolvedBuildConfig } from "./build.mjs";
|
|
2
|
-
import "./babel.mjs";
|
|
3
2
|
import { StoragePort, StoragePreset } from "./fs.mjs";
|
|
4
3
|
import { TSConfig } from "./tsconfig.mjs";
|
|
5
4
|
import { PluginContext } from "./context.mjs";
|
|
6
5
|
import { Plugin } from "./plugin.mjs";
|
|
7
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
8
6
|
import { MaybePromise } from "@stryke/types/base";
|
|
9
7
|
import { PreviewOptions } from "vite";
|
|
10
8
|
import { Format } from "@storm-software/build-tools/types";
|
|
9
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
11
10
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
12
11
|
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
13
12
|
import { AssetGlob } from "@stryke/types/file";
|
|
14
13
|
import { DateString } from "compatx";
|
|
15
14
|
|
|
16
15
|
//#region ../powerlines/src/types/config.d.ts
|
|
16
|
+
|
|
17
17
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
18
18
|
/**
|
|
19
19
|
* The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UserConfig } from "../powerlines/src/types/config.mjs";
|
|
2
|
-
import { ResolvedConfig } from "../powerlines/src/types/resolved.mjs";
|
|
3
|
-
import { PluginContext } from "../powerlines/src/types/context.mjs";
|
|
1
|
+
import { UserConfig } from "../packages/powerlines/src/types/config.mjs";
|
|
2
|
+
import { ResolvedConfig } from "../packages/powerlines/src/types/resolved.mjs";
|
|
3
|
+
import { PluginContext } from "../packages/powerlines/src/types/context.mjs";
|
|
4
4
|
import { SatoriOptions } from "satori";
|
|
5
5
|
|
|
6
6
|
//#region src/types/plugin.d.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-satori",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.128",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to use Satori to generate SVG files from jsx/tsx components.",
|
|
6
6
|
"repository": {
|
|
@@ -131,17 +131,16 @@
|
|
|
131
131
|
"@stryke/types": "^0.10.29",
|
|
132
132
|
"defu": "^6.1.4",
|
|
133
133
|
"jiti": "^2.6.1",
|
|
134
|
-
"powerlines": "^0.37.
|
|
134
|
+
"powerlines": "^0.37.3",
|
|
135
135
|
"satori": "^0.18.3"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
|
-
"@powerlines/
|
|
139
|
-
"@powerlines/plugin-plugin": "^0.12.80",
|
|
138
|
+
"@powerlines/plugin-plugin": "^0.12.81",
|
|
140
139
|
"@storm-software/config": "^1.134.75",
|
|
141
140
|
"@types/node": "^24.10.4",
|
|
142
141
|
"@types/react": "^19.2.7",
|
|
143
142
|
"@types/react-dom": "^19.2.3"
|
|
144
143
|
},
|
|
145
144
|
"publishConfig": { "access": "public" },
|
|
146
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "ae9a5afaa497538477b63988242f433b60974623"
|
|
147
146
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __stryke_path_replace = require("@stryke/path/replace");
|
|
3
|
-
|
|
4
|
-
//#region ../powerlines/src/plugin-utils/paths.ts
|
|
5
|
-
/**
|
|
6
|
-
* Replaces tokens in the given path string with their corresponding values from the context.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* The following tokens are supported:
|
|
10
|
-
* - `{workspaceRoot}` - The root directory of the workspace.
|
|
11
|
-
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
12
|
-
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
13
|
-
* - `{sourceRoot}` - The source root directory of the project (usually `./src`).
|
|
14
|
-
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
15
|
-
* - `{cachePath}` - The environment's directory for cached files.
|
|
16
|
-
* - `{dataPath}` - The environment's directory for data files.
|
|
17
|
-
* - `{logPath}` - The environment's directory for log files.
|
|
18
|
-
* - `{tempPath}` - The environment's directory for temporary files.
|
|
19
|
-
* - `{configPath}` - The environment's directory for configuration files.
|
|
20
|
-
* - `{outputPath}` - The configured output directory for the project.
|
|
21
|
-
* - `{buildPath}` - The configured distribution directory for the project.
|
|
22
|
-
* - `{artifactsPath}` - The configured directory for build artifacts.
|
|
23
|
-
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
24
|
-
* - `{entryPath}` - The configured directory for generated entry files.
|
|
25
|
-
*
|
|
26
|
-
* @param context - The context containing the values for the path tokens.
|
|
27
|
-
* @param path - The path string with tokens to replace.
|
|
28
|
-
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
29
|
-
*/
|
|
30
|
-
function replacePathTokens(context, path) {
|
|
31
|
-
if (!path) return path;
|
|
32
|
-
return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", (0, __stryke_path_replace.replacePath)(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", (0, __stryke_path_replace.replacePath)(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", (0, __stryke_path_replace.replacePath)(context.entryPath, context.workspaceConfig.workspaceRoot));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
exports.replacePathTokens = replacePathTokens;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { replacePath } from "@stryke/path/replace";
|
|
2
|
-
|
|
3
|
-
//#region ../powerlines/src/plugin-utils/paths.ts
|
|
4
|
-
/**
|
|
5
|
-
* Replaces tokens in the given path string with their corresponding values from the context.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* The following tokens are supported:
|
|
9
|
-
* - `{workspaceRoot}` - The root directory of the workspace.
|
|
10
|
-
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
11
|
-
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
12
|
-
* - `{sourceRoot}` - The source root directory of the project (usually `./src`).
|
|
13
|
-
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
14
|
-
* - `{cachePath}` - The environment's directory for cached files.
|
|
15
|
-
* - `{dataPath}` - The environment's directory for data files.
|
|
16
|
-
* - `{logPath}` - The environment's directory for log files.
|
|
17
|
-
* - `{tempPath}` - The environment's directory for temporary files.
|
|
18
|
-
* - `{configPath}` - The environment's directory for configuration files.
|
|
19
|
-
* - `{outputPath}` - The configured output directory for the project.
|
|
20
|
-
* - `{buildPath}` - The configured distribution directory for the project.
|
|
21
|
-
* - `{artifactsPath}` - The configured directory for build artifacts.
|
|
22
|
-
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
23
|
-
* - `{entryPath}` - The configured directory for generated entry files.
|
|
24
|
-
*
|
|
25
|
-
* @param context - The context containing the values for the path tokens.
|
|
26
|
-
* @param path - The path string with tokens to replace.
|
|
27
|
-
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
28
|
-
*/
|
|
29
|
-
function replacePathTokens(context, path) {
|
|
30
|
-
if (!path) return path;
|
|
31
|
-
return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.projectRoot).replaceAll("{projectRoot}", context.config.projectRoot).replaceAll("{sourceRoot}", context.config.sourceRoot).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
export { replacePathTokens };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|