@valbuild/cli 0.60.17 → 0.60.19

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.
@@ -70,7 +70,11 @@ async function validate({
70
70
  var _eslintResultsByFile;
71
71
  const moduleId = `/${file}`.replace(/(\.val\.(ts|js))$/, ""); // TODO: check if this always works? (Windows?)
72
72
  const start = Date.now();
73
- const valModule = await service.get(moduleId, "");
73
+ const valModule = await service.get(moduleId, "", {
74
+ source: true,
75
+ schema: true,
76
+ validate: true
77
+ });
74
78
  const fileContent = await fs__default["default"].readFile(path__default["default"].join(projectRoot, file), "utf-8");
75
79
  const eslintResult = (_eslintResultsByFile = eslintResultsByFile) === null || _eslintResultsByFile === void 0 ? void 0 : _eslintResultsByFile[file];
76
80
  eslintResult === null || eslintResult === void 0 || eslintResult.messages.forEach(m => {
@@ -161,7 +165,11 @@ async function files({
161
165
  const absoluteFilesPathUsedByVal = [];
162
166
  async function printOrGetFileRefs(file) {
163
167
  const moduleId = `/${file}`.replace(/(\.val\.(ts|js))$/, ""); // TODO: check if this always works? (Windows?)
164
- const valModule = await service.get(moduleId, "");
168
+ const valModule = await service.get(moduleId, "", {
169
+ validate: true,
170
+ source: true,
171
+ schema: true
172
+ });
165
173
  // TODO: not sure using validation is the best way to do this, but it works currently.
166
174
  if (valModule.errors) {
167
175
  if (valModule.errors.validation) {
@@ -70,7 +70,11 @@ async function validate({
70
70
  var _eslintResultsByFile;
71
71
  const moduleId = `/${file}`.replace(/(\.val\.(ts|js))$/, ""); // TODO: check if this always works? (Windows?)
72
72
  const start = Date.now();
73
- const valModule = await service.get(moduleId, "");
73
+ const valModule = await service.get(moduleId, "", {
74
+ source: true,
75
+ schema: true,
76
+ validate: true
77
+ });
74
78
  const fileContent = await fs__default["default"].readFile(path__default["default"].join(projectRoot, file), "utf-8");
75
79
  const eslintResult = (_eslintResultsByFile = eslintResultsByFile) === null || _eslintResultsByFile === void 0 ? void 0 : _eslintResultsByFile[file];
76
80
  eslintResult === null || eslintResult === void 0 || eslintResult.messages.forEach(m => {
@@ -161,7 +165,11 @@ async function files({
161
165
  const absoluteFilesPathUsedByVal = [];
162
166
  async function printOrGetFileRefs(file) {
163
167
  const moduleId = `/${file}`.replace(/(\.val\.(ts|js))$/, ""); // TODO: check if this always works? (Windows?)
164
- const valModule = await service.get(moduleId, "");
168
+ const valModule = await service.get(moduleId, "", {
169
+ validate: true,
170
+ source: true,
171
+ schema: true
172
+ });
165
173
  // TODO: not sure using validation is the best way to do this, but it works currently.
166
174
  if (valModule.errors) {
167
175
  if (valModule.errors.validation) {
@@ -60,7 +60,11 @@ async function validate({
60
60
  var _eslintResultsByFile;
61
61
  const moduleId = `/${file}`.replace(/(\.val\.(ts|js))$/, ""); // TODO: check if this always works? (Windows?)
62
62
  const start = Date.now();
63
- const valModule = await service.get(moduleId, "");
63
+ const valModule = await service.get(moduleId, "", {
64
+ source: true,
65
+ schema: true,
66
+ validate: true
67
+ });
64
68
  const fileContent = await fs.readFile(path.join(projectRoot, file), "utf-8");
65
69
  const eslintResult = (_eslintResultsByFile = eslintResultsByFile) === null || _eslintResultsByFile === void 0 ? void 0 : _eslintResultsByFile[file];
66
70
  eslintResult === null || eslintResult === void 0 || eslintResult.messages.forEach(m => {
@@ -151,7 +155,11 @@ async function files({
151
155
  const absoluteFilesPathUsedByVal = [];
152
156
  async function printOrGetFileRefs(file) {
153
157
  const moduleId = `/${file}`.replace(/(\.val\.(ts|js))$/, ""); // TODO: check if this always works? (Windows?)
154
- const valModule = await service.get(moduleId, "");
158
+ const valModule = await service.get(moduleId, "", {
159
+ validate: true,
160
+ source: true,
161
+ schema: true
162
+ });
155
163
  // TODO: not sure using validation is the best way to do this, but it works currently.
156
164
  if (valModule.errors) {
157
165
  if (valModule.errors.validation) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valbuild/cli",
3
3
  "private": false,
4
- "version": "0.60.17",
4
+ "version": "0.60.19",
5
5
  "description": "Val CLI tools",
6
6
  "bin": {
7
7
  "val": "./bin.js"
@@ -18,9 +18,9 @@
18
18
  "typecheck": "tsc --noEmit"
19
19
  },
20
20
  "dependencies": {
21
- "@valbuild/core": "~0.60.17",
22
- "@valbuild/server": "~0.60.17",
23
- "@valbuild/eslint-plugin": "~0.60.17",
21
+ "@valbuild/core": "~0.60.19",
22
+ "@valbuild/server": "~0.60.19",
23
+ "@valbuild/eslint-plugin": "~0.60.19",
24
24
  "eslint": "^8.31.0",
25
25
  "@inquirer/confirm": "^2.0.15",
26
26
  "@inquirer/prompts": "^3.0.2",
package/src/files.ts CHANGED
@@ -33,7 +33,11 @@ export async function files({
33
33
  const absoluteFilesPathUsedByVal: string[] = [];
34
34
  async function printOrGetFileRefs(file: string) {
35
35
  const moduleId = `/${file}`.replace(/(\.val\.(ts|js))$/, "") as ModuleId; // TODO: check if this always works? (Windows?)
36
- const valModule = await service.get(moduleId, "" as ModulePath);
36
+ const valModule = await service.get(moduleId, "" as ModulePath, {
37
+ validate: true,
38
+ source: true,
39
+ schema: true,
40
+ });
37
41
  // TODO: not sure using validation is the best way to do this, but it works currently.
38
42
  if (valModule.errors) {
39
43
  if (valModule.errors.validation) {
package/src/validate.ts CHANGED
@@ -74,7 +74,11 @@ export async function validate({
74
74
  async function validateFile(file: string): Promise<number> {
75
75
  const moduleId = `/${file}`.replace(/(\.val\.(ts|js))$/, "") as ModuleId; // TODO: check if this always works? (Windows?)
76
76
  const start = Date.now();
77
- const valModule = await service.get(moduleId, "" as ModulePath);
77
+ const valModule = await service.get(moduleId, "" as ModulePath, {
78
+ source: true,
79
+ schema: true,
80
+ validate: true,
81
+ });
78
82
  const fileContent = await fs.readFile(
79
83
  path.join(projectRoot, file),
80
84
  "utf-8"