@jay-framework/jay-cli 0.10.0 → 0.12.0

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -5
  2. package/package.json +5 -4
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ import { JAY_EXTENSION, checkValidationErrors, GenerateTarget, RuntimeMode, JAY_
9
9
  import fs, { promises } from "fs";
10
10
  import path from "path";
11
11
  import { parseJayFile, JAY_IMPORT_RESOLVER } from "@jay-framework/compiler-jay-html";
12
+ import { getLogger } from "@jay-framework/logger";
12
13
  import { glob as glob$1 } from "glob";
13
14
  import path$1 from "node:path";
14
15
  const { glob } = fastGlob;
@@ -24,9 +25,9 @@ function checkFileExists(filepath) {
24
25
  }
25
26
  async function generateFiles(dir, codeGenerationFunction, afterGenerationFunction, outputExtension, destinationDir, compilationTarget, projectRoot) {
26
27
  const resolvedProjectRoot = projectRoot || process.cwd();
27
- console.log(chalk.whiteBright("Jay generating files for ", dir));
28
+ getLogger().important(chalk.whiteBright("Jay generating files for ", dir));
28
29
  let jayFiles = await findAllJayFiles(dir);
29
- console.log(dir, jayFiles);
30
+ getLogger().info(`${dir} ${JSON.stringify(jayFiles)}`);
30
31
  let generationFailed = false;
31
32
  for (const jayFile of jayFiles) {
32
33
  const content = await promises.readFile(jayFile, "utf-8");
@@ -48,15 +49,15 @@ async function generateFiles(dir, codeGenerationFunction, afterGenerationFunctio
48
49
  );
49
50
  const generateFileName = jayFile + outputExtension;
50
51
  if (generatedFile.validations.length > 0) {
51
- console.log(
52
+ getLogger().error(
52
53
  `${chalk.red("failed to generate")} ${chalk.yellow(jayFile)} → ${chalk.yellow(
53
54
  generateFileName
54
55
  )}`
55
56
  );
56
- generatedFile.validations.forEach((_) => console.log(chalk.red(_)));
57
+ generatedFile.validations.forEach((_) => getLogger().error(chalk.red(_)));
57
58
  generationFailed = true;
58
59
  } else {
59
- console.log(
60
+ getLogger().important(
60
61
  `${chalk.green("generated")} ${chalk.yellow(jayFile)} → ${chalk.yellow(
61
62
  generateFileName
62
63
  )}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/jay-cli",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "bin": "dist/index.js",
@@ -21,15 +21,16 @@
21
21
  "test:watch": "vitest"
22
22
  },
23
23
  "dependencies": {
24
- "@jay-framework/compiler": "^0.10.0",
25
- "@jay-framework/rollup-plugin": "^0.10.0",
24
+ "@jay-framework/compiler": "^0.12.0",
25
+ "@jay-framework/logger": "^0.12.0",
26
+ "@jay-framework/rollup-plugin": "^0.12.0",
26
27
  "chalk": "^4.1.2",
27
28
  "commander": "^14.0.0",
28
29
  "glob": "^10.4.5",
29
30
  "rollup": "^4.9.5"
30
31
  },
31
32
  "devDependencies": {
32
- "@jay-framework/dev-environment": "^0.10.0",
33
+ "@jay-framework/dev-environment": "^0.12.0",
33
34
  "@types/node": "^20.11.5",
34
35
  "@types/shelljs": "^0.8.15",
35
36
  "rimraf": "^5.0.5",