@stripe/extensibility-dev-tools 0.23.5

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.
Files changed (253) hide show
  1. package/LICENSE.md +19 -0
  2. package/dist/bin/build-custom-object-definitions.cjs +2111 -0
  3. package/dist/bin/build-custom-object-definitions.d.ts +11 -0
  4. package/dist/bin/build-custom-object-definitions.d.ts.map +1 -0
  5. package/dist/bin/build-custom-object-definitions.js +2088 -0
  6. package/dist/bin/create-upload-image.cjs +2136 -0
  7. package/dist/bin/create-upload-image.d.ts +17 -0
  8. package/dist/bin/create-upload-image.d.ts.map +1 -0
  9. package/dist/bin/create-upload-image.js +2113 -0
  10. package/dist/bin/dev-tools-rpc.cjs +3874 -0
  11. package/dist/bin/dev-tools-rpc.d.ts +3 -0
  12. package/dist/bin/dev-tools-rpc.d.ts.map +1 -0
  13. package/dist/bin/dev-tools-rpc.js +3864 -0
  14. package/dist/bin/gen-schemas.cjs +20739 -0
  15. package/dist/bin/gen-schemas.d.ts +8 -0
  16. package/dist/bin/gen-schemas.d.ts.map +1 -0
  17. package/dist/bin/gen-schemas.js +20715 -0
  18. package/dist/bin/gen-workspace.cjs +3847 -0
  19. package/dist/bin/gen-workspace.d.ts +8 -0
  20. package/dist/bin/gen-workspace.d.ts.map +1 -0
  21. package/dist/bin/gen-workspace.js +3841 -0
  22. package/dist/bin/manifest.cjs +686 -0
  23. package/dist/bin/manifest.d.ts +10 -0
  24. package/dist/bin/manifest.d.ts.map +1 -0
  25. package/dist/bin/manifest.js +663 -0
  26. package/dist/bin/rpc/dispatch.d.ts +10 -0
  27. package/dist/bin/rpc/dispatch.d.ts.map +1 -0
  28. package/dist/bin/rpc/handlers.d.ts +4 -0
  29. package/dist/bin/rpc/handlers.d.ts.map +1 -0
  30. package/dist/bin/rpc/types.d.ts +29 -0
  31. package/dist/bin/rpc/types.d.ts.map +1 -0
  32. package/dist/bin/template-info.cjs +1511 -0
  33. package/dist/bin/template-info.d.ts +9 -0
  34. package/dist/bin/template-info.d.ts.map +1 -0
  35. package/dist/bin/template-info.js +1488 -0
  36. package/dist/custom-objects/build-definitions.d.ts +98 -0
  37. package/dist/custom-objects/build-definitions.d.ts.map +1 -0
  38. package/dist/custom-objects/generated/proto/custom_objects/pub/api/app_api/object_definitions_app_service.pb.d.ts +191 -0
  39. package/dist/custom-objects/generated/proto/custom_objects/pub/api/app_api/object_definitions_app_service.pb.d.ts.map +1 -0
  40. package/dist/custom-objects/generated/proto/custom_objects/pub/api/common/schema.pb.d.ts +131 -0
  41. package/dist/custom-objects/generated/proto/custom_objects/pub/api/common/schema.pb.d.ts.map +1 -0
  42. package/dist/custom-objects/generated/proto/google/protobuf/descriptor.pb.d.ts +1482 -0
  43. package/dist/custom-objects/generated/proto/google/protobuf/descriptor.pb.d.ts.map +1 -0
  44. package/dist/custom-objects/generated/proto/google/protobuf/timestamp.pb.d.ts +167 -0
  45. package/dist/custom-objects/generated/proto/google/protobuf/timestamp.pb.d.ts.map +1 -0
  46. package/dist/custom-objects/generated/proto/proto/annotations.pb.d.ts +64 -0
  47. package/dist/custom-objects/generated/proto/proto/annotations.pb.d.ts.map +1 -0
  48. package/dist/custom-objects/generated/proto/proto/extensions.pb.d.ts +657 -0
  49. package/dist/custom-objects/generated/proto/proto/extensions.pb.d.ts.map +1 -0
  50. package/dist/custom-objects/generated/proto/vendor/metadata/pub/api/api_metadata.pb.d.ts +105 -0
  51. package/dist/custom-objects/generated/proto/vendor/metadata/pub/api/api_metadata.pb.d.ts.map +1 -0
  52. package/dist/custom-objects/generated/proto/vendor/net/idempotency/idempotency_model.pb.d.ts +79 -0
  53. package/dist/custom-objects/generated/proto/vendor/net/idempotency/idempotency_model.pb.d.ts.map +1 -0
  54. package/dist/custom-objects/generated/proto/vendor/publicapi/api_group_enum.pb.d.ts +129 -0
  55. package/dist/custom-objects/generated/proto/vendor/publicapi/api_group_enum.pb.d.ts.map +1 -0
  56. package/dist/custom-objects/generated/proto/vendor/publicapi/api_visibility.pb.d.ts +76 -0
  57. package/dist/custom-objects/generated/proto/vendor/publicapi/api_visibility.pb.d.ts.map +1 -0
  58. package/dist/custom-objects/generated/proto/vendor/publicapi/customize_dispatch_middleware_enum.pb.d.ts +78 -0
  59. package/dist/custom-objects/generated/proto/vendor/publicapi/customize_dispatch_middleware_enum.pb.d.ts.map +1 -0
  60. package/dist/custom-objects/generated/proto/vendor/publicapi/docs_namespace_group_enum.pb.d.ts +146 -0
  61. package/dist/custom-objects/generated/proto/vendor/publicapi/docs_namespace_group_enum.pb.d.ts.map +1 -0
  62. package/dist/custom-objects/generated/proto/vendor/publicapi/documented_enum.pb.d.ts +76 -0
  63. package/dist/custom-objects/generated/proto/vendor/publicapi/documented_enum.pb.d.ts.map +1 -0
  64. package/dist/custom-objects/generated/proto/vendor/publicapi/event_scope_enum.pb.d.ts +92 -0
  65. package/dist/custom-objects/generated/proto/vendor/publicapi/event_scope_enum.pb.d.ts.map +1 -0
  66. package/dist/custom-objects/generated/proto/vendor/publicapi/extension_interface.pb.d.ts +124 -0
  67. package/dist/custom-objects/generated/proto/vendor/publicapi/extension_interface.pb.d.ts.map +1 -0
  68. package/dist/custom-objects/generated/proto/vendor/publicapi/feature_enum.pb.d.ts +1070 -0
  69. package/dist/custom-objects/generated/proto/vendor/publicapi/feature_enum.pb.d.ts.map +1 -0
  70. package/dist/custom-objects/generated/proto/vendor/publicapi/field_validation_rules.pb.d.ts +279 -0
  71. package/dist/custom-objects/generated/proto/vendor/publicapi/field_validation_rules.pb.d.ts.map +1 -0
  72. package/dist/custom-objects/generated/proto/vendor/publicapi/flavor_enum.pb.d.ts +78 -0
  73. package/dist/custom-objects/generated/proto/vendor/publicapi/flavor_enum.pb.d.ts.map +1 -0
  74. package/dist/custom-objects/generated/proto/vendor/publicapi/http_error_status.pb.d.ts +102 -0
  75. package/dist/custom-objects/generated/proto/vendor/publicapi/http_error_status.pb.d.ts.map +1 -0
  76. package/dist/custom-objects/generated/proto/vendor/publicapi/method_kind_enum.pb.d.ts +86 -0
  77. package/dist/custom-objects/generated/proto/vendor/publicapi/method_kind_enum.pb.d.ts.map +1 -0
  78. package/dist/custom-objects/generated/proto/vendor/publicapi/method_priority.pb.d.ts +80 -0
  79. package/dist/custom-objects/generated/proto/vendor/publicapi/method_priority.pb.d.ts.map +1 -0
  80. package/dist/custom-objects/generated/proto/vendor/publicapi/permission_check_enum.pb.d.ts +74 -0
  81. package/dist/custom-objects/generated/proto/vendor/publicapi/permission_check_enum.pb.d.ts.map +1 -0
  82. package/dist/custom-objects/generated/proto/vendor/publicapi/redaction_enum.pb.d.ts +76 -0
  83. package/dist/custom-objects/generated/proto/vendor/publicapi/redaction_enum.pb.d.ts.map +1 -0
  84. package/dist/custom-objects/generated/proto/vendor/publicapi/region_routers.pb.d.ts +103 -0
  85. package/dist/custom-objects/generated/proto/vendor/publicapi/region_routers.pb.d.ts.map +1 -0
  86. package/dist/custom-objects/generated/proto/vendor/publicapi/rollout_configs.pb.d.ts +153 -0
  87. package/dist/custom-objects/generated/proto/vendor/publicapi/rollout_configs.pb.d.ts.map +1 -0
  88. package/dist/custom-objects/generated/proto/vendor/publicapi/v2ext.pb.d.ts +1111 -0
  89. package/dist/custom-objects/generated/proto/vendor/publicapi/v2ext.pb.d.ts.map +1 -0
  90. package/dist/custom-objects/generated/proto/vendor/vext/annotations.pb.d.ts +602 -0
  91. package/dist/custom-objects/generated/proto/vendor/vext/annotations.pb.d.ts.map +1 -0
  92. package/dist/custom-objects/generated/proto/vendor/vext/extensions.pb.d.ts +144 -0
  93. package/dist/custom-objects/generated/proto/vendor/vext/extensions.pb.d.ts.map +1 -0
  94. package/dist/custom-objects/generated/proto/vendor/vext/privacy_unified_annotations.pb.d.ts +851 -0
  95. package/dist/custom-objects/generated/proto/vendor/vext/privacy_unified_annotations.pb.d.ts.map +1 -0
  96. package/dist/custom-objects/generated/proto/vendor/vext/xml_annotations.pb.d.ts +125 -0
  97. package/dist/custom-objects/generated/proto/vendor/vext/xml_annotations.pb.d.ts.map +1 -0
  98. package/dist/custom-objects/to-proto-json.d.ts +17 -0
  99. package/dist/custom-objects/to-proto-json.d.ts.map +1 -0
  100. package/dist/dependencies/index.cjs +601 -0
  101. package/dist/dependencies/index.d.ts +320 -0
  102. package/dist/dependencies/index.d.ts.map +1 -0
  103. package/dist/dependencies/index.js +560 -0
  104. package/dist/extensibility-dev-tools-alpha.d.ts +199 -0
  105. package/dist/extensibility-dev-tools-beta.d.ts +199 -0
  106. package/dist/extensibility-dev-tools-dependencies-alpha.d.ts +51 -0
  107. package/dist/extensibility-dev-tools-dependencies-beta.d.ts +51 -0
  108. package/dist/extensibility-dev-tools-dependencies-internal.d.ts +372 -0
  109. package/dist/extensibility-dev-tools-dependencies-public.d.ts +51 -0
  110. package/dist/extensibility-dev-tools-internal.d.ts +1722 -0
  111. package/dist/extensibility-dev-tools-jsonschema-tools-alpha.d.ts +57 -0
  112. package/dist/extensibility-dev-tools-jsonschema-tools-beta.d.ts +57 -0
  113. package/dist/extensibility-dev-tools-jsonschema-tools-internal.d.ts +123 -0
  114. package/dist/extensibility-dev-tools-jsonschema-tools-public.d.ts +57 -0
  115. package/dist/extensibility-dev-tools-manifest-alpha.d.ts +31 -0
  116. package/dist/extensibility-dev-tools-manifest-beta.d.ts +31 -0
  117. package/dist/extensibility-dev-tools-manifest-internal.d.ts +461 -0
  118. package/dist/extensibility-dev-tools-manifest-public.d.ts +31 -0
  119. package/dist/extensibility-dev-tools-public.d.ts +199 -0
  120. package/dist/extensibility-dev-tools-schemas-alpha.d.ts +9 -0
  121. package/dist/extensibility-dev-tools-schemas-beta.d.ts +9 -0
  122. package/dist/extensibility-dev-tools-schemas-internal.d.ts +41 -0
  123. package/dist/extensibility-dev-tools-schemas-public.d.ts +9 -0
  124. package/dist/extensibility-dev-tools-templates-alpha.d.ts +67 -0
  125. package/dist/extensibility-dev-tools-templates-beta.d.ts +67 -0
  126. package/dist/extensibility-dev-tools-templates-internal.d.ts +554 -0
  127. package/dist/extensibility-dev-tools-templates-public.d.ts +67 -0
  128. package/dist/extensibility-dev-tools-workspace-alpha.d.ts +51 -0
  129. package/dist/extensibility-dev-tools-workspace-beta.d.ts +51 -0
  130. package/dist/extensibility-dev-tools-workspace-internal.d.ts +410 -0
  131. package/dist/extensibility-dev-tools-workspace-public.d.ts +51 -0
  132. package/dist/index.cjs +3810 -0
  133. package/dist/index.d.ts +18 -0
  134. package/dist/index.d.ts.map +1 -0
  135. package/dist/index.js +3758 -0
  136. package/dist/jsonschema-tools.cjs +20451 -0
  137. package/dist/jsonschema-tools.d.ts +98 -0
  138. package/dist/jsonschema-tools.d.ts.map +1 -0
  139. package/dist/jsonschema-tools.js +20404 -0
  140. package/dist/manifest/index.cjs +610 -0
  141. package/dist/manifest/index.d.ts +8 -0
  142. package/dist/manifest/index.d.ts.map +1 -0
  143. package/dist/manifest/index.js +571 -0
  144. package/dist/manifest/manifest-v1.d.ts +102 -0
  145. package/dist/manifest/manifest-v1.d.ts.map +1 -0
  146. package/dist/manifest/manifest-v2.d.ts +253 -0
  147. package/dist/manifest/manifest-v2.d.ts.map +1 -0
  148. package/dist/manifest/stripe-app-manifest.d.ts +114 -0
  149. package/dist/manifest/stripe-app-manifest.d.ts.map +1 -0
  150. package/dist/schemas/index.cjs +20692 -0
  151. package/dist/schemas/index.d.ts +37 -0
  152. package/dist/schemas/index.d.ts.map +1 -0
  153. package/dist/schemas/index.js +20656 -0
  154. package/dist/templates/diff-viewer/diff-generator.d.ts +22 -0
  155. package/dist/templates/diff-viewer/diff-generator.d.ts.map +1 -0
  156. package/dist/templates/diff-viewer/diff-prompt.d.ts +13 -0
  157. package/dist/templates/diff-viewer/diff-prompt.d.ts.map +1 -0
  158. package/dist/templates/diff-viewer/index.d.ts +7 -0
  159. package/dist/templates/diff-viewer/index.d.ts.map +1 -0
  160. package/dist/templates/diff-viewer/terminal-renderer.d.ts +29 -0
  161. package/dist/templates/diff-viewer/terminal-renderer.d.ts.map +1 -0
  162. package/dist/templates/diff-viewer/types.d.ts +58 -0
  163. package/dist/templates/diff-viewer/types.d.ts.map +1 -0
  164. package/dist/templates/extensions/base.d.ts +23 -0
  165. package/dist/templates/extensions/base.d.ts.map +1 -0
  166. package/dist/templates/extensions/billing.bill.discount_calculation.d.ts +6 -0
  167. package/dist/templates/extensions/billing.bill.discount_calculation.d.ts.map +1 -0
  168. package/dist/templates/extensions/billing.customer_balance_application.d.ts +6 -0
  169. package/dist/templates/extensions/billing.customer_balance_application.d.ts.map +1 -0
  170. package/dist/templates/extensions/billing.invoice_collection_setting.d.ts +6 -0
  171. package/dist/templates/extensions/billing.invoice_collection_setting.d.ts.map +1 -0
  172. package/dist/templates/extensions/billing.prorations.d.ts +6 -0
  173. package/dist/templates/extensions/billing.prorations.d.ts.map +1 -0
  174. package/dist/templates/extensions/billing.recurring_billing_item_handling.d.ts +6 -0
  175. package/dist/templates/extensions/billing.recurring_billing_item_handling.d.ts.map +1 -0
  176. package/dist/templates/extensions/core.workflows.custom_action.d.ts +6 -0
  177. package/dist/templates/extensions/core.workflows.custom_action.d.ts.map +1 -0
  178. package/dist/templates/extensions/extend.objects.custom_objects.d.ts +6 -0
  179. package/dist/templates/extensions/extend.objects.custom_objects.d.ts.map +1 -0
  180. package/dist/templates/extensions/extend.workflows.custom_action.d.ts +6 -0
  181. package/dist/templates/extensions/extend.workflows.custom_action.d.ts.map +1 -0
  182. package/dist/templates/extensions/index.d.ts +13 -0
  183. package/dist/templates/extensions/index.d.ts.map +1 -0
  184. package/dist/templates/extensions/registry.d.ts +10 -0
  185. package/dist/templates/extensions/registry.d.ts.map +1 -0
  186. package/dist/templates/extensions/types.d.ts +104 -0
  187. package/dist/templates/extensions/types.d.ts.map +1 -0
  188. package/dist/templates/file-writer.d.ts +140 -0
  189. package/dist/templates/file-writer.d.ts.map +1 -0
  190. package/dist/templates/fs/_impl.d.ts +29 -0
  191. package/dist/templates/fs/_impl.d.ts.map +1 -0
  192. package/dist/templates/fs/filesystem.d.ts +8 -0
  193. package/dist/templates/fs/filesystem.d.ts.map +1 -0
  194. package/dist/templates/fs/in-memory.d.ts +9 -0
  195. package/dist/templates/fs/in-memory.d.ts.map +1 -0
  196. package/dist/templates/fs/index.d.ts +25 -0
  197. package/dist/templates/fs/index.d.ts.map +1 -0
  198. package/dist/templates/fs-utils.d.ts +17 -0
  199. package/dist/templates/fs-utils.d.ts.map +1 -0
  200. package/dist/templates/index.cjs +2248 -0
  201. package/dist/templates/index.d.ts +32 -0
  202. package/dist/templates/index.d.ts.map +1 -0
  203. package/dist/templates/index.js +2203 -0
  204. package/dist/templates/root/index.d.ts +60 -0
  205. package/dist/templates/root/index.d.ts.map +1 -0
  206. package/dist/templates/simple-templates.d.ts +8 -0
  207. package/dist/templates/simple-templates.d.ts.map +1 -0
  208. package/dist/templates/template-manager.d.ts +8 -0
  209. package/dist/templates/template-manager.d.ts.map +1 -0
  210. package/dist/templates/types.d.ts +9 -0
  211. package/dist/templates/types.d.ts.map +1 -0
  212. package/dist/tsconfig.build.tsbuildinfo +1 -0
  213. package/dist/workspace/index.cjs +3756 -0
  214. package/dist/workspace/index.d.ts +336 -0
  215. package/dist/workspace/index.d.ts.map +1 -0
  216. package/dist/workspace/index.js +3731 -0
  217. package/package.json +137 -0
  218. package/templates/extensions/billing.bill.discount_calculation/index.test.ts +15 -0
  219. package/templates/extensions/billing.bill.discount_calculation/index.ts +20 -0
  220. package/templates/extensions/billing.customer_balance_application/index.test.ts +15 -0
  221. package/templates/extensions/billing.customer_balance_application/index.ts +18 -0
  222. package/templates/extensions/billing.invoice_collection_setting/index.test.ts +15 -0
  223. package/templates/extensions/billing.invoice_collection_setting/index.ts +16 -0
  224. package/templates/extensions/billing.prorations/index.test.ts +15 -0
  225. package/templates/extensions/billing.prorations/index.ts +18 -0
  226. package/templates/extensions/billing.recurring_billing_item_handling/index.test.ts +15 -0
  227. package/templates/extensions/billing.recurring_billing_item_handling/index.ts +42 -0
  228. package/templates/extensions/common/.prettierignore +3 -0
  229. package/templates/extensions/common/eslint.config.mts.mustache +95 -0
  230. package/templates/extensions/common/package.json.mustache +26 -0
  231. package/templates/extensions/common/tsconfig.build.json.mustache +15 -0
  232. package/templates/extensions/common/tsconfig.json.mustache +16 -0
  233. package/templates/extensions/core.workflows.custom_action/custom_input.schema.json +6 -0
  234. package/templates/extensions/core.workflows.custom_action/index.test.ts +15 -0
  235. package/templates/extensions/core.workflows.custom_action/index.ts +31 -0
  236. package/templates/extensions/extend.workflows.custom_action/custom_input.schema.json +6 -0
  237. package/templates/extensions/extend.workflows.custom_action/index.test.ts +15 -0
  238. package/templates/extensions/extend.workflows.custom_action/index.ts +31 -0
  239. package/templates/root/.husky/pre-commit +1 -0
  240. package/templates/root/.prettierignore +5 -0
  241. package/templates/root/.prettierrc +7 -0
  242. package/templates/root/_gitignore +28 -0
  243. package/templates/root/custom-objects/package.json +20 -0
  244. package/templates/root/custom-objects/tsconfig.json +9 -0
  245. package/templates/root/eslint.config.mts +95 -0
  246. package/templates/root/package.json.mustache +32 -0
  247. package/templates/root/pnpm-workspace.yaml +7 -0
  248. package/templates/root/stripe-app.yaml.mustache +6 -0
  249. package/templates/root/tools/test.mts +38 -0
  250. package/templates/root/tsconfig.base.json +23 -0
  251. package/templates/root/tsconfig.json +15 -0
  252. package/templates/root/ui/package.json +17 -0
  253. package/templates/root/vitest.config.mts +47 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "custom-objects",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "license": "UNLICENSED",
6
+ "private": true,
7
+ "scripts": {
8
+ "build": "test -d src && custom-objects-build --input src --output dist || true",
9
+ "lint:types": "test ! -d src || tsc --noEmit",
10
+ "test": "vitest run"
11
+ },
12
+ "dependencies": {
13
+ "@stripe/extensibility-custom-objects": "0.7.4",
14
+ "@stripe/extensibility-sdk": "0.22.4"
15
+ },
16
+ "devDependencies": {
17
+ "@stripe/extensibility-custom-objects-tools": "0.40.0",
18
+ "@stripe/extensibility-test-helpers": "0.2.7"
19
+ }
20
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "types": ["vitest/globals"]
7
+ },
8
+ "exclude": ["dist"]
9
+ }
@@ -0,0 +1,95 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import eslint from '@eslint/js';
5
+ import { defineConfig } from 'eslint/config';
6
+ import tseslint from 'typescript-eslint';
7
+ import workspaces from 'eslint-plugin-workspaces';
8
+ import eslintConfigPrettier from 'eslint-config-prettier/flat';
9
+
10
+ import globals from 'globals';
11
+
12
+ import stripeAppsConfig from '@stripe/extensibility-eslint-plugin';
13
+
14
+ // Read additional ignore globs from package.json (written by the generate plugin
15
+ // to exclude generated SDK directories from linting).
16
+ let stripeGlobsToIgnore: string[] = [];
17
+ try {
18
+ const configDir = dirname(fileURLToPath(import.meta.url));
19
+ const packageJsonPath = resolve(configDir, './package.json');
20
+ const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
21
+ const globs = pkg?.stripe?.eslintIgnoreGlobs;
22
+ if (Array.isArray(globs)) {
23
+ stripeGlobsToIgnore = globs.filter(
24
+ (g: unknown): g is string => typeof g === 'string'
25
+ );
26
+ }
27
+ } catch {
28
+ // package.json not found or unparseable — ignore
29
+ }
30
+
31
+ export default defineConfig([
32
+ eslint.configs.recommended,
33
+ ...tseslint.configs.recommended,
34
+ ...stripeAppsConfig,
35
+
36
+ // Global ignores
37
+ {
38
+ ignores: [
39
+ '.build',
40
+ '**/dist',
41
+ '**/generated',
42
+ '**/node_modules',
43
+ 'extensions/**',
44
+ 'custom-objects',
45
+ 'ui',
46
+ ...stripeGlobsToIgnore,
47
+ ],
48
+ },
49
+
50
+ // Common rules for all files
51
+ {
52
+ plugins: { workspaces },
53
+ rules: {
54
+ ...workspaces.configs.recommended.rules,
55
+ },
56
+ },
57
+
58
+ // Config files (vitest.config.ts, eslint.config.ts, etc.)
59
+ {
60
+ name: 'ts-configs',
61
+ files: ['extensions/*/*.config.m?ts', '*.config.m?ts', 'eslint.config.mts'],
62
+ languageOptions: {
63
+ globals: {
64
+ ...globals.node,
65
+ },
66
+ parserOptions: {
67
+ projectService: false,
68
+ },
69
+ },
70
+ rules: {
71
+ '@typescript-eslint/no-unused-vars': 'off',
72
+ },
73
+ },
74
+
75
+ // JavaScript/MJS files (scripts, configs)
76
+ {
77
+ name: 'js-configs',
78
+ files: ['**/*.js', '**/*.mjs'],
79
+ languageOptions: {
80
+ globals: {
81
+ ...globals.node,
82
+ },
83
+ parserOptions: {
84
+ projectService: false,
85
+ },
86
+ },
87
+ rules: {
88
+ '@typescript-eslint/no-require-imports': 'off',
89
+ '@typescript-eslint/no-unused-vars': 'off',
90
+ 'no-unused-vars': 'off',
91
+ },
92
+ },
93
+
94
+ eslintConfigPrettier,
95
+ ]);
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "{{ appId }}",
3
+ "version": "{{ version }}",
4
+ "description": "{{ appName }}",
5
+ "private": true,
6
+ "license": "~~proprietary~~",
7
+ "engines": {
8
+ "node": ">=20.0.0"
9
+ },
10
+ "packageManager": "pnpm@10.30.3",
11
+ "scripts": {
12
+ "build": "pnpm -r --if-present build",
13
+ "lint": "pnpm lint:types && pnpm lint:eslint && pnpm lint:format",
14
+ "lint:types": "pnpm -r --if-present lint:types",
15
+ "lint:eslint": "eslint . --ignore-pattern 'extensions/**' && pnpm -r --filter './extensions/*' --if-present lint:eslint",
16
+ "lint:format": "prettier --check .",
17
+ "fix:lint": "eslint --fix . --ignore-pattern 'extensions/**' && pnpm -r --filter './extensions/*' --if-present fix:lint",
18
+ "fix:format": "prettier --write .",
19
+ "test": "tsx tools/test.mts",
20
+ "test:watch": "vitest watch",
21
+ "check": "pnpm build && pnpm lint && pnpm test",
22
+ "prepare": "husky",
23
+ "preimage": "pnpm install --lockfile-only && pnpm build && pnpm lint:types && pnpm lint:eslint && pnpm test",
24
+ "image": "rm -rf .build && create-upload-image .build",
25
+ "postimage": "cp pnpm-lock.yaml .build/",
26
+ "stripe:regen": "gen-workspace --package-dir ."
27
+ },
28
+ "lint-staged": {
29
+ "*.{ts,mts,mjs,js}": ["eslint --fix", "prettier --write"],
30
+ "*.{json,md,yaml}": "prettier --write"
31
+ }
32
+ }
@@ -0,0 +1,7 @@
1
+ packages:
2
+ - extensions/*
3
+ - custom-objects
4
+ - ui
5
+
6
+ overrides:
7
+ vite: ^6.0.0
@@ -0,0 +1,6 @@
1
+ $schema: https://stripe.com/stripe-app/v2.0.0/schema
2
+ id: '{{ appId }}'
3
+ name: '{{ appName }}'
4
+ version: 0.0.1
5
+ declarations:
6
+ distribution_type: private
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Runs tests across the workspace:
4
+ * - vitest for script extensions and custom objects (extensions/*)
5
+ * - jest for UI extensions (ui/)
6
+ */
7
+ import { existsSync, readdirSync } from 'node:fs';
8
+ import { execSync } from 'node:child_process';
9
+
10
+ const hasExtensions =
11
+ existsSync('extensions') &&
12
+ readdirSync('extensions').some((name) => existsSync(`extensions/${name}/package.json`));
13
+
14
+ const hasUI = existsSync('ui/package.json');
15
+
16
+ let exitCode = 0;
17
+
18
+ function run(cmd: string): void {
19
+ try {
20
+ execSync(cmd, { stdio: 'inherit' });
21
+ } catch (e: unknown) {
22
+ exitCode = (e as NodeJS.ErrnoException & { status?: number }).status ?? 1;
23
+ }
24
+ }
25
+
26
+ if (hasExtensions) {
27
+ run('vitest run');
28
+ }
29
+
30
+ if (hasUI) {
31
+ try {
32
+ execSync('pnpm --filter "./ui" test', { stdio: 'inherit' });
33
+ } catch {
34
+ // UI test failures are non-fatal
35
+ }
36
+ }
37
+
38
+ process.exit(exitCode);
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "lib": ["ES2022"],
7
+ "declaration": true,
8
+ "declarationMap": true,
9
+ "esModuleInterop": true,
10
+ "exactOptionalPropertyTypes": false,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "isolatedModules": true,
13
+ "noFallthroughCasesInSwitch": true,
14
+ "noImplicitReturns": true,
15
+ "removeComments": false,
16
+ "resolveJsonModule": true,
17
+ "skipLibCheck": true,
18
+ "sourceMap": true,
19
+ "strict": true,
20
+ "types": [],
21
+ "verbatimModuleSyntax": true
22
+ }
23
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "plugins": [
6
+ {
7
+ "name": "@stripe/extensibility-language-server/plugin"
8
+ }
9
+ ],
10
+ "preserveWatchOutput": true,
11
+ "types": ["vitest/globals", "node"]
12
+ },
13
+ "include": ["**/*.ts"],
14
+ "exclude": ["**/node_modules", "**/dist"]
15
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "ui",
3
+ "version": "0.0.1",
4
+ "license": "UNLICENSED",
5
+ "private": true,
6
+ "scripts": {
7
+ "test": "jest --passWithNoTests"
8
+ },
9
+ "dependencies": {
10
+ "@stripe/ui-extension-sdk": "^9.1.0"
11
+ },
12
+ "devDependencies": {
13
+ "@stripe/ui-extension-tools": "^0.0.1",
14
+ "@types/jest": "^27.5.2",
15
+ "@types/react": "^17.0.2"
16
+ }
17
+ }
@@ -0,0 +1,47 @@
1
+ import { defineConfig } from 'vitest/config';
2
+ import { existsSync, readdirSync } from 'fs';
3
+ import { dirname, resolve } from 'path';
4
+ import { fileURLToPath } from 'url';
5
+
6
+ const rootDir = dirname(fileURLToPath(import.meta.url));
7
+ const extensionsDir = resolve(rootDir, 'extensions');
8
+
9
+ const extensionProjects = existsSync(extensionsDir)
10
+ ? readdirSync(extensionsDir)
11
+ .filter((name) => existsSync(resolve(extensionsDir, name, 'package.json')))
12
+ .map((name) => resolve(extensionsDir, name))
13
+ : [];
14
+
15
+ const coProjects = existsSync(resolve(rootDir, 'custom-objects/package.json'))
16
+ ? [resolve(rootDir, 'custom-objects')]
17
+ : [];
18
+
19
+ const projects = [...extensionProjects, ...coProjects];
20
+
21
+ if (projects.length === 0) {
22
+ console.debug(`No vitest projects detected. This means either:
23
+ - You have no extension projects defined, in which case this warning is expected.
24
+ - There is an internal error detecting vitest projects relative to the project root
25
+ ${rootDir}.
26
+ `);
27
+ }
28
+
29
+ export default projects.length > 0
30
+ ? defineConfig({
31
+ test: {
32
+ projects,
33
+ passWithNoTests: true,
34
+
35
+ // Only run tests from src, not compiled dist
36
+ exclude: ['**/node_modules', '**/dist'],
37
+ // Place snapshots alongside test files instead of in __snapshots__
38
+ snapshotFormat: {
39
+ escapeString: false,
40
+ printBasicPrototype: false,
41
+ },
42
+ resolveSnapshotPath: (testPath, snapExtension) => {
43
+ return testPath.replace(/\.test\.ts$/, `.test${snapExtension}`);
44
+ },
45
+ },
46
+ })
47
+ : defineConfig({ test: { passWithNoTests: true, include: [] } });