@osdk/cli 0.32.0-beta.3 → 0.32.0-beta.4
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/CHANGELOG.md +2 -0
- package/build/esm/{chunk-XIUA5MQB.js → chunk-5EG4W4EY.js} +7 -34
- package/build/esm/chunk-5EG4W4EY.js.map +1 -0
- package/build/esm/{chunk-UIAONP7L.js → chunk-FQRKVHAE.js} +2 -4
- package/build/esm/chunk-FQRKVHAE.js.map +1 -0
- package/build/esm/chunk-PZ5AY32C.js +9 -0
- package/build/esm/chunk-PZ5AY32C.js.map +1 -0
- package/build/esm/index.js +20 -226
- package/build/esm/index.js.map +1 -1
- package/build/esm/{siteDeployCommand-PLEDSCX7.js → siteDeployCommand-FGAA5AF6.js} +6 -13
- package/build/esm/siteDeployCommand-FGAA5AF6.js.map +1 -0
- package/build/esm/{versionDeleteCommand-3WNWVBHJ.js → versionDeleteCommand-HQBNJZQO.js} +5 -9
- package/build/esm/versionDeleteCommand-HQBNJZQO.js.map +1 -0
- package/build/esm/{versionDeleteCommand-ACOXTH77.js → versionDeleteCommand-POCHBGDL.js} +5 -9
- package/build/esm/versionDeleteCommand-POCHBGDL.js.map +1 -0
- package/build/esm/{versionGetCommand-2OBNNIIF.js → versionGetCommand-FVKH4K6S.js} +4 -8
- package/build/esm/versionGetCommand-FVKH4K6S.js.map +1 -0
- package/build/esm/{versionInfoCommand-ONJKKUKB.js → versionInfoCommand-F44PTFBW.js} +4 -8
- package/build/esm/versionInfoCommand-F44PTFBW.js.map +1 -0
- package/build/esm/{versionListCommand-427FZV6N.js → versionListCommand-SMJ6RCRM.js} +4 -8
- package/build/esm/versionListCommand-SMJ6RCRM.js.map +1 -0
- package/build/esm/{versionListCommand-PB7A6NIB.js → versionListCommand-X5PFEG2U.js} +4 -8
- package/build/esm/versionListCommand-X5PFEG2U.js.map +1 -0
- package/build/esm/{versionSetCommand-R7N3NABH.js → versionSetCommand-YGYI2W74.js} +4 -8
- package/build/esm/versionSetCommand-YGYI2W74.js.map +1 -0
- package/build/esm/{versionUnsetCommand-57PLWRZJ.js → versionUnsetCommand-SUZPZFLN.js} +5 -9
- package/build/esm/versionUnsetCommand-SUZPZFLN.js.map +1 -0
- package/build/esm/{widgetSetDeployCommand-VING5SQD.js → widgetSetDeployCommand-42GOCEWP.js} +6 -9
- package/build/esm/widgetSetDeployCommand-42GOCEWP.js.map +1 -0
- package/package.json +7 -7
- package/build/esm/acorn-2ONPHVNE.js +0 -4014
- package/build/esm/acorn-2ONPHVNE.js.map +0 -1
- package/build/esm/angular-BLMWAHFR.js +0 -3921
- package/build/esm/angular-BLMWAHFR.js.map +0 -1
- package/build/esm/babel-3NM2PEMH.js +0 -9588
- package/build/esm/babel-3NM2PEMH.js.map +0 -1
- package/build/esm/chunk-K724VNRG.js +0 -28
- package/build/esm/chunk-K724VNRG.js.map +0 -1
- package/build/esm/chunk-KRGGP7LY.js +0 -221
- package/build/esm/chunk-KRGGP7LY.js.map +0 -1
- package/build/esm/chunk-OBNIOZZ3.js +0 -84
- package/build/esm/chunk-OBNIOZZ3.js.map +0 -1
- package/build/esm/chunk-PTWHSFUF.js +0 -332
- package/build/esm/chunk-PTWHSFUF.js.map +0 -1
- package/build/esm/chunk-RZQ6AXRL.js +0 -239
- package/build/esm/chunk-RZQ6AXRL.js.map +0 -1
- package/build/esm/chunk-SEFKBDOM.js +0 -127
- package/build/esm/chunk-SEFKBDOM.js.map +0 -1
- package/build/esm/chunk-UIAONP7L.js.map +0 -1
- package/build/esm/chunk-UN2YTB6E.js +0 -43
- package/build/esm/chunk-UN2YTB6E.js.map +0 -1
- package/build/esm/chunk-XIUA5MQB.js.map +0 -1
- package/build/esm/estree-W4CYHNEC.js +0 -6145
- package/build/esm/estree-W4CYHNEC.js.map +0 -1
- package/build/esm/find-up-IB2WALTK.js +0 -4
- package/build/esm/find-up-IB2WALTK.js.map +0 -1
- package/build/esm/flow-JBS2TSFC.js +0 -27169
- package/build/esm/flow-JBS2TSFC.js.map +0 -1
- package/build/esm/glimmer-V4LJ6GLD.js +0 -6974
- package/build/esm/glimmer-V4LJ6GLD.js.map +0 -1
- package/build/esm/graphql-H5EVBMG6.js +0 -1720
- package/build/esm/graphql-H5EVBMG6.js.map +0 -1
- package/build/esm/handleGenerate-TU6XBZQY.js +0 -19301
- package/build/esm/handleGenerate-TU6XBZQY.js.map +0 -1
- package/build/esm/html-M53H7DSS.js +0 -5810
- package/build/esm/html-M53H7DSS.js.map +0 -1
- package/build/esm/loginFlow-AD7BNVSR.js +0 -4
- package/build/esm/loginFlow-AD7BNVSR.js.map +0 -1
- package/build/esm/markdown-MBM2N6R4.js +0 -6697
- package/build/esm/markdown-MBM2N6R4.js.map +0 -1
- package/build/esm/meriyah-WA3U2F5N.js +0 -4343
- package/build/esm/meriyah-WA3U2F5N.js.map +0 -1
- package/build/esm/postcss-SG76YHLC.js +0 -6281
- package/build/esm/postcss-SG76YHLC.js.map +0 -1
- package/build/esm/siteDeployCommand-PLEDSCX7.js.map +0 -1
- package/build/esm/typescript-3WZD42RO.js +0 -13078
- package/build/esm/typescript-3WZD42RO.js.map +0 -1
- package/build/esm/versionDeleteCommand-3WNWVBHJ.js.map +0 -1
- package/build/esm/versionDeleteCommand-ACOXTH77.js.map +0 -1
- package/build/esm/versionGetCommand-2OBNNIIF.js.map +0 -1
- package/build/esm/versionInfoCommand-ONJKKUKB.js.map +0 -1
- package/build/esm/versionListCommand-427FZV6N.js.map +0 -1
- package/build/esm/versionListCommand-PB7A6NIB.js.map +0 -1
- package/build/esm/versionSetCommand-R7N3NABH.js.map +0 -1
- package/build/esm/versionUnsetCommand-57PLWRZJ.js.map +0 -1
- package/build/esm/widgetSetDeployCommand-VING5SQD.js.map +0 -1
- package/build/esm/yaml-7IJ6PB44.js +0 -5822
- package/build/esm/yaml-7IJ6PB44.js.map +0 -1
- package/build/types/util/maybeUpdateJemmaCustomMetadata.test.d.ts +0 -1
- package/build/types/util/maybeUpdateJemmaCustomMetadata.test.d.ts.map +0 -1
- package/build/types/util/token.test.d.ts +0 -1
- package/build/types/util/token.test.d.ts.map +0 -1
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-UN2YTB6E.js';
|
|
2
|
-
|
|
3
|
-
// ../widget.api/build/esm/manifest.js
|
|
4
|
-
init_esm_shims();
|
|
5
|
-
var MANIFEST_FILE_LOCATION = ".palantir/widgets.config.json";
|
|
6
|
-
|
|
7
|
-
// ../widget.api/build/esm/index.js
|
|
8
|
-
init_esm_shims();
|
|
9
|
-
|
|
10
|
-
// ../widget.api/build/esm/config.js
|
|
11
|
-
init_esm_shims();
|
|
12
|
-
|
|
13
|
-
// ../widget.api/build/esm/messages/hostMessages.js
|
|
14
|
-
init_esm_shims();
|
|
15
|
-
var HostMessage;
|
|
16
|
-
(function(_HostMessage) {
|
|
17
|
-
_HostMessage.Version = "1.0.0";
|
|
18
|
-
})(HostMessage || (HostMessage = {}));
|
|
19
|
-
|
|
20
|
-
// ../widget.api/build/esm/messages/widgetMessages.js
|
|
21
|
-
init_esm_shims();
|
|
22
|
-
|
|
23
|
-
// ../widget.api/build/esm/permissions.js
|
|
24
|
-
init_esm_shims();
|
|
25
|
-
|
|
26
|
-
export { MANIFEST_FILE_LOCATION };
|
|
27
|
-
//# sourceMappingURL=chunk-K724VNRG.js.map
|
|
28
|
-
//# sourceMappingURL=chunk-K724VNRG.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../widget.api/build/esm/manifest.js","../../../widget.api/build/esm/index.js","../../../widget.api/build/esm/config.js","../../../widget.api/build/esm/messages/hostMessages.js","../../../widget.api/build/esm/messages/widgetMessages.js","../../../widget.api/build/esm/permissions.js"],"names":[],"mappings":";;;AAAA,cAAA,EAAA;AAgBO,IAAM,sBAAyB,GAAA;;;AChBtC,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAgBO,IAAI,WAAA;AAAA,CACV,SAAU,YAAc,EAAA;AACvB,EAAA,YAAA,CAAa,OAAU,GAAA,OAAA;AACzB,CAAG,EAAA,WAAA,KAAgB,WAAc,GAAA,EAAG,CAAA,CAAA;;;ACnBpC,cAAA,EAAA;;;ACAA,cAAA,EAAA","file":"chunk-K724VNRG.js","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const MANIFEST_FILE_LOCATION = \".palantir/widgets.config.json\";","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { defineConfig } from \"./config.js\";\nexport { MANIFEST_FILE_LOCATION } from \"./manifest.js\";\nexport { HostMessage, isHostParametersUpdatedMessage, visitHostMessage } from \"./messages/hostMessages.js\";\nexport { isWidgetEmitEventMessage, isWidgetReadyMessage, isWidgetResizeMessage, visitWidgetMessage } from \"./messages/widgetMessages.js\";\nexport { BrowserPermission } from \"./permissions.js\";","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Extracts the parameter ID strings as types from the given ParameterConfig.\n */\n\n/**\n * Extracts a map of parameter IDs to their async-wrapped value types from the given ParameterConfig.\n */\n\n/**\n * Extracts a map of parameter IDs to the raw parameter values from the given ParameterConfig.\n */\n\n/**\n * Extracts a list of strongly-typed parameter IDs from the given WidgetConfig for a given event ID.\n * If a parameter ID is referenced by an event but does not exist, its type will be never\n */\n\n/**\n * Extracts a map of event IDs to their raw parameter value types from the given WidgetConfig.\n */\n\nexport function defineConfig(c) {\n return c;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Interfaces and type guards for messages passed from the host Foundry UI to the widget\nexport let HostMessage;\n(function (_HostMessage) {\n _HostMessage.Version = \"1.0.0\";\n})(HostMessage || (HostMessage = {}));\nexport function isHostParametersUpdatedMessage(event) {\n return event.type === \"host.update-parameters\";\n}\n/**\n * Strongly typed visitor to handle every type of host message\n */\nexport function visitHostMessage(message, visitor) {\n const {\n type,\n payload\n } = message;\n const handler = visitor[type];\n if (handler) {\n // Typescript creates an & of the parameters instead of a union\n handler(payload);\n } else {\n visitor._unknown(type);\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Interfaces and type guards for messages passed from the widget to the host Foundry UI\nexport let WidgetMessage;\nexport function isWidgetReadyMessage(event) {\n return event.type === \"widget.ready\";\n}\nexport function isWidgetResizeMessage(event) {\n return event.type === \"widget.resize\";\n}\nexport function isWidgetEmitEventMessage(event) {\n return event.type === \"widget.emit-event\";\n}\nexport function visitWidgetMessage(message, visitor) {\n const {\n type,\n payload\n } = message;\n const handler = visitor[type];\n if (handler) {\n // Typescript creates an & of the parameters instead of a union\n handler(payload);\n } else {\n visitor._unknown(type);\n }\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * An additional browser permission that can be requested by a widget.\n */\nexport const BrowserPermission = {\n /** The permissions policy allow camera attribute value */\n CAMERA: \"camera\",\n /** The permissions policy allow microphone attribute value */\n MICROPHONE: \"microphone\",\n /** The permissions policy allow autoplay attribute value */\n AUTOPLAY: \"autoplay\",\n /** The sandbox allow-downloads attribute value */\n ALLOW_DOWNLOADS: \"allow-downloads\",\n /** The sandbox allow-forms attribute value */\n ALLOW_FORMS: \"allow-forms\",\n /** The sandbox allow-popups attribute value */\n ALLOW_POPUPS: \"allow-popups\"\n};"]}
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { findUp } from './chunk-PTWHSFUF.js';
|
|
2
|
-
import { init_esm_shims } from './chunk-UN2YTB6E.js';
|
|
3
|
-
import { promises } from 'fs';
|
|
4
|
-
import { valid } from 'semver';
|
|
5
|
-
import { exec } from 'child_process';
|
|
6
|
-
import { promisify } from 'util';
|
|
7
|
-
import { extname } from 'path';
|
|
8
|
-
|
|
9
|
-
// ../foundry-config-json/build/esm/autoVersion.js
|
|
10
|
-
init_esm_shims();
|
|
11
|
-
|
|
12
|
-
// ../foundry-config-json/build/esm/execAsync.js
|
|
13
|
-
init_esm_shims();
|
|
14
|
-
var execAsync = promisify(exec);
|
|
15
|
-
|
|
16
|
-
// ../foundry-config-json/build/esm/autoVersion.js
|
|
17
|
-
var AutoVersionError = class extends Error {
|
|
18
|
-
constructor(msg, tip) {
|
|
19
|
-
super(msg);
|
|
20
|
-
this.msg = msg;
|
|
21
|
-
this.tip = tip;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
async function autoVersion(config) {
|
|
25
|
-
switch (config.type) {
|
|
26
|
-
case "git-describe":
|
|
27
|
-
return gitDescribeAutoVersion(config.tagPrefix);
|
|
28
|
-
case "package-json":
|
|
29
|
-
return packageJsonAutoVersion();
|
|
30
|
-
default:
|
|
31
|
-
throw new Error(`Unexpected auto version config: (${JSON.stringify(config)})`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async function gitDescribeAutoVersion(tagPrefix = "") {
|
|
35
|
-
const [matchPrefix, prefixRegex] = tagPrefix !== "" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [void 0, new RegExp(`^v?`)];
|
|
36
|
-
const gitVersion = await gitDescribe(matchPrefix);
|
|
37
|
-
const version = gitVersion.trim().replace(prefixRegex, "");
|
|
38
|
-
validateVersion(version);
|
|
39
|
-
return version;
|
|
40
|
-
}
|
|
41
|
-
async function packageJsonAutoVersion() {
|
|
42
|
-
const packageJsonPath = await findUp("package.json");
|
|
43
|
-
if (!packageJsonPath) {
|
|
44
|
-
throw new AutoVersionError(`Couldn't find package.json file in the current working directory or its parents: ${process.cwd()}`);
|
|
45
|
-
}
|
|
46
|
-
let packageJson;
|
|
47
|
-
try {
|
|
48
|
-
const fileContent = await promises.readFile(packageJsonPath, "utf-8");
|
|
49
|
-
packageJson = JSON.parse(fileContent);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
throw new AutoVersionError(`Couldn't read or parse package.json file ${packageJsonPath}. Error: ${error}`);
|
|
52
|
-
}
|
|
53
|
-
const version = packageJson.version;
|
|
54
|
-
validateVersion(version);
|
|
55
|
-
return version;
|
|
56
|
-
}
|
|
57
|
-
async function gitDescribe(matchPrefix) {
|
|
58
|
-
let gitVersion;
|
|
59
|
-
try {
|
|
60
|
-
const {
|
|
61
|
-
stdout
|
|
62
|
-
} = await execAsync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match="${matchPrefix}*"` : ""}`, {
|
|
63
|
-
encoding: "utf8"
|
|
64
|
-
});
|
|
65
|
-
gitVersion = stdout;
|
|
66
|
-
} catch (error) {
|
|
67
|
-
if (error instanceof Error) {
|
|
68
|
-
const errorMessage = error.message.toLowerCase();
|
|
69
|
-
if (errorMessage.includes("not recognized") || errorMessage.includes("command not found") || errorMessage.includes("no such file or directory")) {
|
|
70
|
-
throw new AutoVersionError("Unable to determine auto version using git-describe as git is not installed or found in the PATH.", `You can set up git and try again or supply a --version option to set the version manually`);
|
|
71
|
-
}
|
|
72
|
-
if (errorMessage.includes("fatal: not a git repository")) {
|
|
73
|
-
throw new AutoVersionError(`Unable to determine auto version using git-describe as the current directory is not a git repository.`, `You can run the command in a git repository and try again or supply a --version option to set the version manually`);
|
|
74
|
-
}
|
|
75
|
-
if (errorMessage.includes("fatal: no names found, cannot describe anything.")) {
|
|
76
|
-
throw new AutoVersionError(`Unable to determine auto version using git-describe as no matching tags were found.`, `You can create a tag matching the configured tag prefix and try again or supply a --version option to set the version manually`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
throw new AutoVersionError(`Unable to determine auto version using git-describe: ${error}.`, `You can supply a --version option to set the version manually`);
|
|
80
|
-
}
|
|
81
|
-
return gitVersion;
|
|
82
|
-
}
|
|
83
|
-
function validateVersion(version) {
|
|
84
|
-
if (valid(version) == null) {
|
|
85
|
-
throw new AutoVersionError(`The version string ${version} is not SemVer compliant.`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// ../foundry-config-json/build/esm/index.js
|
|
90
|
-
init_esm_shims();
|
|
91
|
-
|
|
92
|
-
// ../foundry-config-json/build/esm/config.js
|
|
93
|
-
init_esm_shims();
|
|
94
|
-
var CONFIG_FILE_NAMES = ["foundry.config.json"];
|
|
95
|
-
var FOUNDRY_SITE_CONFIG_SCHEMA = {
|
|
96
|
-
type: "object",
|
|
97
|
-
properties: {
|
|
98
|
-
foundryUrl: {
|
|
99
|
-
type: "string"
|
|
100
|
-
},
|
|
101
|
-
site: {
|
|
102
|
-
type: "object",
|
|
103
|
-
properties: {
|
|
104
|
-
application: {
|
|
105
|
-
type: "string"
|
|
106
|
-
},
|
|
107
|
-
directory: {
|
|
108
|
-
type: "string"
|
|
109
|
-
},
|
|
110
|
-
autoVersion: {
|
|
111
|
-
type: "object",
|
|
112
|
-
nullable: true,
|
|
113
|
-
oneOf: [{
|
|
114
|
-
properties: {
|
|
115
|
-
type: {
|
|
116
|
-
const: "git-describe",
|
|
117
|
-
type: "string"
|
|
118
|
-
},
|
|
119
|
-
tagPrefix: {
|
|
120
|
-
type: "string",
|
|
121
|
-
nullable: true
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}, {
|
|
125
|
-
properties: {
|
|
126
|
-
type: {
|
|
127
|
-
const: "package-json",
|
|
128
|
-
type: "string"
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}],
|
|
132
|
-
required: ["type"]
|
|
133
|
-
},
|
|
134
|
-
uploadOnly: {
|
|
135
|
-
type: "boolean",
|
|
136
|
-
nullable: true
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
required: ["application", "directory"]
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
required: ["foundryUrl", "site"],
|
|
143
|
-
additionalProperties: false
|
|
144
|
-
};
|
|
145
|
-
var FOUNDRY_WIDGET_SET_CONFIG_SCHEMA = {
|
|
146
|
-
type: "object",
|
|
147
|
-
properties: {
|
|
148
|
-
foundryUrl: {
|
|
149
|
-
type: "string"
|
|
150
|
-
},
|
|
151
|
-
widgetSet: {
|
|
152
|
-
type: "object",
|
|
153
|
-
properties: {
|
|
154
|
-
rid: {
|
|
155
|
-
type: "string"
|
|
156
|
-
},
|
|
157
|
-
directory: {
|
|
158
|
-
type: "string"
|
|
159
|
-
},
|
|
160
|
-
repository: {
|
|
161
|
-
type: "string",
|
|
162
|
-
nullable: true
|
|
163
|
-
},
|
|
164
|
-
autoVersion: FOUNDRY_SITE_CONFIG_SCHEMA.properties.site.properties.autoVersion,
|
|
165
|
-
uploadOnly: {
|
|
166
|
-
type: "boolean",
|
|
167
|
-
nullable: true
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
required: ["rid", "directory"]
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
required: ["foundryUrl", "widgetSet"],
|
|
174
|
-
additionalProperties: false
|
|
175
|
-
};
|
|
176
|
-
var FOUNDRY_CONFIG_SCHEMA = {
|
|
177
|
-
site: FOUNDRY_SITE_CONFIG_SCHEMA,
|
|
178
|
-
widgetSet: FOUNDRY_WIDGET_SET_CONFIG_SCHEMA
|
|
179
|
-
};
|
|
180
|
-
async function loadFoundryConfig(type) {
|
|
181
|
-
const ajvModule = await import('ajv');
|
|
182
|
-
const Ajv = ajvModule.default.default;
|
|
183
|
-
const ajv = new Ajv({
|
|
184
|
-
allErrors: true
|
|
185
|
-
});
|
|
186
|
-
const validate = ajv.compile(FOUNDRY_CONFIG_SCHEMA[type]);
|
|
187
|
-
const {
|
|
188
|
-
findUp: findUp2
|
|
189
|
-
} = await import('./find-up-IB2WALTK.js');
|
|
190
|
-
const configFilePath = await findUp2(CONFIG_FILE_NAMES);
|
|
191
|
-
if (configFilePath) {
|
|
192
|
-
let foundryConfig;
|
|
193
|
-
try {
|
|
194
|
-
const fileContent = await promises.readFile(configFilePath, "utf-8");
|
|
195
|
-
foundryConfig = parseConfigFile(fileContent, configFilePath);
|
|
196
|
-
} catch (error) {
|
|
197
|
-
throw new Error(`Couldn't read or parse config file ${configFilePath}. Error: ${error}`);
|
|
198
|
-
}
|
|
199
|
-
if (!validate(foundryConfig)) {
|
|
200
|
-
throw new Error(`The configuration file ${configFilePath} does not match the expected schema: ${ajv.errorsText(validate.errors)}`);
|
|
201
|
-
}
|
|
202
|
-
return {
|
|
203
|
-
foundryConfig,
|
|
204
|
-
configFilePath
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
return void 0;
|
|
208
|
-
}
|
|
209
|
-
function parseConfigFile(fileContent, configFilePath) {
|
|
210
|
-
const extension = extname(configFilePath);
|
|
211
|
-
switch (extension) {
|
|
212
|
-
case ".json":
|
|
213
|
-
return JSON.parse(fileContent);
|
|
214
|
-
default:
|
|
215
|
-
throw new Error(`Unsupported file extension: ${extension} for config file.`);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export { AutoVersionError, autoVersion, loadFoundryConfig };
|
|
220
|
-
//# sourceMappingURL=chunk-KRGGP7LY.js.map
|
|
221
|
-
//# sourceMappingURL=chunk-KRGGP7LY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../foundry-config-json/build/esm/autoVersion.js","../../../foundry-config-json/build/esm/execAsync.js","../../../foundry-config-json/build/esm/index.js","../../../foundry-config-json/build/esm/config.js"],"names":["fsPromises","findUp"],"mappings":";;;;;;;;;AAAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAkBO,IAAM,SAAA,GAAY,UAAU,IAAI,CAAA;;;ADE1B,IAAA,gBAAA,GAAN,cAA+B,KAAM,CAAA;AAAA,EAC1C,WAAA,CAAY,KA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AA;AACH,MAAO,OAAA,IAAA,CAAK,MAAM,WAAW,CAAA;AAAA,IAC/B;AACE,MAAA,MAAM,IAAI,KAAA,CAAM,CAA+B,4BAAA,EAAA,SAAS,CAAmB,iBAAA,CAAA,CAAA;AAAA;AAEjF","file":"chunk-KRGGP7LY.js","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { findUp } from \"find-up\";\nimport { promises as fsPromises } from \"node:fs\";\nimport { valid } from \"semver\";\nimport { execAsync } from \"./execAsync.js\";\nexport class AutoVersionError extends Error {\n constructor(msg, tip) {\n super(msg);\n this.msg = msg;\n this.tip = tip;\n }\n}\n\n/**\n * Gets the version string using git describe. If the @param tagPrefix is empty, git describe will return the\n * latest tag (without any filtering) and if the tag starts with \"v\", it will be removed.\n * @param tagPrefix The prefix to use for matching against tags. Defaults to an empty string.\n * @returns A promise that resolves to the version string.\n * @throws An error if the version string is not SemVer compliant or if the version cannot be determined.\n */\nexport async function autoVersion(config) {\n switch (config.type) {\n case \"git-describe\":\n return gitDescribeAutoVersion(config.tagPrefix);\n case \"package-json\":\n return packageJsonAutoVersion();\n default:\n throw new Error(`Unexpected auto version config: (${JSON.stringify(config)})`);\n }\n}\nasync function gitDescribeAutoVersion(tagPrefix = \"\") {\n const [matchPrefix, prefixRegex] = tagPrefix !== \"\" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [undefined, new RegExp(`^v?`)];\n const gitVersion = await gitDescribe(matchPrefix);\n const version = gitVersion.trim().replace(prefixRegex, \"\");\n validateVersion(version);\n return version;\n}\nasync function packageJsonAutoVersion() {\n const packageJsonPath = await findUp(\"package.json\");\n if (!packageJsonPath) {\n throw new AutoVersionError(`Couldn't find package.json file in the current working directory or its parents: ${process.cwd()}`);\n }\n let packageJson;\n try {\n const fileContent = await fsPromises.readFile(packageJsonPath, \"utf-8\");\n packageJson = JSON.parse(fileContent);\n } catch (error) {\n throw new AutoVersionError(`Couldn't read or parse package.json file ${packageJsonPath}. Error: ${error}`);\n }\n const version = packageJson.version;\n validateVersion(version);\n return version;\n}\nasync function gitDescribe(matchPrefix) {\n let gitVersion;\n try {\n const {\n stdout\n } = await execAsync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match=\"${matchPrefix}*\"` : \"\"}`, {\n encoding: \"utf8\"\n });\n gitVersion = stdout;\n } catch (error) {\n if (error instanceof Error) {\n const errorMessage = error.message.toLowerCase();\n if (errorMessage.includes(\"not recognized\") || errorMessage.includes(\"command not found\") || errorMessage.includes(\"no such file or directory\")) {\n throw new AutoVersionError(\"Unable to determine auto version using git-describe as git is not installed or found in the PATH.\", `You can set up git and try again or supply a --version option to set the version manually`);\n }\n if (errorMessage.includes(\"fatal: not a git repository\")) {\n throw new AutoVersionError(`Unable to determine auto version using git-describe as the current directory is not a git repository.`, `You can run the command in a git repository and try again or supply a --version option to set the version manually`);\n }\n if (errorMessage.includes(\"fatal: no names found, cannot describe anything.\")) {\n throw new AutoVersionError(`Unable to determine auto version using git-describe as no matching tags were found.`, `You can create a tag matching the configured tag prefix and try again or supply a --version option to set the version manually`);\n }\n }\n throw new AutoVersionError(`Unable to determine auto version using git-describe: ${error}.`, `You can supply a --version option to set the version manually`);\n }\n return gitVersion;\n}\nfunction validateVersion(version) {\n if (valid(version) == null) {\n throw new AutoVersionError(`The version string ${version} is not SemVer compliant.`);\n }\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nexport const execAsync = promisify(exec);","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { autoVersion, AutoVersionError } from \"./autoVersion.js\";\nexport { loadFoundryConfig } from \"./config.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { promises as fsPromises } from \"node:fs\";\nimport { extname } from \"node:path\";\nconst CONFIG_FILE_NAMES = [\"foundry.config.json\"];\nconst FOUNDRY_SITE_CONFIG_SCHEMA = {\n type: \"object\",\n properties: {\n foundryUrl: {\n type: \"string\"\n },\n site: {\n type: \"object\",\n properties: {\n application: {\n type: \"string\"\n },\n directory: {\n type: \"string\"\n },\n autoVersion: {\n type: \"object\",\n nullable: true,\n oneOf: [{\n properties: {\n type: {\n const: \"git-describe\",\n type: \"string\"\n },\n tagPrefix: {\n type: \"string\",\n nullable: true\n }\n }\n }, {\n properties: {\n type: {\n const: \"package-json\",\n type: \"string\"\n }\n }\n }],\n required: [\"type\"]\n },\n uploadOnly: {\n type: \"boolean\",\n nullable: true\n }\n },\n required: [\"application\", \"directory\"]\n }\n },\n required: [\"foundryUrl\", \"site\"],\n additionalProperties: false\n};\nconst FOUNDRY_WIDGET_SET_CONFIG_SCHEMA = {\n type: \"object\",\n properties: {\n foundryUrl: {\n type: \"string\"\n },\n widgetSet: {\n type: \"object\",\n properties: {\n rid: {\n type: \"string\"\n },\n directory: {\n type: \"string\"\n },\n repository: {\n type: \"string\",\n nullable: true\n },\n autoVersion: FOUNDRY_SITE_CONFIG_SCHEMA.properties.site.properties.autoVersion,\n uploadOnly: {\n type: \"boolean\",\n nullable: true\n }\n },\n required: [\"rid\", \"directory\"]\n }\n },\n required: [\"foundryUrl\", \"widgetSet\"],\n additionalProperties: false\n};\nconst FOUNDRY_CONFIG_SCHEMA = {\n site: FOUNDRY_SITE_CONFIG_SCHEMA,\n widgetSet: FOUNDRY_WIDGET_SET_CONFIG_SCHEMA\n};\n\n/**\n * Asynchronously loads a configuration file. Looks for any of the CONFIG_FILE_NAMES in the current directory going up to the root directory.\n * @returns A promise that resolves to the configuration JSON object, or undefined if not found.\n * @throws Will throw an error if the configuration file is found but cannot be read or parsed.\n */\n\nexport async function loadFoundryConfig(type) {\n const ajvModule = await import(\"ajv\");\n const Ajv = ajvModule.default.default; // https://github.com/ajv-validator/ajv/issues/2132\n const ajv = new Ajv({\n allErrors: true\n });\n const validate = ajv.compile(FOUNDRY_CONFIG_SCHEMA[type]);\n const {\n findUp\n } = await import(\"find-up\");\n const configFilePath = await findUp(CONFIG_FILE_NAMES);\n if (configFilePath) {\n let foundryConfig;\n try {\n const fileContent = await fsPromises.readFile(configFilePath, \"utf-8\");\n foundryConfig = parseConfigFile(fileContent, configFilePath);\n } catch (error) {\n throw new Error(`Couldn't read or parse config file ${configFilePath}. Error: ${error}`);\n }\n if (!validate(foundryConfig)) {\n throw new Error(`The configuration file ${configFilePath} does not match the expected schema: ${ajv.errorsText(validate.errors)}`);\n }\n return {\n foundryConfig,\n configFilePath\n };\n }\n return undefined;\n}\nfunction parseConfigFile(fileContent, configFilePath) {\n const extension = extname(configFilePath);\n switch (extension) {\n case \".json\":\n return JSON.parse(fileContent);\n default:\n throw new Error(`Unsupported file extension: ${extension} for config file.`);\n }\n}"]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-UN2YTB6E.js';
|
|
2
|
-
import { consola } from 'consola';
|
|
3
|
-
import { colorize } from 'consola/utils';
|
|
4
|
-
import yargs from 'yargs';
|
|
5
|
-
import { hideBin } from 'yargs/helpers';
|
|
6
|
-
import { valid } from 'semver';
|
|
7
|
-
|
|
8
|
-
// ../cli.common/build/esm/ExitProcessError.js
|
|
9
|
-
init_esm_shims();
|
|
10
|
-
var ExitProcessError = class extends Error {
|
|
11
|
-
constructor(errorCode, msg, tip, originalError) {
|
|
12
|
-
super(msg);
|
|
13
|
-
this.errorCode = errorCode;
|
|
14
|
-
this.msg = msg;
|
|
15
|
-
this.tip = tip;
|
|
16
|
-
this.originalError = originalError;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// ../cli.common/build/esm/YargsCheckError.js
|
|
21
|
-
init_esm_shims();
|
|
22
|
-
var YargsCheckError = class extends Error {
|
|
23
|
-
constructor(msg) {
|
|
24
|
-
super(msg);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
// ../cli.common/build/esm/index.js
|
|
29
|
-
init_esm_shims();
|
|
30
|
-
|
|
31
|
-
// ../cli.common/build/esm/getYargsBase.js
|
|
32
|
-
init_esm_shims();
|
|
33
|
-
|
|
34
|
-
// ../cli.common/build/esm/yargs/logLevelMiddleware.js
|
|
35
|
-
init_esm_shims();
|
|
36
|
-
var firstTime = true;
|
|
37
|
-
async function logLevelMiddleware(args) {
|
|
38
|
-
if (firstTime) {
|
|
39
|
-
firstTime = false;
|
|
40
|
-
consola.level = 3 + args.verbose;
|
|
41
|
-
if (consola.level > 3) {
|
|
42
|
-
consola.debug(`Verbose logging enabled (${consola.level === 4 ? "debug" : "trace"})
|
|
43
|
-
`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// ../cli.common/build/esm/getYargsBase.js
|
|
49
|
-
function getYargsBase(args) {
|
|
50
|
-
return yargs(hideBin(args)).wrap(Math.min(150, yargs().terminalWidth())).env("OSDK").version(false).option("verbose", {
|
|
51
|
-
alias: "v",
|
|
52
|
-
type: "boolean",
|
|
53
|
-
description: "Enable verbose logging",
|
|
54
|
-
count: true
|
|
55
|
-
}).demandCommand().middleware(logLevelMiddleware, true).strict().fail(async (msg, err, argv) => {
|
|
56
|
-
if (err instanceof ExitProcessError) {
|
|
57
|
-
consola.error(err.message);
|
|
58
|
-
if (err.tip != null) {
|
|
59
|
-
consola.log(colorize("bold", `\u{1F4A1} Tip: ${err.tip}`));
|
|
60
|
-
consola.log("");
|
|
61
|
-
}
|
|
62
|
-
consola.debug(err.stack);
|
|
63
|
-
} else {
|
|
64
|
-
if (err && !(err instanceof YargsCheckError)) {
|
|
65
|
-
throw err;
|
|
66
|
-
} else {
|
|
67
|
-
argv.showHelp();
|
|
68
|
-
consola.log("");
|
|
69
|
-
consola.error(msg);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
process.exit(1);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// ../cli.common/build/esm/util/isValidSemver.js
|
|
77
|
-
init_esm_shims();
|
|
78
|
-
function isValidSemver(semverString) {
|
|
79
|
-
return valid(semverString) != null;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export { ExitProcessError, YargsCheckError, getYargsBase, isValidSemver };
|
|
83
|
-
//# sourceMappingURL=chunk-OBNIOZZ3.js.map
|
|
84
|
-
//# sourceMappingURL=chunk-OBNIOZZ3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../cli.common/build/esm/ExitProcessError.js","../../../cli.common/build/esm/YargsCheckError.js","../../../cli.common/build/esm/index.js","../../../cli.common/build/esm/getYargsBase.js","../../../cli.common/build/esm/yargs/logLevelMiddleware.js","../../../cli.common/build/esm/util/isValidSemver.js"],"names":["consola"],"mappings":";;;;;;;;AAAA,cAAA,EAAA;AAgBa,IAAA,gBAAA,GAAN,cAA+B,KAAM,CAAA;AAAA,EAC1C,WAAY,CAAA,SAAA,EAAW,GAAK,EAAA,GAAA,EAAK,aAAe,EAAA;AAC9C,IAAA,KAAA,CAAM,GAAG,CAAA;AACT,IAAA,IAAA,CAAK,SAAY,GAAA,SAAA;AACjB,IAAA,IAAA,CAAK,GAAM,GAAA,GAAA;AACX,IAAA,IAAA,CAAK,GAAM,GAAA,GAAA;AACX,IAAA,IAAA,CAAK,aAAgB,GAAA,aAAA;AAAA;AAEzB;;;ACxBA,cAAA,EAAA;AAgBa,IAAA,eAAA,GAAN,cAA8B,KAAM,CAAA;AAAA,EACzC,YAAY,GAAK,EAAA;AACf,IAAA,KAAA,CAAM,GAAG,CAAA;AAAA;AAEb;;;ACpBA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAiBA,IAAI,SAAY,GAAA,IAAA;AAChB,eAAsB,mBAAmB,IAAM,EAAA;AAC7C,EAAA,IAAI,SAAW,EAAA;AACb,IAAY,SAAA,GAAA,KAAA;AACZ,IAAQ,OAAA,CAAA,KAAA,GAAQ,IAAI,IAAK,CAAA,OAAA;AACzB,IAAI,IAAA,OAAA,CAAQ,QAAQ,CAAG,EAAA;AACrB,MAAA,OAAA,CAAQ,MAAM,CAA4B,yBAAA,EAAA,OAAA,CAAQ,KAAU,KAAA,CAAA,GAAI,UAAU,OAAO,CAAA;AAAA,CAAK,CAAA;AAAA;AACxF;AAEJ;;;ADHO,SAAS,aAAa,I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EAAA;AAC1C,EAAO,OAAA,KAAA,CAAM,YAAY,CAAK,IAAA,IAAA;AAChC","file":"chunk-OBNIOZZ3.js","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class ExitProcessError extends Error {\n constructor(errorCode, msg, tip, originalError) {\n super(msg);\n this.errorCode = errorCode;\n this.msg = msg;\n this.tip = tip;\n this.originalError = originalError;\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class YargsCheckError extends Error {\n constructor(msg) {\n super(msg);\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { ExitProcessError } from \"./ExitProcessError.js\";\nexport { getYargsBase } from \"./getYargsBase.js\";\nexport { isValidSemver } from \"./util/isValidSemver.js\";\nexport { YargsCheckError } from \"./YargsCheckError.js\";","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nimport { logLevelMiddleware } from \"./yargs/logLevelMiddleware.js\";\nimport { YargsCheckError } from \"./YargsCheckError.js\";\nexport function getYargsBase(args) {\n return yargs(hideBin(args)).wrap(Math.min(150, yargs().terminalWidth())).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logLevelMiddleware, true).strict().fail(async (msg, err, argv) => {\n if (err instanceof ExitProcessError) {\n consola.error(err.message);\n if (err.tip != null) {\n consola.log(colorize(\"bold\", `💡 Tip: ${err.tip}`));\n consola.log(\"\");\n }\n consola.debug(err.stack);\n } else {\n if (err && !(err instanceof YargsCheckError)) {\n throw err;\n } else {\n argv.showHelp();\n consola.log(\"\");\n consola.error(msg);\n }\n }\n process.exit(1);\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nlet firstTime = true;\nexport async function logLevelMiddleware(args) {\n if (firstTime) {\n firstTime = false;\n consola.level = 3 + args.verbose; // so 1 -v is debug logs and -vv is trace\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})\\n`);\n }\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { valid } from \"semver\";\nexport function isValidSemver(semverString) {\n return valid(semverString) != null;\n}"]}
|