@powerlines/plugin-satori 0.1.221 → 0.1.222
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
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
+
const require_paths = require('./powerlines/src/plugin-utils/paths.cjs');
|
|
3
4
|
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
4
5
|
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
5
6
|
let __stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
@@ -8,7 +9,6 @@ let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
|
8
9
|
let __stryke_path_replace = require("@stryke/path/replace");
|
|
9
10
|
let defu = require("defu");
|
|
10
11
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
11
|
-
let powerlines_plugin_utils_paths = require("powerlines/plugin-utils/paths");
|
|
12
12
|
let satori = require("satori");
|
|
13
13
|
satori = require_rolldown_runtime.__toESM(satori);
|
|
14
14
|
|
|
@@ -34,8 +34,8 @@ const plugin = (options) => {
|
|
|
34
34
|
async configResolved() {
|
|
35
35
|
if (!this.config.satori.path) throw new Error("The Powerlines Satori plugin requires a `path` option to be specified.");
|
|
36
36
|
this.config.satori.inputs = (await Promise.all((0, __stryke_convert_to_array.toArray)(this.config.satori.path).map(async (path) => {
|
|
37
|
-
if (path.includes("*")) return (0, __stryke_fs_list_files.listFiles)(
|
|
38
|
-
return
|
|
37
|
+
if (path.includes("*")) return (0, __stryke_fs_list_files.listFiles)(require_paths.replacePathTokens(this, path));
|
|
38
|
+
return require_paths.replacePathTokens(this, path);
|
|
39
39
|
}))).flat().filter((path) => path && ["jsx", "tsx"].includes((0, __stryke_path_file_path_fns.findFileExtensionSafe)(path)) && (0, __stryke_fs_exists.existsSync)(path));
|
|
40
40
|
},
|
|
41
41
|
async prepare() {
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { replacePathTokens } from "./powerlines/src/plugin-utils/paths.mjs";
|
|
1
2
|
import { toArray } from "@stryke/convert/to-array";
|
|
2
3
|
import { existsSync } from "@stryke/fs/exists";
|
|
3
4
|
import { listFiles } from "@stryke/fs/list-files";
|
|
@@ -5,7 +6,6 @@ import { findFileExtensionSafe } from "@stryke/path/file-path-fns";
|
|
|
5
6
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
6
7
|
import { replacePath } from "@stryke/path/replace";
|
|
7
8
|
import defu from "defu";
|
|
8
|
-
import { replacePathTokens } from "powerlines/plugin-utils/paths";
|
|
9
9
|
import satori from "satori";
|
|
10
10
|
|
|
11
11
|
//#region src/index.ts
|
|
@@ -0,0 +1,36 @@
|
|
|
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;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-satori",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.222",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to use Satori to generate SVG files from jsx/tsx components.",
|
|
6
6
|
"repository": {
|
|
@@ -135,12 +135,12 @@
|
|
|
135
135
|
"satori": "^0.18.4"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
138
|
+
"@powerlines/plugin-plugin": "^0.12.174",
|
|
139
139
|
"@storm-software/config": "^1.135.1",
|
|
140
140
|
"@types/node": "^24.10.9",
|
|
141
141
|
"@types/react": "^19.2.9",
|
|
142
142
|
"@types/react-dom": "^19.2.3"
|
|
143
143
|
},
|
|
144
144
|
"publishConfig": { "access": "public" },
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "2852dab8ff7cad2d1aa4a44d7fd2479d62f65d47"
|
|
146
146
|
}
|