@osdk/create-app 0.19.0-beta.6 → 0.19.0
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 +14 -0
- package/build/browser/esm-AQEYRLX5.js +383 -0
- package/build/browser/esm-AQEYRLX5.js.map +1 -0
- package/build/browser/esm-FVYIHZAJ.js +375 -0
- package/build/browser/esm-FVYIHZAJ.js.map +1 -0
- package/build/browser/esm-NCHOZ6BO.js +1176 -0
- package/build/browser/esm-NCHOZ6BO.js.map +1 -0
- package/build/browser/esm-NPLFBOV7.js +908 -0
- package/build/browser/esm-NPLFBOV7.js.map +1 -0
- package/build/browser/esm-SNM7M67J.js +253 -0
- package/build/browser/esm-SNM7M67J.js.map +1 -0
- package/build/browser/esm-UJCFN4M3.js +456 -0
- package/build/browser/esm-UJCFN4M3.js.map +1 -0
- package/build/browser/index.js +540 -18
- package/build/browser/index.js.map +1 -1
- package/build/esm/esm-AQEYRLX5.js +383 -0
- package/build/esm/esm-AQEYRLX5.js.map +1 -0
- package/build/esm/esm-FVYIHZAJ.js +375 -0
- package/build/esm/esm-FVYIHZAJ.js.map +1 -0
- package/build/esm/esm-NCHOZ6BO.js +1176 -0
- package/build/esm/esm-NCHOZ6BO.js.map +1 -0
- package/build/esm/esm-NPLFBOV7.js +908 -0
- package/build/esm/esm-NPLFBOV7.js.map +1 -0
- package/build/esm/esm-SNM7M67J.js +253 -0
- package/build/esm/esm-SNM7M67J.js.map +1 -0
- package/build/esm/esm-UJCFN4M3.js +456 -0
- package/build/esm/esm-UJCFN4M3.js.map +1 -0
- package/build/esm/index.js +540 -18
- package/build/esm/index.js.map +1 -1
- package/package.json +8 -8
- package/build/browser/cli.d.ts +0 -2
- package/build/browser/cli.d.ts.map +0 -1
- package/build/browser/cli.js +0 -95
- package/build/browser/cli.js.map +0 -1
- package/build/browser/cli.test.d.ts +0 -2
- package/build/browser/cli.test.d.ts.map +0 -1
- package/build/browser/cli.test.js +0 -59
- package/build/browser/cli.test.js.map +0 -1
- package/build/browser/consola.d.ts +0 -3
- package/build/browser/consola.d.ts.map +0 -1
- package/build/browser/consola.js +0 -28
- package/build/browser/consola.js.map +0 -1
- package/build/browser/generate/generateEnv.d.ts +0 -13
- package/build/browser/generate/generateEnv.d.ts.map +0 -1
- package/build/browser/generate/generateEnv.js +0 -50
- package/build/browser/generate/generateEnv.js.map +0 -1
- package/build/browser/generate/generateEnv.test.d.ts +0 -2
- package/build/browser/generate/generateEnv.test.d.ts.map +0 -1
- package/build/browser/generate/generateEnv.test.js +0 -70
- package/build/browser/generate/generateEnv.test.js.map +0 -1
- package/build/browser/generate/generateFoundryConfigJson.d.ts +0 -6
- package/build/browser/generate/generateFoundryConfigJson.d.ts.map +0 -1
- package/build/browser/generate/generateFoundryConfigJson.js +0 -33
- package/build/browser/generate/generateFoundryConfigJson.js.map +0 -1
- package/build/browser/generate/generateFoundryConfigJson.test.d.ts +0 -2
- package/build/browser/generate/generateFoundryConfigJson.test.d.ts.map +0 -1
- package/build/browser/generate/generateFoundryConfigJson.test.js +0 -38
- package/build/browser/generate/generateFoundryConfigJson.test.js.map +0 -1
- package/build/browser/generate/generateNpmRc.d.ts +0 -5
- package/build/browser/generate/generateNpmRc.d.ts.map +0 -1
- package/build/browser/generate/generateNpmRc.js +0 -27
- package/build/browser/generate/generateNpmRc.js.map +0 -1
- package/build/browser/generate/generateNpmRc.test.d.ts +0 -2
- package/build/browser/generate/generateNpmRc.test.d.ts.map +0 -1
- package/build/browser/generate/generateNpmRc.test.js +0 -28
- package/build/browser/generate/generateNpmRc.test.js.map +0 -1
- package/build/browser/highlight.d.ts +0 -3
- package/build/browser/highlight.d.ts.map +0 -1
- package/build/browser/highlight.js +0 -23
- package/build/browser/highlight.js.map +0 -1
- package/build/browser/index.d.ts +0 -5
- package/build/browser/index.d.ts.map +0 -1
- package/build/browser/prompts/promptApplicationRid.d.ts +0 -4
- package/build/browser/prompts/promptApplicationRid.d.ts.map +0 -1
- package/build/browser/prompts/promptApplicationRid.js +0 -31
- package/build/browser/prompts/promptApplicationRid.js.map +0 -1
- package/build/browser/prompts/promptApplicationRid.test.d.ts +0 -2
- package/build/browser/prompts/promptApplicationRid.test.d.ts.map +0 -1
- package/build/browser/prompts/promptApplicationRid.test.js +0 -48
- package/build/browser/prompts/promptApplicationRid.test.js.map +0 -1
- package/build/browser/prompts/promptApplicationUrl.d.ts +0 -5
- package/build/browser/prompts/promptApplicationUrl.d.ts.map +0 -1
- package/build/browser/prompts/promptApplicationUrl.js +0 -50
- package/build/browser/prompts/promptApplicationUrl.js.map +0 -1
- package/build/browser/prompts/promptApplicationUrl.test.d.ts +0 -2
- package/build/browser/prompts/promptApplicationUrl.test.d.ts.map +0 -1
- package/build/browser/prompts/promptApplicationUrl.test.js +0 -68
- package/build/browser/prompts/promptApplicationUrl.test.js.map +0 -1
- package/build/browser/prompts/promptClientId.d.ts +0 -4
- package/build/browser/prompts/promptClientId.d.ts.map +0 -1
- package/build/browser/prompts/promptClientId.js +0 -31
- package/build/browser/prompts/promptClientId.js.map +0 -1
- package/build/browser/prompts/promptClientId.test.d.ts +0 -2
- package/build/browser/prompts/promptClientId.test.d.ts.map +0 -1
- package/build/browser/prompts/promptClientId.test.js +0 -47
- package/build/browser/prompts/promptClientId.test.js.map +0 -1
- package/build/browser/prompts/promptCorsProxy.d.ts +0 -4
- package/build/browser/prompts/promptCorsProxy.d.ts.map +0 -1
- package/build/browser/prompts/promptCorsProxy.js +0 -29
- package/build/browser/prompts/promptCorsProxy.js.map +0 -1
- package/build/browser/prompts/promptCorsProxy.test.d.ts +0 -2
- package/build/browser/prompts/promptCorsProxy.test.d.ts.map +0 -1
- package/build/browser/prompts/promptCorsProxy.test.js +0 -44
- package/build/browser/prompts/promptCorsProxy.test.js.map +0 -1
- package/build/browser/prompts/promptFoundryUrl.d.ts +0 -4
- package/build/browser/prompts/promptFoundryUrl.d.ts.map +0 -1
- package/build/browser/prompts/promptFoundryUrl.js +0 -31
- package/build/browser/prompts/promptFoundryUrl.js.map +0 -1
- package/build/browser/prompts/promptFoundryUrl.test.d.ts +0 -2
- package/build/browser/prompts/promptFoundryUrl.test.d.ts.map +0 -1
- package/build/browser/prompts/promptFoundryUrl.test.js +0 -55
- package/build/browser/prompts/promptFoundryUrl.test.js.map +0 -1
- package/build/browser/prompts/promptOsdkPackage.d.ts +0 -4
- package/build/browser/prompts/promptOsdkPackage.d.ts.map +0 -1
- package/build/browser/prompts/promptOsdkPackage.js +0 -31
- package/build/browser/prompts/promptOsdkPackage.js.map +0 -1
- package/build/browser/prompts/promptOsdkPackage.test.d.ts +0 -2
- package/build/browser/prompts/promptOsdkPackage.test.d.ts.map +0 -1
- package/build/browser/prompts/promptOsdkPackage.test.js +0 -48
- package/build/browser/prompts/promptOsdkPackage.test.js.map +0 -1
- package/build/browser/prompts/promptOsdkRegistryUrl.d.ts +0 -4
- package/build/browser/prompts/promptOsdkRegistryUrl.d.ts.map +0 -1
- package/build/browser/prompts/promptOsdkRegistryUrl.js +0 -31
- package/build/browser/prompts/promptOsdkRegistryUrl.js.map +0 -1
- package/build/browser/prompts/promptOsdkRegistryUrl.test.d.ts +0 -2
- package/build/browser/prompts/promptOsdkRegistryUrl.test.d.ts.map +0 -1
- package/build/browser/prompts/promptOsdkRegistryUrl.test.js +0 -54
- package/build/browser/prompts/promptOsdkRegistryUrl.test.js.map +0 -1
- package/build/browser/prompts/promptOverwrite.d.ts +0 -5
- package/build/browser/prompts/promptOverwrite.d.ts.map +0 -1
- package/build/browser/prompts/promptOverwrite.js +0 -53
- package/build/browser/prompts/promptOverwrite.js.map +0 -1
- package/build/browser/prompts/promptOverwrite.test.d.ts +0 -2
- package/build/browser/prompts/promptOverwrite.test.d.ts.map +0 -1
- package/build/browser/prompts/promptOverwrite.test.js +0 -55
- package/build/browser/prompts/promptOverwrite.test.js.map +0 -1
- package/build/browser/prompts/promptProject.d.ts +0 -4
- package/build/browser/prompts/promptProject.d.ts.map +0 -1
- package/build/browser/prompts/promptProject.js +0 -32
- package/build/browser/prompts/promptProject.js.map +0 -1
- package/build/browser/prompts/promptProject.test.d.ts +0 -2
- package/build/browser/prompts/promptProject.test.d.ts.map +0 -1
- package/build/browser/prompts/promptProject.test.js +0 -47
- package/build/browser/prompts/promptProject.test.js.map +0 -1
- package/build/browser/prompts/promptTemplate.d.ts +0 -6
- package/build/browser/prompts/promptTemplate.d.ts.map +0 -1
- package/build/browser/prompts/promptTemplate.js +0 -45
- package/build/browser/prompts/promptTemplate.js.map +0 -1
- package/build/browser/prompts/promptTemplate.test.d.ts +0 -2
- package/build/browser/prompts/promptTemplate.test.d.ts.map +0 -1
- package/build/browser/prompts/promptTemplate.test.js +0 -48
- package/build/browser/prompts/promptTemplate.test.js.map +0 -1
- package/build/browser/run.d.ts +0 -16
- package/build/browser/run.d.ts.map +0 -1
- package/build/browser/run.js +0 -132
- package/build/browser/run.js.map +0 -1
- package/build/browser/templates.d.ts +0 -23
- package/build/browser/templates.d.ts.map +0 -1
- package/build/browser/templates.js +0 -56
- package/build/browser/templates.js.map +0 -1
- package/build/esm/cli.js +0 -95
- package/build/esm/cli.js.map +0 -1
- package/build/esm/cli.test.js +0 -59
- package/build/esm/cli.test.js.map +0 -1
- package/build/esm/consola.js +0 -28
- package/build/esm/consola.js.map +0 -1
- package/build/esm/generate/generateEnv.js +0 -50
- package/build/esm/generate/generateEnv.js.map +0 -1
- package/build/esm/generate/generateEnv.test.js +0 -70
- package/build/esm/generate/generateEnv.test.js.map +0 -1
- package/build/esm/generate/generateFoundryConfigJson.js +0 -33
- package/build/esm/generate/generateFoundryConfigJson.js.map +0 -1
- package/build/esm/generate/generateFoundryConfigJson.test.js +0 -38
- package/build/esm/generate/generateFoundryConfigJson.test.js.map +0 -1
- package/build/esm/generate/generateNpmRc.js +0 -27
- package/build/esm/generate/generateNpmRc.js.map +0 -1
- package/build/esm/generate/generateNpmRc.test.js +0 -28
- package/build/esm/generate/generateNpmRc.test.js.map +0 -1
- package/build/esm/highlight.js +0 -23
- package/build/esm/highlight.js.map +0 -1
- package/build/esm/prompts/promptApplicationRid.js +0 -31
- package/build/esm/prompts/promptApplicationRid.js.map +0 -1
- package/build/esm/prompts/promptApplicationRid.test.js +0 -48
- package/build/esm/prompts/promptApplicationRid.test.js.map +0 -1
- package/build/esm/prompts/promptApplicationUrl.js +0 -50
- package/build/esm/prompts/promptApplicationUrl.js.map +0 -1
- package/build/esm/prompts/promptApplicationUrl.test.js +0 -68
- package/build/esm/prompts/promptApplicationUrl.test.js.map +0 -1
- package/build/esm/prompts/promptClientId.js +0 -31
- package/build/esm/prompts/promptClientId.js.map +0 -1
- package/build/esm/prompts/promptClientId.test.js +0 -47
- package/build/esm/prompts/promptClientId.test.js.map +0 -1
- package/build/esm/prompts/promptCorsProxy.js +0 -29
- package/build/esm/prompts/promptCorsProxy.js.map +0 -1
- package/build/esm/prompts/promptCorsProxy.test.js +0 -44
- package/build/esm/prompts/promptCorsProxy.test.js.map +0 -1
- package/build/esm/prompts/promptFoundryUrl.js +0 -31
- package/build/esm/prompts/promptFoundryUrl.js.map +0 -1
- package/build/esm/prompts/promptFoundryUrl.test.js +0 -55
- package/build/esm/prompts/promptFoundryUrl.test.js.map +0 -1
- package/build/esm/prompts/promptOsdkPackage.js +0 -31
- package/build/esm/prompts/promptOsdkPackage.js.map +0 -1
- package/build/esm/prompts/promptOsdkPackage.test.js +0 -48
- package/build/esm/prompts/promptOsdkPackage.test.js.map +0 -1
- package/build/esm/prompts/promptOsdkRegistryUrl.js +0 -31
- package/build/esm/prompts/promptOsdkRegistryUrl.js.map +0 -1
- package/build/esm/prompts/promptOsdkRegistryUrl.test.js +0 -54
- package/build/esm/prompts/promptOsdkRegistryUrl.test.js.map +0 -1
- package/build/esm/prompts/promptOverwrite.js +0 -53
- package/build/esm/prompts/promptOverwrite.js.map +0 -1
- package/build/esm/prompts/promptOverwrite.test.js +0 -55
- package/build/esm/prompts/promptOverwrite.test.js.map +0 -1
- package/build/esm/prompts/promptProject.js +0 -32
- package/build/esm/prompts/promptProject.js.map +0 -1
- package/build/esm/prompts/promptProject.test.js +0 -47
- package/build/esm/prompts/promptProject.test.js.map +0 -1
- package/build/esm/prompts/promptTemplate.js +0 -45
- package/build/esm/prompts/promptTemplate.js.map +0 -1
- package/build/esm/prompts/promptTemplate.test.js +0 -48
- package/build/esm/prompts/promptTemplate.test.js.map +0 -1
- package/build/esm/run.js +0 -132
- package/build/esm/run.js.map +0 -1
- package/build/esm/templates.js +0 -56
- package/build/esm/templates.js.map +0 -1
package/build/esm/consola.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { consola as defaultConsola, createConsola } from "consola";
|
|
17
|
-
export const consola = createConsola({
|
|
18
|
-
// https://github.com/unjs/consola/issues/251
|
|
19
|
-
async prompt(...params) {
|
|
20
|
-
const response = await defaultConsola.prompt(...params);
|
|
21
|
-
if (typeof response === "symbol" && response.toString() === "Symbol(clack:cancel)") {
|
|
22
|
-
defaultConsola.fail("Operation cancelled");
|
|
23
|
-
process.exit(0);
|
|
24
|
-
}
|
|
25
|
-
return response;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=consola.js.map
|
package/build/esm/consola.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consola.js","names":["consola","defaultConsola","createConsola","prompt","params","response","toString","fail","process","exit"],"sources":["consola.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 */\nimport { consola as defaultConsola, createConsola } from \"consola\";\nexport const consola = createConsola({\n // https://github.com/unjs/consola/issues/251\n async prompt(...params) {\n const response = (await defaultConsola.prompt(...params));\n if (typeof response === \"symbol\"\n && response.toString() === \"Symbol(clack:cancel)\") {\n defaultConsola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n return response;\n },\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,IAAIC,cAAc,EAAEC,aAAa,QAAQ,SAAS;AAClE,OAAO,MAAMF,OAAO,GAAGE,aAAa,CAAC;EACjC;EACA,MAAMC,MAAMA,CAAC,GAAGC,MAAM,EAAE;IACpB,MAAMC,QAAQ,GAAI,MAAMJ,cAAc,CAACE,MAAM,CAAC,GAAGC,MAAM,CAAE;IACzD,IAAI,OAAOC,QAAQ,KAAK,QAAQ,IACzBA,QAAQ,CAACC,QAAQ,CAAC,CAAC,KAAK,sBAAsB,EAAE;MACnDL,cAAc,CAACM,IAAI,CAAC,qBAAqB,CAAC;MAC1CC,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;IACnB;IACA,OAAOJ,QAAQ;EACnB;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export function generateEnvDevelopment({
|
|
17
|
-
envPrefix,
|
|
18
|
-
foundryUrl,
|
|
19
|
-
clientId,
|
|
20
|
-
corsProxy
|
|
21
|
-
}) {
|
|
22
|
-
return generateEnv({
|
|
23
|
-
envPrefix,
|
|
24
|
-
foundryUrl: corsProxy ? "http://localhost:8080" : foundryUrl,
|
|
25
|
-
applicationUrl: "http://localhost:8080",
|
|
26
|
-
clientId
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export function generateEnvProduction({
|
|
30
|
-
envPrefix,
|
|
31
|
-
foundryUrl,
|
|
32
|
-
applicationUrl,
|
|
33
|
-
clientId
|
|
34
|
-
}) {
|
|
35
|
-
return generateEnv({
|
|
36
|
-
envPrefix,
|
|
37
|
-
foundryUrl,
|
|
38
|
-
applicationUrl,
|
|
39
|
-
clientId
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function generateEnv({
|
|
43
|
-
envPrefix,
|
|
44
|
-
foundryUrl,
|
|
45
|
-
applicationUrl,
|
|
46
|
-
clientId
|
|
47
|
-
}) {
|
|
48
|
-
return `${envPrefix}FOUNDRY_API_URL=${foundryUrl}\n` + `${applicationUrl == null ? "# " : ""}${envPrefix}FOUNDRY_REDIRECT_URL=${applicationUrl ?? "<Fill in the domain at which you deploy your application>"}/auth/callback\n` + `${envPrefix}FOUNDRY_CLIENT_ID=${clientId}\n`;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=generateEnv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateEnv.js","names":["generateEnvDevelopment","envPrefix","foundryUrl","clientId","corsProxy","generateEnv","applicationUrl","generateEnvProduction"],"sources":["generateEnv.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 */\nexport function generateEnvDevelopment({ envPrefix, foundryUrl, clientId, corsProxy, }) {\n return generateEnv({\n envPrefix,\n foundryUrl: corsProxy ? \"http://localhost:8080\" : foundryUrl,\n applicationUrl: \"http://localhost:8080\",\n clientId,\n });\n}\nexport function generateEnvProduction({ envPrefix, foundryUrl, applicationUrl, clientId, }) {\n return generateEnv({\n envPrefix,\n foundryUrl,\n applicationUrl,\n clientId,\n });\n}\nfunction generateEnv({ envPrefix, foundryUrl, applicationUrl, clientId, }) {\n return `${envPrefix}FOUNDRY_API_URL=${foundryUrl}\\n`\n + `${applicationUrl == null ? \"# \" : \"\"}${envPrefix}FOUNDRY_REDIRECT_URL=${applicationUrl\n ?? \"<Fill in the domain at which you deploy your application>\"}/auth/callback\\n`\n + `${envPrefix}FOUNDRY_CLIENT_ID=${clientId}\\n`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,sBAAsBA,CAAC;EAAEC,SAAS;EAAEC,UAAU;EAAEC,QAAQ;EAAEC;AAAW,CAAC,EAAE;EACpF,OAAOC,WAAW,CAAC;IACfJ,SAAS;IACTC,UAAU,EAAEE,SAAS,GAAG,uBAAuB,GAAGF,UAAU;IAC5DI,cAAc,EAAE,uBAAuB;IACvCH;EACJ,CAAC,CAAC;AACN;AACA,OAAO,SAASI,qBAAqBA,CAAC;EAAEN,SAAS;EAAEC,UAAU;EAAEI,cAAc;EAAEH;AAAU,CAAC,EAAE;EACxF,OAAOE,WAAW,CAAC;IACfJ,SAAS;IACTC,UAAU;IACVI,cAAc;IACdH;EACJ,CAAC,CAAC;AACN;AACA,SAASE,WAAWA,CAAC;EAAEJ,SAAS;EAAEC,UAAU;EAAEI,cAAc;EAAEH;AAAU,CAAC,EAAE;EACvE,OAAO,GAAGF,SAAS,mBAAmBC,UAAU,IAAI,GAC9C,GAAGI,cAAc,IAAI,IAAI,GAAG,IAAI,GAAG,EAAE,GAAGL,SAAS,wBAAwBK,cAAc,IAClF,2DAA2D,kBAAkB,GAClF,GAAGL,SAAS,qBAAqBE,QAAQ,IAAI;AACvD","ignoreList":[]}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { expect, test } from "vitest";
|
|
17
|
-
import { generateEnvDevelopment, generateEnvProduction } from "./generateEnv.js";
|
|
18
|
-
const expectedEnvDevelopment = `
|
|
19
|
-
PUBLIC_FOUNDRY_API_URL=https://example.palantirfoundry.com
|
|
20
|
-
PUBLIC_FOUNDRY_REDIRECT_URL=http://localhost:8080/auth/callback
|
|
21
|
-
PUBLIC_FOUNDRY_CLIENT_ID=123
|
|
22
|
-
`.trimStart();
|
|
23
|
-
const expectedEnvDevelopmentCorsProxy = `
|
|
24
|
-
PUBLIC_FOUNDRY_API_URL=http://localhost:8080
|
|
25
|
-
PUBLIC_FOUNDRY_REDIRECT_URL=http://localhost:8080/auth/callback
|
|
26
|
-
PUBLIC_FOUNDRY_CLIENT_ID=123
|
|
27
|
-
`.trimStart();
|
|
28
|
-
const expectedEnvProduction = `
|
|
29
|
-
PUBLIC_FOUNDRY_API_URL=https://example.palantirfoundry.com
|
|
30
|
-
PUBLIC_FOUNDRY_REDIRECT_URL=https://app.com/auth/callback
|
|
31
|
-
PUBLIC_FOUNDRY_CLIENT_ID=123
|
|
32
|
-
`.trimStart();
|
|
33
|
-
const expectedEnvProductionNoAppUrl = `
|
|
34
|
-
PUBLIC_FOUNDRY_API_URL=https://example.palantirfoundry.com
|
|
35
|
-
# PUBLIC_FOUNDRY_REDIRECT_URL=<Fill in the domain at which you deploy your application>/auth/callback
|
|
36
|
-
PUBLIC_FOUNDRY_CLIENT_ID=123
|
|
37
|
-
`.trimStart();
|
|
38
|
-
test("it generates .env.development", () => {
|
|
39
|
-
expect(generateEnvDevelopment({
|
|
40
|
-
envPrefix: "PUBLIC_",
|
|
41
|
-
foundryUrl: "https://example.palantirfoundry.com",
|
|
42
|
-
clientId: "123",
|
|
43
|
-
corsProxy: false
|
|
44
|
-
})).toEqual(expectedEnvDevelopment);
|
|
45
|
-
});
|
|
46
|
-
test("it generates .env.development assuming CORS proxy", () => {
|
|
47
|
-
expect(generateEnvDevelopment({
|
|
48
|
-
envPrefix: "PUBLIC_",
|
|
49
|
-
foundryUrl: "https://example.palantirfoundry.com",
|
|
50
|
-
clientId: "123",
|
|
51
|
-
corsProxy: true
|
|
52
|
-
})).toEqual(expectedEnvDevelopmentCorsProxy);
|
|
53
|
-
});
|
|
54
|
-
test("it generates .env.production", () => {
|
|
55
|
-
expect(generateEnvProduction({
|
|
56
|
-
envPrefix: "PUBLIC_",
|
|
57
|
-
foundryUrl: "https://example.palantirfoundry.com",
|
|
58
|
-
applicationUrl: "https://app.com",
|
|
59
|
-
clientId: "123"
|
|
60
|
-
})).toEqual(expectedEnvProduction);
|
|
61
|
-
});
|
|
62
|
-
test("it generates .env.production without app url", () => {
|
|
63
|
-
expect(generateEnvProduction({
|
|
64
|
-
envPrefix: "PUBLIC_",
|
|
65
|
-
foundryUrl: "https://example.palantirfoundry.com",
|
|
66
|
-
applicationUrl: undefined,
|
|
67
|
-
clientId: "123"
|
|
68
|
-
})).toEqual(expectedEnvProductionNoAppUrl);
|
|
69
|
-
});
|
|
70
|
-
//# sourceMappingURL=generateEnv.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateEnv.test.js","names":["expect","test","generateEnvDevelopment","generateEnvProduction","expectedEnvDevelopment","trimStart","expectedEnvDevelopmentCorsProxy","expectedEnvProduction","expectedEnvProductionNoAppUrl","envPrefix","foundryUrl","clientId","corsProxy","toEqual","applicationUrl","undefined"],"sources":["generateEnv.test.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 */\nimport { expect, test } from \"vitest\";\nimport { generateEnvDevelopment, generateEnvProduction, } from \"./generateEnv.js\";\nconst expectedEnvDevelopment = `\nPUBLIC_FOUNDRY_API_URL=https://example.palantirfoundry.com\nPUBLIC_FOUNDRY_REDIRECT_URL=http://localhost:8080/auth/callback\nPUBLIC_FOUNDRY_CLIENT_ID=123\n`.trimStart();\nconst expectedEnvDevelopmentCorsProxy = `\nPUBLIC_FOUNDRY_API_URL=http://localhost:8080\nPUBLIC_FOUNDRY_REDIRECT_URL=http://localhost:8080/auth/callback\nPUBLIC_FOUNDRY_CLIENT_ID=123\n`.trimStart();\nconst expectedEnvProduction = `\nPUBLIC_FOUNDRY_API_URL=https://example.palantirfoundry.com\nPUBLIC_FOUNDRY_REDIRECT_URL=https://app.com/auth/callback\nPUBLIC_FOUNDRY_CLIENT_ID=123\n`.trimStart();\nconst expectedEnvProductionNoAppUrl = `\nPUBLIC_FOUNDRY_API_URL=https://example.palantirfoundry.com\n# PUBLIC_FOUNDRY_REDIRECT_URL=<Fill in the domain at which you deploy your application>/auth/callback\nPUBLIC_FOUNDRY_CLIENT_ID=123\n`.trimStart();\ntest(\"it generates .env.development\", () => {\n expect(generateEnvDevelopment({\n envPrefix: \"PUBLIC_\",\n foundryUrl: \"https://example.palantirfoundry.com\",\n clientId: \"123\",\n corsProxy: false,\n })).toEqual(expectedEnvDevelopment);\n});\ntest(\"it generates .env.development assuming CORS proxy\", () => {\n expect(generateEnvDevelopment({\n envPrefix: \"PUBLIC_\",\n foundryUrl: \"https://example.palantirfoundry.com\",\n clientId: \"123\",\n corsProxy: true,\n })).toEqual(expectedEnvDevelopmentCorsProxy);\n});\ntest(\"it generates .env.production\", () => {\n expect(generateEnvProduction({\n envPrefix: \"PUBLIC_\",\n foundryUrl: \"https://example.palantirfoundry.com\",\n applicationUrl: \"https://app.com\",\n clientId: \"123\",\n })).toEqual(expectedEnvProduction);\n});\ntest(\"it generates .env.production without app url\", () => {\n expect(generateEnvProduction({\n envPrefix: \"PUBLIC_\",\n foundryUrl: \"https://example.palantirfoundry.com\",\n applicationUrl: undefined,\n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AO,CAACN,qBAAqB,CAAC;AACtC,CAAC,CAAC;AACFN,IAAI,CAAC,8CAA8C,EAAE,MAAM;EACvDD,MAAM,CAACG,qBAAqB,CAAC;IACzBM,SAAS,EAAE,SAAS;IACpBC,UAAU,EAAE,qCAAqC;IACjDI,cAAc,EAAEC,SAAS;IACzBJ,QAAQ,EAAE;EACd,CAAC,CAAC,CAAC,CAACE,OAAO,CAACL,6BAA6B,CAAC;AAC9C,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export function generateFoundryConfigJson({
|
|
17
|
-
foundryUrl,
|
|
18
|
-
application,
|
|
19
|
-
directory
|
|
20
|
-
}) {
|
|
21
|
-
return JSON.stringify({
|
|
22
|
-
foundryUrl,
|
|
23
|
-
site: {
|
|
24
|
-
application,
|
|
25
|
-
directory,
|
|
26
|
-
autoVersion: {
|
|
27
|
-
type: "git-describe",
|
|
28
|
-
tagPrefix: ""
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}, null, 2) + "\n";
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=generateFoundryConfigJson.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateFoundryConfigJson.js","names":["generateFoundryConfigJson","foundryUrl","application","directory","JSON","stringify","site","autoVersion","type","tagPrefix"],"sources":["generateFoundryConfigJson.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 */\nexport function generateFoundryConfigJson({ foundryUrl, application, directory, }) {\n return JSON.stringify({\n foundryUrl,\n site: {\n application,\n directory,\n autoVersion: {\n type: \"git-describe\",\n tagPrefix: \"\",\n },\n },\n }, null, 2) + \"\\n\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,yBAAyBA,CAAC;EAAEC,UAAU;EAAEC,WAAW;EAAEC;AAAW,CAAC,EAAE;EAC/E,OAAOC,IAAI,CAACC,SAAS,CAAC;IAClBJ,UAAU;IACVK,IAAI,EAAE;MACFJ,WAAW;MACXC,SAAS;MACTI,WAAW,EAAE;QACTC,IAAI,EAAE,cAAc;QACpBC,SAAS,EAAE;MACf;IACJ;EACJ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI;AACtB","ignoreList":[]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { expect, test } from "vitest";
|
|
17
|
-
import { generateFoundryConfigJson } from "./generateFoundryConfigJson.js";
|
|
18
|
-
const expected = `
|
|
19
|
-
{
|
|
20
|
-
"foundryUrl": "https://example.palantirfoundry.com",
|
|
21
|
-
"site": {
|
|
22
|
-
"application": "ri.third-party-applications.main.application.fake",
|
|
23
|
-
"directory": "./dist",
|
|
24
|
-
"autoVersion": {
|
|
25
|
-
"type": "git-describe",
|
|
26
|
-
"tagPrefix": ""
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
`.trimStart();
|
|
31
|
-
test("it generates foundry.config.json", () => {
|
|
32
|
-
expect(generateFoundryConfigJson({
|
|
33
|
-
foundryUrl: "https://example.palantirfoundry.com",
|
|
34
|
-
application: "ri.third-party-applications.main.application.fake",
|
|
35
|
-
directory: "./dist"
|
|
36
|
-
})).toEqual(expected);
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=generateFoundryConfigJson.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateFoundryConfigJson.test.js","names":["expect","test","generateFoundryConfigJson","expected","trimStart","foundryUrl","application","directory","toEqual"],"sources":["generateFoundryConfigJson.test.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 */\nimport { expect, test } from \"vitest\";\nimport { generateFoundryConfigJson } from \"./generateFoundryConfigJson.js\";\nconst expected = `\n{\n \"foundryUrl\": \"https://example.palantirfoundry.com\",\n \"site\": {\n \"application\": \"ri.third-party-applications.main.application.fake\",\n \"directory\": \"./dist\",\n \"autoVersion\": {\n \"type\": \"git-describe\",\n \"tagPrefix\": \"\"\n }\n }\n}\n`.trimStart();\ntest(\"it generates foundry.config.json\", () => {\n expect(generateFoundryConfigJson({\n foundryUrl: \"https://example.palantirfoundry.com\",\n application: \"ri.third-party-applications.main.application.fake\",\n directory: \"./dist\",\n })).toEqual(expected);\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,IAAI,QAAQ,QAAQ;AACrC,SAASC,yBAAyB,QAAQ,gCAAgC;AAC1E,MAAMC,QAAQ,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAACC,SAAS,CAAC,CAAC;AACbH,IAAI,CAAC,kCAAkC,EAAE,MAAM;EAC3CD,MAAM,CAACE,yBAAyB,CAAC;IAC7BG,UAAU,EAAE,qCAAqC;IACjDC,WAAW,EAAE,mDAAmD;IAChEC,SAAS,EAAE;EACf,CAAC,CAAC,CAAC,CAACC,OAAO,CAACL,QAAQ,CAAC;AACzB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export function generateNpmRc({
|
|
17
|
-
osdkPackage,
|
|
18
|
-
osdkRegistryUrl
|
|
19
|
-
}) {
|
|
20
|
-
// pnpm requires a trailing slash in .npmrc
|
|
21
|
-
// https://github.com/pnpm/pnpm/issues/5941
|
|
22
|
-
const withTrailingSlash = osdkRegistryUrl.endsWith("/") ? osdkRegistryUrl : osdkRegistryUrl + "/";
|
|
23
|
-
const withoutProtocol = withTrailingSlash.replace(/^https:\/\//, "");
|
|
24
|
-
const packageScope = osdkPackage.split("/")[0];
|
|
25
|
-
return `//${withoutProtocol}:_authToken=\${FOUNDRY_TOKEN}\n` + `${packageScope}:registry=${withTrailingSlash}\n`;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=generateNpmRc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateNpmRc.js","names":["generateNpmRc","osdkPackage","osdkRegistryUrl","withTrailingSlash","endsWith","withoutProtocol","replace","packageScope","split"],"sources":["generateNpmRc.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 */\nexport function generateNpmRc({ osdkPackage, osdkRegistryUrl, }) {\n // pnpm requires a trailing slash in .npmrc\n // https://github.com/pnpm/pnpm/issues/5941\n const withTrailingSlash = osdkRegistryUrl.endsWith(\"/\")\n ? osdkRegistryUrl\n : osdkRegistryUrl + \"/\";\n const withoutProtocol = withTrailingSlash.replace(/^https:\\/\\//, \"\");\n const packageScope = osdkPackage.split(\"/\")[0];\n return `//${withoutProtocol}:_authToken=\\${FOUNDRY_TOKEN}\\n`\n + `${packageScope}:registry=${withTrailingSlash}\\n`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAAC;EAAEC,WAAW;EAAEC;AAAiB,CAAC,EAAE;EAC7D;EACA;EACA,MAAMC,iBAAiB,GAAGD,eAAe,CAACE,QAAQ,CAAC,GAAG,CAAC,GACjDF,eAAe,GACfA,eAAe,GAAG,GAAG;EAC3B,MAAMG,eAAe,GAAGF,iBAAiB,CAACG,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;EACpE,MAAMC,YAAY,GAAGN,WAAW,CAACO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;EAC9C,OAAO,KAAKH,eAAe,iCAAiC,GACtD,GAAGE,YAAY,aAAaJ,iBAAiB,IAAI;AAC3D","ignoreList":[]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { expect, test } from "vitest";
|
|
17
|
-
import { generateNpmRc } from "./generateNpmRc.js";
|
|
18
|
-
const expected = `
|
|
19
|
-
//registry.com/:_authToken=\${FOUNDRY_TOKEN}
|
|
20
|
-
@myapp:registry=https://registry.com/
|
|
21
|
-
`.trimStart();
|
|
22
|
-
test("it generates .npmrc for package and registry", () => {
|
|
23
|
-
expect(generateNpmRc({
|
|
24
|
-
osdkPackage: "@myapp/sdk",
|
|
25
|
-
osdkRegistryUrl: "https://registry.com"
|
|
26
|
-
})).toEqual(expected);
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=generateNpmRc.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateNpmRc.test.js","names":["expect","test","generateNpmRc","expected","trimStart","osdkPackage","osdkRegistryUrl","toEqual"],"sources":["generateNpmRc.test.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 */\nimport { expect, test } from \"vitest\";\nimport { generateNpmRc } from \"./generateNpmRc.js\";\nconst expected = `\n//registry.com/:_authToken=\\${FOUNDRY_TOKEN}\n@myapp:registry=https://registry.com/\n`.trimStart();\ntest(\"it generates .npmrc for package and registry\", () => {\n expect(generateNpmRc({\n osdkPackage: \"@myapp/sdk\",\n osdkRegistryUrl: \"https://registry.com\",\n })).toEqual(expected);\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,IAAI,QAAQ,QAAQ;AACrC,SAASC,aAAa,QAAQ,oBAAoB;AAClD,MAAMC,QAAQ,GAAG;AACjB;AACA;AACA,CAAC,CAACC,SAAS,CAAC,CAAC;AACbH,IAAI,CAAC,8CAA8C,EAAE,MAAM;EACvDD,MAAM,CAACE,aAAa,CAAC;IACjBG,WAAW,EAAE,YAAY;IACzBC,eAAe,EAAE;EACrB,CAAC,CAAC,CAAC,CAACC,OAAO,CAACJ,QAAQ,CAAC;AACzB,CAAC,CAAC","ignoreList":[]}
|
package/build/esm/highlight.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { colorize } from "consola/utils";
|
|
17
|
-
export function green(text) {
|
|
18
|
-
return colorize("green", text);
|
|
19
|
-
}
|
|
20
|
-
export function italic(text) {
|
|
21
|
-
return colorize("italic", text);
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=highlight.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"highlight.js","names":["colorize","green","text","italic"],"sources":["highlight.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 */\nimport { colorize } from \"consola/utils\";\nexport function green(text) {\n return colorize(\"green\", text);\n}\nexport function italic(text) {\n return colorize(\"italic\", text);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,eAAe;AACxC,OAAO,SAASC,KAAKA,CAACC,IAAI,EAAE;EACxB,OAAOF,QAAQ,CAAC,OAAO,EAAEE,IAAI,CAAC;AAClC;AACA,OAAO,SAASC,MAAMA,CAACD,IAAI,EAAE;EACzB,OAAOF,QAAQ,CAAC,QAAQ,EAAEE,IAAI,CAAC;AACnC","ignoreList":[]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { consola } from "../consola.js";
|
|
17
|
-
import { italic } from "../highlight.js";
|
|
18
|
-
export async function promptApplicationRid({
|
|
19
|
-
application
|
|
20
|
-
}) {
|
|
21
|
-
while (application == null || !/^ri\.third-party-applications\.[^.]+\.application\.[^.]+$/.test(application)) {
|
|
22
|
-
if (application != null) {
|
|
23
|
-
consola.fail("Please enter a valid application resource identifier (rid)");
|
|
24
|
-
}
|
|
25
|
-
application = await consola.prompt(`Enter the application resource identifier (rid) for your application from Developer Console:\n${italic("(Example: ri.third-party-applications.main.application.1c66b352-4e00-40d2-995d-061c9d533ace)")}`, {
|
|
26
|
-
type: "text"
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return application;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=promptApplicationRid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promptApplicationRid.js","names":["consola","italic","promptApplicationRid","application","test","fail","prompt","type"],"sources":["promptApplicationRid.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 */\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptApplicationRid({ application }) {\n while (application == null\n || !/^ri\\.third-party-applications\\.[^.]+\\.application\\.[^.]+$/.test(application)) {\n if (application != null) {\n consola.fail(\"Please enter a valid application resource identifier (rid)\");\n }\n application = await consola.prompt(`Enter the application resource identifier (rid) for your application from Developer Console:\\n${italic(\"(Example: ri.third-party-applications.main.application.1c66b352-4e00-40d2-995d-061c9d533ace)\")}`, { type: \"text\" });\n }\n return application;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,eAAe;AACvC,SAASC,MAAM,QAAQ,iBAAiB;AACxC,OAAO,eAAeC,oBAAoBA,CAAC;EAAEC;AAAY,CAAC,EAAE;EACxD,OAAOA,WAAW,IAAI,IAAI,IACnB,CAAC,2DAA2D,CAACC,IAAI,CAACD,WAAW,CAAC,EAAE;IACnF,IAAIA,WAAW,IAAI,IAAI,EAAE;MACrBH,OAAO,CAACK,IAAI,CAAC,4DAA4D,CAAC;IAC9E;IACAF,WAAW,GAAG,MAAMH,OAAO,CAACM,MAAM,CAAC,iGAAiGL,MAAM,CAAC,8FAA8F,CAAC,EAAE,EAAE;MAAEM,IAAI,EAAE;IAAO,CAAC,CAAC;EACnQ;EACA,OAAOJ,WAAW;AACtB","ignoreList":[]}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { afterEach, expect, test, vi } from "vitest";
|
|
17
|
-
import { consola } from "../consola.js";
|
|
18
|
-
import { promptApplicationRid } from "./promptApplicationRid.js";
|
|
19
|
-
vi.mock("../consola.js");
|
|
20
|
-
afterEach(() => {
|
|
21
|
-
vi.restoreAllMocks();
|
|
22
|
-
});
|
|
23
|
-
const valid = "ri.third-party-applications.main.application.fake";
|
|
24
|
-
test("it accepts valid application rid from prompt", async () => {
|
|
25
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce(valid);
|
|
26
|
-
expect(await promptApplicationRid({})).toEqual(valid);
|
|
27
|
-
expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(1);
|
|
28
|
-
});
|
|
29
|
-
test("it prompts again if answered value is invalid", async () => {
|
|
30
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce("ri.something.else.and.fake");
|
|
31
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce(valid);
|
|
32
|
-
expect(await promptApplicationRid({})).toEqual(valid);
|
|
33
|
-
expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(2);
|
|
34
|
-
});
|
|
35
|
-
test("it accepts valid initial value without prompt", async () => {
|
|
36
|
-
expect(await promptApplicationRid({
|
|
37
|
-
application: valid
|
|
38
|
-
})).toEqual(valid);
|
|
39
|
-
expect(vi.mocked(consola).prompt).not.toHaveBeenCalled();
|
|
40
|
-
});
|
|
41
|
-
test("it prompts if initial value is invalid", async () => {
|
|
42
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce(valid);
|
|
43
|
-
expect(await promptApplicationRid({
|
|
44
|
-
application: "ri.something.else.and.fake"
|
|
45
|
-
})).toEqual(valid);
|
|
46
|
-
expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(1);
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=promptApplicationRid.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promptApplicationRid.test.js","names":["afterEach","expect","test","vi","consola","promptApplicationRid","mock","restoreAllMocks","valid","mocked","prompt","mockResolvedValueOnce","toEqual","toHaveBeenCalledTimes","application","not","toHaveBeenCalled"],"sources":["promptApplicationRid.test.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 */\nimport { afterEach, expect, test, vi } from \"vitest\";\nimport { consola } from \"../consola.js\";\nimport { promptApplicationRid } from \"./promptApplicationRid.js\";\nvi.mock(\"../consola.js\");\nafterEach(() => {\n vi.restoreAllMocks();\n});\nconst valid = \"ri.third-party-applications.main.application.fake\";\ntest(\"it accepts valid application rid from prompt\", async () => {\n vi.mocked(consola).prompt.mockResolvedValueOnce(valid);\n expect(await promptApplicationRid({})).toEqual(valid);\n expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(1);\n});\ntest(\"it prompts again if answered value is invalid\", async () => {\n vi.mocked(consola).prompt.mockResolvedValueOnce(\"ri.something.else.and.fake\");\n vi.mocked(consola).prompt.mockResolvedValueOnce(valid);\n expect(await promptApplicationRid({})).toEqual(valid);\n expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(2);\n});\ntest(\"it accepts valid initial value without prompt\", async () => {\n expect(await promptApplicationRid({ application: valid })).toEqual(valid);\n expect(vi.mocked(consola).prompt).not.toHaveBeenCalled();\n});\ntest(\"it prompts if initial value is invalid\", async () => {\n vi.mocked(consola).prompt.mockResolvedValueOnce(valid);\n expect(await promptApplicationRid({ application: \"ri.something.else.and.fake\" })).toEqual(valid);\n expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(1);\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,EAAEC,IAAI,EAAEC,EAAE,QAAQ,QAAQ;AACpD,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,oBAAoB,QAAQ,2BAA2B;AAChEF,EAAE,CAACG,IAAI,CAAC,eAAe,CAAC;AACxBN,SAAS,CAAC,M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CAACL,OAAO,CAAC,CAACM,MAAM,CAACC,qBAAqB,CAACH,KAAK,CAAC;EACtDP,MAAM,CAAC,MAAMI,oBAAoB,CAAC;IAAES,WAAW,EAAE;EAA6B,CAAC,CAAC,CAAC,CAACF,OAAO,CAACJ,KAAK,CAAC;EAChGP,MAAM,CAACE,EAAE,CAACM,MAAM,CAACL,OAAO,CAAC,CAACM,MAAM,CAAC,CAACG,qBAAqB,CAAC,CAAC,CAAC;AAC9D,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { consola } from "../consola.js";
|
|
17
|
-
import { italic } from "../highlight.js";
|
|
18
|
-
export async function promptApplicationUrl({
|
|
19
|
-
skipApplicationUrl,
|
|
20
|
-
applicationUrl
|
|
21
|
-
}) {
|
|
22
|
-
if (skipApplicationUrl) {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
if (applicationUrl == null) {
|
|
26
|
-
const skip = await consola.prompt(`Do you know the URL your production application will be hosted on? This is required to create a production build of your application with the correct OAuth redirect URL.`, {
|
|
27
|
-
type: "select",
|
|
28
|
-
options: [{
|
|
29
|
-
label: "Yes, let me fill it here",
|
|
30
|
-
value: "yes"
|
|
31
|
-
}, {
|
|
32
|
-
label: "No, I will fill it in later following the instructions in the generated README",
|
|
33
|
-
value: "no"
|
|
34
|
-
}]
|
|
35
|
-
});
|
|
36
|
-
if (skip === "no") {
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
while (applicationUrl == null || !/^https?:\/\//.test(applicationUrl)) {
|
|
41
|
-
if (applicationUrl != null) {
|
|
42
|
-
consola.fail("Please enter a valid application URL");
|
|
43
|
-
}
|
|
44
|
-
applicationUrl = await consola.prompt(`Enter the URL your production application will be hosted on:\n${italic("(Example: https://myapp.example.palantirfoundry.com)")}`, {
|
|
45
|
-
type: "text"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return applicationUrl.replace(/\/$/, "");
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=promptApplicationUrl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promptApplicationUrl.js","names":["consola","italic","promptApplicationUrl","skipApplicationUrl","applicationUrl","undefined","skip","prompt","type","options","label","value","test","fail","replace"],"sources":["promptApplicationUrl.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 */\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptApplicationUrl({ skipApplicationUrl, applicationUrl }) {\n if (skipApplicationUrl) {\n return undefined;\n }\n if (applicationUrl == null) {\n const skip = (await consola.prompt(`Do you know the URL your production application will be hosted on? This is required to create a production build of your application with the correct OAuth redirect URL.`, {\n type: \"select\",\n options: [\n { label: \"Yes, let me fill it here\", value: \"yes\" },\n {\n label: \"No, I will fill it in later following the instructions in the generated README\",\n value: \"no\",\n },\n ],\n }));\n if (skip === \"no\") {\n return undefined;\n }\n }\n while (applicationUrl == null || !/^https?:\\/\\//.test(applicationUrl)) {\n if (applicationUrl != null) {\n consola.fail(\"Please enter a valid application URL\");\n }\n applicationUrl = await consola.prompt(`Enter the URL your production application will be hosted on:\\n${italic(\"(Example: https://myapp.example.palantirfoundry.com)\")}`, { type: \"text\" });\n }\n return applicationUrl.replace(/\\/$/, \"\");\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,eAAe;AACvC,SAASC,MAAM,QAAQ,iBAAiB;AACxC,OAAO,eAAeC,oBAAoBA,CAAC;EAAEC,kBAAkB;EAAEC;AAAe,CAAC,EAAE;EAC/E,IAAID,kBAAkB,EAAE;IACpB,OAAOE,SAAS;EACpB;EACA,IAAID,cAAc,IAAI,IAAI,EAAE;IACxB,MAAME,IAAI,GAAI,MAAMN,OAAO,CAACO,MAAM,CAAC,2KAA2K,EAAE;MAC5MC,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAE,CACL;QAAEC,KAAK,EAAE,0BAA0B;QAAEC,KAAK,EAAE;MAAM,CAAC,EACnD;QACID,KAAK,EAAE,gFAAgF;QACvFC,KAAK,EAAE;MACX,CAAC;IAET,CAAC,CAAE;IACH,IAAIL,IAAI,KAAK,IAAI,EAAE;MACf,OAAOD,SAAS;IACpB;EACJ;EACA,OAAOD,cAAc,IAAI,IAAI,IAAI,CAAC,cAAc,CAACQ,IAAI,CAACR,cAAc,CAAC,EAAE;IACnE,IAAIA,cAAc,IAAI,IAAI,EAAE;MACxBJ,OAAO,CAACa,IAAI,CAAC,sCAAsC,CAAC;IACxD;IACAT,cAAc,GAAG,MAAMJ,OAAO,CAACO,MAAM,CAAC,iEAAiEN,MAAM,CAAC,sDAAsD,CAAC,EAAE,EAAE;MAAEO,IAAI,EAAE;IAAO,CAAC,CAAC;EAC9L;EACA,OAAOJ,cAAc,CAACU,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;AAC5C","ignoreList":[]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { afterEach, expect, test, vi } from "vitest";
|
|
17
|
-
import { consola } from "../consola.js";
|
|
18
|
-
import { promptApplicationUrl } from "./promptApplicationUrl.js";
|
|
19
|
-
vi.mock("../consola.js");
|
|
20
|
-
afterEach(() => {
|
|
21
|
-
vi.restoreAllMocks();
|
|
22
|
-
});
|
|
23
|
-
const valid = "https://app.com";
|
|
24
|
-
test("it accepts valid application url from prompt", async () => {
|
|
25
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce("yes");
|
|
26
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce(valid);
|
|
27
|
-
expect(await promptApplicationUrl({})).toEqual(valid);
|
|
28
|
-
expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(2);
|
|
29
|
-
});
|
|
30
|
-
test("it prompts again if answered value is invalid", async () => {
|
|
31
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce("yes");
|
|
32
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce("invalid");
|
|
33
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce("ftp://abc.com");
|
|
34
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce(valid);
|
|
35
|
-
expect(await promptApplicationUrl({})).toEqual(valid);
|
|
36
|
-
expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(4);
|
|
37
|
-
});
|
|
38
|
-
test("it accepts valid initial value without prompt", async () => {
|
|
39
|
-
expect(await promptApplicationUrl({
|
|
40
|
-
applicationUrl: valid
|
|
41
|
-
})).toEqual(valid);
|
|
42
|
-
expect(vi.mocked(consola).prompt).not.toHaveBeenCalled();
|
|
43
|
-
});
|
|
44
|
-
test("it prompts if initial value is invalid", async () => {
|
|
45
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce(valid);
|
|
46
|
-
expect(await promptApplicationUrl({
|
|
47
|
-
applicationUrl: "invalid"
|
|
48
|
-
})).toEqual(valid);
|
|
49
|
-
expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(1);
|
|
50
|
-
});
|
|
51
|
-
test("it strips trailing slash from url", async () => {
|
|
52
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce("yes");
|
|
53
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce(valid + "/");
|
|
54
|
-
expect(await promptApplicationUrl({})).toEqual(valid);
|
|
55
|
-
expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(2);
|
|
56
|
-
});
|
|
57
|
-
test("it skips prompting application url if told to fill in later", async () => {
|
|
58
|
-
vi.mocked(consola).prompt.mockResolvedValueOnce("no");
|
|
59
|
-
expect(await promptApplicationUrl({})).toEqual(undefined);
|
|
60
|
-
expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(1);
|
|
61
|
-
});
|
|
62
|
-
test("it skips prompting completely if told to", async () => {
|
|
63
|
-
expect(await promptApplicationUrl({
|
|
64
|
-
skipApplicationUrl: true
|
|
65
|
-
})).toEqual(undefined);
|
|
66
|
-
expect(vi.mocked(consola).prompt).not.toHaveBeenCalled();
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=promptApplicationUrl.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promptApplicationUrl.test.js","names":["afterEach","expect","test","vi","consola","promptApplicationUrl","mock","restoreAllMocks","valid","mocked","prompt","mockResolvedValueOnce","toEqual","toHaveBeenCalledTimes","applicationUrl","not","toHaveBeenCalled","undefined","skipApplicationUrl"],"sources":["promptApplicationUrl.test.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 */\nimport { afterEach, expect, test, vi } from \"vitest\";\nimport { consola } from \"../consola.js\";\nimport { promptApplicationUrl } from \"./promptApplicationUrl.js\";\nvi.mock(\"../consola.js\");\nafterEach(() => {\n vi.restoreAllMocks();\n});\nconst valid = \"https://app.com\";\ntest(\"it accepts valid application url from prompt\", async () => {\n vi.mocked(consola).prompt.mockResolvedValueOnce(\"yes\");\n vi.mocked(consola).prompt.mockResolvedValueOnce(valid);\n expect(await promptApplicationUrl({})).toEqual(valid);\n expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(2);\n});\ntest(\"it prompts again if answered value is invalid\", async () => {\n vi.mocked(consola).prompt.mockResolvedValueOnce(\"yes\");\n vi.mocked(consola).prompt.mockResolvedValueOnce(\"invalid\");\n vi.mocked(consola).prompt.mockResolvedValueOnce(\"ftp://abc.com\");\n vi.mocked(consola).prompt.mockResolvedValueOnce(valid);\n expect(await promptApplicationUrl({})).toEqual(valid);\n expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(4);\n});\ntest(\"it accepts valid initial value without prompt\", async () => {\n expect(await promptApplicationUrl({ applicationUrl: valid })).toEqual(valid);\n expect(vi.mocked(consola).prompt).not.toHaveBeenCalled();\n});\ntest(\"it prompts if initial value is invalid\", async () => {\n vi.mocked(consola).prompt.mockResolvedValueOnce(valid);\n expect(await promptApplicationUrl({ applicationUrl: \"invalid\" })).toEqual(valid);\n expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(1);\n});\ntest(\"it strips trailing slash from url\", async () => {\n vi.mocked(consola).prompt.mockResolvedValueOnce(\"yes\");\n vi.mocked(consola).prompt.mockResolvedValueOnce(valid + \"/\");\n expect(await promptApplicationUrl({})).toEqual(valid);\n expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(2);\n});\ntest(\"it skips prompting application url if told to fill in later\", async () => {\n vi.mocked(consola).prompt.mockResolvedValueOnce(\"no\");\n expect(await promptApplicationUrl({})).toEqual(undefined);\n expect(vi.mocked(consola).prompt).toHaveBeenCalledTimes(1);\n});\ntest(\"it skips prompting completely if told to\", async () => {\n expect(await promptApplicationUrl({ skipApplicationUrl: true })).toEqual(undefined);\n expect(vi.mocked(consola).prompt).not.toHaveBeenCalled();\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,EAAEC,IAAI,EAAEC,EAAE,QAAQ,QAAQ;AACpD,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,oBAAoB,QAAQ,2BAA2B;AAChEF,EAAE,CAACG,IAAI,CAAC,eAAe,CAAC;AACxBN,SAAS,CAAC,MAAM;EACZG,EAAE,CAACI,eAAe,CAAC,CAAC;AACxB,CAAC,CAAC;AACF,MAAMC,KAAK,GAAG,iBAAiB;AAC/BN,IAAI,CAAC,8CAA8C,EAAE,YAAY;EAC7DC,EAAE,CAACM,MAAM,CAACL,OAAO,CAAC,CAACM,MAAM,CAACC,qBAAqB,CAAC,KA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