@breadstone-infrastructure/nx-tasks 0.0.231 → 0.0.233
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/executors/doppler-config-sync/executor.task.d.ts.map +1 -1
- package/executors/doppler-config-sync/executor.task.js +37 -18
- package/executors/doppler-config-sync/executor.task.js.map +1 -1
- package/executors/doppler-vercel-sync/executor.d.ts +11 -0
- package/executors/doppler-vercel-sync/executor.d.ts.map +1 -0
- package/executors/doppler-vercel-sync/executor.js +71 -0
- package/executors/doppler-vercel-sync/executor.js.map +1 -0
- package/executors/doppler-vercel-sync/executor.options.d.ts +8 -0
- package/executors/doppler-vercel-sync/executor.options.d.ts.map +1 -0
- package/executors/doppler-vercel-sync/executor.options.js +4 -0
- package/executors/doppler-vercel-sync/executor.options.js.map +1 -0
- package/executors/doppler-vercel-sync/executor.task.d.ts +30 -0
- package/executors/doppler-vercel-sync/executor.task.d.ts.map +1 -0
- package/executors/doppler-vercel-sync/executor.task.js +522 -0
- package/executors/doppler-vercel-sync/executor.task.js.map +1 -0
- package/executors/doppler-vercel-sync/schema.json +95 -0
- package/executors/generate-package-docs/executor.d.ts +6 -0
- package/executors/generate-package-docs/executor.d.ts.map +1 -0
- package/executors/generate-package-docs/executor.js +72 -0
- package/executors/generate-package-docs/executor.js.map +1 -0
- package/executors/generate-package-docs/executor.options.d.ts +6 -0
- package/executors/generate-package-docs/executor.options.d.ts.map +1 -0
- package/executors/generate-package-docs/executor.options.js +4 -0
- package/executors/generate-package-docs/executor.options.js.map +1 -0
- package/executors/generate-package-docs/executor.task.d.ts +103 -0
- package/executors/generate-package-docs/executor.task.d.ts.map +1 -0
- package/executors/generate-package-docs/executor.task.js +259 -0
- package/executors/generate-package-docs/executor.task.js.map +1 -0
- package/executors/generate-package-docs/schema.json +258 -0
- package/executors/icon-collection-builder/executor.d.ts.map +1 -1
- package/executors/icon-collection-builder/executor.js +3 -2
- package/executors/icon-collection-builder/executor.js.map +1 -1
- package/executors/icon-collection-builder/executor.task.d.ts +1 -0
- package/executors/icon-collection-builder/executor.task.d.ts.map +1 -1
- package/executors/icon-collection-builder/executor.task.js +73 -11
- package/executors/icon-collection-builder/executor.task.js.map +1 -1
- package/executors/icon-collection-builder/svg.d.ts +19 -0
- package/executors/icon-collection-builder/svg.d.ts.map +1 -1
- package/executors/icon-collection-builder/svg.js +106 -0
- package/executors/icon-collection-builder/svg.js.map +1 -1
- package/executors/icon-collection-downloader/executor.d.ts.map +1 -1
- package/executors/icon-collection-downloader/executor.js +3 -2
- package/executors/icon-collection-downloader/executor.js.map +1 -1
- package/executors/icon-collection-downloader/executor.task.d.ts +2 -0
- package/executors/icon-collection-downloader/executor.task.d.ts.map +1 -1
- package/executors/icon-collection-downloader/executor.task.js +130 -15
- package/executors/icon-collection-downloader/executor.task.js.map +1 -1
- package/executors/lit-docs/ComponentDocFixer.d.ts +176 -0
- package/executors/lit-docs/ComponentDocFixer.d.ts.map +1 -0
- package/executors/lit-docs/ComponentDocFixer.js +424 -0
- package/executors/lit-docs/ComponentDocFixer.js.map +1 -0
- package/executors/lit-docs/JSDocFixer.d.ts +97 -0
- package/executors/lit-docs/JSDocFixer.d.ts.map +1 -0
- package/executors/lit-docs/JSDocFixer.js +200 -0
- package/executors/lit-docs/JSDocFixer.js.map +1 -0
- package/executors/lit-docs/executor.d.ts.map +1 -1
- package/executors/lit-docs/executor.js +2 -1
- package/executors/lit-docs/executor.js.map +1 -1
- package/executors/lit-docs/executor.task.d.ts +1 -0
- package/executors/lit-docs/executor.task.d.ts.map +1 -1
- package/executors/lit-docs/executor.task.js +71 -24
- package/executors/lit-docs/executor.task.js.map +1 -1
- package/executors/lit-style-transform/executor.js +1 -1
- package/executors/lit-style-transform/executor.js.map +1 -1
- package/executors/prisma-seeds/executor.options.d.ts +1 -1
- package/executors/prisma-seeds/executor.task.d.ts +1 -1
- package/executors/secrets-config-sync/executor.d.ts +11 -0
- package/executors/secrets-config-sync/executor.d.ts.map +1 -0
- package/executors/secrets-config-sync/executor.js +64 -0
- package/executors/secrets-config-sync/executor.js.map +1 -0
- package/executors/secrets-config-sync/executor.options.d.ts +6 -0
- package/executors/secrets-config-sync/executor.options.d.ts.map +1 -0
- package/executors/secrets-config-sync/executor.options.js +4 -0
- package/executors/secrets-config-sync/executor.options.js.map +1 -0
- package/executors/secrets-config-sync/executor.task.d.ts +14 -0
- package/executors/secrets-config-sync/executor.task.d.ts.map +1 -0
- package/executors/secrets-config-sync/executor.task.js +157 -0
- package/executors/secrets-config-sync/executor.task.js.map +1 -0
- package/executors/secrets-config-sync/providers/azure-keyvault.provider.d.ts +42 -0
- package/executors/secrets-config-sync/providers/azure-keyvault.provider.d.ts.map +1 -0
- package/executors/secrets-config-sync/providers/azure-keyvault.provider.js +120 -0
- package/executors/secrets-config-sync/providers/azure-keyvault.provider.js.map +1 -0
- package/executors/secrets-config-sync/providers/doppler.provider.d.ts +18 -0
- package/executors/secrets-config-sync/providers/doppler.provider.d.ts.map +1 -0
- package/executors/secrets-config-sync/providers/doppler.provider.js +53 -0
- package/executors/secrets-config-sync/providers/doppler.provider.js.map +1 -0
- package/executors/secrets-config-sync/providers/secrets-provider.factory.d.ts +17 -0
- package/executors/secrets-config-sync/providers/secrets-provider.factory.d.ts.map +1 -0
- package/executors/secrets-config-sync/providers/secrets-provider.factory.js +25 -0
- package/executors/secrets-config-sync/providers/secrets-provider.factory.js.map +1 -0
- package/executors/secrets-config-sync/providers/secrets-provider.interface.d.ts +28 -0
- package/executors/secrets-config-sync/providers/secrets-provider.interface.d.ts.map +1 -0
- package/executors/secrets-config-sync/providers/secrets-provider.interface.js +4 -0
- package/executors/secrets-config-sync/providers/secrets-provider.interface.js.map +1 -0
- package/executors/secrets-config-sync/schema.json +44 -0
- package/executors/secrets-vercel-sync/executor.d.ts +11 -0
- package/executors/secrets-vercel-sync/executor.d.ts.map +1 -0
- package/executors/secrets-vercel-sync/executor.js +74 -0
- package/executors/secrets-vercel-sync/executor.js.map +1 -0
- package/executors/secrets-vercel-sync/executor.options.d.ts +8 -0
- package/executors/secrets-vercel-sync/executor.options.d.ts.map +1 -0
- package/executors/secrets-vercel-sync/executor.options.js +4 -0
- package/executors/secrets-vercel-sync/executor.options.js.map +1 -0
- package/executors/secrets-vercel-sync/executor.task.d.ts +34 -0
- package/executors/secrets-vercel-sync/executor.task.d.ts.map +1 -0
- package/executors/secrets-vercel-sync/executor.task.js +492 -0
- package/executors/secrets-vercel-sync/executor.task.js.map +1 -0
- package/executors/secrets-vercel-sync/providers/azure-keyvault.provider.d.ts +42 -0
- package/executors/secrets-vercel-sync/providers/azure-keyvault.provider.d.ts.map +1 -0
- package/executors/secrets-vercel-sync/providers/azure-keyvault.provider.js +118 -0
- package/executors/secrets-vercel-sync/providers/azure-keyvault.provider.js.map +1 -0
- package/executors/secrets-vercel-sync/providers/doppler.provider.d.ts +18 -0
- package/executors/secrets-vercel-sync/providers/doppler.provider.d.ts.map +1 -0
- package/executors/secrets-vercel-sync/providers/doppler.provider.js +61 -0
- package/executors/secrets-vercel-sync/providers/doppler.provider.js.map +1 -0
- package/executors/secrets-vercel-sync/providers/secrets-provider.factory.d.ts +17 -0
- package/executors/secrets-vercel-sync/providers/secrets-provider.factory.d.ts.map +1 -0
- package/executors/secrets-vercel-sync/providers/secrets-provider.factory.js +25 -0
- package/executors/secrets-vercel-sync/providers/secrets-provider.factory.js.map +1 -0
- package/executors/secrets-vercel-sync/providers/secrets-provider.interface.d.ts +28 -0
- package/executors/secrets-vercel-sync/providers/secrets-provider.interface.d.ts.map +1 -0
- package/executors/secrets-vercel-sync/providers/secrets-provider.interface.js +4 -0
- package/executors/secrets-vercel-sync/providers/secrets-provider.interface.js.map +1 -0
- package/executors/secrets-vercel-sync/schema.json +112 -0
- package/executors/token-linter/executor.options.d.ts +1 -1
- package/executors/token-linter/executor.task.d.ts +1 -1
- package/executors/token-linter/schema.json +1 -1
- package/executors.json +40 -30
- package/index.d.ts +4 -3
- package/index.d.ts.map +1 -1
- package/index.js +41 -39
- package/index.js.map +1 -1
- package/package.json +21 -19
- package/utils/markdown-processing.d.ts +43 -0
- package/utils/markdown-processing.d.ts.map +1 -0
- package/utils/markdown-processing.js +186 -0
- package/utils/markdown-processing.js.map +1 -0
- package/utils/valid-html-tags.d.ts +6 -0
- package/utils/valid-html-tags.d.ts.map +1 -0
- package/utils/valid-html-tags.js +83 -0
- package/utils/valid-html-tags.js.map +1 -0
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DopplerVercelSyncTask = void 0;
|
|
5
|
+
const utilities_1 = require("@breadstone-infrastructure/utilities");
|
|
6
|
+
const enquirer_1 = require("enquirer");
|
|
7
|
+
// #endregion
|
|
8
|
+
var DopplerVercelSyncTask;
|
|
9
|
+
(function (DopplerVercelSyncTask) {
|
|
10
|
+
// #region Constants
|
|
11
|
+
const DOPPLER_API_BASE = 'https://api.doppler.com/v3';
|
|
12
|
+
const VERCEL_API_BASE = 'https://api.vercel.com';
|
|
13
|
+
const VALID_VERCEL_ENVIRONMENTS = ['development', 'preview', 'production'];
|
|
14
|
+
const VALID_VERCEL_VARIABLE_TYPES = ['encrypted', 'sensitive'];
|
|
15
|
+
const VALID_CONFLICT_STRATEGIES = ['none', 'prefer-doppler', 'prefer-vercel'];
|
|
16
|
+
/**
|
|
17
|
+
* Expected semantic mapping: Doppler config -> Vercel environment.
|
|
18
|
+
*/
|
|
19
|
+
const STAGE_MAPPING = {
|
|
20
|
+
dev: 'development',
|
|
21
|
+
prev: 'preview',
|
|
22
|
+
stage: 'preview',
|
|
23
|
+
prod: 'production'
|
|
24
|
+
};
|
|
25
|
+
// #endregion
|
|
26
|
+
// #region Validation
|
|
27
|
+
/**
|
|
28
|
+
* Validates all options before execution.
|
|
29
|
+
*/
|
|
30
|
+
function validate(options) {
|
|
31
|
+
const variableType = options.vercelVariableType ?? 'encrypted';
|
|
32
|
+
const conflictStrategy = options.conflictStrategy ?? 'prefer-doppler';
|
|
33
|
+
if (!VALID_VERCEL_ENVIRONMENTS.includes(options.vercelEnvironment)) {
|
|
34
|
+
throw new Error(`Invalid vercelEnvironment "${options.vercelEnvironment}". Allowed: ${VALID_VERCEL_ENVIRONMENTS.join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
if (!VALID_VERCEL_VARIABLE_TYPES.includes(variableType)) {
|
|
37
|
+
throw new Error(`Invalid vercelVariableType "${variableType}". Allowed: ${VALID_VERCEL_VARIABLE_TYPES.join(', ')}`);
|
|
38
|
+
}
|
|
39
|
+
if (!VALID_CONFLICT_STRATEGIES.includes(conflictStrategy)) {
|
|
40
|
+
throw new Error(`Invalid conflictStrategy "${conflictStrategy}". Allowed: ${VALID_CONFLICT_STRATEGIES.join(', ')}`);
|
|
41
|
+
}
|
|
42
|
+
if (variableType === 'sensitive' && options.vercelEnvironment === 'development') {
|
|
43
|
+
throw new Error('vercelVariableType "sensitive" is not allowed for vercelEnvironment "development". Vercel does not support sensitive variables in development.');
|
|
44
|
+
}
|
|
45
|
+
validateStageMapping(options.dopplerConfig, options.vercelEnvironment);
|
|
46
|
+
if (options.includeKeys && options.excludeKeys) {
|
|
47
|
+
const overlap = options.includeKeys.filter(key => options.excludeKeys.includes(key));
|
|
48
|
+
if (overlap.length > 0) {
|
|
49
|
+
throw new Error(`includeKeys and excludeKeys overlap on: ${overlap.join(', ')}. Remove duplicates.`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Validates that the Doppler config and Vercel environment follow the expected semantic mapping.
|
|
55
|
+
*/
|
|
56
|
+
function validateStageMapping(dopplerConfig, vercelEnvironment) {
|
|
57
|
+
const expectedEnvironment = STAGE_MAPPING[dopplerConfig];
|
|
58
|
+
if (expectedEnvironment && expectedEnvironment !== vercelEnvironment) {
|
|
59
|
+
throw new Error(`Semantic stage mismatch: Doppler config "${dopplerConfig}" is expected to map to Vercel environment "${expectedEnvironment}", but "${vercelEnvironment}" was configured. ` +
|
|
60
|
+
`If this is intentional, review the configuration carefully.`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// #endregion
|
|
64
|
+
// #region Doppler API
|
|
65
|
+
/**
|
|
66
|
+
* Prompts the user for a token via interactive terminal input.
|
|
67
|
+
*/
|
|
68
|
+
async function promptForToken(label, hint) {
|
|
69
|
+
const credentials = await (0, enquirer_1.prompt)([
|
|
70
|
+
{
|
|
71
|
+
type: 'input',
|
|
72
|
+
name: 'token',
|
|
73
|
+
message: `Enter your ${label}:\n${hint}`
|
|
74
|
+
}
|
|
75
|
+
]);
|
|
76
|
+
if (!credentials.token) {
|
|
77
|
+
throw new Error(`No ${label} provided. Aborting.`);
|
|
78
|
+
}
|
|
79
|
+
return credentials.token;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Resolves the Doppler API token from the DOPPLER_TOKEN environment variable.
|
|
83
|
+
* Falls back to interactive prompt if interactive mode is enabled.
|
|
84
|
+
*/
|
|
85
|
+
async function resolveDopplerToken(interactive) {
|
|
86
|
+
const token = process.env['DOPPLER_TOKEN'];
|
|
87
|
+
if (token) {
|
|
88
|
+
return token;
|
|
89
|
+
}
|
|
90
|
+
if (interactive) {
|
|
91
|
+
return promptForToken('Doppler API token', 'You can find it in your Doppler account under Service Tokens or Personal Tokens.');
|
|
92
|
+
}
|
|
93
|
+
throw new Error('DOPPLER_TOKEN environment variable is not set. Set it to a Doppler Service Token or Personal Token, or enable interactive mode.');
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Fetches secrets from the Doppler API.
|
|
97
|
+
*/
|
|
98
|
+
async function fetchDopplerSecrets(token, project, config, logger) {
|
|
99
|
+
const url = `${DOPPLER_API_BASE}/configs/config/secrets?project=${encodeURIComponent(project)}&config=${encodeURIComponent(config)}&include_dynamic_secrets=false&include_managed_secrets=true`;
|
|
100
|
+
const response = await fetch(url, {
|
|
101
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
102
|
+
});
|
|
103
|
+
if (!response.ok) {
|
|
104
|
+
throw new Error(`Failed to fetch Doppler secrets (HTTP ${response.status}): ${response.statusText}`);
|
|
105
|
+
}
|
|
106
|
+
const data = await response.json();
|
|
107
|
+
if (!data.success) {
|
|
108
|
+
throw new Error('Doppler API returned success=false.');
|
|
109
|
+
}
|
|
110
|
+
const secrets = Object.fromEntries(Object.entries(data.secrets).map(([key, value]) => [key, value.computed]));
|
|
111
|
+
logger.log(` Fetched ${Object.keys(secrets).length} secrets from Doppler [${project}/${config}].`);
|
|
112
|
+
return secrets;
|
|
113
|
+
}
|
|
114
|
+
// #endregion
|
|
115
|
+
// #region Vercel API
|
|
116
|
+
/**
|
|
117
|
+
* Resolves the Vercel API token from the VERCEL_TOKEN environment variable.
|
|
118
|
+
* Falls back to interactive prompt if interactive mode is enabled.
|
|
119
|
+
*/
|
|
120
|
+
async function resolveVercelToken(interactive) {
|
|
121
|
+
const token = process.env['VERCEL_TOKEN'];
|
|
122
|
+
if (token) {
|
|
123
|
+
return token;
|
|
124
|
+
}
|
|
125
|
+
if (interactive) {
|
|
126
|
+
return promptForToken('Vercel API token', 'You can create one at https://vercel.com/account/tokens.');
|
|
127
|
+
}
|
|
128
|
+
throw new Error('VERCEL_TOKEN environment variable is not set. Set it to a Vercel API token, or enable interactive mode.');
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Builds the query string for Vercel team scoping.
|
|
132
|
+
*/
|
|
133
|
+
function buildVercelTeamQuery(team) {
|
|
134
|
+
return team.startsWith('team_')
|
|
135
|
+
? `teamId=${encodeURIComponent(team)}`
|
|
136
|
+
: `slug=${encodeURIComponent(team)}`;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Heuristically detects whether the values returned by Vercel are still ciphertext despite a
|
|
140
|
+
* successful `?decrypt=true` request. Vercel silently returns ciphertext when the calling token
|
|
141
|
+
* lacks decryption permission (no error). Ciphertext is invariably long (≥100 chars) and limited
|
|
142
|
+
* to base64url charset. If most encrypted-typed values match this profile, we treat the fetch as
|
|
143
|
+
* non-decrypted.
|
|
144
|
+
*/
|
|
145
|
+
function detectCiphertext(envs) {
|
|
146
|
+
const candidates = envs.filter(e => e.type === 'encrypted' && typeof e.value === 'string' && e.value.length > 0);
|
|
147
|
+
if (candidates.length === 0) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
const base64UrlOnly = /^[A-Za-z0-9+/=_-]+$/;
|
|
151
|
+
let suspicious = 0;
|
|
152
|
+
for (const env of candidates) {
|
|
153
|
+
if (env.value.length >= 100 && base64UrlOnly.test(env.value)) {
|
|
154
|
+
suspicious++;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// If a clear majority looks like ciphertext, assume decryption did not happen.
|
|
158
|
+
return suspicious / candidates.length >= 0.5;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Fetches existing environment variables from a Vercel project.
|
|
162
|
+
*
|
|
163
|
+
* Attempts to retrieve decrypted values when `requestDecrypt` is true. If Vercel rejects the
|
|
164
|
+
* decrypt request (e.g. token lacks scope, or the variable type does not support decryption),
|
|
165
|
+
* the request is retried without `decrypt=true` and `decrypted` is reported as `false`.
|
|
166
|
+
*
|
|
167
|
+
* Note: Vercel may also silently return ciphertext when `?decrypt=true` is sent with a token
|
|
168
|
+
* that lacks decryption scope (no HTTP error). In that case `decrypted` is also reported as
|
|
169
|
+
* `false` based on a content heuristic ({@link detectCiphertext}).
|
|
170
|
+
*/
|
|
171
|
+
async function fetchVercelEnvVars(token, project, team, requestDecrypt, logger) {
|
|
172
|
+
const teamQuery = buildVercelTeamQuery(team);
|
|
173
|
+
const baseUrl = `${VERCEL_API_BASE}/v9/projects/${encodeURIComponent(project)}/env?${teamQuery}`;
|
|
174
|
+
if (requestDecrypt) {
|
|
175
|
+
try {
|
|
176
|
+
const envs = await fetchAllVercelEnvPages(token, `${baseUrl}&decrypt=true`);
|
|
177
|
+
const stillCiphertext = detectCiphertext(envs);
|
|
178
|
+
if (stillCiphertext) {
|
|
179
|
+
logger.warn(' Vercel returned ciphertext despite decrypt=true (token likely lacks decryption scope).');
|
|
180
|
+
return { envs, decrypted: false };
|
|
181
|
+
}
|
|
182
|
+
logger.log(` Fetched ${envs.length} env vars from Vercel [${project}] (decrypted).`);
|
|
183
|
+
return { envs, decrypted: true };
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
187
|
+
logger.warn(` Decrypted fetch failed (${message}). Falling back to non-decrypted fetch.`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
const envs = await fetchAllVercelEnvPages(token, baseUrl);
|
|
191
|
+
logger.log(` Fetched ${envs.length} env vars from Vercel [${project}] (values not comparable).`);
|
|
192
|
+
return { envs, decrypted: false };
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Pages through all Vercel env vars for the given list URL.
|
|
196
|
+
*/
|
|
197
|
+
async function fetchAllVercelEnvPages(token, listUrl) {
|
|
198
|
+
const allEnvVars = [];
|
|
199
|
+
let nextUrl = listUrl;
|
|
200
|
+
while (nextUrl) {
|
|
201
|
+
const response = await fetch(nextUrl, {
|
|
202
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
203
|
+
});
|
|
204
|
+
if (!response.ok) {
|
|
205
|
+
throw new Error(`Failed to fetch Vercel env vars (HTTP ${response.status}): ${response.statusText}`);
|
|
206
|
+
}
|
|
207
|
+
const data = await response.json();
|
|
208
|
+
allEnvVars.push(...data.envs);
|
|
209
|
+
if (data.pagination?.next) {
|
|
210
|
+
nextUrl = `${listUrl}&until=${data.pagination.next}`;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
nextUrl = undefined;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return allEnvVars;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Creates a new environment variable in Vercel.
|
|
220
|
+
*/
|
|
221
|
+
async function createVercelEnvVar(token, project, team, key, value, target, type) {
|
|
222
|
+
const teamQuery = buildVercelTeamQuery(team);
|
|
223
|
+
const url = `${VERCEL_API_BASE}/v10/projects/${encodeURIComponent(project)}/env?${teamQuery}`;
|
|
224
|
+
const response = await fetch(url, {
|
|
225
|
+
method: 'POST',
|
|
226
|
+
headers: {
|
|
227
|
+
Authorization: `Bearer ${token}`,
|
|
228
|
+
'Content-Type': 'application/json'
|
|
229
|
+
},
|
|
230
|
+
body: JSON.stringify({
|
|
231
|
+
key,
|
|
232
|
+
value,
|
|
233
|
+
target: [target],
|
|
234
|
+
type
|
|
235
|
+
})
|
|
236
|
+
});
|
|
237
|
+
if (!response.ok) {
|
|
238
|
+
const body = await response.text();
|
|
239
|
+
throw new Error(`Failed to create Vercel env var "${key}" (HTTP ${response.status}): ${body}`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Updates an existing environment variable in Vercel.
|
|
244
|
+
*/
|
|
245
|
+
async function updateVercelEnvVar(token, project, team, envVarId, key, value, target, type) {
|
|
246
|
+
const teamQuery = buildVercelTeamQuery(team);
|
|
247
|
+
const url = `${VERCEL_API_BASE}/v9/projects/${encodeURIComponent(project)}/env/${encodeURIComponent(envVarId)}?${teamQuery}`;
|
|
248
|
+
const response = await fetch(url, {
|
|
249
|
+
method: 'PATCH',
|
|
250
|
+
headers: {
|
|
251
|
+
Authorization: `Bearer ${token}`,
|
|
252
|
+
'Content-Type': 'application/json'
|
|
253
|
+
},
|
|
254
|
+
body: JSON.stringify({
|
|
255
|
+
value,
|
|
256
|
+
target: [target],
|
|
257
|
+
type
|
|
258
|
+
})
|
|
259
|
+
});
|
|
260
|
+
if (!response.ok) {
|
|
261
|
+
const body = await response.text();
|
|
262
|
+
throw new Error(`Failed to update Vercel env var "${key}" (HTTP ${response.status}): ${body}`);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Deletes an environment variable from Vercel.
|
|
267
|
+
*/
|
|
268
|
+
async function deleteVercelEnvVar(token, project, team, envVarId, key) {
|
|
269
|
+
const teamQuery = buildVercelTeamQuery(team);
|
|
270
|
+
const url = `${VERCEL_API_BASE}/v9/projects/${encodeURIComponent(project)}/env/${encodeURIComponent(envVarId)}?${teamQuery}`;
|
|
271
|
+
const response = await fetch(url, {
|
|
272
|
+
method: 'DELETE',
|
|
273
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
274
|
+
});
|
|
275
|
+
if (!response.ok) {
|
|
276
|
+
const body = await response.text();
|
|
277
|
+
throw new Error(`Failed to delete Vercel env var "${key}" (HTTP ${response.status}): ${body}`);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Triggers a redeployment of the latest deployment in the given Vercel project and environment.
|
|
282
|
+
*/
|
|
283
|
+
async function triggerRedeploy(token, project, team, target, logger) {
|
|
284
|
+
const teamQuery = buildVercelTeamQuery(team);
|
|
285
|
+
const listUrl = `${VERCEL_API_BASE}/v6/deployments?projectId=${encodeURIComponent(project)}&${teamQuery}&target=${encodeURIComponent(target)}&limit=1`;
|
|
286
|
+
const listResponse = await fetch(listUrl, {
|
|
287
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
288
|
+
});
|
|
289
|
+
if (!listResponse.ok) {
|
|
290
|
+
logger.warn(` Could not list deployments for redeploy (HTTP ${listResponse.status}). Skipping redeploy.`);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const listData = await listResponse.json();
|
|
294
|
+
if (!listData.deployments || listData.deployments.length === 0) {
|
|
295
|
+
logger.warn(` No deployment found for target "${target}". Skipping redeploy.`);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
const deploymentId = listData.deployments[0].uid;
|
|
299
|
+
const redeployUrl = `${VERCEL_API_BASE}/v13/deployments?${teamQuery}&forceNew=1`;
|
|
300
|
+
const redeployResponse = await fetch(redeployUrl, {
|
|
301
|
+
method: 'POST',
|
|
302
|
+
headers: {
|
|
303
|
+
Authorization: `Bearer ${token}`,
|
|
304
|
+
'Content-Type': 'application/json'
|
|
305
|
+
},
|
|
306
|
+
body: JSON.stringify({
|
|
307
|
+
name: project,
|
|
308
|
+
deploymentId,
|
|
309
|
+
target
|
|
310
|
+
})
|
|
311
|
+
});
|
|
312
|
+
if (!redeployResponse.ok) {
|
|
313
|
+
const body = await redeployResponse.text();
|
|
314
|
+
logger.warn(` Redeploy failed (HTTP ${redeployResponse.status}): ${body}`);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
logger.log(` Triggered redeployment for "${target}".`);
|
|
318
|
+
}
|
|
319
|
+
// #endregion
|
|
320
|
+
// #region Filtering
|
|
321
|
+
/**
|
|
322
|
+
* Applies includeKeys and excludeKeys filters to the given secrets map.
|
|
323
|
+
*/
|
|
324
|
+
function applyKeyFilters(secrets, includeKeys, excludeKeys) {
|
|
325
|
+
let keys = Object.keys(secrets);
|
|
326
|
+
if (includeKeys && includeKeys.length > 0) {
|
|
327
|
+
const includeSet = new Set(includeKeys);
|
|
328
|
+
keys = keys.filter(key => includeSet.has(key));
|
|
329
|
+
}
|
|
330
|
+
if (excludeKeys && excludeKeys.length > 0) {
|
|
331
|
+
const excludeSet = new Set(excludeKeys);
|
|
332
|
+
keys = keys.filter(key => !excludeSet.has(key));
|
|
333
|
+
}
|
|
334
|
+
return Object.fromEntries(keys.map(key => [key, secrets[key]]));
|
|
335
|
+
}
|
|
336
|
+
// #endregion
|
|
337
|
+
// #region Diff & Sync
|
|
338
|
+
/**
|
|
339
|
+
* Computes the diff between Doppler secrets and existing Vercel env vars for a given environment.
|
|
340
|
+
*
|
|
341
|
+
* When `valuesComparable` is `false`, value equality cannot be verified (encrypted/sensitive variables
|
|
342
|
+
* whose decrypted form was not retrievable). To guarantee Vercel always reflects the latest Doppler state,
|
|
343
|
+
* existing keys are then emitted as `forced` (and will be patched) under `prefer-doppler`. Under
|
|
344
|
+
* `prefer-vercel` or `none` the key is `skipped` to honor user intent.
|
|
345
|
+
*/
|
|
346
|
+
function computeDiff(dopplerSecrets, vercelVars, environment, conflictStrategy, deleteMissing, valuesComparable) {
|
|
347
|
+
const results = [];
|
|
348
|
+
// Index vercel vars for this environment by key
|
|
349
|
+
const vercelByKey = new Map();
|
|
350
|
+
for (const envVar of vercelVars) {
|
|
351
|
+
if (envVar.target.includes(environment)) {
|
|
352
|
+
vercelByKey.set(envVar.key, envVar);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
// Process all Doppler keys
|
|
356
|
+
for (const [key, value] of Object.entries(dopplerSecrets)) {
|
|
357
|
+
const existing = vercelByKey.get(key);
|
|
358
|
+
if (!existing) {
|
|
359
|
+
// Key does not exist in Vercel -> add
|
|
360
|
+
results.push({ key, action: 'added', value });
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
if (!valuesComparable) {
|
|
364
|
+
// Cannot compare values (encrypted without decrypt or sensitive).
|
|
365
|
+
// To guarantee Vercel = Doppler, force a patch under prefer-doppler.
|
|
366
|
+
switch (conflictStrategy) {
|
|
367
|
+
case 'prefer-doppler':
|
|
368
|
+
results.push({ key, action: 'forced', vercelId: existing.id, value });
|
|
369
|
+
break;
|
|
370
|
+
case 'prefer-vercel':
|
|
371
|
+
case 'none':
|
|
372
|
+
results.push({ key, action: 'skipped', vercelId: existing.id });
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
if (existing.value === value) {
|
|
378
|
+
// Value is unchanged
|
|
379
|
+
results.push({ key, action: 'unchanged', vercelId: existing.id });
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
// Conflict: value differs
|
|
383
|
+
switch (conflictStrategy) {
|
|
384
|
+
case 'prefer-doppler':
|
|
385
|
+
results.push({ key, action: 'updated', vercelId: existing.id, value });
|
|
386
|
+
break;
|
|
387
|
+
case 'prefer-vercel':
|
|
388
|
+
results.push({ key, action: 'skipped', vercelId: existing.id });
|
|
389
|
+
break;
|
|
390
|
+
case 'none':
|
|
391
|
+
results.push({ key, action: 'skipped', vercelId: existing.id });
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
// Keys in Vercel but not in Doppler
|
|
397
|
+
if (deleteMissing) {
|
|
398
|
+
for (const [key, envVar] of vercelByKey) {
|
|
399
|
+
if (!(key in dopplerSecrets)) {
|
|
400
|
+
results.push({ key, action: 'deleted', vercelId: envVar.id });
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
return results;
|
|
405
|
+
}
|
|
406
|
+
// #endregion
|
|
407
|
+
// #region Logging
|
|
408
|
+
/**
|
|
409
|
+
* Returns a colored tag string for the given sync action.
|
|
410
|
+
*/
|
|
411
|
+
function formatActionTag(action, dryRun) {
|
|
412
|
+
const prefix = dryRun ? 'DRY RUN: ' : '';
|
|
413
|
+
switch (action) {
|
|
414
|
+
case 'added':
|
|
415
|
+
return (0, utilities_1.green)((0, utilities_1.bold)(`[${prefix}added]`));
|
|
416
|
+
case 'updated':
|
|
417
|
+
return (0, utilities_1.yellow)((0, utilities_1.bold)(`[${prefix}updated]`));
|
|
418
|
+
case 'forced':
|
|
419
|
+
return (0, utilities_1.cyan)((0, utilities_1.bold)(`[${prefix}forced]`));
|
|
420
|
+
case 'unchanged':
|
|
421
|
+
return (0, utilities_1.gray)((0, utilities_1.bold)('[unchanged]'));
|
|
422
|
+
case 'skipped':
|
|
423
|
+
return (0, utilities_1.magenta)((0, utilities_1.bold)('[skipped]'));
|
|
424
|
+
case 'deleted':
|
|
425
|
+
return (0, utilities_1.red)((0, utilities_1.bold)(`[${prefix}deleted]`));
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Logs the sync results as a single alphabetically sorted tree with colored action tags.
|
|
430
|
+
*/
|
|
431
|
+
function logResults(logger, results, dryRun) {
|
|
432
|
+
const sorted = [...results].sort((a, b) => a.key.localeCompare(b.key));
|
|
433
|
+
(0, utilities_1.logTree)(logger, `Keys (${sorted.length})`, sorted.map(r => ({
|
|
434
|
+
label: `${r.key} ${formatActionTag(r.action, dryRun)}`
|
|
435
|
+
})));
|
|
436
|
+
}
|
|
437
|
+
// #endregion
|
|
438
|
+
// #region Main Task
|
|
439
|
+
/**
|
|
440
|
+
* Executes the Doppler -> Vercel sync.
|
|
441
|
+
*/
|
|
442
|
+
async function run(options) {
|
|
443
|
+
const logger = new utilities_1.ConsoleLogger();
|
|
444
|
+
const variableType = options.vercelVariableType ?? 'encrypted';
|
|
445
|
+
const conflictStrategy = options.conflictStrategy ?? 'prefer-doppler';
|
|
446
|
+
const dryRun = options.dryRun ?? false;
|
|
447
|
+
const deleteMissing = options.deleteMissing ?? false;
|
|
448
|
+
const interactive = options.interactive ?? false;
|
|
449
|
+
(0, utilities_1.logSeparator)(logger, 'Doppler → Vercel Sync');
|
|
450
|
+
// Step 1: Validate
|
|
451
|
+
logger.log('Validating options...');
|
|
452
|
+
validate(options);
|
|
453
|
+
(0, utilities_1.logBanner)(logger, 'info', {
|
|
454
|
+
message: `${options.dopplerProject}/${options.dopplerConfig} → ${options.vercelProject}/${options.vercelEnvironment}`,
|
|
455
|
+
details: `Type: ${variableType} | Strategy: ${conflictStrategy} | Dry Run: ${dryRun} | Delete Missing: ${deleteMissing}`
|
|
456
|
+
});
|
|
457
|
+
// Step 2: Resolve tokens
|
|
458
|
+
const dopplerToken = await resolveDopplerToken(interactive);
|
|
459
|
+
const vercelToken = await resolveVercelToken(interactive);
|
|
460
|
+
// Step 3: Fetch Doppler secrets
|
|
461
|
+
logger.log('Fetching Doppler secrets...');
|
|
462
|
+
let dopplerSecrets = await fetchDopplerSecrets(dopplerToken, options.dopplerProject, options.dopplerConfig, logger);
|
|
463
|
+
// Step 4: Apply key filters
|
|
464
|
+
dopplerSecrets = applyKeyFilters(dopplerSecrets, options.includeKeys, options.excludeKeys);
|
|
465
|
+
logger.log(` ${Object.keys(dopplerSecrets).length} keys after filtering.`);
|
|
466
|
+
// Step 5: Fetch Vercel env vars (request decryption only for encrypted type;
|
|
467
|
+
// sensitive values are never returned by the Vercel API regardless of decrypt=true).
|
|
468
|
+
logger.log('Fetching Vercel environment variables...');
|
|
469
|
+
const requestDecrypt = variableType === 'encrypted';
|
|
470
|
+
const vercelFetch = await fetchVercelEnvVars(vercelToken, options.vercelProject, options.vercelTeam, requestDecrypt, logger);
|
|
471
|
+
const valuesComparable = vercelFetch.decrypted;
|
|
472
|
+
if (!valuesComparable) {
|
|
473
|
+
const reason = variableType === 'sensitive'
|
|
474
|
+
? 'Vercel never returns values for "sensitive" variables.'
|
|
475
|
+
: 'Decrypted fetch was not available (token scope or API restriction).';
|
|
476
|
+
(0, utilities_1.logBanner)(logger, 'warning', {
|
|
477
|
+
message: 'Value comparison disabled.',
|
|
478
|
+
details: `${reason} Existing keys will be force-patched under "prefer-doppler" to guarantee Vercel mirrors Doppler. Use "prefer-vercel" or "none" to skip instead.`
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
// Step 6: Compute diff
|
|
482
|
+
logger.log('Computing diff...');
|
|
483
|
+
const diff = computeDiff(dopplerSecrets, vercelFetch.envs, options.vercelEnvironment, conflictStrategy, deleteMissing, valuesComparable);
|
|
484
|
+
(0, utilities_1.logEmptyLine)(logger);
|
|
485
|
+
// Step 7: Apply changes (or dry-run report)
|
|
486
|
+
if (dryRun) {
|
|
487
|
+
(0, utilities_1.logBanner)(logger, 'warning', 'DRY RUN - no changes will be written to Vercel.');
|
|
488
|
+
logResults(logger, diff, true);
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
for (const entry of diff) {
|
|
492
|
+
switch (entry.action) {
|
|
493
|
+
case 'added':
|
|
494
|
+
await createVercelEnvVar(vercelToken, options.vercelProject, options.vercelTeam, entry.key, entry.value, options.vercelEnvironment, variableType);
|
|
495
|
+
break;
|
|
496
|
+
case 'updated':
|
|
497
|
+
case 'forced':
|
|
498
|
+
await updateVercelEnvVar(vercelToken, options.vercelProject, options.vercelTeam, entry.vercelId, entry.key, entry.value, options.vercelEnvironment, variableType);
|
|
499
|
+
break;
|
|
500
|
+
case 'deleted':
|
|
501
|
+
await deleteVercelEnvVar(vercelToken, options.vercelProject, options.vercelTeam, entry.vercelId, entry.key);
|
|
502
|
+
break;
|
|
503
|
+
case 'unchanged':
|
|
504
|
+
case 'skipped':
|
|
505
|
+
// No action needed
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
logResults(logger, diff, false);
|
|
510
|
+
// Step 8: Optional redeploy
|
|
511
|
+
if (options.redeploy) {
|
|
512
|
+
logger.log('Triggering redeployment...');
|
|
513
|
+
await triggerRedeploy(vercelToken, options.vercelProject, options.vercelTeam, options.vercelEnvironment, logger);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
(0, utilities_1.logEmptyLine)(logger);
|
|
517
|
+
(0, utilities_1.logBanner)(logger, 'success', 'Sync complete.');
|
|
518
|
+
}
|
|
519
|
+
DopplerVercelSyncTask.run = run;
|
|
520
|
+
// #endregion
|
|
521
|
+
})(DopplerVercelSyncTask || (exports.DopplerVercelSyncTask = DopplerVercelSyncTask = {}));
|
|
522
|
+
//# sourceMappingURL=executor.task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.task.js","sourceRoot":"","sources":["../../../src/executors/doppler-vercel-sync/executor.task.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,oEAAkL;AAClL,uCAAkC;AAElC,aAAa;AAEb,IAAiB,qBAAqB,CAouBrC;AApuBD,WAAiB,qBAAqB;IAElC,oBAAoB;IAEpB,MAAM,gBAAgB,GAAG,4BAA4B,CAAC;IAEtD,MAAM,eAAe,GAAG,wBAAwB,CAAC;IAEjD,MAAM,yBAAyB,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,YAAY,CAAU,CAAC;IAEpF,MAAM,2BAA2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@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"title": "Doppler Vercel Sync",
|
|
5
|
+
"description": "Synchronizes secrets from a Doppler project/config to a Vercel project/environment.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"dopplerProject": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The Doppler project name."
|
|
11
|
+
},
|
|
12
|
+
"dopplerConfig": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The Doppler config name (e.g. dev, prev, prod)."
|
|
15
|
+
},
|
|
16
|
+
"vercelTeam": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The Vercel team slug or scope."
|
|
19
|
+
},
|
|
20
|
+
"vercelProject": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The Vercel project name or ID."
|
|
23
|
+
},
|
|
24
|
+
"vercelEnvironment": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "The target Vercel environment.",
|
|
27
|
+
"enum": [
|
|
28
|
+
"development",
|
|
29
|
+
"preview",
|
|
30
|
+
"production"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"vercelVariableType": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "The Vercel variable type (encrypted or sensitive).",
|
|
36
|
+
"enum": [
|
|
37
|
+
"encrypted",
|
|
38
|
+
"sensitive"
|
|
39
|
+
],
|
|
40
|
+
"default": "encrypted"
|
|
41
|
+
},
|
|
42
|
+
"conflictStrategy": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "How to handle conflicts between Doppler and existing Vercel values.",
|
|
45
|
+
"enum": [
|
|
46
|
+
"none",
|
|
47
|
+
"prefer-doppler",
|
|
48
|
+
"prefer-vercel"
|
|
49
|
+
],
|
|
50
|
+
"default": "prefer-doppler"
|
|
51
|
+
},
|
|
52
|
+
"dryRun": {
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"description": "If true, no changes are written to Vercel. Only a diff report is shown.",
|
|
55
|
+
"default": false
|
|
56
|
+
},
|
|
57
|
+
"deleteMissing": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"description": "If true, keys present in Vercel but not in Doppler are deleted. Must be explicitly enabled.",
|
|
60
|
+
"default": false
|
|
61
|
+
},
|
|
62
|
+
"includeKeys": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": {
|
|
65
|
+
"type": "string"
|
|
66
|
+
},
|
|
67
|
+
"description": "If set, only these keys are synchronized."
|
|
68
|
+
},
|
|
69
|
+
"excludeKeys": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"items": {
|
|
72
|
+
"type": "string"
|
|
73
|
+
},
|
|
74
|
+
"description": "If set, these keys are excluded from synchronization."
|
|
75
|
+
},
|
|
76
|
+
"redeploy": {
|
|
77
|
+
"type": "boolean",
|
|
78
|
+
"description": "If true, triggers a redeployment of the Vercel project after sync.",
|
|
79
|
+
"default": false
|
|
80
|
+
},
|
|
81
|
+
"interactive": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"description": "If true, prompts the user for missing tokens (DOPPLER_TOKEN, VERCEL_TOKEN) instead of failing.",
|
|
84
|
+
"default": false
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"required": [
|
|
88
|
+
"dopplerProject",
|
|
89
|
+
"dopplerConfig",
|
|
90
|
+
"vercelTeam",
|
|
91
|
+
"vercelProject",
|
|
92
|
+
"vercelEnvironment"
|
|
93
|
+
],
|
|
94
|
+
"additionalProperties": false
|
|
95
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import type { GeneratePackageDocsExecutorOptions } from './executor.options';
|
|
3
|
+
export default function runExecutor(options: GeneratePackageDocsExecutorOptions, context: ExecutorContext): Promise<{
|
|
4
|
+
success: boolean;
|
|
5
|
+
}>;
|
|
6
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/generate-package-docs/executor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAC;AAI7E,wBAA8B,WAAW,CACrC,OAAO,EAAE,kCAAkC,EAC3C,OAAO,EAAE,eAAe,GACzB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAkC/B"}
|