@powerlines/plugin-tamagui 0.1.111 → 0.1.112
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-BgAdqTbb.d.mts +1 -0
- package/dist/index-CEgs-Dz2.d.cts +1 -0
- package/dist/index.cjs +111 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +80 -2
- package/dist/plugin-C3MaN5jp.mjs +1 -0
- package/dist/plugin-CnWeA5Mq.d.mts +1780 -0
- package/dist/plugin-DGwyHDoC.d.cts +1780 -0
- package/dist/plugin-DHXHjv16.cjs +0 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.mjs +3 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +1 -35
- package/dist/types/plugin.d.mts +1 -35
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-CTUnla4x.mjs +1 -0
- package/dist/types-DHkg7xmX.cjs +0 -0
- package/package.json +2 -2
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- package/dist/powerlines/src/plugin-utils/get-config-path.cjs +0 -49
- package/dist/powerlines/src/plugin-utils/get-config-path.mjs +0 -48
- 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/src/types/build.d.cts +0 -145
- package/dist/powerlines/src/types/build.d.mts +0 -147
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/config.d.cts +0 -369
- package/dist/powerlines/src/types/config.d.mts +0 -369
- package/dist/powerlines/src/types/context.d.cts +0 -403
- package/dist/powerlines/src/types/context.d.mts +0 -405
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/fs.d.mts +0 -486
- package/dist/powerlines/src/types/hooks.d.mts +0 -2
- package/dist/powerlines/src/types/plugin.d.cts +0 -231
- package/dist/powerlines/src/types/plugin.d.mts +0 -231
- package/dist/powerlines/src/types/resolved.d.cts +0 -81
- package/dist/powerlines/src/types/resolved.d.mts +0 -82
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.cjs
CHANGED
|
@@ -1,16 +1,120 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
//#region rolldown:runtime
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
require('./plugin-DHXHjv16.cjs');
|
|
30
|
+
require('./types-DHkg7xmX.cjs');
|
|
5
31
|
let __stryke_fs_resolve = require("@stryke/fs/resolve");
|
|
6
32
|
let __stryke_hash_neutral = require("@stryke/hash/neutral");
|
|
7
33
|
let __stryke_path_join = require("@stryke/path/join");
|
|
8
34
|
let __tamagui_static_worker = require("@tamagui/static-worker");
|
|
9
|
-
__tamagui_static_worker =
|
|
35
|
+
__tamagui_static_worker = __toESM(__tamagui_static_worker);
|
|
10
36
|
let defu = require("defu");
|
|
11
|
-
defu =
|
|
37
|
+
defu = __toESM(defu);
|
|
38
|
+
let node_fs = require("node:fs");
|
|
39
|
+
let __stryke_path_replace = require("@stryke/path/replace");
|
|
12
40
|
let vite = require("vite");
|
|
13
41
|
|
|
42
|
+
//#region ../powerlines/src/plugin-utils/get-config-path.ts
|
|
43
|
+
/**
|
|
44
|
+
* Get the configuration file path for a given name.
|
|
45
|
+
*
|
|
46
|
+
* @param context - The Powerlines context.
|
|
47
|
+
* @param name - The name of the configuration file (without extension).
|
|
48
|
+
* @returns The absolute path to the configuration file, or undefined if not found.
|
|
49
|
+
*/
|
|
50
|
+
function getConfigPath(context, name) {
|
|
51
|
+
if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`);
|
|
52
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`);
|
|
53
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`);
|
|
54
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`);
|
|
55
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`);
|
|
56
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`);
|
|
57
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`);
|
|
58
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`);
|
|
59
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`);
|
|
60
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`);
|
|
61
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`);
|
|
62
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`);
|
|
63
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`);
|
|
64
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`);
|
|
65
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`);
|
|
66
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`);
|
|
67
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yml`);
|
|
68
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yaml`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.yaml`);
|
|
69
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.json`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.json`);
|
|
70
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.jsonc`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.jsonc`);
|
|
71
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.ts`);
|
|
72
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cts`);
|
|
73
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mts`);
|
|
74
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.js`);
|
|
75
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.cjs`);
|
|
76
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.mjs`);
|
|
77
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.ts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.ts`);
|
|
78
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cts`);
|
|
79
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mts`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mts`);
|
|
80
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.js`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.js`);
|
|
81
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`);
|
|
82
|
+
else if ((0, node_fs.existsSync)((0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`))) return (0, __stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region ../powerlines/src/plugin-utils/paths.ts
|
|
87
|
+
/**
|
|
88
|
+
* Replaces tokens in the given path string with their corresponding values from the context.
|
|
89
|
+
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* The following tokens are supported:
|
|
92
|
+
* - `{workspaceRoot}` - The root directory of the workspace.
|
|
93
|
+
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
94
|
+
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
95
|
+
* - `{sourceRoot}` - The source root directory of the project (usually `./src`).
|
|
96
|
+
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
97
|
+
* - `{cachePath}` - The environment's directory for cached files.
|
|
98
|
+
* - `{dataPath}` - The environment's directory for data files.
|
|
99
|
+
* - `{logPath}` - The environment's directory for log files.
|
|
100
|
+
* - `{tempPath}` - The environment's directory for temporary files.
|
|
101
|
+
* - `{configPath}` - The environment's directory for configuration files.
|
|
102
|
+
* - `{outputPath}` - The configured output directory for the project.
|
|
103
|
+
* - `{buildPath}` - The configured distribution directory for the project.
|
|
104
|
+
* - `{artifactsPath}` - The configured directory for build artifacts.
|
|
105
|
+
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
106
|
+
* - `{entryPath}` - The configured directory for generated entry files.
|
|
107
|
+
*
|
|
108
|
+
* @param context - The context containing the values for the path tokens.
|
|
109
|
+
* @param path - The path string with tokens to replace.
|
|
110
|
+
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
111
|
+
*/
|
|
112
|
+
function replacePathTokens(context, path) {
|
|
113
|
+
if (!path) return path;
|
|
114
|
+
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));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
14
118
|
//#region src/index.ts
|
|
15
119
|
/**
|
|
16
120
|
* Tamagui plugin for Powerlines.
|
|
@@ -30,7 +134,7 @@ const plugin = (options = {}) => {
|
|
|
30
134
|
return {
|
|
31
135
|
name: "tamagui",
|
|
32
136
|
async config() {
|
|
33
|
-
const configPath =
|
|
137
|
+
const configPath = getConfigPath(this, "tamagui");
|
|
34
138
|
const tamaguiOptions = await (0, __tamagui_static_worker.loadTamaguiBuildConfig)((0, defu.default)({
|
|
35
139
|
...options,
|
|
36
140
|
components: [(0, __stryke_path_join.joinPaths)("{projectRoot}", "src/components")]
|
|
@@ -124,7 +228,7 @@ const plugin = (options = {}) => {
|
|
|
124
228
|
},
|
|
125
229
|
configResolved() {
|
|
126
230
|
if (!this.config.tamagui.components || this.config.tamagui.components.length === 0) throw new Error(`Tamagui Plugin: No components paths defined in Tamagui configuration. Please ensure that the 'components' option is set correctly.`);
|
|
127
|
-
this.config.tamagui.components = this.config.tamagui.components.map((path) =>
|
|
231
|
+
this.config.tamagui.components = this.config.tamagui.components.map((path) => replacePathTokens(this, path)).filter(Boolean);
|
|
128
232
|
if (this.config.build.variant === "vite") {
|
|
129
233
|
this.config.build.optimizeDeps ??= {};
|
|
130
234
|
this.config.build.optimizeDeps.include ??= [];
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Plugin } from "./
|
|
2
|
-
import
|
|
1
|
+
import { a as __ΩTamaguiPluginContext, c as __ΩTamaguiPluginUserConfig, i as TamaguiPluginUserConfig, l as Plugin, n as TamaguiPluginOptions, o as __ΩTamaguiPluginOptions, r as TamaguiPluginResolvedConfig, s as __ΩTamaguiPluginResolvedConfig, t as TamaguiPluginContext } from "./plugin-DGwyHDoC.cjs";
|
|
2
|
+
import "./index-CEgs-Dz2.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
5
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Plugin } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./types/index.mjs";
|
|
1
|
+
import { a as __ΩTamaguiPluginContext, c as __ΩTamaguiPluginUserConfig, i as TamaguiPluginUserConfig, l as Plugin, n as TamaguiPluginOptions, o as __ΩTamaguiPluginOptions, r as TamaguiPluginResolvedConfig, s as __ΩTamaguiPluginResolvedConfig, t as TamaguiPluginContext } from "./plugin-CnWeA5Mq.mjs";
|
|
2
|
+
import "./index-BgAdqTbb.mjs";
|
|
4
3
|
|
|
5
4
|
//#region src/index.d.ts
|
|
6
5
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,91 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import "./plugin-C3MaN5jp.mjs";
|
|
2
|
+
import "./types-CTUnla4x.mjs";
|
|
3
3
|
import { resolvePackage } from "@stryke/fs/resolve";
|
|
4
4
|
import { murmurhash } from "@stryke/hash/neutral";
|
|
5
5
|
import { joinPaths } from "@stryke/path/join";
|
|
6
6
|
import * as Static from "@tamagui/static-worker";
|
|
7
7
|
import { getPragmaOptions, loadTamaguiBuildConfig } from "@tamagui/static-worker";
|
|
8
8
|
import defu from "defu";
|
|
9
|
+
import { existsSync } from "node:fs";
|
|
10
|
+
import { replacePath } from "@stryke/path/replace";
|
|
9
11
|
import { transformWithEsbuild } from "vite";
|
|
10
12
|
|
|
13
|
+
//#region ../powerlines/src/plugin-utils/get-config-path.ts
|
|
14
|
+
/**
|
|
15
|
+
* Get the configuration file path for a given name.
|
|
16
|
+
*
|
|
17
|
+
* @param context - The Powerlines context.
|
|
18
|
+
* @param name - The name of the configuration file (without extension).
|
|
19
|
+
* @returns The absolute path to the configuration file, or undefined if not found.
|
|
20
|
+
*/
|
|
21
|
+
function getConfigPath(context, name) {
|
|
22
|
+
if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yml`);
|
|
23
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.yaml`);
|
|
24
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.json`);
|
|
25
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.jsonc`);
|
|
26
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.ts`);
|
|
27
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cts`);
|
|
28
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mts`);
|
|
29
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.js`);
|
|
30
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.cjs`);
|
|
31
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.mjs`);
|
|
32
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.ts`);
|
|
33
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cts`);
|
|
34
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mts`);
|
|
35
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.js`);
|
|
36
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.cjs`);
|
|
37
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, `${name}.config.mjs`);
|
|
38
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yml`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yml`);
|
|
39
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yaml`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.yaml`);
|
|
40
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.json`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.json`);
|
|
41
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.jsonc`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.jsonc`);
|
|
42
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.ts`);
|
|
43
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cts`);
|
|
44
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mts`);
|
|
45
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.js`);
|
|
46
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.cjs`);
|
|
47
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.mjs`);
|
|
48
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.ts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.ts`);
|
|
49
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cts`);
|
|
50
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mts`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mts`);
|
|
51
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.js`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.js`);
|
|
52
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.cjs`);
|
|
53
|
+
else if (existsSync(joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`))) return joinPaths(context.workspaceConfig.workspaceRoot, `${name}.config.mjs`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region ../powerlines/src/plugin-utils/paths.ts
|
|
58
|
+
/**
|
|
59
|
+
* Replaces tokens in the given path string with their corresponding values from the context.
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* The following tokens are supported:
|
|
63
|
+
* - `{workspaceRoot}` - The root directory of the workspace.
|
|
64
|
+
* - `{root}` - The root directory of the project (same as `{projectRoot}`).
|
|
65
|
+
* - `{projectRoot}` - The root directory of the project (same as `{root}`).
|
|
66
|
+
* - `{sourceRoot}` - The source root directory of the project (usually `./src`).
|
|
67
|
+
* - `{powerlinesPath}` - The directory where Powerlines is installed.
|
|
68
|
+
* - `{cachePath}` - The environment's directory for cached files.
|
|
69
|
+
* - `{dataPath}` - The environment's directory for data files.
|
|
70
|
+
* - `{logPath}` - The environment's directory for log files.
|
|
71
|
+
* - `{tempPath}` - The environment's directory for temporary files.
|
|
72
|
+
* - `{configPath}` - The environment's directory for configuration files.
|
|
73
|
+
* - `{outputPath}` - The configured output directory for the project.
|
|
74
|
+
* - `{buildPath}` - The configured distribution directory for the project.
|
|
75
|
+
* - `{artifactsPath}` - The configured directory for build artifacts.
|
|
76
|
+
* - `{builtinPath}` - The configured directory for generated built-in plugins.
|
|
77
|
+
* - `{entryPath}` - The configured directory for generated entry files.
|
|
78
|
+
*
|
|
79
|
+
* @param context - The context containing the values for the path tokens.
|
|
80
|
+
* @param path - The path string with tokens to replace.
|
|
81
|
+
* @returns The path string with tokens replaced by their corresponding values from the context.
|
|
82
|
+
*/
|
|
83
|
+
function replacePathTokens(context, path) {
|
|
84
|
+
if (!path) return path;
|
|
85
|
+
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));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
11
89
|
//#region src/index.ts
|
|
12
90
|
/**
|
|
13
91
|
* Tamagui plugin for Powerlines.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|