@dbx-tools/projen 0.9.50 → 0.9.54

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,67 +0,0 @@
1
- /**
2
- * Projen task wiring for pyproject-driven PythonMonkey runtime generation.
3
- *
4
- * Type extraction and bundle emission remain in the executable generator; this
5
- * component owns only typed configuration and generate/check task registration.
6
- */
7
- import { Component, type Project, type Task } from "projen";
8
- import { taskCommand } from "./project-js.ts";
9
-
10
- /** One function replaced only in a generated PythonMonkey bundle. */
11
- export interface PythonNodeFunctionOverride {
12
- /** Module specifier imported by the ordinary Node source. */
13
- readonly module: string;
14
- /** Named export to replace. */
15
- readonly export: string;
16
- /** Repository-relative TypeScript file containing the replacement. */
17
- readonly handler: string;
18
- /** Named export in {@link handler}. Defaults to {@link export}. */
19
- readonly handlerExport?: string;
20
- }
21
-
22
- /** Node package embedded into one Python distribution through PythonMonkey. */
23
- export interface PythonNodeBindingsOptions {
24
- /** Public Node package specifier, such as `@dbx-tools/auth`. */
25
- readonly package: string;
26
- /** Optional portable package subpath to bind. Defaults to {@link package}. */
27
- readonly entrypoint?: string;
28
- /** Automatically generated root namespace modules to bind independently. */
29
- readonly modules?: readonly string[];
30
- /** Functions replaced only while generating the Python runtime. */
31
- readonly functionOverrides?: readonly PythonNodeFunctionOverride[];
32
- }
33
-
34
- /** Options for pyproject-driven PythonMonkey generation tasks. */
35
- export interface PythonNodeBundleOptions {
36
- /** Stable task-name prefix, such as `auth`. */
37
- readonly name: string;
38
- /** Repository-relative Python project containing `pyproject.toml`. */
39
- readonly projectDirectory: string;
40
- /** Add the freshness check to the project's test task. Defaults to true. */
41
- readonly test?: boolean;
42
- }
43
-
44
- /** Owns paired generation and freshness-check tasks for one Python package. */
45
- export class PythonNodeBundle extends Component {
46
- readonly buildTask: Task;
47
- readonly checkTask: Task;
48
- readonly watchTask: Task;
49
-
50
- constructor(project: Project, options: PythonNodeBundleOptions) {
51
- super(project);
52
- const command = taskCommand("python-node-bindings.ts", "--project", options.projectDirectory);
53
- this.buildTask = project.addTask(`${options.name}:python-runtime`, {
54
- description: `Generate Node bindings for Python package ${options.name}`,
55
- execArgs: command,
56
- });
57
- this.checkTask = project.addTask(`${options.name}:python-runtime:check`, {
58
- description: `Verify generated Node bindings for Python package ${options.name}`,
59
- execArgs: [...command, "--check"],
60
- });
61
- this.watchTask = project.addTask(`${options.name}:python-runtime:watch`, {
62
- description: `Watch and regenerate Node bindings for Python package ${options.name}`,
63
- execArgs: taskCommand("python-node-bindings-watch.ts", "--project", options.projectDirectory),
64
- });
65
- if (options.test ?? true) project.testTask.spawn(this.checkTask);
66
- }
67
- }