@dbx-tools/projen 0.9.70 → 0.9.71

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/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // Hand edits are overwritten on the next watch; this file is read-only.
4
4
 
5
5
  export const PACKAGE_IDENTIFIER = "@dbx-tools/projen";
6
- export const PACKAGE_VERSION = "0.9.70";
6
+ export const PACKAGE_VERSION = "0.9.71";
7
7
  export * as barrels from "./src/barrels.ts";
8
8
  export * as bunApp from "./src/bun-app.ts";
9
9
  export * as bunWorkflow from "./src/bun-workflow.ts";
package/package.json CHANGED
@@ -30,9 +30,9 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@clack/prompts": "^1.7.0",
33
- "@dbx-tools/core": "^0.9.70",
34
- "@dbx-tools/path": "^0.9.70",
35
- "@dbx-tools/shared-core": "^0.9.70",
33
+ "@dbx-tools/core": "^0.9.71",
34
+ "@dbx-tools/path": "^0.9.71",
35
+ "@dbx-tools/shared-core": "^0.9.71",
36
36
  "commander": "^15.0.0",
37
37
  "concurrently": "^10.0.3",
38
38
  "constructs": "^10.6.0",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "main": "index.ts",
56
56
  "license": "Apache-2.0",
57
- "version": "0.9.70",
57
+ "version": "0.9.71",
58
58
  "types": "index.ts",
59
59
  "type": "module",
60
60
  "exports": {
@@ -217,9 +217,9 @@ export async function main(args: string[] = process.argv.slice(2)): Promise<void
217
217
  const entrypoint = Bun.resolveSync(binding.entrypoint, binding.projectDirectory);
218
218
  return binding.modules.length > 0
219
219
  ? binding.modules.map((module) => ({
220
- key: runtimeModuleName(binding, module),
221
- entrypoint: resolvePythonNodeBindingModule(entrypoint, module),
222
- }))
220
+ key: runtimeModuleName(binding, module),
221
+ entrypoint: resolvePythonNodeBindingModule(entrypoint, module),
222
+ }))
223
223
  : [{ key: runtimeModuleName(binding), entrypoint }];
224
224
  });
225
225
  const runtimeExports = [
@@ -320,8 +320,9 @@ export async function main(args: string[] = process.argv.slice(2)): Promise<void
320
320
  const result = await Bun.build({
321
321
  entrypoints: [shimEntry],
322
322
  format: "cjs",
323
- plugins: [runtimePlugin],
324
323
  target: "browser",
324
+ conditions: ["require"],
325
+ plugins: [runtimePlugin],
325
326
  });
326
327
  if (!result.success) {
327
328
  for (const message of result.logs) logger.error(message);
@@ -366,8 +367,8 @@ export async function main(args: string[] = process.argv.slice(2)): Promise<void
366
367
  ...bindings.flatMap((binding) => [
367
368
  ...(binding.modules.length > 0
368
369
  ? binding.modules.map((module) =>
369
- join(binding.bindingDirectory, `${pythonFunctionName(module)}.py`),
370
- )
370
+ join(binding.bindingDirectory, `${pythonFunctionName(module)}.py`),
371
+ )
371
372
  : [join(binding.bindingDirectory, "index.py")]),
372
373
  ]),
373
374
  ].filter((file): file is string => Boolean(file)),
@@ -986,18 +987,18 @@ export async function main(args: string[] = process.argv.slice(2)): Promise<void
986
987
  function pythonDataclass(record: PythonRecord): string {
987
988
  const body = record.fields.length
988
989
  ? record.fields
989
- .map((field) => {
990
- const defaultArgument = Object.hasOwn(field, "defaultValue")
991
- ? pythonDefault(field.defaultValue)
992
- : "default=None";
993
- return [
994
- ` ${field.pythonName}: ${pythonOptionalType(field.type)} = field(`,
995
- ` ${defaultArgument},`,
996
- ` metadata={"javascript_name": ${JSON.stringify(field.javascriptName)}},`,
997
- " )",
998
- ].join("\n");
999
- })
1000
- .join("\n")
990
+ .map((field) => {
991
+ const defaultArgument = Object.hasOwn(field, "defaultValue")
992
+ ? pythonDefault(field.defaultValue)
993
+ : "default=None";
994
+ return [
995
+ ` ${field.pythonName}: ${pythonOptionalType(field.type)} = field(`,
996
+ ` ${defaultArgument},`,
997
+ ` metadata={"javascript_name": ${JSON.stringify(field.javascriptName)}},`,
998
+ " )",
999
+ ].join("\n");
1000
+ })
1001
+ .join("\n")
1001
1002
  : " pass";
1002
1003
  return `@dataclass(kw_only=True)\nclass ${record.name}:\n${body}`;
1003
1004
  }
@@ -1025,11 +1026,11 @@ export async function main(args: string[] = process.argv.slice(2)): Promise<void
1025
1026
  }
1026
1027
  const body = response.fields.length
1027
1028
  ? response.fields
1028
- .map(
1029
- ({ name, required, type }) =>
1030
- ` ${name}: ${required ? type : `NotRequired[${type}]`}`,
1031
- )
1032
- .join("\n")
1029
+ .map(
1030
+ ({ name, required, type }) =>
1031
+ ` ${name}: ${required ? type : `NotRequired[${type}]`}`,
1032
+ )
1033
+ .join("\n")
1033
1034
  : " pass";
1034
1035
  return `class ${response.name}(TypedDict):\n${body}`;
1035
1036
  }
@@ -1044,18 +1045,18 @@ export async function main(args: string[] = process.argv.slice(2)): Promise<void
1044
1045
  );
1045
1046
  const methods = protocol.methods.length
1046
1047
  ? protocol.methods
1047
- .map((method) => {
1048
- const parameters = method.parameters.map(
1049
- ({ name, required, type }) => ` ${name}: ${type}${required ? "" : " = ..."},`,
1050
- );
1051
- return [
1052
- ` async def ${method.name}(`,
1053
- " self,",
1054
- ...parameters,
1055
- ` ) -> ${method.returnType}: ...`,
1056
- ].join("\n");
1057
- })
1058
- .join("\n\n")
1048
+ .map((method) => {
1049
+ const parameters = method.parameters.map(
1050
+ ({ name, required, type }) => ` ${name}: ${type}${required ? "" : " = ..."},`,
1051
+ );
1052
+ return [
1053
+ ` async def ${method.name}(`,
1054
+ " self,",
1055
+ ...parameters,
1056
+ ` ) -> ${method.returnType}: ...`,
1057
+ ].join("\n");
1058
+ })
1059
+ .join("\n\n")
1059
1060
  : "";
1060
1061
  const body = [...properties, methods].filter(Boolean).join("\n\n") || " pass";
1061
1062
  return `class ${protocol.name}(Protocol):\n${body}`;