@powerlines/core 0.13.22 → 0.13.23
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/plugin-utils/paths.cjs +12 -2
- package/dist/plugin-utils/paths.d.cts +12 -2
- package/dist/plugin-utils/paths.d.cts.map +1 -1
- package/dist/plugin-utils/paths.d.mts +12 -2
- package/dist/plugin-utils/paths.d.mts.map +1 -1
- package/dist/plugin-utils/paths.mjs +12 -2
- package/dist/plugin-utils/paths.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -10,10 +10,11 @@ let _stryke_path_join = require("@stryke/path/join");
|
|
|
10
10
|
*
|
|
11
11
|
* @remarks
|
|
12
12
|
* The following tokens are supported:
|
|
13
|
-
* - `{
|
|
13
|
+
* - `{cwd}` - The current working directory.
|
|
14
|
+
* - `{workspaceRoot}` - The current working directory (same as `{cwd}`).
|
|
14
15
|
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
15
16
|
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
16
|
-
* - `{sourceRoot}` - The source root directory of the project (usually
|
|
17
|
+
* - `{sourceRoot}` - The source root directory of the project (usually `{root}/src`).
|
|
17
18
|
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
18
19
|
* - `{cachePath}` - The environment's directory for cached files.
|
|
19
20
|
* - `{dataPath}` - The environment's directory for data files.
|
|
@@ -28,6 +29,15 @@ let _stryke_path_join = require("@stryke/path/join");
|
|
|
28
29
|
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
29
30
|
* - `{entryPath}` - The configured directory for generated entry files.
|
|
30
31
|
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const path = replacePathTokens(context, "{root}/dist");
|
|
35
|
+
* // If context.config.root is "/home/user/project", this will return "/home/user/project/dist"
|
|
36
|
+
*
|
|
37
|
+
* const pathWithCopy = replacePathTokens(context, "{copy}");
|
|
38
|
+
* // If context.config.output.copy.path is "/home/user/project/dist-copy", this will return "/home/user/project/dist-copy"
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
31
41
|
* @param context - The context containing the values for the path tokens.
|
|
32
42
|
* @param path - The path string with tokens to replace.
|
|
33
43
|
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
@@ -7,10 +7,11 @@ import { IsUndefined } from "@stryke/types/base";
|
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
9
|
* The following tokens are supported:
|
|
10
|
-
* - `{
|
|
10
|
+
* - `{cwd}` - The current working directory.
|
|
11
|
+
* - `{workspaceRoot}` - The current working directory (same as `{cwd}`).
|
|
11
12
|
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
12
13
|
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
13
|
-
* - `{sourceRoot}` - The source root directory of the project (usually
|
|
14
|
+
* - `{sourceRoot}` - The source root directory of the project (usually `{root}/src`).
|
|
14
15
|
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
15
16
|
* - `{cachePath}` - The environment's directory for cached files.
|
|
16
17
|
* - `{dataPath}` - The environment's directory for data files.
|
|
@@ -25,6 +26,15 @@ import { IsUndefined } from "@stryke/types/base";
|
|
|
25
26
|
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
26
27
|
* - `{entryPath}` - The configured directory for generated entry files.
|
|
27
28
|
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const path = replacePathTokens(context, "{root}/dist");
|
|
32
|
+
* // If context.config.root is "/home/user/project", this will return "/home/user/project/dist"
|
|
33
|
+
*
|
|
34
|
+
* const pathWithCopy = replacePathTokens(context, "{copy}");
|
|
35
|
+
* // If context.config.output.copy.path is "/home/user/project/dist-copy", this will return "/home/user/project/dist-copy"
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
28
38
|
* @param context - The context containing the values for the path tokens.
|
|
29
39
|
* @param path - The path string with tokens to replace.
|
|
30
40
|
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.cts","names":[],"sources":["../../src/plugin-utils/paths.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"paths.d.cts","names":[],"sources":["../../src/plugin-utils/paths.ts"],"mappings":";;;;;;AA6DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,iBAAA,CACd,OAAA,EAAS,iBAAA,EACT,IAAA,YACC,WAAA,QAAmB,IAAA"}
|
|
@@ -7,10 +7,11 @@ import { IsUndefined } from "@stryke/types/base";
|
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
9
|
* The following tokens are supported:
|
|
10
|
-
* - `{
|
|
10
|
+
* - `{cwd}` - The current working directory.
|
|
11
|
+
* - `{workspaceRoot}` - The current working directory (same as `{cwd}`).
|
|
11
12
|
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
12
13
|
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
13
|
-
* - `{sourceRoot}` - The source root directory of the project (usually
|
|
14
|
+
* - `{sourceRoot}` - The source root directory of the project (usually `{root}/src`).
|
|
14
15
|
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
15
16
|
* - `{cachePath}` - The environment's directory for cached files.
|
|
16
17
|
* - `{dataPath}` - The environment's directory for data files.
|
|
@@ -25,6 +26,15 @@ import { IsUndefined } from "@stryke/types/base";
|
|
|
25
26
|
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
26
27
|
* - `{entryPath}` - The configured directory for generated entry files.
|
|
27
28
|
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const path = replacePathTokens(context, "{root}/dist");
|
|
32
|
+
* // If context.config.root is "/home/user/project", this will return "/home/user/project/dist"
|
|
33
|
+
*
|
|
34
|
+
* const pathWithCopy = replacePathTokens(context, "{copy}");
|
|
35
|
+
* // If context.config.output.copy.path is "/home/user/project/dist-copy", this will return "/home/user/project/dist-copy"
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
28
38
|
* @param context - The context containing the values for the path tokens.
|
|
29
39
|
* @param path - The path string with tokens to replace.
|
|
30
40
|
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.mts","names":[],"sources":["../../src/plugin-utils/paths.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"paths.d.mts","names":[],"sources":["../../src/plugin-utils/paths.ts"],"mappings":";;;;;;AA6DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,iBAAA,CACd,OAAA,EAAS,iBAAA,EACT,IAAA,YACC,WAAA,QAAmB,IAAA"}
|
|
@@ -8,10 +8,11 @@ import { joinPaths } from "@stryke/path/join";
|
|
|
8
8
|
*
|
|
9
9
|
* @remarks
|
|
10
10
|
* The following tokens are supported:
|
|
11
|
-
* - `{
|
|
11
|
+
* - `{cwd}` - The current working directory.
|
|
12
|
+
* - `{workspaceRoot}` - The current working directory (same as `{cwd}`).
|
|
12
13
|
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
13
14
|
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
14
|
-
* - `{sourceRoot}` - The source root directory of the project (usually
|
|
15
|
+
* - `{sourceRoot}` - The source root directory of the project (usually `{root}/src`).
|
|
15
16
|
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
16
17
|
* - `{cachePath}` - The environment's directory for cached files.
|
|
17
18
|
* - `{dataPath}` - The environment's directory for data files.
|
|
@@ -26,6 +27,15 @@ import { joinPaths } from "@stryke/path/join";
|
|
|
26
27
|
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
27
28
|
* - `{entryPath}` - The configured directory for generated entry files.
|
|
28
29
|
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const path = replacePathTokens(context, "{root}/dist");
|
|
33
|
+
* // If context.config.root is "/home/user/project", this will return "/home/user/project/dist"
|
|
34
|
+
*
|
|
35
|
+
* const pathWithCopy = replacePathTokens(context, "{copy}");
|
|
36
|
+
* // If context.config.output.copy.path is "/home/user/project/dist-copy", this will return "/home/user/project/dist-copy"
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
29
39
|
* @param context - The context containing the values for the path tokens.
|
|
30
40
|
* @param path - The path string with tokens to replace.
|
|
31
41
|
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.mjs","names":[],"sources":["../../src/plugin-utils/paths.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { IsUndefined } from \"@stryke/types/base\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Replaces tokens in the given path string with their corresponding values from the context.\n *\n * @remarks\n * The following tokens are supported:\n * - `{workspaceRoot}` - The
|
|
1
|
+
{"version":3,"file":"paths.mjs","names":[],"sources":["../../src/plugin-utils/paths.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { IsUndefined } from \"@stryke/types/base\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Replaces tokens in the given path string with their corresponding values from the context.\n *\n * @remarks\n * The following tokens are supported:\n * - `{cwd}` - The current working directory.\n * - `{workspaceRoot}` - The current working directory (same as `{cwd}`).\n * - `{root}` - The root directory of the project (same as `{projectRoot}`).\n * - `{projectRoot}` - The root directory of the project (same as `{root}`).\n * - `{sourceRoot}` - The source root directory of the project (usually `{root}/src`).\n * - `{powerlinesPath}` - The directory where Powerlines is installed.\n * - `{cachePath}` - The environment's directory for cached files.\n * - `{dataPath}` - The environment's directory for data files.\n * - `{logPath}` - The environment's directory for log files.\n * - `{tempPath}` - The environment's directory for temporary files.\n * - `{configPath}` - The environment's directory for configuration files.\n * - `{output}` - The configured output directory for the project.\n * - `{outputPath}` - The configured output directory for the project.\n * - `{copy}` - The configured final/copied distribution directory for the project.\n * - `{copyPath}` - The configured final/copied distribution directory for the project.\n * - `{artifactsPath}` - The configured directory for build artifacts.\n * - `{builtinPath}` - The configured directory for generated built-in plugins.\n * - `{entryPath}` - The configured directory for generated entry files.\n *\n * @example\n * ```ts\n * const path = replacePathTokens(context, \"{root}/dist\");\n * // If context.config.root is \"/home/user/project\", this will return \"/home/user/project/dist\"\n *\n * const pathWithCopy = replacePathTokens(context, \"{copy}\");\n * // If context.config.output.copy.path is \"/home/user/project/dist-copy\", this will return \"/home/user/project/dist-copy\"\n * ```\n *\n * @param context - The context containing the values for the path tokens.\n * @param path - The path string with tokens to replace.\n * @returns The path string with tokens replaced by their corresponding values from the context.\n */\nexport function replacePathTokens(\n context: UnresolvedContext,\n path?: string\n): IsUndefined<typeof path> extends true ? undefined : string {\n if (!path) {\n return path as IsUndefined<typeof path> extends true ? undefined : string;\n }\n\n const result = path\n .replaceAll(\"{cwd}\", context.config.cwd || process.cwd() || \"./\")\n .replaceAll(\"{workspaceRoot}\", context.config.cwd || process.cwd() || \"./\")\n .replaceAll(\"{root}\", context.config.root)\n .replaceAll(\"{projectRoot}\", context.config.root)\n .replaceAll(\"{sourceRoot}\", joinPaths(context.config.root, \"src\"))\n .replaceAll(\"{powerlinesPath}\", context.powerlinesPath)\n .replaceAll(\"{cachePath}\", context.cachePath)\n .replaceAll(\"{dataPath}\", context.dataPath)\n .replaceAll(\"{logPath}\", context.envPaths.log)\n .replaceAll(\"{tempPath}\", context.envPaths.temp)\n .replaceAll(\"{configPath}\", context.envPaths.config)\n .replaceAll(\"{outputPath}\", context.config.output.path)\n .replaceAll(\"{output}\", context.config.output.path)\n\n .replaceAll(\n \"{artifactsPath}\",\n replacePath(context.artifactsPath, context.config.cwd)\n )\n .replaceAll(\n \"{builtinPath}\",\n replacePath(context.builtinsPath, context.config.cwd)\n )\n .replaceAll(\n \"{builtinsPath}\",\n replacePath(context.builtinsPath, context.config.cwd)\n )\n .replaceAll(\n \"{entryPath}\",\n replacePath(context.entryPath, context.config.cwd)\n );\n\n return context.config.output.copy &&\n isSetString(context.config.output.copy.path)\n ? result\n .replaceAll(\"{copyPath}\", context.config.output.copy.path)\n .replaceAll(\"{copy}\", context.config.output.copy.path)\n : result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,SAAgB,kBACd,SACA,MAC4D;AAC5D,KAAI,CAAC,KACH,QAAO;CAGT,MAAM,SAAS,KACZ,WAAW,SAAS,QAAQ,OAAO,OAAO,QAAQ,KAAK,IAAI,KAAK,CAChE,WAAW,mBAAmB,QAAQ,OAAO,OAAO,QAAQ,KAAK,IAAI,KAAK,CAC1E,WAAW,UAAU,QAAQ,OAAO,KAAK,CACzC,WAAW,iBAAiB,QAAQ,OAAO,KAAK,CAChD,WAAW,gBAAgB,UAAU,QAAQ,OAAO,MAAM,MAAM,CAAC,CACjE,WAAW,oBAAoB,QAAQ,eAAe,CACtD,WAAW,eAAe,QAAQ,UAAU,CAC5C,WAAW,cAAc,QAAQ,SAAS,CAC1C,WAAW,aAAa,QAAQ,SAAS,IAAI,CAC7C,WAAW,cAAc,QAAQ,SAAS,KAAK,CAC/C,WAAW,gBAAgB,QAAQ,SAAS,OAAO,CACnD,WAAW,gBAAgB,QAAQ,OAAO,OAAO,KAAK,CACtD,WAAW,YAAY,QAAQ,OAAO,OAAO,KAAK,CAElD,WACC,mBACA,YAAY,QAAQ,eAAe,QAAQ,OAAO,IAAI,CACvD,CACA,WACC,iBACA,YAAY,QAAQ,cAAc,QAAQ,OAAO,IAAI,CACtD,CACA,WACC,kBACA,YAAY,QAAQ,cAAc,QAAQ,OAAO,IAAI,CACtD,CACA,WACC,eACA,YAAY,QAAQ,WAAW,QAAQ,OAAO,IAAI,CACnD;AAEH,QAAO,QAAQ,OAAO,OAAO,QAC3B,YAAY,QAAQ,OAAO,OAAO,KAAK,KAAK,GAC1C,OACG,WAAW,cAAc,QAAQ,OAAO,OAAO,KAAK,KAAK,CACzD,WAAW,UAAU,QAAQ,OAAO,OAAO,KAAK,KAAK,GACxD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/core",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.23",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "An internal core package for Powerlines - please use the `powerlines` package for public usage.",
|
|
6
6
|
"homepage": "https://stormsoftware.com",
|
|
@@ -569,5 +569,5 @@
|
|
|
569
569
|
"typescript": "^6.0.3"
|
|
570
570
|
},
|
|
571
571
|
"publishConfig": { "access": "public" },
|
|
572
|
-
"gitHead": "
|
|
572
|
+
"gitHead": "026a6f082ae5efe2fe607e3ba27eebdf01db89e0"
|
|
573
573
|
}
|