lucy-cli 0.7.8 → 0.7.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ export function updateWixTypes(options) {
11
11
  return () => {
12
12
  const { publicSettings, backendSettings, masterSettings, pageSettings, replaceOptions } = options;
13
13
  let count = 0;
14
- const modules = options.moduleSettings?.settings.modules;
14
+ const modules = Object.assign({}, options.projectSettings?.modules, options.projectSettings?.lucySettings?.modules);
15
15
  let localModules = undefined;
16
16
  if (options.projectSettings?.lucySettings) {
17
17
  localModules = options.projectSettings.lucySettings.modules;
@@ -19,6 +19,7 @@ export function updateWixTypes(options) {
19
19
  // Add module to publicSettings
20
20
  publicSettings.compilerOptions.paths.mocks = ["../../../typescript/__mocks__/*"];
21
21
  publicSettings.compilerOptions.paths['types/*'] = ["../../../typescript/types/*"];
22
+ publicSettings.compilerOptions.paths['public/*'] = ["../../../typescript/public/*.ts"];
22
23
  publicSettings.include = ["../../../typescript/public/**/*", "../../../typescript/__mocks__/**/*", "../../../typescript/backend/**/*"];
23
24
  // Add module to backendSettings
24
25
  backendSettings.compilerOptions.paths.mocks = ["../../../typescript/__mocks__/*"];
@@ -38,7 +39,6 @@ export function updateWixTypes(options) {
38
39
  publicSettings.compilerOptions.paths['backend/*.web.js'] = [`../../../${name}/backend/*.web.ts`];
39
40
  publicSettings.compilerOptions.paths['backend/*.web'] = [`../../../${name}/backend/*.web.ts`];
40
41
  publicSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*`);
41
- publicSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*`);
42
42
  publicSettings.compilerOptions.paths.mocks.push(...[`../../../${name}/__mocks__/*`]);
43
43
  publicSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*`);
44
44
  publicSettings.include.push(...[`../../../${name}/public/**/*`, `../../../${name}/backend/**/*.web.js`, `../../../${name}__mocks__/**/*`, `../../../${name}/backend/**/*`]);
@@ -110,8 +110,8 @@ export function addTypes(options, done) {
110
110
  .pipe(replace('type ', 'export type ', replaceOptions))
111
111
  .pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/beta/common/'));
112
112
  const processCommon = gulp.src(['./.wix/types/wix-code-types/dist/types/common/$w.d.ts'])
113
- .pipe(insert.prepend("import { FrontendAPISchema } from '../../../../../../lib/public/models/common/frontendApi.model';\nimport '@total-typescript/ts-reset';\n"))
114
- .pipe(replace('namespace \\$w {', 'declare namespace $w{\ntype Api = FrontendAPISchema;\n', replaceOptions))
113
+ .pipe(insert.prepend("import { FrontendAPI } from '../../../../../../typescript/public/models/frontendApi.model';\nimport '@total-typescript/ts-reset';\n"))
114
+ .pipe(replace('namespace \\$w {', 'declare namespace $w{\ntype Api = FrontendAPI;\n', replaceOptions))
115
115
  .pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/common/'));
116
116
  return merge(processPages, processCommon, exportTypesBeta, exportTypes)
117
117
  .on('error', function (e) {
File without changes
@@ -0,0 +1,17 @@
1
+ {
2
+ "web-methods": {
3
+ "*": {
4
+ "*": {
5
+ "siteOwner": {
6
+ "invoke": true
7
+ },
8
+ "siteMember": {
9
+ "invoke": true
10
+ },
11
+ "anonymous": {
12
+ "invoke": true
13
+ }
14
+ }
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+
3
+ export const frontendAPISchema = z.object({});
4
+ export type FrontendAPI = z.infer<typeof frontendAPISchema>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "0.7.8",
4
+ "version": "0.7.10",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
@@ -16,7 +16,8 @@
16
16
  "keywords": [
17
17
  "Framework",
18
18
  "WIX",
19
- "Studio"
19
+ "Studio",
20
+ "Velo"
20
21
  ],
21
22
  "author": "Gradlon von Känel",
22
23
  "license": "MIT",
@@ -11,7 +11,6 @@
11
11
  "backend/*.web.js": [],
12
12
  "backend/*.web": [],
13
13
  "mocks": [],
14
- "backend/*": [],
15
14
  "public/*": [],
16
15
  "types/*": [],
17
16
  "wix-types/*": ["../wix-code-types/dist/types/*"]
package/src/gulp/types.ts CHANGED
@@ -15,7 +15,8 @@ export function updateWixTypes(options: TaskOptions) {
15
15
  const { publicSettings, backendSettings, masterSettings, pageSettings, replaceOptions } = options;
16
16
  let count = 0;
17
17
 
18
- const modules = options.moduleSettings?.settings.modules;
18
+ const modules: Record<string, string> = Object.assign({}, options.projectSettings?.modules, options.projectSettings?.lucySettings?.modules);
19
+
19
20
  let localModules: Record<string, string> | undefined = undefined;
20
21
  if(options.projectSettings?.lucySettings) {
21
22
  localModules = options.projectSettings.lucySettings.modules as unknown as Record<string, string>;
@@ -23,6 +24,7 @@ export function updateWixTypes(options: TaskOptions) {
23
24
  // Add module to publicSettings
24
25
  publicSettings.compilerOptions.paths.mocks = [ "../../../typescript/__mocks__/*" ] as never;
25
26
  publicSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
27
+ publicSettings.compilerOptions.paths['public/*'] = [ "../../../typescript/public/*.ts" ] as never;
26
28
  publicSettings.include = [ "../../../typescript/public/**/*", "../../../typescript/__mocks__/**/*", "../../../typescript/backend/**/*" ] as never;
27
29
  // Add module to backendSettings
28
30
  backendSettings.compilerOptions.paths.mocks = [ "../../../typescript/__mocks__/*" ] as never;
@@ -43,7 +45,6 @@ export function updateWixTypes(options: TaskOptions) {
43
45
  publicSettings.compilerOptions.paths['backend/*.web.js'] = [`../../../${name}/backend/*.web.ts`] as never;
44
46
  publicSettings.compilerOptions.paths['backend/*.web'] = [`../../../${name}/backend/*.web.ts`] as never;
45
47
  publicSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
46
- publicSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*` as never);
47
48
  publicSettings.compilerOptions.paths.mocks.push(...[ `../../../${name}/__mocks__/*` as never ]);
48
49
  publicSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
49
50
  publicSettings.include.push(...[`../../../${name}/public/**/*`, `../../../${name}/backend/**/*.web.js`, `../../../${name}__mocks__/**/*`, `../../../${name}/backend/**/*` ] as never[]);
@@ -119,8 +120,8 @@ export function addTypes(options: TaskOptions, done: gulp.TaskFunctionCallback):
119
120
  .pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/beta/common/'));
120
121
 
121
122
  const processCommon = gulp.src(['./.wix/types/wix-code-types/dist/types/common/$w.d.ts'])
122
- .pipe(insert.prepend("import { FrontendAPISchema } from '../../../../../../lib/public/models/common/frontendApi.model';\nimport '@total-typescript/ts-reset';\n"))
123
- .pipe(replace('namespace \\$w {', 'declare namespace $w{\ntype Api = FrontendAPISchema;\n', replaceOptions))
123
+ .pipe(insert.prepend("import { FrontendAPI } from '../../../../../../typescript/public/models/frontendApi.model';\nimport '@total-typescript/ts-reset';\n"))
124
+ .pipe(replace('namespace \\$w {', 'declare namespace $w{\ntype Api = FrontendAPI;\n', replaceOptions))
124
125
  .pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/common/'));
125
126
 
126
127
  return merge(
File without changes