create-typescript-app 2.3.0 → 2.4.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.
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { base } from "../base.js";
|
|
3
|
-
|
|
4
|
-
name: z.string(),
|
|
5
|
-
url: z.string()
|
|
6
|
-
});
|
|
3
|
+
import { getInstallationSuggestions } from "./getInstallationSuggestions.js";
|
|
7
4
|
const blockGitHubApps = base.createBlock({
|
|
8
5
|
about: {
|
|
9
6
|
name: "GitHub Apps"
|
|
10
7
|
},
|
|
11
8
|
addons: {
|
|
12
|
-
apps: z.array(
|
|
9
|
+
apps: z.array(
|
|
10
|
+
z.object({
|
|
11
|
+
name: z.string(),
|
|
12
|
+
url: z.string()
|
|
13
|
+
})
|
|
14
|
+
).default([])
|
|
13
15
|
},
|
|
14
|
-
produce({ addons }) {
|
|
16
|
+
produce({ addons, options }) {
|
|
15
17
|
return {
|
|
16
|
-
suggestions:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`,
|
|
22
|
-
addons.apps.map(printApp).join("\n")
|
|
23
|
-
].join("")
|
|
24
|
-
] : void 0
|
|
18
|
+
suggestions: getInstallationSuggestions(
|
|
19
|
+
"enable the GitHub app",
|
|
20
|
+
addons.apps.map((app) => `${app.name} (${app.url})`),
|
|
21
|
+
`https://github.com/${options.owner}/${options.repository}/settings/installations`
|
|
22
|
+
)
|
|
25
23
|
};
|
|
26
24
|
}
|
|
27
25
|
});
|
|
28
|
-
function printApp(app) {
|
|
29
|
-
return ` - ${app.name} (${app.url})`;
|
|
30
|
-
}
|
|
31
26
|
export {
|
|
32
27
|
blockGitHubApps
|
|
33
28
|
};
|
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { base } from "../base.js";
|
|
3
|
-
|
|
4
|
-
description: z.string(),
|
|
5
|
-
name: z.string()
|
|
6
|
-
});
|
|
3
|
+
import { getInstallationSuggestions } from "./getInstallationSuggestions.js";
|
|
7
4
|
const blockRepositorySecrets = base.createBlock({
|
|
8
5
|
about: {
|
|
9
6
|
name: "Repository Secrets"
|
|
10
7
|
},
|
|
11
8
|
addons: {
|
|
12
|
-
secrets: z.array(
|
|
9
|
+
secrets: z.array(
|
|
10
|
+
z.object({
|
|
11
|
+
description: z.string(),
|
|
12
|
+
name: z.string()
|
|
13
|
+
})
|
|
14
|
+
).default([])
|
|
13
15
|
},
|
|
14
|
-
produce({ addons }) {
|
|
16
|
+
produce({ addons, options }) {
|
|
15
17
|
return {
|
|
16
|
-
suggestions:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
].join("")
|
|
24
|
-
] : void 0
|
|
18
|
+
suggestions: getInstallationSuggestions(
|
|
19
|
+
"populate the secret",
|
|
20
|
+
addons.secrets.map(
|
|
21
|
+
(secret) => `${secret.name} (${secret.description})`
|
|
22
|
+
),
|
|
23
|
+
`https://github.com/${options.owner}/${options.repository}/settings/secrets/actions`
|
|
24
|
+
)
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
function printSecret(app) {
|
|
29
|
-
return ` - ${app.name} (${app.description})`;
|
|
30
|
-
}
|
|
31
28
|
export {
|
|
32
29
|
blockRepositorySecrets
|
|
33
30
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function getInstallationSuggestions(description, entries, url) {
|
|
2
|
+
return entries.length ? [
|
|
3
|
+
[
|
|
4
|
+
`- ${description}`,
|
|
5
|
+
entries.length === 1 ? "" : "s",
|
|
6
|
+
` on ${url}:
|
|
7
|
+
`,
|
|
8
|
+
entries.map((entry) => ` - ${entry}`).join("\n")
|
|
9
|
+
].join("")
|
|
10
|
+
] : void 0;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
getInstallationSuggestions
|
|
14
|
+
};
|