@valbuild/cli 0.60.21 → 0.60.23

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.
@@ -24,7 +24,6 @@ function error(message) {
24
24
 
25
25
  async function validate({
26
26
  root,
27
- cfg,
28
27
  fix,
29
28
  noEslint
30
29
  }) {
@@ -34,9 +33,7 @@ async function validate({
34
33
  ignore: false,
35
34
  useEslintrc: true
36
35
  });
37
- const service = await server.createService(projectRoot, {
38
- valConfigPath: cfg ?? "./val.config"
39
- });
36
+ const service = await server.createService(projectRoot, {});
40
37
  const valFiles = await fastGlob.glob("**/*.val.{js,ts}", {
41
38
  ignore: ["node_modules/**"],
42
39
  cwd: projectRoot
@@ -150,14 +147,11 @@ function logEslintMessage(fileContent, filePath, eslintMessage) {
150
147
 
151
148
  async function files({
152
149
  root,
153
- cfg,
154
150
  managedDir
155
151
  }) {
156
152
  const printFilesUsedByVal = !managedDir;
157
153
  const projectRoot = root ? path__default["default"].resolve(root) : process.cwd();
158
- const service = await server.createService(projectRoot, {
159
- valConfigPath: cfg ?? "./val.config"
160
- });
154
+ const service = await server.createService(projectRoot, {});
161
155
  const valFiles = await fastGlob.glob("**/*.val.{js,ts}", {
162
156
  ignore: ["node_modules/**"],
163
157
  cwd: projectRoot
@@ -221,6 +215,31 @@ function isFileRef(value) {
221
215
  return false;
222
216
  }
223
217
 
218
+ const getVersions = async () => {
219
+ const coreVersion = await (() => {
220
+ try {
221
+ var _require;
222
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
223
+ return (_require = require("@valbuild/core")) === null || _require === void 0 || (_require = _require.Internal) === null || _require === void 0 || (_require = _require.VERSION) === null || _require === void 0 ? void 0 : _require.core;
224
+ } catch {
225
+ return null;
226
+ }
227
+ })();
228
+ const nextVersion = await (() => {
229
+ try {
230
+ var _require2;
231
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
232
+ return (_require2 = require("@valbuild/next")) === null || _require2 === void 0 || (_require2 = _require2.Internal) === null || _require2 === void 0 || (_require2 = _require2.VERSION) === null || _require2 === void 0 ? void 0 : _require2.next;
233
+ } catch {
234
+ return null;
235
+ }
236
+ })();
237
+ return {
238
+ coreVersion: coreVersion || undefined,
239
+ nextVersion: nextVersion || undefined
240
+ };
241
+ };
242
+
224
243
  async function main() {
225
244
  const {
226
245
  input,
@@ -236,12 +255,12 @@ async function main() {
236
255
  Commands:
237
256
  validate
238
257
  list-files
258
+ versions
239
259
 
240
260
  Command: validate
241
261
  Description: val-idate val modules
242
262
  Options:
243
263
  --root [root], -r [root] Set project root directory (default process.cwd())
244
- --cfg [cfg], -c [cfg] Set path to config relative to root (default ./val.config)
245
264
  --fix [fix] Attempt to fix validation errors
246
265
  --noEslint [noEslint] Disable eslint validation during validate
247
266
 
@@ -257,7 +276,6 @@ async function main() {
257
276
  Options:
258
277
  --managedDir [dir] If set, list files found in directory that are not managed by Val
259
278
  --root [root], -r [root] Set project root directory (default process.cwd())
260
- --cfg [cfg], -c [cfg] Set path to config relative to root (default ./val.config)
261
279
  `, {
262
280
  flags: {
263
281
  port: {
@@ -269,10 +287,6 @@ async function main() {
269
287
  type: "string",
270
288
  alias: "r"
271
289
  },
272
- cfg: {
273
- type: "string",
274
- alias: "c"
275
- },
276
290
  fix: {
277
291
  type: "boolean"
278
292
  },
@@ -299,9 +313,10 @@ async function main() {
299
313
  }
300
314
  return files({
301
315
  root: flags.root,
302
- cfg: flags.cfg,
303
316
  managedDir: flags.managedDir
304
317
  });
318
+ case "versions":
319
+ return versions();
305
320
  case "validate":
306
321
  case "idate":
307
322
  if (flags.managedDir) {
@@ -309,7 +324,6 @@ async function main() {
309
324
  }
310
325
  return validate({
311
326
  root: flags.root,
312
- cfg: flags.cfg,
313
327
  fix: flags.fix,
314
328
  noEslint: flags.noEslint
315
329
  });
@@ -321,3 +335,8 @@ void main().catch(err => {
321
335
  error(err instanceof Error ? err.message + "\n" + err.stack : typeof err === "object" ? JSON.stringify(err, null, 2) : err);
322
336
  process.exitCode = 1;
323
337
  });
338
+ async function versions() {
339
+ const foundVersions = await getVersions();
340
+ console.log(`${chalk__default["default"].cyan("@valbuild/core")}: ${foundVersions.coreVersion}`);
341
+ console.log(`${chalk__default["default"].cyan("@valbuild/next")}: ${foundVersions.nextVersion}`);
342
+ }
@@ -24,7 +24,6 @@ function error(message) {
24
24
 
25
25
  async function validate({
26
26
  root,
27
- cfg,
28
27
  fix,
29
28
  noEslint
30
29
  }) {
@@ -34,9 +33,7 @@ async function validate({
34
33
  ignore: false,
35
34
  useEslintrc: true
36
35
  });
37
- const service = await server.createService(projectRoot, {
38
- valConfigPath: cfg ?? "./val.config"
39
- });
36
+ const service = await server.createService(projectRoot, {});
40
37
  const valFiles = await fastGlob.glob("**/*.val.{js,ts}", {
41
38
  ignore: ["node_modules/**"],
42
39
  cwd: projectRoot
@@ -150,14 +147,11 @@ function logEslintMessage(fileContent, filePath, eslintMessage) {
150
147
 
151
148
  async function files({
152
149
  root,
153
- cfg,
154
150
  managedDir
155
151
  }) {
156
152
  const printFilesUsedByVal = !managedDir;
157
153
  const projectRoot = root ? path__default["default"].resolve(root) : process.cwd();
158
- const service = await server.createService(projectRoot, {
159
- valConfigPath: cfg ?? "./val.config"
160
- });
154
+ const service = await server.createService(projectRoot, {});
161
155
  const valFiles = await fastGlob.glob("**/*.val.{js,ts}", {
162
156
  ignore: ["node_modules/**"],
163
157
  cwd: projectRoot
@@ -221,6 +215,31 @@ function isFileRef(value) {
221
215
  return false;
222
216
  }
223
217
 
218
+ const getVersions = async () => {
219
+ const coreVersion = await (() => {
220
+ try {
221
+ var _require;
222
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
223
+ return (_require = require("@valbuild/core")) === null || _require === void 0 || (_require = _require.Internal) === null || _require === void 0 || (_require = _require.VERSION) === null || _require === void 0 ? void 0 : _require.core;
224
+ } catch {
225
+ return null;
226
+ }
227
+ })();
228
+ const nextVersion = await (() => {
229
+ try {
230
+ var _require2;
231
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
232
+ return (_require2 = require("@valbuild/next")) === null || _require2 === void 0 || (_require2 = _require2.Internal) === null || _require2 === void 0 || (_require2 = _require2.VERSION) === null || _require2 === void 0 ? void 0 : _require2.next;
233
+ } catch {
234
+ return null;
235
+ }
236
+ })();
237
+ return {
238
+ coreVersion: coreVersion || undefined,
239
+ nextVersion: nextVersion || undefined
240
+ };
241
+ };
242
+
224
243
  async function main() {
225
244
  const {
226
245
  input,
@@ -236,12 +255,12 @@ async function main() {
236
255
  Commands:
237
256
  validate
238
257
  list-files
258
+ versions
239
259
 
240
260
  Command: validate
241
261
  Description: val-idate val modules
242
262
  Options:
243
263
  --root [root], -r [root] Set project root directory (default process.cwd())
244
- --cfg [cfg], -c [cfg] Set path to config relative to root (default ./val.config)
245
264
  --fix [fix] Attempt to fix validation errors
246
265
  --noEslint [noEslint] Disable eslint validation during validate
247
266
 
@@ -257,7 +276,6 @@ async function main() {
257
276
  Options:
258
277
  --managedDir [dir] If set, list files found in directory that are not managed by Val
259
278
  --root [root], -r [root] Set project root directory (default process.cwd())
260
- --cfg [cfg], -c [cfg] Set path to config relative to root (default ./val.config)
261
279
  `, {
262
280
  flags: {
263
281
  port: {
@@ -269,10 +287,6 @@ async function main() {
269
287
  type: "string",
270
288
  alias: "r"
271
289
  },
272
- cfg: {
273
- type: "string",
274
- alias: "c"
275
- },
276
290
  fix: {
277
291
  type: "boolean"
278
292
  },
@@ -299,9 +313,10 @@ async function main() {
299
313
  }
300
314
  return files({
301
315
  root: flags.root,
302
- cfg: flags.cfg,
303
316
  managedDir: flags.managedDir
304
317
  });
318
+ case "versions":
319
+ return versions();
305
320
  case "validate":
306
321
  case "idate":
307
322
  if (flags.managedDir) {
@@ -309,7 +324,6 @@ async function main() {
309
324
  }
310
325
  return validate({
311
326
  root: flags.root,
312
- cfg: flags.cfg,
313
327
  fix: flags.fix,
314
328
  noEslint: flags.noEslint
315
329
  });
@@ -321,3 +335,8 @@ void main().catch(err => {
321
335
  error(err instanceof Error ? err.message + "\n" + err.stack : typeof err === "object" ? JSON.stringify(err, null, 2) : err);
322
336
  process.exitCode = 1;
323
337
  });
338
+ async function versions() {
339
+ const foundVersions = await getVersions();
340
+ console.log(`${chalk__default["default"].cyan("@valbuild/core")}: ${foundVersions.coreVersion}`);
341
+ console.log(`${chalk__default["default"].cyan("@valbuild/next")}: ${foundVersions.nextVersion}`);
342
+ }
@@ -14,7 +14,6 @@ function error(message) {
14
14
 
15
15
  async function validate({
16
16
  root,
17
- cfg,
18
17
  fix,
19
18
  noEslint
20
19
  }) {
@@ -24,9 +23,7 @@ async function validate({
24
23
  ignore: false,
25
24
  useEslintrc: true
26
25
  });
27
- const service = await createService(projectRoot, {
28
- valConfigPath: cfg ?? "./val.config"
29
- });
26
+ const service = await createService(projectRoot, {});
30
27
  const valFiles = await glob("**/*.val.{js,ts}", {
31
28
  ignore: ["node_modules/**"],
32
29
  cwd: projectRoot
@@ -140,14 +137,11 @@ function logEslintMessage(fileContent, filePath, eslintMessage) {
140
137
 
141
138
  async function files({
142
139
  root,
143
- cfg,
144
140
  managedDir
145
141
  }) {
146
142
  const printFilesUsedByVal = !managedDir;
147
143
  const projectRoot = root ? path.resolve(root) : process.cwd();
148
- const service = await createService(projectRoot, {
149
- valConfigPath: cfg ?? "./val.config"
150
- });
144
+ const service = await createService(projectRoot, {});
151
145
  const valFiles = await glob("**/*.val.{js,ts}", {
152
146
  ignore: ["node_modules/**"],
153
147
  cwd: projectRoot
@@ -211,6 +205,31 @@ function isFileRef(value) {
211
205
  return false;
212
206
  }
213
207
 
208
+ const getVersions = async () => {
209
+ const coreVersion = await (() => {
210
+ try {
211
+ var _require;
212
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
213
+ return (_require = require("@valbuild/core")) === null || _require === void 0 || (_require = _require.Internal) === null || _require === void 0 || (_require = _require.VERSION) === null || _require === void 0 ? void 0 : _require.core;
214
+ } catch {
215
+ return null;
216
+ }
217
+ })();
218
+ const nextVersion = await (() => {
219
+ try {
220
+ var _require2;
221
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
222
+ return (_require2 = require("@valbuild/next")) === null || _require2 === void 0 || (_require2 = _require2.Internal) === null || _require2 === void 0 || (_require2 = _require2.VERSION) === null || _require2 === void 0 ? void 0 : _require2.next;
223
+ } catch {
224
+ return null;
225
+ }
226
+ })();
227
+ return {
228
+ coreVersion: coreVersion || undefined,
229
+ nextVersion: nextVersion || undefined
230
+ };
231
+ };
232
+
214
233
  async function main() {
215
234
  const {
216
235
  input,
@@ -226,12 +245,12 @@ async function main() {
226
245
  Commands:
227
246
  validate
228
247
  list-files
248
+ versions
229
249
 
230
250
  Command: validate
231
251
  Description: val-idate val modules
232
252
  Options:
233
253
  --root [root], -r [root] Set project root directory (default process.cwd())
234
- --cfg [cfg], -c [cfg] Set path to config relative to root (default ./val.config)
235
254
  --fix [fix] Attempt to fix validation errors
236
255
  --noEslint [noEslint] Disable eslint validation during validate
237
256
 
@@ -247,7 +266,6 @@ async function main() {
247
266
  Options:
248
267
  --managedDir [dir] If set, list files found in directory that are not managed by Val
249
268
  --root [root], -r [root] Set project root directory (default process.cwd())
250
- --cfg [cfg], -c [cfg] Set path to config relative to root (default ./val.config)
251
269
  `, {
252
270
  flags: {
253
271
  port: {
@@ -259,10 +277,6 @@ async function main() {
259
277
  type: "string",
260
278
  alias: "r"
261
279
  },
262
- cfg: {
263
- type: "string",
264
- alias: "c"
265
- },
266
280
  fix: {
267
281
  type: "boolean"
268
282
  },
@@ -289,9 +303,10 @@ async function main() {
289
303
  }
290
304
  return files({
291
305
  root: flags.root,
292
- cfg: flags.cfg,
293
306
  managedDir: flags.managedDir
294
307
  });
308
+ case "versions":
309
+ return versions();
295
310
  case "validate":
296
311
  case "idate":
297
312
  if (flags.managedDir) {
@@ -299,7 +314,6 @@ async function main() {
299
314
  }
300
315
  return validate({
301
316
  root: flags.root,
302
- cfg: flags.cfg,
303
317
  fix: flags.fix,
304
318
  noEslint: flags.noEslint
305
319
  });
@@ -311,3 +325,8 @@ void main().catch(err => {
311
325
  error(err instanceof Error ? err.message + "\n" + err.stack : typeof err === "object" ? JSON.stringify(err, null, 2) : err);
312
326
  process.exitCode = 1;
313
327
  });
328
+ async function versions() {
329
+ const foundVersions = await getVersions();
330
+ console.log(`${chalk.cyan("@valbuild/core")}: ${foundVersions.coreVersion}`);
331
+ console.log(`${chalk.cyan("@valbuild/next")}: ${foundVersions.nextVersion}`);
332
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valbuild/cli",
3
3
  "private": false,
4
- "version": "0.60.21",
4
+ "version": "0.60.23",
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.21",
22
- "@valbuild/server": "~0.60.21",
23
- "@valbuild/eslint-plugin": "~0.60.21",
21
+ "@valbuild/core": "~0.60.23",
22
+ "@valbuild/server": "~0.60.23",
23
+ "@valbuild/eslint-plugin": "~0.60.23",
24
24
  "eslint": "^8.31.0",
25
25
  "@inquirer/confirm": "^2.0.15",
26
26
  "@inquirer/prompts": "^3.0.2",
package/src/cli.ts CHANGED
@@ -2,6 +2,8 @@ import meow from "meow";
2
2
  import { error } from "./logger";
3
3
  import { validate } from "./validate";
4
4
  import { files as files } from "./files";
5
+ import { getVersions } from "./getVersions";
6
+ import chalk from "chalk";
5
7
 
6
8
  async function main(): Promise<void> {
7
9
  const { input, flags, showHelp } = meow(
@@ -15,12 +17,12 @@ async function main(): Promise<void> {
15
17
  Commands:
16
18
  validate
17
19
  list-files
20
+ versions
18
21
 
19
22
  Command: validate
20
23
  Description: val-idate val modules
21
24
  Options:
22
25
  --root [root], -r [root] Set project root directory (default process.cwd())
23
- --cfg [cfg], -c [cfg] Set path to config relative to root (default ./val.config)
24
26
  --fix [fix] Attempt to fix validation errors
25
27
  --noEslint [noEslint] Disable eslint validation during validate
26
28
 
@@ -36,7 +38,6 @@ async function main(): Promise<void> {
36
38
  Options:
37
39
  --managedDir [dir] If set, list files found in directory that are not managed by Val
38
40
  --root [root], -r [root] Set project root directory (default process.cwd())
39
- --cfg [cfg], -c [cfg] Set path to config relative to root (default ./val.config)
40
41
  `,
41
42
  {
42
43
  flags: {
@@ -49,10 +50,6 @@ async function main(): Promise<void> {
49
50
  type: "string",
50
51
  alias: "r",
51
52
  },
52
- cfg: {
53
- type: "string",
54
- alias: "c",
55
- },
56
53
  fix: {
57
54
  type: "boolean",
58
55
  },
@@ -85,9 +82,10 @@ async function main(): Promise<void> {
85
82
  }
86
83
  return files({
87
84
  root: flags.root,
88
- cfg: flags.cfg,
89
85
  managedDir: flags.managedDir,
90
86
  });
87
+ case "versions":
88
+ return versions();
91
89
  case "validate":
92
90
  case "idate":
93
91
  if (flags.managedDir) {
@@ -95,7 +93,6 @@ async function main(): Promise<void> {
95
93
  }
96
94
  return validate({
97
95
  root: flags.root,
98
- cfg: flags.cfg,
99
96
  fix: flags.fix,
100
97
  noEslint: flags.noEslint,
101
98
  });
@@ -114,3 +111,9 @@ void main().catch((err) => {
114
111
  );
115
112
  process.exitCode = 1;
116
113
  });
114
+
115
+ async function versions() {
116
+ const foundVersions = await getVersions();
117
+ console.log(`${chalk.cyan("@valbuild/core")}: ${foundVersions.coreVersion}`);
118
+ console.log(`${chalk.cyan("@valbuild/next")}: ${foundVersions.nextVersion}`);
119
+ }
package/src/files.ts CHANGED
@@ -11,19 +11,15 @@ import path from "path";
11
11
 
12
12
  export async function files({
13
13
  root,
14
- cfg,
15
14
  managedDir,
16
15
  }: {
17
16
  root?: string;
18
- cfg?: string;
19
17
  managedDir?: string;
20
18
  }) {
21
19
  const printFilesUsedByVal = !managedDir;
22
20
  const projectRoot = root ? path.resolve(root) : process.cwd();
23
21
 
24
- const service = await createService(projectRoot, {
25
- valConfigPath: cfg ?? "./val.config",
26
- });
22
+ const service = await createService(projectRoot, {});
27
23
 
28
24
  const valFiles: string[] = await glob("**/*.val.{js,ts}", {
29
25
  ignore: ["node_modules/**"],
@@ -0,0 +1,25 @@
1
+ export const getVersions = async (): Promise<{
2
+ coreVersion?: string;
3
+ nextVersion?: string;
4
+ }> => {
5
+ const coreVersion = await (() => {
6
+ try {
7
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
8
+ return require("@valbuild/core")?.Internal?.VERSION?.core;
9
+ } catch {
10
+ return null;
11
+ }
12
+ })();
13
+ const nextVersion = await (() => {
14
+ try {
15
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
16
+ return require("@valbuild/next")?.Internal?.VERSION?.next;
17
+ } catch {
18
+ return null;
19
+ }
20
+ })();
21
+ return {
22
+ coreVersion: coreVersion || undefined,
23
+ nextVersion: nextVersion || undefined,
24
+ };
25
+ };
package/src/validate.ts CHANGED
@@ -8,12 +8,10 @@ import fs from "fs/promises";
8
8
 
9
9
  export async function validate({
10
10
  root,
11
- cfg,
12
11
  fix,
13
12
  noEslint,
14
13
  }: {
15
14
  root?: string;
16
- cfg?: string;
17
15
  fix?: boolean;
18
16
  noEslint?: boolean;
19
17
  }) {
@@ -23,9 +21,7 @@ export async function validate({
23
21
  ignore: false,
24
22
  useEslintrc: true,
25
23
  });
26
- const service = await createService(projectRoot, {
27
- valConfigPath: cfg ?? "./val.config",
28
- });
24
+ const service = await createService(projectRoot, {});
29
25
 
30
26
  const valFiles: string[] = await glob("**/*.val.{js,ts}", {
31
27
  ignore: ["node_modules/**"],