lucy-cli 2.0.0-beta.8 → 2.0.0-beta.9

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 (65) hide show
  1. package/dist/commands/checks.d.ts +1 -1
  2. package/dist/commands/edit.d.ts +1 -1
  3. package/dist/commands/exec.d.ts +1 -1
  4. package/dist/commands/read.d.ts +3 -3
  5. package/dist/config.d.ts +1 -1
  6. package/dist/helpers.d.ts +1 -1
  7. package/dist/helpers.js +1 -8
  8. package/dist/helpers.js.map +1 -1
  9. package/dist/index.js +4 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/init/blocks.d.ts +1 -1
  12. package/dist/init/cargo.d.ts +1 -1
  13. package/dist/init/expo.d.ts +1 -1
  14. package/dist/init/gitModules.d.ts +1 -1
  15. package/dist/init/index.js +3 -0
  16. package/dist/init/index.js.map +1 -1
  17. package/dist/init/monorepo.d.ts +1 -1
  18. package/dist/init/prepareVelo.d.ts +1 -1
  19. package/dist/init/tauri.d.ts +1 -1
  20. package/dist/init/templates.d.ts +1 -1
  21. package/dist/init/velo.d.ts +1 -1
  22. package/dist/runtime.d.ts +1 -1
  23. package/dist/tasks/Gulpfile.js +1 -1
  24. package/dist/tasks/Gulpfile.js.map +1 -1
  25. package/dist/tasks/gulp/checks.js +12 -11
  26. package/dist/tasks/gulp/checks.js.map +1 -1
  27. package/dist/tasks/gulp/watchers.js +3 -3
  28. package/dist/tasks/gulp/watchers.js.map +1 -1
  29. package/dist/wix-sdk/index.d.ts +1 -1
  30. package/dist/wix-sdk/init.d.ts +1 -1
  31. package/dist/wix-sdk/run.d.ts +1 -1
  32. package/dist/wix-sync/index.d.ts +1 -1
  33. package/dist/wix-sync/init.d.ts +1 -1
  34. package/files/templates/velo[D]/files/typescript/backend/config/authz.ts +47 -0
  35. package/files/templates/velo[D]/files/typescript/backend/config/env.ts +8 -0
  36. package/files/templates/velo[D]/files/typescript/backend/config/index.ts +26 -0
  37. package/files/templates/velo[D]/files/typescript/backend/config/mail.ts +10 -0
  38. package/files/templates/velo[D]/files/typescript/backend/config/nats.ts +6 -0
  39. package/files/templates/velo[D]/files/typescript/public/config/env.ts +9 -0
  40. package/files/templates/velo[D]/files/typescript/public/config/index.ts +76 -0
  41. package/files/templates/velo[D]/files/typescript/public/config/locales.ts +30 -0
  42. package/files/templates/velo[D]/files/typescript/public/config/theme.ts +110 -0
  43. package/files/templates/velo[D]/files/typescript/public/i18n/default.ts +123 -0
  44. package/files/templates/velo[D]/files/typescript/public/i18n/en.ts +117 -0
  45. package/files/templates/velo[D]/files/typescript/public/models/collections/member_roles.mode.ts +21 -0
  46. package/files/templates/velo[D]/files/typescript/public/models/collections/organization.model.ts +38 -0
  47. package/files/templates/velo[D]/files/typescript/public/models/collections/plan.model.ts +94 -0
  48. package/files/templates/velo[D]/files/typescript/public/models/collections/stage.model.ts +14 -0
  49. package/files/templates/velo[D]/files/typescript/public/models/collections/subscriptions.model.ts +80 -0
  50. package/files/templates/velo[D]/files/typescript/public/models/collections/tag.model.ts +15 -0
  51. package/files/templates/velo[D]/files/typescript/public/models/collections/translations.model.ts +16 -0
  52. package/files/templates/velo[D]/files/typescript/public/models/modules/authz.model.ts +31 -0
  53. package/files/templates/velo[D]/files/typescript/public/models/modules/organization.ts +20 -0
  54. package/files/templates/velo[D]/files/typescript/public/models/splitwise.model.ts +18 -0
  55. package/files/templates/velo[D]/files/typescript/public/models/store/local.model.ts +10 -0
  56. package/files/templates/velo[D]/files/typescript/public/models/store/memory.model.ts +10 -0
  57. package/files/templates/velo[D]/files/typescript/public/models/store/session.model.ts +10 -0
  58. package/files/templates/velo[D]/files/typescript/public/models/wix/ecom/payment.ts +236 -0
  59. package/package.json +1 -1
  60. package/src/helpers.ts +1 -9
  61. package/src/index.ts +4 -1
  62. package/src/init/index.ts +3 -1
  63. package/src/tasks/Gulpfile.ts +1 -1
  64. package/src/tasks/gulp/checks.ts +15 -14
  65. package/src/tasks/gulp/watchers.ts +3 -3
@@ -0,0 +1,80 @@
1
+ import { satisfies } from 'effect/Function';
2
+ import { Schema } from 'effect/index';
3
+
4
+ export const futuresSchema = Schema.Literal('create_event', 'create_organization');
5
+ export const planSchema = Schema.Struct({
6
+ id: Schema.String,
7
+ name: Schema.String,
8
+ order: Schema.Number,
9
+ features: Schema.Array(futuresSchema),
10
+ limits: Schema.Struct({
11
+ organizations: Schema.Number,
12
+ events: Schema.Number,
13
+ }),
14
+ });
15
+
16
+ export const availablePlans = satisfies<typeof planSchema.Type[]>()([
17
+ {
18
+ id: '00000000-0000-0000-0000-000000000000',
19
+ name: 'free',
20
+ order: 0,
21
+ features: [ 'create_event', 'create_organization' ],
22
+ limits: {
23
+ organizations: 2,
24
+ events: 1
25
+ },
26
+ },
27
+ {
28
+ id: '26b02e36-6d07-41d8-ae49-8241756b4270',
29
+ name: '1 Jahr kostenlos',
30
+ order: 1,
31
+ features: ['create_event', 'create_organization'],
32
+ limits: {
33
+ organizations: 2,
34
+ events: 1
35
+ },
36
+ },
37
+ {
38
+ id: 'a86edd6d-8d7e-468d-b763-838674cff834',
39
+ name: 'Einsteiger',
40
+ order: 2,
41
+ features: ['create_event', 'create_organization'],
42
+ limits: {
43
+ organizations: 2,
44
+ events: 1
45
+ },
46
+ },
47
+ {
48
+ id: '9c6b158e-2689-45c0-95a3-8c0e596a69ce',
49
+ name: 'Hobby',
50
+ order: 3,
51
+ features: [],
52
+ limits: {
53
+ organizations: 2,
54
+ events: 1
55
+ },
56
+ },
57
+ {
58
+ id: 'c7de837b-7463-4508-a89c-d7deec3fc9fd',
59
+ name: 'Teilzeit',
60
+ order: 4,
61
+ features: ['create_event', 'create_organization'],
62
+ limits: {
63
+ organizations: 2,
64
+ events: 1
65
+ },
66
+ },
67
+ {
68
+ id: 'c1e48401-1126-4834-be26-6fd5df9d5ffe',
69
+ name: 'Vollzeit',
70
+ order: 5,
71
+ features: ['create_event', 'create_organization'],
72
+ limits: {
73
+ organizations: 2,
74
+ events: 1
75
+ },
76
+ },
77
+ ] as const);
78
+ export const subscriptionsSchema = Schema.Literal(...availablePlans.map(plan => plan.id));
79
+
80
+
@@ -0,0 +1,15 @@
1
+ import { Schema } from 'effect/index';
2
+ import { wixItemBaseSchema } from 'public/lib/models/wix/common/collection.model';
3
+
4
+ export const tagBaseSchema = Schema.Struct({
5
+ name: Schema.String,
6
+ description: Schema.String,
7
+ image: Schema.String,
8
+ });
9
+
10
+ export const tagSchema = Schema.Struct({
11
+ ...wixItemBaseSchema.fields,
12
+ ...tagBaseSchema.fields,
13
+ });
14
+
15
+ export const tagsSchema = Schema.Array(tagSchema);
@@ -0,0 +1,16 @@
1
+ import { Schema } from 'effect/index';
2
+ import { wixItemBaseSchema } from 'public/lib/models/wix/common/collection.model';
3
+
4
+ export const translationBaseSchema = Schema.Struct({
5
+ key: Schema.String,
6
+ language: Schema.String,
7
+ text: Schema.optional(Schema.String),
8
+ rich_text: Schema.optional(Schema.String),
9
+ rich_content: Schema.optional(Schema.String),
10
+ });
11
+
12
+ export const translationSchema = Schema.Struct({
13
+ ...wixItemBaseSchema.fields,
14
+ ...translationBaseSchema.fields,
15
+ });
16
+ export const translationsSchema = Schema.Array(translationSchema);
@@ -0,0 +1,31 @@
1
+ import { Schema } from 'effect/index';
2
+ import { jwtBaseSchema } from 'public/lib/models/dto/jwt.mode';
3
+
4
+ import { Roles } from '../../config';
5
+ import { availablePlans, planSchema } from '../collections/subscriptions.model';
6
+
7
+ export const subscriptionSchema = Schema.Union(planSchema);
8
+ export type Subscription = typeof subscriptionSchema.Type;
9
+ export const organizationDetails = Schema.Struct({
10
+ organizationId: Schema.String,
11
+ organizationSlug: Schema.optional(Schema.String),
12
+ organizationSubscriptionId: Schema.Literal(...availablePlans.map(plan => plan.id)),
13
+ roles: Schema.mutable(Schema.Array(Schema.Enums(Roles))),
14
+ });
15
+
16
+ export const rolesByOrgCollectionSchema = Schema.Struct({
17
+ user: Schema.Struct({
18
+ id: Schema.String,
19
+ subscription: Schema.NullOr(subscriptionSchema),
20
+ }),
21
+ organizations: Schema.Array(organizationDetails),
22
+ isSuperAdmin: Schema.Boolean,
23
+ });
24
+ export type AuthzData = typeof rolesByOrgCollectionSchema.Type;
25
+
26
+ export const jwtSchema = Schema.Struct({
27
+ ...jwtBaseSchema.fields,
28
+ ...rolesByOrgCollectionSchema.fields,
29
+ });
30
+
31
+ //Schema.optional(Schema.Union(...availablePlans.map(plan => Schema.Literal(typeof plan))))
@@ -0,0 +1,20 @@
1
+ import { Schema } from 'effect/index';
2
+ import { createResponseDTOSchema } from 'public/lib/dto/response.dto';
3
+ import { createRequestDTOSchema } from 'public/lib/dto/shared/request.dto';
4
+ import { ResponseDTO } from 'public/lib/models/dto/response.model';
5
+ import { multireferenceSchema } from 'public/lib/models/wix/common/common.model';
6
+ import { organizationSchema } from 'public/models/collections/organization.model';
7
+
8
+ import { stageSchema } from '../collections/stage.model';
9
+ import { tagSchema } from '../collections/tag.model';
10
+
11
+ export const organizationFullSchema = Schema.Struct({
12
+ ...organizationSchema.fields,
13
+ tags: multireferenceSchema(tagSchema),
14
+ stage: stageSchema, // Assuming stage is a string, adjust if it's different
15
+ });
16
+
17
+ // export type GetOrganizationDTO = ResponseDTO<typeof organizationFullSchema.Type | undefined>;
18
+ // export const getOrganizationDTOSchema = createResponseDTOSchema(organizationFullSchema);
19
+ // export type GetSingleOrganizationDTO = ResponseDTO<typeof organizationFullSchema.Type>;
20
+ // export const requestOrganizationDTOSchema = createRequestDTOSchema(Schema.String);
@@ -0,0 +1,18 @@
1
+ import { Schema } from "effect";
2
+
3
+ export const userSchema = Schema.Struct({
4
+ label: Schema.String,
5
+ value: Schema.String,
6
+ });
7
+
8
+ export const userListSchema = Schema.mutable(Schema.Array(userSchema));
9
+
10
+ export const responseSchema = Schema.Struct({
11
+ status: Schema.String,
12
+ message: Schema.String,
13
+ });
14
+
15
+
16
+ export type UserList = typeof userListSchema.Type;
17
+
18
+ export type Response = typeof responseSchema.Type;
@@ -0,0 +1,10 @@
1
+ import { tablesBaseSchema, valuesBaseSchema } from 'public/lib/models/store/local';
2
+
3
+ export const tablesSchema = {
4
+ // pets: { species: { type: 'string' }, age: { type: 'number' }, puppie: { type: 'boolean' } },
5
+ ...tablesBaseSchema,
6
+ } as const;
7
+
8
+ export const valuesSchema = {
9
+ ...valuesBaseSchema,
10
+ } as const;
@@ -0,0 +1,10 @@
1
+ import { tablesBaseSchema, valuesBaseSchema } from 'public/lib/models/store/memory';
2
+
3
+ export const tablesSchema = {
4
+ // pets: { species: { type: 'string' } },
5
+ ...tablesBaseSchema,
6
+ } as const;
7
+
8
+ export const valuesSchema = {
9
+ ...valuesBaseSchema,
10
+ } as const;
@@ -0,0 +1,10 @@
1
+ import { tablesBaseSchema, valuesBaseSchema } from 'public/lib/models/store/session';
2
+
3
+ export const tablesSchema = {
4
+ ...tablesBaseSchema,
5
+ } as const;
6
+
7
+ export const valuesSchema = {
8
+ ...valuesBaseSchema,
9
+ } as const;
10
+
@@ -0,0 +1,236 @@
1
+ import { z } from 'zod';
2
+
3
+ const addressSchema = z.object({
4
+ addressLine1: z.string().optional(),
5
+ addressLine2: z.string().optional(),
6
+ city: z.string().optional(),
7
+ country: z.string().optional(),
8
+ postalCode: z.string().optional(),
9
+ streetAddress: z.object({
10
+ name: z.string().optional(),
11
+ number: z.string().optional(),
12
+ }).optional(),
13
+ subdivision: z.string().optional(),
14
+ });
15
+
16
+ const fullAddressContactDetailsSchema = z.object({
17
+ company: z.string().optional(),
18
+ firstName: z.string().optional(),
19
+ lastName: z.string().optional(),
20
+ phone: z.string().optional(),
21
+ vatId: z.object({
22
+ _id: z.string().optional(),
23
+ type: z.enum(['CNPJ', 'CPF', 'UNSPECIFIED']).optional(),
24
+ }).optional(),
25
+ });
26
+
27
+ const itemTaxFullDetailsSchema = z.object({
28
+ taxRate: z.string().optional(),
29
+ taxableAmount: z.object({
30
+ amount: z.string(),
31
+ }).optional(),
32
+ totalTax: z.object({
33
+ amount: z.string(),
34
+ }).optional(),
35
+ });
36
+
37
+ const priceSchema = z.object({
38
+ amount: z.string(),
39
+ formattedAmount: z.string().optional(),
40
+ });
41
+
42
+ const lineItemSchema = z.object({
43
+ productName: z.object({
44
+ original: z.string(),
45
+ translated: z.string().optional(),
46
+ }),
47
+ catalogReference: z.object({
48
+ catalogItemId: z.string(),
49
+ appId: z.string(),
50
+ options: z.object({
51
+ options: z.record(z.unknown()),
52
+ variantId: z.string().optional(),
53
+ }).optional(),
54
+ }),
55
+ quantity: z.number(),
56
+ totalDiscount: priceSchema.optional(),
57
+ descriptionLines: z.array(z.string()).optional(),
58
+ image: z.string().optional(),
59
+ physicalProperties: z.object({
60
+ sku: z.string(),
61
+ shippable: z.boolean(),
62
+ }).optional(),
63
+ itemType: z.object({
64
+ preset: z.string(),
65
+ }).optional(),
66
+ price: priceSchema,
67
+ priceBeforeDiscounts: priceSchema.optional(),
68
+ totalPriceBeforeTax: priceSchema.optional(),
69
+ totalPriceAfterTax: priceSchema.optional(),
70
+ paymentOption: z.string().optional(),
71
+ taxDetails: itemTaxFullDetailsSchema.optional(),
72
+ taxInfo: z.object({
73
+ taxAmount: priceSchema.optional(),
74
+ taxableAmount: priceSchema.optional(),
75
+ taxRate: z.string(),
76
+ taxIncludedInPrice: z.boolean().optional(),
77
+ taxBreakdown: z.array(z.unknown()).optional(),
78
+ }).optional(),
79
+ digitalFile: z.object({
80
+ fileId: z.string(),
81
+ expirationDate: z.union([z.string(), z.date()]), // Accepts either a string or a date
82
+ }).optional(),
83
+ locations: z.array(z.unknown()).optional(),
84
+ lineItemPrice: priceSchema.optional(),
85
+ customLineItem: z.boolean().optional(),
86
+ rootCatalogItemId: z.string().optional(),
87
+ taxableAddress: z.object({
88
+ addressType: z.string(),
89
+ }).optional(),
90
+ _id: z.string(),
91
+ });
92
+
93
+ const appliedDiscountSchema = z.object({
94
+ _id: z.string(),
95
+ discountType: z.enum(['GLOBAL', 'SHIPPING', 'SPECIFIC_ITEMS']),
96
+ lineItemIds: z.array(z.string()).optional(),
97
+ coupon: z.object({
98
+ _id: z.string().optional(),
99
+ amount: priceSchema.optional(),
100
+ code: z.string().optional(),
101
+ name: z.string().optional(),
102
+ }).optional(),
103
+ discountRule: z.object({
104
+ _id: z.string().optional(),
105
+ amount: priceSchema.optional(),
106
+ name: z.object({
107
+ original: z.string(),
108
+ translated: z.string(),
109
+ }),
110
+ }).optional(),
111
+ merchantDiscount: z.object({
112
+ amount: priceSchema,
113
+ description: z.string().optional(),
114
+ discountReason: z.enum(['EXCHANGED_ITEMS', 'UNSPECIFIED']).optional(),
115
+ }).optional(),
116
+ });
117
+
118
+ const additionalFeeSchema = z.object({
119
+ _id: z.string(),
120
+ code: z.string(),
121
+ lineItemIds: z.array(z.string()).optional(),
122
+ name: z.string(),
123
+ price: priceSchema,
124
+ priceAfterTax: priceSchema.optional(),
125
+ priceBeforeTax: priceSchema.optional(),
126
+ providerAppId: z.string().optional(),
127
+ taxDetails: itemTaxFullDetailsSchema.optional(),
128
+ });
129
+
130
+ const eventMetadataSchema = z.object({
131
+ id: z.string(),
132
+ entityId: z.string(),
133
+ eventTime: z.string(),
134
+ triggeredByAnonymizeRequest: z.boolean().optional(),
135
+ });
136
+
137
+ const orderSchema = z.object({
138
+ number: z.string(),
139
+ lineItems: z.array(lineItemSchema),
140
+ buyerInfo: z.object({
141
+ contactId: z.string(),
142
+ email: z.string(),
143
+ memberId: z.string().optional(),
144
+ visitorId: z.string().optional(),
145
+ buyerLanguage: z.string().optional(), // Made optional to avoid the error
146
+ buyerNote: z.string().optional(),
147
+ }),
148
+ paymentStatus: z.enum(['FULLY_REFUNDED', 'NOT_PAID', 'PAID', 'PARTIALLY_PAID', 'PARTIALLY_REFUNDED', 'PENDING', 'UNSPECIFIED']),
149
+ fulfillmentStatus: z.string().optional(),
150
+ currency: z.string(),
151
+ taxIncludedInPrices: z.boolean(),
152
+ siteLanguage: z.string().optional(),
153
+ priceSummary: z.object({
154
+ subtotal: priceSchema,
155
+ shipping: priceSchema.optional(),
156
+ tax: priceSchema.optional(),
157
+ discount: priceSchema.optional(),
158
+ totalPrice: priceSchema,
159
+ total: priceSchema,
160
+ totalWithGiftCard: priceSchema.optional(),
161
+ totalWithoutGiftCard: priceSchema.optional(),
162
+ totalAdditionalFees: priceSchema.optional(),
163
+ }),
164
+ billingInfo: z.object({
165
+ address: addressSchema.optional(),
166
+ contactDetails: fullAddressContactDetailsSchema,
167
+ }).optional(),
168
+ status: z.enum(['APPROVED', 'CANCELED', 'INITIALIZED']),
169
+ archived: z.boolean(),
170
+ taxSummary: z.object({
171
+ totalTax: priceSchema.optional(),
172
+ manualTaxRate: z.string().optional(),
173
+ }).optional(),
174
+ taxInfo: z.object({
175
+ totalTax: priceSchema.optional(),
176
+ taxBreakdown: z.array(z.unknown()).optional(),
177
+ manualTaxRate: z.string().optional(),
178
+ }).optional(),
179
+ appliedDiscounts: z.array(appliedDiscountSchema).optional(),
180
+ activities: z.array(
181
+ z.object({
182
+ type: z.string(),
183
+ _id: z.string(),
184
+ _createdDate: z.union([z.string(), z.date()]), // Accepts either a string or a date
185
+ })
186
+ ),
187
+ attributionSource: z.enum(['FACEBOOK_ADS', 'UNSPECIFIED']).optional(),
188
+ createdBy: z.record(z.unknown()).optional(),
189
+ channelInfo: z.object({
190
+ type: z.enum([
191
+ 'AMAZON', 'BACKOFFICE_MERCHANT', 'CLASS_PASS', 'EBAY', 'ETSY',
192
+ 'FACEBOOK', 'FAIRE_COM', 'GLOBAL_E', 'OTHER_PLATFORM', 'POS',
193
+ 'TIKTOK', 'UNSPECIFIED', 'WEB', 'WISH', 'WIX_APP_STORE', 'WIX_INVOICES'
194
+ ]),
195
+ }).optional(),
196
+ seenByAHuman: z.boolean().optional(),
197
+ checkoutId: z.string().optional(),
198
+ customFields: z.array(z.unknown()).optional(),
199
+ cartId: z.string().optional(),
200
+ isInternalOrderCreate: z.boolean().optional(),
201
+ payNow: z.object({
202
+ subtotal: priceSchema,
203
+ shipping: priceSchema.optional(),
204
+ tax: priceSchema.optional(),
205
+ discount: priceSchema.optional(),
206
+ totalPrice: priceSchema,
207
+ total: priceSchema,
208
+ totalWithGiftCard: priceSchema.optional(),
209
+ totalWithoutGiftCard: priceSchema.optional(),
210
+ totalAdditionalFees: priceSchema.optional(),
211
+ }).optional(),
212
+ balanceSummary: z.object({
213
+ balance: priceSchema,
214
+ paid: priceSchema,
215
+ refunded: priceSchema.optional(),
216
+ authorized: priceSchema.optional(),
217
+ pendingRefund: priceSchema.optional(),
218
+ }).optional(),
219
+ additionalFees: z.array(additionalFeeSchema).optional(),
220
+ purchaseFlowId: z.string().optional(),
221
+ recipientInfo: z.object({
222
+ address: addressSchema.optional(), // Made optional to avoid the error
223
+ contactDetails: fullAddressContactDetailsSchema,
224
+ }).optional(),
225
+ });
226
+
227
+ export const orderPaymentStatusUpdatedSchema = z.object({
228
+ metadata: eventMetadataSchema,
229
+ data: z.object({
230
+ order: orderSchema,
231
+ previousPaymentStatus: z.enum(['FULLY_REFUNDED', 'NOT_PAID', 'PAID', 'PARTIALLY_PAID', 'PARTIALLY_REFUNDED', 'PENDING', 'UNSPECIFIED']).optional(),
232
+ }),
233
+ });
234
+
235
+ export type OrderPaymentStatusUpdated = z.infer<typeof orderPaymentStatusUpdatedSchema>;
236
+ export type OrderSchema = z.infer<typeof orderSchema>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "2.0.0-beta.8",
4
+ "version": "2.0.0-beta.9",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "repository": {
package/src/helpers.ts CHANGED
@@ -89,13 +89,5 @@ export function cleanupWatchers() {
89
89
 
90
90
  logger.info(`Cleaning watchers for directory: ${cwd}`);
91
91
  const result = spawnSync(command, { shell: true, encoding: 'utf-8' });
92
-
93
- // if (result.stderr) {
94
- // logger.error(`spawnSync error: ${result.stderr}`);
95
- // return;
96
- // }
97
- // if (!result.stdout.trim()) {
98
- // logger.info(`No watchers found to clean up.`);
99
- // return;
100
- // }
92
+ return result;
101
93
  }
package/src/index.ts CHANGED
@@ -20,8 +20,9 @@ export function setNeedsCleanup(value: boolean) {
20
20
  process.on('exit', (code) => {
21
21
  if(!needsCleanup) return;
22
22
  if(exitReason === 'none') {
23
- killAllProcesses('@wix/cli/bin/wix.cjs'); // Matches processes running the Wix CLI
23
+ killAllProcesses('@wix/cli/bin/wix.cjs');
24
24
  killAllProcesses('wix:dev');
25
+ killAllProcesses('wix dev');
25
26
  cleanupWatchers();
26
27
  }
27
28
 
@@ -34,6 +35,7 @@ process.on('SIGINT', () => {
34
35
  logger.info(`🐕 Received Ctrl+C (SIGINT), cleaning up...`);
35
36
  killAllProcesses('@wix/cli/bin/wix.cjs'); // Matches processes running the Wix CLI
36
37
  killAllProcesses('wix:dev');
38
+ killAllProcesses('wix dev');
37
39
  cleanupWatchers();
38
40
  process.exit(); // Exit explicitly after handling
39
41
  });
@@ -44,6 +46,7 @@ process.on('SIGTERM', () => {
44
46
  logger.info(`🛑 Received termination signal (SIGTERM), cleaning up...`);
45
47
  killAllProcesses('@wix/cli/bin/wix.cjs'); // Matches processes running the Wix CLI
46
48
  killAllProcesses('wix:dev');
49
+ killAllProcesses('wix dev');
47
50
  cleanupWatchers();
48
51
  process.exit(); // Exit explicitly after handling
49
52
  });
package/src/init/index.ts CHANGED
@@ -14,7 +14,9 @@ import { init_submodules } from "./gitModules.js";
14
14
  import { init_tauri } from "./tauri.js";
15
15
  import { pkgManagers } from "../schemas/lucy.js";
16
16
 
17
-
17
+ //TODO: Get Templates from Reposytory
18
+ //TODO: Update Local tsconfig for libs
19
+ //TODO: Fix PNPM in VELO
18
20
  export const init = Effect.gen(function* (_) {
19
21
  const config = yield* Config;
20
22
  if(config.config.action.initType === undefined) {
@@ -55,7 +55,7 @@ export const task_runGulp = Effect.gen(function* (_) {
55
55
  logger.action(`Running task: ${task}`);
56
56
 
57
57
  gulp.task('check-ts', gulp.parallel(
58
- checkTs(taskOptions),
58
+ checkTs(taskOptions, false),
59
59
  ));
60
60
 
61
61
  gulp.task('scss', gulp.parallel(
@@ -52,7 +52,7 @@ import { TaskType } from '../../schemas/types.js';
52
52
  * @param {string} filePath File path
53
53
  * @param {string} pattern Pattern to match
54
54
  */
55
- function extractMatchFromFile(filePath: string, pattern: string) {
55
+ async function extractMatchFromFile(filePath: string, pattern: string) {
56
56
  return new Promise((resolve, reject) => {
57
57
  fs.readFile(filePath, 'utf8', (err, data) => {
58
58
  if (err){
@@ -77,29 +77,30 @@ function extractMatchFromFile(filePath: string, pattern: string) {
77
77
  async function readFilesInFolder(folderPath: string, pattern: string | null, globPattern: string,) {
78
78
  const files = await glob.glob(path.join(folderPath, globPattern));
79
79
  const filenameList: Object[] = [];
80
- function traverseFiles(index: number) {
80
+ async function traverseFiles(index: number) {
81
81
  if (index === files.length){
82
82
  return;
83
83
  }
84
84
  const file = files[index];
85
85
  if(pattern){
86
86
  if(!file) return
87
- extractMatchFromFile(file, pattern)
88
- .then((capturedGroup) => {
89
- if (capturedGroup){
90
- filenameList.push(capturedGroup);
91
- }
92
- traverseFiles(index + 1);
93
- })
94
- .catch(() => { throw new Error(`Error reading file: ${file}`); });
87
+ try {
88
+ const capturedGroup = await extractMatchFromFile(file, pattern);
89
+ if (capturedGroup){
90
+ filenameList.push(capturedGroup);
91
+ }
92
+ } catch (error) {
93
+ throw new Error(`Error reading file: ${file}`);
94
+ }
95
95
  }
96
96
  if(!pattern){
97
97
  if(!file) return
98
98
  filenameList.push(path.basename(file));
99
- traverseFiles(index + 1);
100
99
  }
100
+ await traverseFiles(index + 1);
101
+
101
102
  }
102
- traverseFiles(0);
103
+ await traverseFiles(0);
103
104
 
104
105
  return filenameList;
105
106
  }
@@ -107,7 +108,7 @@ export async function checkPages(fail: boolean, force: boolean) {
107
108
  logger.action('Checking pages...');
108
109
  return new Promise<void>(async (resolve, reject) => {
109
110
  try {
110
- const sourcePages = await readFilesInFolder('./.wix/types/', '\\/pages\\/(?<page>.*\\.ts)', '**/*.json',) as string[];
111
+ const sourcePages = await readFilesInFolder('./.wix/types/', '\\/pages\\/(?<page>.*\\.ts)', '*/*.json',) as string[];
111
112
  const tsPages = await readFilesInFolder('./typescript/pages', null, '**/*.ts',) as string[];
112
113
 
113
114
  const sourcePagesSet = new Set(sourcePages);
@@ -187,7 +188,7 @@ export function checkTs(options: TaskOptions, watching: boolean = false): TaskTy
187
188
  const task = (done: gulp.TaskFunctionCallback) => {
188
189
  let hasError = false;
189
190
  const stream = gulp
190
- .src([`${folder}/**/*.ts`, `!${folder}/types/**/*.ts`])
191
+ .src([`${folder}/**/*.{ts,tsx}`, `!${folder}/types/**/*.ts`])
191
192
  .pipe(tsProject(customReporter))
192
193
  .on("error", (error) => {
193
194
  hasError = true;
@@ -35,7 +35,7 @@ export function watchAll(options: TaskOptions): TaskType {
35
35
  '*/public/**/*.tsx',
36
36
  '!src/**/*',
37
37
  ], gulp.parallel(
38
- checkTs(options),
38
+ checkTs(options, true),
39
39
  buildPublic(options),
40
40
  ));
41
41
  }
@@ -43,7 +43,7 @@ export function watchAll(options: TaskOptions): TaskType {
43
43
  function watchPages() {
44
44
  return gulp.watch(['typescript/pages/**/*.ts', '!src/**/*',],
45
45
  gulp.parallel(
46
- checkTs(options),
46
+ checkTs(options, true),
47
47
  buildPages(options),
48
48
  )
49
49
  );
@@ -68,7 +68,7 @@ export function watchAll(options: TaskOptions): TaskType {
68
68
  '!src/**/*',
69
69
  ], gulp.parallel(
70
70
  previewTemplates(options),
71
- checkTs(options),
71
+ checkTs(options, true),
72
72
  )
73
73
  );
74
74
  }