@pronto-tools-and-more/pronto 7.5.0 → 7.7.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/pronto",
3
- "version": "7.5.0",
3
+ "version": "7.7.0",
4
4
  "description": "",
5
5
  "main": "src/main.js",
6
6
  "type": "module",
@@ -17,14 +17,14 @@
17
17
  "@lvce-editor/ipc": "^11.0.1",
18
18
  "@lvce-editor/json-rpc": "^4.2.0",
19
19
  "@lvce-editor/verror": "^1.4.0",
20
- "@pronto-tools-and-more/file-watcher": "7.5.0",
21
- "@pronto-tools-and-more/files": "7.5.0",
22
- "@pronto-tools-and-more/network-process": "7.5.0",
23
- "@pronto-tools-and-more/sass-compiler": "7.5.0",
24
- "@pronto-tools-and-more/components-renderer": "7.5.0",
25
- "@pronto-tools-and-more/components": "7.5.0",
26
- "@pronto-tools-and-more/schema-process": "7.5.0",
27
- "@pronto-tools-and-more/type-checker": "7.5.0",
20
+ "@pronto-tools-and-more/file-watcher": "7.7.0",
21
+ "@pronto-tools-and-more/files": "7.7.0",
22
+ "@pronto-tools-and-more/network-process": "7.7.0",
23
+ "@pronto-tools-and-more/sass-compiler": "7.7.0",
24
+ "@pronto-tools-and-more/components-renderer": "7.7.0",
25
+ "@pronto-tools-and-more/components": "7.7.0",
26
+ "@pronto-tools-and-more/schema-process": "7.7.0",
27
+ "@pronto-tools-and-more/type-checker": "7.7.0",
28
28
  "execa": "^9.4.1",
29
29
  "express": "^4.21.1"
30
30
  },
@@ -0,0 +1 @@
1
+ export const Error = 128;
@@ -1,5 +1,5 @@
1
1
  import * as Version from "../Version/Version.js";
2
2
 
3
3
  export const printVersion = () => {
4
- console.info(`[pronto] ${Version.version}`);
4
+ console.info(`[pronto] version ${Version.version}`);
5
5
  };
@@ -1,7 +1,32 @@
1
- export const typeCheck = () => {
2
- // TODO
3
- // 1. find path to custom.server.js
4
- // 2. read the file contents
5
- // 3. validate the code with ts morph
6
- // 4. print out errors
1
+ import { existsSync } from "fs";
2
+ import { join } from "path";
3
+ import * as Cwd from "../Cwd/Cwd.js";
4
+ import * as TypeCheckerProcess from "../TypeCheckerProcess/TypeCheckerProcess.js";
5
+ import * as ExitCode from "../ExitCode/ExitCode.js";
6
+
7
+ export const typeCheck = async () => {
8
+ const customServerPath = join(
9
+ Cwd.cwd,
10
+ "src",
11
+ "default",
12
+ "storefront",
13
+ "assets",
14
+ "scripts",
15
+ "custom.server.js"
16
+ );
17
+ if (!existsSync(customServerPath)) {
18
+ return;
19
+ }
20
+ const errors = await TypeCheckerProcess.invoke(
21
+ "CheckTypes.checkTypes",
22
+ customServerPath
23
+ );
24
+ const errorCount = errors.length;
25
+ if (errorCount === 0) {
26
+ TypeCheckerProcess.dispose();
27
+ return;
28
+ }
29
+ console.info(`[pronto-type-checker] found ${errorCount} errors`);
30
+ console.info({ errors });
31
+ process.exit(ExitCode.Error);
7
32
  };
@@ -4,6 +4,7 @@ import * as FilesPath from "../FilesPath/FilesPath.js";
4
4
  import * as JsonFile from "../JsonFile/JsonFile.js";
5
5
  import * as ValidateSchema from "../ValidateSchema/ValidateSchema.js";
6
6
  import * as SchemaProcess from "../SchemaProcess/SchemaProcess.js";
7
+ import * as ExitCode from "../ExitCode/ExitCode.js";
7
8
 
8
9
  export const validateAllSchemas = async () => {
9
10
  const dist = join(Cwd.cwd, ".tmp", "dist");
@@ -32,7 +33,7 @@ export const validateAllSchemas = async () => {
32
33
  `[pronto] views json schema error: ${error.message} at ${error.instancePath} `
33
34
  );
34
35
  }
35
- process.exit(128);
36
+ process.exit(ExitCode.Error);
36
37
  }
37
38
  await SchemaProcess.dispose();
38
39
  };
@@ -1 +1 @@
1
- export const version = '7.5.0'
1
+ export const version = '7.7.0'