lucy-cli 0.7.6 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,6 +29,7 @@ export function updateWixTypes(options) {
29
29
  masterSettings.include = ["../../../typescript/public/**/*", "index.d.ts", "../../../typescript/__mocks__/**/*", "../../../typescript/backend/**/*"];
30
30
  // Add module to pageSettings
31
31
  pageSettings.compilerOptions.paths['types/*'] = ["../../../typescript/types/*"];
32
+ pageSettings.compilerOptions.paths['backend/*'] = ["../../../typescript/backend/*.jsw.ts"];
32
33
  pageSettings.include = ["../../../typescript/public/**/*", "../../../typescript/__mocks__/**/*", "../../../typescript/backend/**/*"];
33
34
  if (modules) {
34
35
  for (const [name] of Object.entries(modules)) {
@@ -58,12 +59,12 @@ export function updateWixTypes(options) {
58
59
  pageSettings.compilerOptions.paths['backend/*.web.js'] = [`../../../${name}/backend/*.web.ts`];
59
60
  pageSettings.compilerOptions.paths['backend/*.web'] = [`../../../${name}/backend/*.web.ts`];
60
61
  pageSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*`);
61
- pageSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*`);
62
+ pageSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.jsw.ts`);
62
63
  pageSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*`);
63
64
  pageSettings.include.push(...[`../../../${name}/public/**/*`, `../../../${name}/backend/**/*.web.js`, `../../../${name}__mocks__/**/*`, `../../../${name}/backend/**/*`]);
64
65
  }
65
66
  }
66
- return gulp.src(['./.wix/types/*/*.json', '!./.wix/types/wix-code-types/*.json'])
67
+ return gulp.src(['./.wix/types/**/*.json', '!./.wix/types/wix-code-types/*.json'])
67
68
  .pipe(flatmap(function (stream, file) {
68
69
  count++;
69
70
  if (file.dirname.endsWith('public'))
package/dist/init.js CHANGED
@@ -25,9 +25,14 @@ export async function init(moduleSettings, projectSettings) {
25
25
  await editJson(join(moduleSettings.targetFolder, 'typedoc.json'), ['name'], [path.basename(moduleSettings.targetFolder)]);
26
26
  await gitInit(moduleSettings.targetFolder, moduleSettings.settings.modules);
27
27
  moduleSettings.settings.initialized = true;
28
- await fs.rm(join(moduleSettings.targetFolder, '.eslintrc.json'), { recursive: false }).catch(e => {
29
- console.log((`💩 ${red.underline.bold("=> Could not delete .eslintrc.json")}`));
30
- });
28
+ const eslintrcPath = join(moduleSettings.targetFolder, '.eslintrc.json');
29
+ if (existsSync(eslintrcPath)) {
30
+ console.log((`🐕 ${blue.underline.bold("=> Deleting .eslintrc.json")}`));
31
+ await fs.rm(join(eslintrcPath), { recursive: false }).catch(e => {
32
+ console.log((`💩 ${red.underline.bold("=> Could not delete .eslintrc.json ")} ${red.bold("=> ", e)}`));
33
+ });
34
+ }
35
+ console.log((`🐕 ${blue.underline.bold("=> Writing settings to lucy.json")}`));
31
36
  await fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
32
37
  console.log(chalk.greenBright.underline('🐶 => Initialization done!'));
33
38
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "0.7.6",
4
+ "version": "0.7.8",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
@@ -7,7 +7,7 @@
7
7
  "jsx": "react-jsx",
8
8
  "noEmit": false,
9
9
  "noUncheckedIndexedAccess": true,
10
- "lib": ["DOM"],
10
+ "lib": ["DOM", "es2015"],
11
11
  "paths": {
12
12
  "backend/*.web.js": [],
13
13
  "backend/*.web": [],
package/src/gulp/types.ts CHANGED
@@ -33,6 +33,7 @@ export function updateWixTypes(options: TaskOptions) {
33
33
  masterSettings.include = [ "../../../typescript/public/**/*", "index.d.ts", "../../../typescript/__mocks__/**/*", "../../../typescript/backend/**/*" ] as never;
34
34
  // Add module to pageSettings
35
35
  pageSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
36
+ pageSettings.compilerOptions.paths['backend/*'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
36
37
  pageSettings.include = [ "../../../typescript/public/**/*", "../../../typescript/__mocks__/**/*", "../../../typescript/backend/**/*" ] as never;
37
38
 
38
39
  if (modules) {
@@ -63,13 +64,13 @@ export function updateWixTypes(options: TaskOptions) {
63
64
  pageSettings.compilerOptions.paths['backend/*.web.js'] = [`../../../${name}/backend/*.web.ts`] as never;
64
65
  pageSettings.compilerOptions.paths['backend/*.web'] = [`../../../${name}/backend/*.web.ts`] as never;
65
66
  pageSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
66
- pageSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*` as never);
67
+ pageSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.jsw.ts` as never);
67
68
  pageSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
68
69
  pageSettings.include.push(...[`../../../${name}/public/**/*`, `../../../${name}/backend/**/*.web.js`, `../../../${name}__mocks__/**/*`, `../../../${name}/backend/**/*` ] as never[]);
69
70
  }
70
71
  }
71
72
 
72
- return gulp.src(['./.wix/types/*/*.json', '!./.wix/types/wix-code-types/*.json'])
73
+ return gulp.src(['./.wix/types/**/*.json', '!./.wix/types/wix-code-types/*.json'])
73
74
  .pipe(flatmap(function(stream: NodeJS.ReadableStream, file: File) {
74
75
  count ++;
75
76
  if (file.dirname.endsWith('public')) return stream.pipe(jeditor(publicSettings)).pipe(jeditor((json: any) => processJson(json)));
package/src/index.ts CHANGED
@@ -37,7 +37,7 @@ export type LucySettings = {
37
37
  scripts: {
38
38
  [commandName: string]: string;
39
39
  };
40
- };
40
+ };
41
41
 
42
42
  export type ModuleSettings = {
43
43
  packageRoot: string;
package/src/init.ts CHANGED
@@ -36,9 +36,15 @@ export async function init(moduleSettings: ModuleSettings, projectSettings: Proj
36
36
 
37
37
  moduleSettings.settings.initialized = true;
38
38
 
39
- await fs.rm(join(moduleSettings.targetFolder, '.eslintrc.json'), { recursive: false }).catch(e => {
40
- console.log((`💩 ${red.underline.bold("=> Could not delete .eslintrc.json")}`));
41
- });
39
+ const eslintrcPath = join(moduleSettings.targetFolder, '.eslintrc.json');
40
+ if(existsSync(eslintrcPath)) {
41
+ console.log((`🐕 ${blue.underline.bold("=> Deleting .eslintrc.json")}`));
42
+ await fs.rm(join(eslintrcPath), { recursive: false }).catch(e => {
43
+ console.log((`💩 ${red.underline.bold("=> Could not delete .eslintrc.json ")} ${red.bold("=> ", e)}`));
44
+ });
45
+ }
46
+
47
+ console.log((`🐕 ${blue.underline.bold("=> Writing settings to lucy.json")}`));
42
48
  await fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
43
49
 
44
50
  console.log(chalk.greenBright.underline('🐶 => Initialization done!'));