@necord/schematics 1.3.7 → 1.3.8

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/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # Changelog
2
+
3
+ ## [1.3.8](https://github.com/necordjs/schematics/compare/1.3.7...1.3.8) (2025-09-03)
@@ -1,25 +1,12 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
3
  exports.CommonSchematicFactory = void 0;
4
+ const tslib_1 = require("tslib");
18
5
  const core_1 = require("@angular-devkit/core");
19
6
  const schematics_1 = require("@angular-devkit/schematics");
20
7
  const schematics_2 = require("@nestjs/schematics");
21
8
  const path_1 = require("path");
22
- __exportStar(require("./common-options.interface"), exports);
9
+ tslib_1.__exportStar(require("./common-options.interface"), exports);
23
10
  class CommonSchematicFactory {
24
11
  constructor() {
25
12
  this.templatePath = './files';
@@ -31,18 +18,18 @@ class CommonSchematicFactory {
31
18
  return (0, schematics_1.branchAndMerge)((0, schematics_1.chain)([(0, schematics_2.mergeSourceRoot)(options), this.addDeclarationToModule(options), (0, schematics_1.mergeWith)(this.generate(options))]));
32
19
  }
33
20
  generate(options) {
34
- return (context) => {
35
- var _a;
36
- return (0, schematics_1.apply)((0, schematics_1.url)((0, path_1.join)(this.templatePath)), [
37
- options.spec ? (0, schematics_1.noop)() : (0, schematics_1.filter)((path) => !path.endsWith('.spec.ts')),
38
- (0, schematics_1.applyTemplates)(Object.assign(Object.assign(Object.assign({}, core_1.strings), options), { lowercase: (str) => str.toLowerCase() })),
39
- (0, schematics_1.move)((_a = options.path) !== null && _a !== void 0 ? _a : '')
40
- ])(context);
41
- };
21
+ return (context) => (0, schematics_1.apply)((0, schematics_1.url)((0, path_1.join)(this.templatePath)), [
22
+ options.spec ? (0, schematics_1.noop)() : (0, schematics_1.filter)((path) => !path.endsWith('.spec.ts')),
23
+ (0, schematics_1.applyTemplates)({
24
+ ...core_1.strings,
25
+ ...options,
26
+ lowercase: (str) => str.toLowerCase()
27
+ }),
28
+ (0, schematics_1.move)(options.path ?? '')
29
+ ])(context);
42
30
  }
43
31
  addDeclarationToModule(options) {
44
32
  return (tree) => {
45
- var _a;
46
33
  options.module = new schematics_2.ModuleFinder(tree).find({
47
34
  name: options.name,
48
35
  path: options.path
@@ -51,7 +38,7 @@ class CommonSchematicFactory {
51
38
  return tree;
52
39
  }
53
40
  const rawContent = tree.read(options.module);
54
- const content = (_a = rawContent === null || rawContent === void 0 ? void 0 : rawContent.toString()) !== null && _a !== void 0 ? _a : '';
41
+ const content = rawContent?.toString() ?? '';
55
42
  const declarator = new schematics_2.ModuleDeclarator();
56
43
  tree.overwrite(options.module, declarator.declare(content, options));
57
44
  return tree;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@necord/schematics",
3
3
  "description": "A collection of schematics for Necord projects with NestJS",
4
- "version": "1.3.7",
4
+ "version": "1.3.8",
5
5
  "scripts": {
6
6
  "build": "rimraf -rf dist && tsc -p tsconfig.build.json",
7
7
  "postbuild": "npm run copy:collection && npm run copy:lib",
@@ -14,9 +14,16 @@
14
14
  "prepare": "husky",
15
15
  "format": "prettier --write \"src/**/*.ts\"",
16
16
  "lint": "eslint --ignore-pattern .gitignore {integration,src}/**/*.ts",
17
- "test": "jest"
17
+ "test": "jest",
18
+ "test:watch": "jest --watch",
19
+ "test:cov": "jest --coverage",
20
+ "test:ci": "jest --ci --passWithNoTests --coverage"
18
21
  },
19
22
  "schematics": "./dist/collection.json",
23
+ "funding": {
24
+ "type": "opencollective",
25
+ "url": "https://opencollective.com/necord"
26
+ },
20
27
  "main": "dist/index.js",
21
28
  "typings": "dist/index.d.ts",
22
29
  "files": [
@@ -38,29 +45,32 @@
38
45
  "necord"
39
46
  ],
40
47
  "dependencies": {
41
- "@nestjs/schematics": "11.0.0",
42
- "rxjs": "7.8.1"
48
+ "@nestjs/schematics": "11.0.7",
49
+ "rxjs": "7.8.2",
50
+ "tslib": "^2.8.1"
43
51
  },
44
52
  "devDependencies": {
45
- "@commitlint/cli": "19.6.1",
46
- "@commitlint/config-angular": "19.7.0",
53
+ "@commitlint/cli": "19.8.1",
54
+ "@commitlint/config-angular": "19.8.1",
47
55
  "@eslint/eslintrc": "^3.2.0",
48
56
  "@eslint/js": "^9.18.0",
49
- "@types/jest": "^29.5.14",
50
- "@types/node": "22.10.7",
57
+ "@nestjs/testing": "^11.1.0",
58
+ "@release-it/conventional-changelog": "^10.0.0",
59
+ "@types/jest": "^30.0.0",
60
+ "@types/node": "24.3.0",
51
61
  "copyfiles": "2.4.1",
52
62
  "eslint": "^9.18.0",
53
- "eslint-config-prettier": "10.0.1",
63
+ "eslint-config-prettier": "10.1.8",
54
64
  "eslint-plugin-import": "^2.31.0",
55
65
  "eslint-plugin-prettier": "^5.2.3",
56
- "globals": "^15.14.0",
66
+ "globals": "^16.0.0",
57
67
  "husky": "9.1.7",
58
- "jest": "^29.7.0",
59
- "prettier": "3.4.2",
60
- "release-it": "18.1.1",
68
+ "jest": "^30.0.0",
69
+ "prettier": "3.6.2",
70
+ "release-it": "19.0.4",
61
71
  "rimraf": "6.0.1",
62
- "ts-jest": "^29.2.5",
63
- "typescript": "5.7.3",
72
+ "ts-jest": "^29.3.2",
73
+ "typescript": "5.9.2",
64
74
  "typescript-eslint": "^8.21.0"
65
75
  },
66
76
  "repository": {
@@ -1,12 +0,0 @@
1
- import { Injectable } from '@nestjs/common';
2
- import { Context, Modal, ModalContext } from 'necord';
3
-
4
- @Injectable()
5
- export class <%= classify(name) %>Modals {
6
- @Modal('<%= name %>')
7
- public <%= name %>(@Ctx() [interaction]: ModalContext) {
8
- return interaction.reply({
9
- content: `Your fav pizza : ${interaction.fields.getTextInputValue('pizza')}`
10
- });
11
- }
12
- }