@open-mercato/cli 0.6.2-develop.3467.1.2a1818709d → 0.6.3-develop.3484.1.1427e58147
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.
|
@@ -112,6 +112,7 @@ function createNotificationsExtension() {
|
|
|
112
112
|
fileName: "notifications.generated.ts",
|
|
113
113
|
imports: [
|
|
114
114
|
{ namedImports: [{ name: "NotificationTypeDefinition", isTypeOnly: true }], moduleSpecifier: "@open-mercato/shared/modules/notifications/types" },
|
|
115
|
+
{ namedImports: [{ name: "applyNotificationTypeOverridesToEntries" }], moduleSpecifier: "@open-mercato/shared/modules/overrides" },
|
|
115
116
|
...notificationImports
|
|
116
117
|
],
|
|
117
118
|
build(sourceFile) {
|
|
@@ -127,9 +128,13 @@ function createNotificationsExtension() {
|
|
|
127
128
|
type: "NotificationTypeEntry[]",
|
|
128
129
|
initializer: arrayLiteral(notificationTypeEntries, writeValue)
|
|
129
130
|
},
|
|
131
|
+
{
|
|
132
|
+
name: "entries",
|
|
133
|
+
initializer: callExpression(identifier("applyNotificationTypeOverridesToEntries"), [identifier("entriesRaw")])
|
|
134
|
+
},
|
|
130
135
|
{
|
|
131
136
|
name: "allTypes",
|
|
132
|
-
initializer: methodCall(identifier("
|
|
137
|
+
initializer: methodCall(identifier("entries"), "flatMap", [
|
|
133
138
|
arrowFunction({
|
|
134
139
|
parameters: ["entry"],
|
|
135
140
|
body: propertyAccess(identifier("entry"), "types")
|
|
@@ -142,7 +147,7 @@ function createNotificationsExtension() {
|
|
|
142
147
|
declarationKind: VariableDeclarationKind.Const,
|
|
143
148
|
isExported: true,
|
|
144
149
|
declarations: [
|
|
145
|
-
{ name: "notificationTypeEntries", initializer: identifier("
|
|
150
|
+
{ name: "notificationTypeEntries", initializer: identifier("entries") },
|
|
146
151
|
{ name: "notificationTypes", initializer: identifier("allTypes") }
|
|
147
152
|
]
|
|
148
153
|
});
|
|
@@ -181,6 +186,7 @@ function createNotificationsExtension() {
|
|
|
181
186
|
],
|
|
182
187
|
moduleSpecifier: "@open-mercato/shared/modules/notifications/types"
|
|
183
188
|
},
|
|
189
|
+
{ namedImports: [{ name: "applyNotificationTypeOverridesToEntries" }], moduleSpecifier: "@open-mercato/shared/modules/overrides" },
|
|
184
190
|
...notificationClientImports
|
|
185
191
|
],
|
|
186
192
|
build(sourceFile) {
|
|
@@ -201,9 +207,13 @@ function createNotificationsExtension() {
|
|
|
201
207
|
type: "NotificationTypeEntry[]",
|
|
202
208
|
initializer: arrayLiteral(notificationClientTypeEntries, writeValue)
|
|
203
209
|
},
|
|
210
|
+
{
|
|
211
|
+
name: "entries",
|
|
212
|
+
initializer: callExpression(identifier("applyNotificationTypeOverridesToEntries"), [identifier("entriesRaw")])
|
|
213
|
+
},
|
|
204
214
|
{
|
|
205
215
|
name: "allTypes",
|
|
206
|
-
initializer: methodCall(identifier("
|
|
216
|
+
initializer: methodCall(identifier("entries"), "flatMap", [
|
|
207
217
|
arrowFunction({
|
|
208
218
|
parameters: ["entry"],
|
|
209
219
|
body: propertyAccess(identifier("entry"), "types")
|
|
@@ -243,7 +253,7 @@ function createNotificationsExtension() {
|
|
|
243
253
|
declarationKind: VariableDeclarationKind.Const,
|
|
244
254
|
isExported: true,
|
|
245
255
|
declarations: [
|
|
246
|
-
{ name: "notificationClientTypeEntries", initializer: identifier("
|
|
256
|
+
{ name: "notificationClientTypeEntries", initializer: identifier("entries") },
|
|
247
257
|
{ name: "notificationClientTypes", initializer: identifier("allTypes") },
|
|
248
258
|
{ name: "notificationRenderers", initializer: identifier("renderers") }
|
|
249
259
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/generators/extensions/notifications.ts"],
|
|
4
|
-
"sourcesContent": ["import { VariableDeclarationKind, type WriterFunction } from 'ts-morph'\nimport type { GeneratorExtension } from '../extension'\nimport {\n arrayLiteral,\n arrowFunction,\n binaryExpression,\n callExpression,\n identifier,\n methodCall,\n nonNullAssertion,\n objectFromEntries,\n optionalPropertyAccess,\n propertyAccess,\n returnStatement,\n writeValue,\n} from '../ast'\nimport {\n emptyArray,\n moduleEntry,\n namespaceFallback,\n namespaceImportSpec,\n renderGeneratedTsSource,\n sideEffectImportSpec,\n} from './shared'\n\nexport function createNotificationsExtension(): GeneratorExtension {\n const notificationImports: Array<ReturnType<typeof namespaceImportSpec>> = []\n const notificationTypeEntries: WriterFunction[] = []\n const notificationClientImports: Array<ReturnType<typeof namespaceImportSpec>> = []\n const notificationClientTypeEntries: WriterFunction[] = []\n const paymentClientImports: Array<ReturnType<typeof sideEffectImportSpec>> = []\n const notificationHandlerImports: Array<ReturnType<typeof namespaceImportSpec>> = []\n const notificationHandlerEntries: WriterFunction[] = []\n\n return {\n id: 'registry.notifications',\n outputFiles: [\n 'notifications.generated.ts',\n 'notifications.client.generated.ts',\n 'payments.client.generated.ts',\n 'notification-handlers.generated.ts',\n ],\n scanModule(ctx) {\n ctx.processStandaloneConfig({\n roots: ctx.roots,\n imps: ctx.imps,\n modId: ctx.moduleId,\n relativePath: 'notifications.ts',\n prefix: 'NOTIF',\n importIdRef: ctx.importIdRef,\n standaloneImports: notificationImports,\n standaloneEntries: notificationTypeEntries,\n writeConfig: ({ importName, moduleId }) =>\n moduleEntry(moduleId, [\n {\n name: 'types',\n value: namespaceFallback({\n importName,\n members: ['default', 'notificationTypes', 'types'],\n fallback: emptyArray(),\n castType: 'NotificationTypeDefinition[]',\n }),\n },\n ]),\n })\n\n ctx.processStandaloneConfig({\n roots: ctx.roots,\n imps: ctx.imps,\n modId: ctx.moduleId,\n relativePath: 'notifications.client.ts',\n prefix: 'NOTIF_CLIENT',\n importIdRef: ctx.importIdRef,\n standaloneImports: notificationClientImports,\n standaloneEntries: notificationClientTypeEntries,\n writeConfig: ({ importName, moduleId }) =>\n moduleEntry(moduleId, [\n {\n name: 'types',\n value: namespaceFallback({\n importName,\n members: ['default'],\n fallback: emptyArray(),\n castType: 'NotificationTypeDefinition[]',\n }),\n },\n ]),\n })\n\n const paymentClient = ctx.resolveFirstModuleFile(ctx.roots, ctx.imps, [\n 'widgets/payments/client.tsx',\n 'widgets/payments/client.ts',\n ])\n if (paymentClient) {\n paymentClientImports.push(sideEffectImportSpec(paymentClient.importPath))\n }\n\n ctx.processStandaloneConfig({\n roots: ctx.roots,\n imps: ctx.imps,\n modId: ctx.moduleId,\n relativePath: 'notifications.handlers.ts',\n prefix: 'NOTIF_HANDLERS',\n importIdRef: ctx.importIdRef,\n standaloneImports: notificationHandlerImports,\n standaloneEntries: notificationHandlerEntries,\n writeConfig: ({ importName, moduleId }) =>\n moduleEntry(moduleId, [\n {\n name: 'handlers',\n value: namespaceFallback({\n importName,\n members: ['default', 'notificationHandlers'],\n fallback: emptyArray(),\n castType: 'NotificationHandler[]',\n }),\n },\n ]),\n })\n },\n generateOutput() {\n const notificationsOutput = renderGeneratedTsSource({\n fileName: 'notifications.generated.ts',\n imports: [\n { namedImports: [{ name: 'NotificationTypeDefinition', isTypeOnly: true }], moduleSpecifier: '@open-mercato/shared/modules/notifications/types' },\n ...notificationImports,\n ],\n build(sourceFile) {\n sourceFile.addTypeAlias({\n name: 'NotificationTypeEntry',\n type: '{ moduleId: string; types: NotificationTypeDefinition[] }',\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n declarations: [\n {\n name: 'entriesRaw',\n type: 'NotificationTypeEntry[]',\n initializer: arrayLiteral(notificationTypeEntries, writeValue),\n },\n {\n name: 'allTypes',\n initializer: methodCall(identifier('entriesRaw'), 'flatMap', [\n arrowFunction({\n parameters: ['entry'],\n body: propertyAccess(identifier('entry'), 'types'),\n }),\n ]),\n },\n ],\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n { name: 'notificationTypeEntries', initializer: identifier('entriesRaw') },\n { name: 'notificationTypes', initializer: identifier('allTypes') },\n ],\n })\n sourceFile.addFunction({\n name: 'getNotificationTypes',\n isExported: true,\n returnType: 'NotificationTypeDefinition[]',\n statements: [returnStatement(identifier('allTypes'))],\n })\n sourceFile.addFunction({\n name: 'getNotificationType',\n isExported: true,\n parameters: [{ name: 'type', type: 'string' }],\n returnType: 'NotificationTypeDefinition | undefined',\n statements: [\n returnStatement(\n methodCall(identifier('allTypes'), 'find', [\n arrowFunction({\n parameters: ['entry'],\n body: binaryExpression(propertyAccess(identifier('entry'), 'type'), '===', identifier('type')),\n }),\n ]),\n ),\n ],\n })\n },\n })\n\n const notificationsClientOutput = renderGeneratedTsSource({\n fileName: 'notifications.client.generated.ts',\n imports: [\n { namedImports: [{ name: 'ComponentType', isTypeOnly: true }], moduleSpecifier: 'react' },\n {\n namedImports: [\n { name: 'NotificationTypeDefinition', isTypeOnly: true },\n { name: 'NotificationRendererProps', isTypeOnly: true },\n ],\n moduleSpecifier: '@open-mercato/shared/modules/notifications/types',\n },\n ...notificationClientImports,\n ],\n build(sourceFile) {\n sourceFile.addTypeAlias({\n name: 'NotificationTypeEntry',\n type: '{ moduleId: string; types: NotificationTypeDefinition[] }',\n })\n sourceFile.addTypeAlias({\n name: 'NotificationRenderers',\n isExported: true,\n type: 'Record<string, ComponentType<NotificationRendererProps>>',\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n declarations: [\n {\n name: 'entriesRaw',\n type: 'NotificationTypeEntry[]',\n initializer: arrayLiteral(notificationClientTypeEntries, writeValue),\n },\n {\n name: 'allTypes',\n initializer: methodCall(identifier('entriesRaw'), 'flatMap', [\n arrowFunction({\n parameters: ['entry'],\n body: propertyAccess(identifier('entry'), 'types'),\n }),\n ]),\n },\n {\n name: 'renderers',\n type: 'NotificationRenderers',\n initializer: objectFromEntries(\n methodCall(\n methodCall(identifier('allTypes'), 'filter', [\n arrowFunction({\n parameters: ['typeDef'],\n body: callExpression(identifier('Boolean'), [propertyAccess(identifier('typeDef'), 'Renderer')]),\n }),\n ]),\n 'map',\n [\n arrowFunction({\n parameters: ['typeDef'],\n body: arrayLiteral(\n [\n propertyAccess(identifier('typeDef'), 'type'),\n nonNullAssertion(propertyAccess(identifier('typeDef'), 'Renderer')),\n ],\n writeValue,\n ),\n }),\n ],\n ),\n ),\n },\n ],\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n { name: 'notificationClientTypeEntries', initializer: identifier('entriesRaw') },\n { name: 'notificationClientTypes', initializer: identifier('allTypes') },\n { name: 'notificationRenderers', initializer: identifier('renderers') },\n ],\n })\n sourceFile.addFunction({\n name: 'getNotificationRenderers',\n isExported: true,\n returnType: 'NotificationRenderers',\n statements: [returnStatement(identifier('renderers'))],\n })\n },\n })\n\n const paymentsClientOutput = renderGeneratedTsSource({\n fileName: 'payments.client.generated.ts',\n imports: paymentClientImports,\n build(sourceFile) {\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n { name: 'paymentGatewayClientModuleCount', initializer: String(paymentClientImports.length) },\n ],\n })\n },\n })\n\n const notificationHandlersOutput = renderGeneratedTsSource({\n fileName: 'notification-handlers.generated.ts',\n imports: [\n { namedImports: [{ name: 'NotificationHandler', isTypeOnly: true }], moduleSpecifier: '@open-mercato/shared/modules/notifications/handler' },\n ...notificationHandlerImports,\n ],\n build(sourceFile) {\n sourceFile.addTypeAlias({\n name: 'NotificationHandlerEntry',\n type: '{ moduleId: string; handlers: NotificationHandler[] }',\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n {\n name: 'notificationHandlerEntries',\n type: 'NotificationHandlerEntry[]',\n initializer: arrayLiteral(notificationHandlerEntries, writeValue),\n },\n ],\n })\n },\n })\n\n return new Map([\n ['notifications.generated.ts', notificationsOutput],\n ['notifications.client.generated.ts', notificationsClientOutput],\n ['payments.client.generated.ts', paymentsClientOutput],\n ['notification-handlers.generated.ts', notificationHandlersOutput],\n ])\n },\n }\n}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AA,YAC9B,iBAAiB,wBAAwB;AAAA,YACzC,cAAc;AAAA,cACZ;AAAA,gBACE,MAAM;AAAA,gBACN,MAAM;AAAA,gBACN,aAAa,aAAa,yBAAyB,UAAU;AAAA,cAC/D;AAAA,cACA;AAAA,gBACE,MAAM;AAAA,gBACN,aAAa,WAAW,WAAW,YAAY,GAAG,WAAW;AAAA,
|
|
4
|
+
"sourcesContent": ["import { VariableDeclarationKind, type WriterFunction } from 'ts-morph'\nimport type { GeneratorExtension } from '../extension'\nimport {\n arrayLiteral,\n arrowFunction,\n binaryExpression,\n callExpression,\n identifier,\n methodCall,\n nonNullAssertion,\n objectFromEntries,\n optionalPropertyAccess,\n propertyAccess,\n returnStatement,\n writeValue,\n} from '../ast'\nimport {\n emptyArray,\n moduleEntry,\n namespaceFallback,\n namespaceImportSpec,\n renderGeneratedTsSource,\n sideEffectImportSpec,\n} from './shared'\n\nexport function createNotificationsExtension(): GeneratorExtension {\n const notificationImports: Array<ReturnType<typeof namespaceImportSpec>> = []\n const notificationTypeEntries: WriterFunction[] = []\n const notificationClientImports: Array<ReturnType<typeof namespaceImportSpec>> = []\n const notificationClientTypeEntries: WriterFunction[] = []\n const paymentClientImports: Array<ReturnType<typeof sideEffectImportSpec>> = []\n const notificationHandlerImports: Array<ReturnType<typeof namespaceImportSpec>> = []\n const notificationHandlerEntries: WriterFunction[] = []\n\n return {\n id: 'registry.notifications',\n outputFiles: [\n 'notifications.generated.ts',\n 'notifications.client.generated.ts',\n 'payments.client.generated.ts',\n 'notification-handlers.generated.ts',\n ],\n scanModule(ctx) {\n ctx.processStandaloneConfig({\n roots: ctx.roots,\n imps: ctx.imps,\n modId: ctx.moduleId,\n relativePath: 'notifications.ts',\n prefix: 'NOTIF',\n importIdRef: ctx.importIdRef,\n standaloneImports: notificationImports,\n standaloneEntries: notificationTypeEntries,\n writeConfig: ({ importName, moduleId }) =>\n moduleEntry(moduleId, [\n {\n name: 'types',\n value: namespaceFallback({\n importName,\n members: ['default', 'notificationTypes', 'types'],\n fallback: emptyArray(),\n castType: 'NotificationTypeDefinition[]',\n }),\n },\n ]),\n })\n\n ctx.processStandaloneConfig({\n roots: ctx.roots,\n imps: ctx.imps,\n modId: ctx.moduleId,\n relativePath: 'notifications.client.ts',\n prefix: 'NOTIF_CLIENT',\n importIdRef: ctx.importIdRef,\n standaloneImports: notificationClientImports,\n standaloneEntries: notificationClientTypeEntries,\n writeConfig: ({ importName, moduleId }) =>\n moduleEntry(moduleId, [\n {\n name: 'types',\n value: namespaceFallback({\n importName,\n members: ['default'],\n fallback: emptyArray(),\n castType: 'NotificationTypeDefinition[]',\n }),\n },\n ]),\n })\n\n const paymentClient = ctx.resolveFirstModuleFile(ctx.roots, ctx.imps, [\n 'widgets/payments/client.tsx',\n 'widgets/payments/client.ts',\n ])\n if (paymentClient) {\n paymentClientImports.push(sideEffectImportSpec(paymentClient.importPath))\n }\n\n ctx.processStandaloneConfig({\n roots: ctx.roots,\n imps: ctx.imps,\n modId: ctx.moduleId,\n relativePath: 'notifications.handlers.ts',\n prefix: 'NOTIF_HANDLERS',\n importIdRef: ctx.importIdRef,\n standaloneImports: notificationHandlerImports,\n standaloneEntries: notificationHandlerEntries,\n writeConfig: ({ importName, moduleId }) =>\n moduleEntry(moduleId, [\n {\n name: 'handlers',\n value: namespaceFallback({\n importName,\n members: ['default', 'notificationHandlers'],\n fallback: emptyArray(),\n castType: 'NotificationHandler[]',\n }),\n },\n ]),\n })\n },\n generateOutput() {\n const notificationsOutput = renderGeneratedTsSource({\n fileName: 'notifications.generated.ts',\n imports: [\n { namedImports: [{ name: 'NotificationTypeDefinition', isTypeOnly: true }], moduleSpecifier: '@open-mercato/shared/modules/notifications/types' },\n { namedImports: [{ name: 'applyNotificationTypeOverridesToEntries' }], moduleSpecifier: '@open-mercato/shared/modules/overrides' },\n ...notificationImports,\n ],\n build(sourceFile) {\n sourceFile.addTypeAlias({\n name: 'NotificationTypeEntry',\n type: '{ moduleId: string; types: NotificationTypeDefinition[] }',\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n declarations: [\n {\n name: 'entriesRaw',\n type: 'NotificationTypeEntry[]',\n initializer: arrayLiteral(notificationTypeEntries, writeValue),\n },\n {\n name: 'entries',\n initializer: callExpression(identifier('applyNotificationTypeOverridesToEntries'), [identifier('entriesRaw')]),\n },\n {\n name: 'allTypes',\n initializer: methodCall(identifier('entries'), 'flatMap', [\n arrowFunction({\n parameters: ['entry'],\n body: propertyAccess(identifier('entry'), 'types'),\n }),\n ]),\n },\n ],\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n { name: 'notificationTypeEntries', initializer: identifier('entries') },\n { name: 'notificationTypes', initializer: identifier('allTypes') },\n ],\n })\n sourceFile.addFunction({\n name: 'getNotificationTypes',\n isExported: true,\n returnType: 'NotificationTypeDefinition[]',\n statements: [returnStatement(identifier('allTypes'))],\n })\n sourceFile.addFunction({\n name: 'getNotificationType',\n isExported: true,\n parameters: [{ name: 'type', type: 'string' }],\n returnType: 'NotificationTypeDefinition | undefined',\n statements: [\n returnStatement(\n methodCall(identifier('allTypes'), 'find', [\n arrowFunction({\n parameters: ['entry'],\n body: binaryExpression(propertyAccess(identifier('entry'), 'type'), '===', identifier('type')),\n }),\n ]),\n ),\n ],\n })\n },\n })\n\n const notificationsClientOutput = renderGeneratedTsSource({\n fileName: 'notifications.client.generated.ts',\n imports: [\n { namedImports: [{ name: 'ComponentType', isTypeOnly: true }], moduleSpecifier: 'react' },\n {\n namedImports: [\n { name: 'NotificationTypeDefinition', isTypeOnly: true },\n { name: 'NotificationRendererProps', isTypeOnly: true },\n ],\n moduleSpecifier: '@open-mercato/shared/modules/notifications/types',\n },\n { namedImports: [{ name: 'applyNotificationTypeOverridesToEntries' }], moduleSpecifier: '@open-mercato/shared/modules/overrides' },\n ...notificationClientImports,\n ],\n build(sourceFile) {\n sourceFile.addTypeAlias({\n name: 'NotificationTypeEntry',\n type: '{ moduleId: string; types: NotificationTypeDefinition[] }',\n })\n sourceFile.addTypeAlias({\n name: 'NotificationRenderers',\n isExported: true,\n type: 'Record<string, ComponentType<NotificationRendererProps>>',\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n declarations: [\n {\n name: 'entriesRaw',\n type: 'NotificationTypeEntry[]',\n initializer: arrayLiteral(notificationClientTypeEntries, writeValue),\n },\n {\n name: 'entries',\n initializer: callExpression(identifier('applyNotificationTypeOverridesToEntries'), [identifier('entriesRaw')]),\n },\n {\n name: 'allTypes',\n initializer: methodCall(identifier('entries'), 'flatMap', [\n arrowFunction({\n parameters: ['entry'],\n body: propertyAccess(identifier('entry'), 'types'),\n }),\n ]),\n },\n {\n name: 'renderers',\n type: 'NotificationRenderers',\n initializer: objectFromEntries(\n methodCall(\n methodCall(identifier('allTypes'), 'filter', [\n arrowFunction({\n parameters: ['typeDef'],\n body: callExpression(identifier('Boolean'), [propertyAccess(identifier('typeDef'), 'Renderer')]),\n }),\n ]),\n 'map',\n [\n arrowFunction({\n parameters: ['typeDef'],\n body: arrayLiteral(\n [\n propertyAccess(identifier('typeDef'), 'type'),\n nonNullAssertion(propertyAccess(identifier('typeDef'), 'Renderer')),\n ],\n writeValue,\n ),\n }),\n ],\n ),\n ),\n },\n ],\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n { name: 'notificationClientTypeEntries', initializer: identifier('entries') },\n { name: 'notificationClientTypes', initializer: identifier('allTypes') },\n { name: 'notificationRenderers', initializer: identifier('renderers') },\n ],\n })\n sourceFile.addFunction({\n name: 'getNotificationRenderers',\n isExported: true,\n returnType: 'NotificationRenderers',\n statements: [returnStatement(identifier('renderers'))],\n })\n },\n })\n\n const paymentsClientOutput = renderGeneratedTsSource({\n fileName: 'payments.client.generated.ts',\n imports: paymentClientImports,\n build(sourceFile) {\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n { name: 'paymentGatewayClientModuleCount', initializer: String(paymentClientImports.length) },\n ],\n })\n },\n })\n\n const notificationHandlersOutput = renderGeneratedTsSource({\n fileName: 'notification-handlers.generated.ts',\n imports: [\n { namedImports: [{ name: 'NotificationHandler', isTypeOnly: true }], moduleSpecifier: '@open-mercato/shared/modules/notifications/handler' },\n ...notificationHandlerImports,\n ],\n build(sourceFile) {\n sourceFile.addTypeAlias({\n name: 'NotificationHandlerEntry',\n type: '{ moduleId: string; handlers: NotificationHandler[] }',\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n {\n name: 'notificationHandlerEntries',\n type: 'NotificationHandlerEntry[]',\n initializer: arrayLiteral(notificationHandlerEntries, writeValue),\n },\n ],\n })\n },\n })\n\n return new Map([\n ['notifications.generated.ts', notificationsOutput],\n ['notifications.client.generated.ts', notificationsClientOutput],\n ['payments.client.generated.ts', paymentsClientOutput],\n ['notification-handlers.generated.ts', notificationHandlersOutput],\n ])\n },\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,+BAAoD;AAE7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AAEA,SAAS,+BAAmD;AACjE,QAAM,sBAAqE,CAAC;AAC5E,QAAM,0BAA4C,CAAC;AACnD,QAAM,4BAA2E,CAAC;AAClF,QAAM,gCAAkD,CAAC;AACzD,QAAM,uBAAuE,CAAC;AAC9E,QAAM,6BAA4E,CAAC;AACnF,QAAM,6BAA+C,CAAC;AAEtD,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,aAAa;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,KAAK;AAC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A,cACZ;AAAA,gBACE,MAAM;AAAA,gBACN,MAAM;AAAA,gBACN,aAAa,aAAa,4BAA4B,UAAU;AAAA,cAClE;AAAA,YACF;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF,CAAC;AAED,aAAO,oBAAI,IAAI;AAAA,QACb,CAAC,8BAA8B,mBAAmB;AAAA,QAClD,CAAC,qCAAqC,yBAAyB;AAAA,QAC/D,CAAC,gCAAgC,oBAAoB;AAAA,QACrD,CAAC,sCAAsC,0BAA0B;AAAA,MACnE,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/jest.config.cjs
CHANGED
|
@@ -10,6 +10,8 @@ module.exports = {
|
|
|
10
10
|
{
|
|
11
11
|
tsconfig: {
|
|
12
12
|
jsx: 'react-jsx',
|
|
13
|
+
rootDir: '.',
|
|
14
|
+
ignoreDeprecations: '6.0',
|
|
13
15
|
},
|
|
14
16
|
},
|
|
15
17
|
],
|
|
@@ -21,7 +23,7 @@ module.exports = {
|
|
|
21
23
|
'^@open-mercato/queue/(.*)$': '<rootDir>/../queue/src/$1',
|
|
22
24
|
},
|
|
23
25
|
transformIgnorePatterns: [
|
|
24
|
-
'node_modules/(?!(@mikro-orm)/)',
|
|
26
|
+
'node_modules/(?!(@mikro-orm|kysely)/)',
|
|
25
27
|
],
|
|
26
28
|
testMatch: ['<rootDir>/src/**/__tests__/**/*.test.(ts|tsx)'],
|
|
27
29
|
passWithNoTests: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3-develop.3484.1.1427e58147",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -55,25 +55,25 @@
|
|
|
55
55
|
"node": "24.x"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@mikro-orm/core": "^7.0.
|
|
59
|
-
"@mikro-orm/decorators": "^7.0.
|
|
60
|
-
"@mikro-orm/migrations": "^7.0.
|
|
61
|
-
"@mikro-orm/postgresql": "^7.0.
|
|
62
|
-
"@open-mercato/queue": "0.6.
|
|
63
|
-
"@open-mercato/shared": "0.6.
|
|
58
|
+
"@mikro-orm/core": "^7.0.17",
|
|
59
|
+
"@mikro-orm/decorators": "^7.0.17",
|
|
60
|
+
"@mikro-orm/migrations": "^7.0.17",
|
|
61
|
+
"@mikro-orm/postgresql": "^7.0.17",
|
|
62
|
+
"@open-mercato/queue": "0.6.3-develop.3484.1.1427e58147",
|
|
63
|
+
"@open-mercato/shared": "0.6.3-develop.3484.1.1427e58147",
|
|
64
64
|
"cross-spawn": "^7.0.6",
|
|
65
|
-
"pg": "8.
|
|
65
|
+
"pg": "8.21.0",
|
|
66
66
|
"semver": "^7.8.0",
|
|
67
67
|
"testcontainers": "^11.14.0",
|
|
68
68
|
"ts-morph": "^28.0.0",
|
|
69
|
-
"tsx": "^4.
|
|
70
|
-
"typescript": "^
|
|
69
|
+
"tsx": "^4.22.2",
|
|
70
|
+
"typescript": "^6.0.3"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@open-mercato/shared": "0.6.
|
|
73
|
+
"@open-mercato/shared": "0.6.3-develop.3484.1.1427e58147"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@open-mercato/shared": "0.6.
|
|
76
|
+
"@open-mercato/shared": "0.6.3-develop.3484.1.1427e58147",
|
|
77
77
|
"@types/jest": "^30.0.0",
|
|
78
78
|
"jest": "^30.4.2",
|
|
79
79
|
"ts-jest": "^29.4.9"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"url": "https://github.com/open-mercato/open-mercato",
|
|
87
87
|
"directory": "packages/cli"
|
|
88
88
|
},
|
|
89
|
-
"stableVersion": "0.6.
|
|
89
|
+
"stableVersion": "0.6.2"
|
|
90
90
|
}
|
|
@@ -123,6 +123,7 @@ export function createNotificationsExtension(): GeneratorExtension {
|
|
|
123
123
|
fileName: 'notifications.generated.ts',
|
|
124
124
|
imports: [
|
|
125
125
|
{ namedImports: [{ name: 'NotificationTypeDefinition', isTypeOnly: true }], moduleSpecifier: '@open-mercato/shared/modules/notifications/types' },
|
|
126
|
+
{ namedImports: [{ name: 'applyNotificationTypeOverridesToEntries' }], moduleSpecifier: '@open-mercato/shared/modules/overrides' },
|
|
126
127
|
...notificationImports,
|
|
127
128
|
],
|
|
128
129
|
build(sourceFile) {
|
|
@@ -138,9 +139,13 @@ export function createNotificationsExtension(): GeneratorExtension {
|
|
|
138
139
|
type: 'NotificationTypeEntry[]',
|
|
139
140
|
initializer: arrayLiteral(notificationTypeEntries, writeValue),
|
|
140
141
|
},
|
|
142
|
+
{
|
|
143
|
+
name: 'entries',
|
|
144
|
+
initializer: callExpression(identifier('applyNotificationTypeOverridesToEntries'), [identifier('entriesRaw')]),
|
|
145
|
+
},
|
|
141
146
|
{
|
|
142
147
|
name: 'allTypes',
|
|
143
|
-
initializer: methodCall(identifier('
|
|
148
|
+
initializer: methodCall(identifier('entries'), 'flatMap', [
|
|
144
149
|
arrowFunction({
|
|
145
150
|
parameters: ['entry'],
|
|
146
151
|
body: propertyAccess(identifier('entry'), 'types'),
|
|
@@ -153,7 +158,7 @@ export function createNotificationsExtension(): GeneratorExtension {
|
|
|
153
158
|
declarationKind: VariableDeclarationKind.Const,
|
|
154
159
|
isExported: true,
|
|
155
160
|
declarations: [
|
|
156
|
-
{ name: 'notificationTypeEntries', initializer: identifier('
|
|
161
|
+
{ name: 'notificationTypeEntries', initializer: identifier('entries') },
|
|
157
162
|
{ name: 'notificationTypes', initializer: identifier('allTypes') },
|
|
158
163
|
],
|
|
159
164
|
})
|
|
@@ -193,6 +198,7 @@ export function createNotificationsExtension(): GeneratorExtension {
|
|
|
193
198
|
],
|
|
194
199
|
moduleSpecifier: '@open-mercato/shared/modules/notifications/types',
|
|
195
200
|
},
|
|
201
|
+
{ namedImports: [{ name: 'applyNotificationTypeOverridesToEntries' }], moduleSpecifier: '@open-mercato/shared/modules/overrides' },
|
|
196
202
|
...notificationClientImports,
|
|
197
203
|
],
|
|
198
204
|
build(sourceFile) {
|
|
@@ -213,9 +219,13 @@ export function createNotificationsExtension(): GeneratorExtension {
|
|
|
213
219
|
type: 'NotificationTypeEntry[]',
|
|
214
220
|
initializer: arrayLiteral(notificationClientTypeEntries, writeValue),
|
|
215
221
|
},
|
|
222
|
+
{
|
|
223
|
+
name: 'entries',
|
|
224
|
+
initializer: callExpression(identifier('applyNotificationTypeOverridesToEntries'), [identifier('entriesRaw')]),
|
|
225
|
+
},
|
|
216
226
|
{
|
|
217
227
|
name: 'allTypes',
|
|
218
|
-
initializer: methodCall(identifier('
|
|
228
|
+
initializer: methodCall(identifier('entries'), 'flatMap', [
|
|
219
229
|
arrowFunction({
|
|
220
230
|
parameters: ['entry'],
|
|
221
231
|
body: propertyAccess(identifier('entry'), 'types'),
|
|
@@ -255,7 +265,7 @@ export function createNotificationsExtension(): GeneratorExtension {
|
|
|
255
265
|
declarationKind: VariableDeclarationKind.Const,
|
|
256
266
|
isExported: true,
|
|
257
267
|
declarations: [
|
|
258
|
-
{ name: 'notificationClientTypeEntries', initializer: identifier('
|
|
268
|
+
{ name: 'notificationClientTypeEntries', initializer: identifier('entries') },
|
|
259
269
|
{ name: 'notificationClientTypes', initializer: identifier('allTypes') },
|
|
260
270
|
{ name: 'notificationRenderers', initializer: identifier('renderers') },
|
|
261
271
|
],
|