@foal/cli 2.6.0 → 2.8.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2021 FoalTS
3
+ Copyright (c) 2017-2022 FoalTS
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createEntity = void 0;
4
4
  // FoalTS
5
+ const path_1 = require("path");
5
6
  const file_system_1 = require("../../file-system");
6
7
  const utils_1 = require("../../utils");
7
8
  function createEntity({ name }) {
@@ -13,10 +14,13 @@ function createEntity({ name }) {
13
14
  else if (fs.exists('entities')) {
14
15
  root = 'entities';
15
16
  }
16
- const names = utils_1.getNames(name);
17
+ const names = utils_1.getNames(path_1.basename(name));
18
+ const subdir = path_1.dirname(name);
17
19
  const isMongoDBProject = fs.projectHasDependency('mongodb');
18
20
  fs
19
21
  .cd(root)
22
+ .ensureDir(subdir)
23
+ .cd(subdir)
20
24
  .renderOnlyIf(!isMongoDBProject, 'entity/entity.ts', `${names.kebabName}.entity.ts`, names)
21
25
  .renderOnlyIf(isMongoDBProject, 'entity/entity.mongodb.ts', `${names.kebabName}.entity.ts`, names)
22
26
  .ensureFile('index.ts')
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createHook = void 0;
4
4
  // FoalTS
5
+ const path_1 = require("path");
5
6
  const file_system_1 = require("../../file-system");
6
7
  const utils_1 = require("../../utils");
7
8
  function createHook({ name }) {
@@ -13,9 +14,12 @@ function createHook({ name }) {
13
14
  else if (fs.exists('hooks')) {
14
15
  root = 'hooks';
15
16
  }
16
- const names = utils_1.getNames(name);
17
+ const names = utils_1.getNames(path_1.basename(name));
18
+ const subdir = path_1.dirname(name);
17
19
  fs
18
20
  .cd(root)
21
+ .ensureDir(subdir)
22
+ .cd(subdir)
19
23
  .render('hook/hook.ts', `${names.kebabName}.hook.ts`, names)
20
24
  .ensureFile('index.ts')
21
25
  .addNamedExportIn('index.ts', names.upperFirstCamelName, `./${names.kebabName}.hook`);
@@ -31,7 +31,7 @@
31
31
  "@foal/core": "^2.0.0",
32
32
  "@foal/typeorm": "^2.0.0",
33
33
  "source-map-support": "~0.5.19",
34
- "better-sqlite3": "~7.1.2",
34
+ "better-sqlite3": "~7.5.0",
35
35
  "typeorm": "0.2.26"
36
36
  },
37
37
  "devDependencies": {
@@ -31,7 +31,7 @@
31
31
  "@foal/core": "^2.0.0",
32
32
  "@foal/typeorm": "^2.0.0",
33
33
  "source-map-support": "~0.5.19",
34
- "better-sqlite3": "~7.1.2",
34
+ "better-sqlite3": "~7.5.0",
35
35
  "typeorm": "0.2.26",
36
36
  "yamljs": "~0.3.0"
37
37
  },
package/lib/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * FoalTS
4
- * Copyright(c) 2017-2021 Loïc Poullain <loic.poullain@centraliens.net>
4
+ * Copyright(c) 2017-2022 Loïc Poullain <loic.poullain@centraliens.net>
5
5
  * Released under the MIT License.
6
6
  */
7
7
  export {};
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  /**
4
4
  * FoalTS
5
- * Copyright(c) 2017-2021 Loïc Poullain <loic.poullain@centraliens.net>
5
+ * Copyright(c) 2017-2022 Loïc Poullain <loic.poullain@centraliens.net>
6
6
  * Released under the MIT License.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foal/cli",
3
- "version": "2.6.0",
3
+ "version": "2.8.0",
4
4
  "description": "CLI tool for FoalTS",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,7 +59,7 @@
59
59
  "dependencies": {
60
60
  "ajv": "~6.12.0",
61
61
  "cli-spinner": "~0.2.10",
62
- "colors": "~1.4.0",
62
+ "colors": "1.4.0",
63
63
  "commander": "~7.2.0"
64
64
  },
65
65
  "devDependencies": {
@@ -71,5 +71,5 @@
71
71
  "ts-node": "~9.0.0",
72
72
  "typescript": "~4.0.2"
73
73
  },
74
- "gitHead": "250d8220d4f6045f1e9eafd1902624ae61b4779d"
74
+ "gitHead": "3651abba986459ca1a2efb8a02f480b9a063fb4a"
75
75
  }