@dbx-tools/projen 0.9.151 → 0.9.153
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/README.md +49 -4
- package/index.ts +6 -1
- package/package.json +7 -5
- package/src/appkit-workspace.ts +181 -0
- package/src/bun-app.ts +7 -1
- package/src/dbx-tools-config.ts +1 -0
- package/src/generated.ts +16 -7
- package/src/packages.ts +6 -1
- package/src/pnpm-workspace.ts +4 -0
- package/src/project-js.ts +65 -10
- package/src/project-py.ts +50 -19
- package/src/tsconfig.ts +10 -2
- package/src/workspace-manifest.ts +182 -0
- package/tasks/appkit-deploy.ts +245 -0
- package/tasks/compile-workspace.ts +2 -1
- package/tasks/publish-npm.ts +3 -54
- package/tasks/pypi-trusted-publisher-instructions.ts +54 -0
- package/tasks/python-node-bindings.ts +11 -7
- package/tasks/test-workspace.ts +2 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Parse and print generated PyPI trusted-publisher setup instructions. */
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { taskCommand, taskOptions } from "./cli.ts";
|
|
4
|
+
|
|
5
|
+
export const PypiTrustedPublisherInstructionsOptionsSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
secretFile: z
|
|
8
|
+
.string()
|
|
9
|
+
.trim()
|
|
10
|
+
.min(1)
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("Credential file used only when browser authentication is required")
|
|
13
|
+
.meta({ env: [], helpDefault: false, short: false }),
|
|
14
|
+
})
|
|
15
|
+
.describe("Options for rendering PyPI trusted-publisher setup instructions");
|
|
16
|
+
|
|
17
|
+
/** Project-specific instruction sections wrapped around browser authentication guidance. */
|
|
18
|
+
export interface PypiTrustedPublisherInstructions {
|
|
19
|
+
readonly afterAuthentication: readonly string[];
|
|
20
|
+
readonly beforeAuthentication: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Parse task options and write the complete trusted-publisher instructions. */
|
|
24
|
+
export async function printPypiTrustedPublisherInstructions(
|
|
25
|
+
instructions: PypiTrustedPublisherInstructions,
|
|
26
|
+
argv: readonly string[] = process.argv.slice(2),
|
|
27
|
+
): Promise<void> {
|
|
28
|
+
const { secretFile } = await taskOptions(
|
|
29
|
+
taskCommand(
|
|
30
|
+
import.meta.url,
|
|
31
|
+
"Print system-browser instructions for PyPI trusted publishers",
|
|
32
|
+
PypiTrustedPublisherInstructionsOptionsSchema,
|
|
33
|
+
),
|
|
34
|
+
PypiTrustedPublisherInstructionsOptionsSchema,
|
|
35
|
+
argv,
|
|
36
|
+
);
|
|
37
|
+
const authentication = secretFile
|
|
38
|
+
? [
|
|
39
|
+
`- If browser authentication is required, read credentials from ${secretFile} directly into the browser without printing, logging, or exposing secret values.`,
|
|
40
|
+
`- If ${secretFile} is absent, invalid, or insufficient for authentication, pause and ask the user to complete authentication.`,
|
|
41
|
+
]
|
|
42
|
+
: [
|
|
43
|
+
"- If browser authentication is required, pause and ask the user to complete authentication.",
|
|
44
|
+
];
|
|
45
|
+
process.stdout.write(
|
|
46
|
+
`${[
|
|
47
|
+
...instructions.beforeAuthentication,
|
|
48
|
+
...authentication,
|
|
49
|
+
...instructions.afterAuthentication,
|
|
50
|
+
]
|
|
51
|
+
.join("\n")
|
|
52
|
+
.trimEnd()}\n`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -13,7 +13,7 @@ import ts from "typescript";
|
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
import { runTaskMain, taskCommand, taskOptions } from "./cli.ts";
|
|
15
15
|
import { TaskCheckOptionSchema, TaskForceOptionSchema, TaskRootOptionSchema } from "./options.ts";
|
|
16
|
-
import { header, makeReadonly, makeWritable } from "../src/generated.ts";
|
|
16
|
+
import { header, headerLines, makeReadonly, makeWritable } from "../src/generated.ts";
|
|
17
17
|
import { publicFunctionExports } from "../src/module-exports.ts";
|
|
18
18
|
import { resolveRepoRoot } from "../src/packages.ts";
|
|
19
19
|
import {
|
|
@@ -434,9 +434,11 @@ export async function main(args: string[] = process.argv.slice(2)): Promise<void
|
|
|
434
434
|
section.includes("Callable["),
|
|
435
435
|
);
|
|
436
436
|
return [
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
437
|
+
...headerLines({
|
|
438
|
+
comment: "#",
|
|
439
|
+
tool: "projen/tasks/python-node-bindings.ts",
|
|
440
|
+
source,
|
|
441
|
+
}),
|
|
440
442
|
"",
|
|
441
443
|
"from __future__ import annotations",
|
|
442
444
|
"",
|
|
@@ -1162,9 +1164,11 @@ function removeEmptyDirectories(directory: string): void {
|
|
|
1162
1164
|
|
|
1163
1165
|
function pythonRuntimeLoader(source: string): string {
|
|
1164
1166
|
return [
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1167
|
+
...headerLines({
|
|
1168
|
+
comment: "#",
|
|
1169
|
+
tool: "projen/tasks/python-node-bindings.ts",
|
|
1170
|
+
source,
|
|
1171
|
+
}),
|
|
1168
1172
|
"",
|
|
1169
1173
|
"from __future__ import annotations",
|
|
1170
1174
|
"",
|
package/tasks/test-workspace.ts
CHANGED
|
@@ -167,6 +167,8 @@ function selectedTests(
|
|
|
167
167
|
): string[] {
|
|
168
168
|
const all = [
|
|
169
169
|
...graph.packages.flatMap((pkg) => testFiles(join(root, pkg.path, "test"))),
|
|
170
|
+
...testFiles(join(root, "test")),
|
|
171
|
+
...testFiles(join(root, "scripts")),
|
|
170
172
|
...testFiles(join(root, "docs/scripts")),
|
|
171
173
|
];
|
|
172
174
|
if (mode === "unit") return all.filter((path) => !integrationTest(path));
|