@dura-run/cli 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dura.js +32 -4
- package/package.json +1 -1
package/dist/dura.js
CHANGED
|
@@ -2834,6 +2834,17 @@ var init_hello = __esm(() => {
|
|
|
2834
2834
|
HELLO_TEMPLATE = GET_TEMPLATE;
|
|
2835
2835
|
});
|
|
2836
2836
|
|
|
2837
|
+
// src/templates/package.json.ts
|
|
2838
|
+
function packageJsonTemplate(projectName) {
|
|
2839
|
+
return JSON.stringify({
|
|
2840
|
+
name: projectName,
|
|
2841
|
+
version: "0.0.0",
|
|
2842
|
+
private: true,
|
|
2843
|
+
type: "module"
|
|
2844
|
+
}, null, 2) + `
|
|
2845
|
+
`;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2837
2848
|
// src/lib/handle-api-error.ts
|
|
2838
2849
|
function reportApiError(output, err, fallbackCode) {
|
|
2839
2850
|
if (err instanceof ApiClientError) {
|
|
@@ -2913,6 +2924,7 @@ Set required secrets: ${result.requiredSecrets.join(", ")}`);
|
|
|
2913
2924
|
mkdirSync2(join2(projectDir, "routes"), { recursive: true });
|
|
2914
2925
|
mkdirSync2(join2(projectDir, "jobs"), { recursive: true });
|
|
2915
2926
|
writeFileSync2(join2(projectDir, "dura.json"), duraJsonTemplate(name, triggerKind));
|
|
2927
|
+
writeFileSync2(join2(projectDir, "package.json"), packageJsonTemplate(name));
|
|
2916
2928
|
writeFileSync2(join2(projectDir, "routes", "hello.ts"), helloTemplate(triggerKind));
|
|
2917
2929
|
writeFileSync2(join2(projectDir, ".gitignore"), GITIGNORE_CONTENT);
|
|
2918
2930
|
const token = getAuthToken();
|
|
@@ -2946,7 +2958,13 @@ Set required secrets: ${result.requiredSecrets.join(", ")}`);
|
|
|
2946
2958
|
created: true,
|
|
2947
2959
|
name,
|
|
2948
2960
|
path: projectDir,
|
|
2949
|
-
files: [
|
|
2961
|
+
files: [
|
|
2962
|
+
"dura.json",
|
|
2963
|
+
"package.json",
|
|
2964
|
+
"routes/hello.ts",
|
|
2965
|
+
"jobs/",
|
|
2966
|
+
".gitignore"
|
|
2967
|
+
]
|
|
2950
2968
|
});
|
|
2951
2969
|
});
|
|
2952
2970
|
}
|
|
@@ -19230,6 +19248,10 @@ function registerInitCommand(program2) {
|
|
|
19230
19248
|
if (!existsSync13(gitignorePath)) {
|
|
19231
19249
|
writeFileSync11(gitignorePath, GITIGNORE_CONTENT2);
|
|
19232
19250
|
}
|
|
19251
|
+
const pkgPath = join14(projectDir, "package.json");
|
|
19252
|
+
if (!existsSync13(pkgPath)) {
|
|
19253
|
+
writeFileSync11(pkgPath, packageJsonTemplate(projectName));
|
|
19254
|
+
}
|
|
19233
19255
|
if (alreadyInitialized) {
|
|
19234
19256
|
output.info(`Re-checked dura project "${projectName}" in ${projectDir}`);
|
|
19235
19257
|
} else {
|
|
@@ -19262,7 +19284,13 @@ function registerInitCommand(program2) {
|
|
|
19262
19284
|
alreadyInitialized,
|
|
19263
19285
|
name: projectName,
|
|
19264
19286
|
path: projectDir,
|
|
19265
|
-
files: [
|
|
19287
|
+
files: [
|
|
19288
|
+
"dura.json",
|
|
19289
|
+
"package.json",
|
|
19290
|
+
"routes/hello.ts",
|
|
19291
|
+
"jobs/",
|
|
19292
|
+
".gitignore"
|
|
19293
|
+
]
|
|
19266
19294
|
});
|
|
19267
19295
|
if (!output.isJson()) {
|
|
19268
19296
|
output.info("");
|
|
@@ -19485,7 +19513,7 @@ async function registerAllCommands(program2) {
|
|
|
19485
19513
|
registerOpenApiCommand2(program2);
|
|
19486
19514
|
return program2;
|
|
19487
19515
|
}
|
|
19488
|
-
var CLI_VERSION = "0.3.
|
|
19516
|
+
var CLI_VERSION = "0.3.2";
|
|
19489
19517
|
var init_src3 = __esm(() => {
|
|
19490
19518
|
init_esm();
|
|
19491
19519
|
if (import.meta.url === `file://${realpathSync(process.argv[1] ?? "").replace(/\\/g, "/")}`) {
|
|
@@ -19502,4 +19530,4 @@ export {
|
|
|
19502
19530
|
CLI_VERSION
|
|
19503
19531
|
};
|
|
19504
19532
|
|
|
19505
|
-
//# debugId=
|
|
19533
|
+
//# debugId=BE2D824A7368E16F64756E2164756E21
|