@necord/schematics 1.1.6 → 1.1.7

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.
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "context-menu": {
5
+ "description": "Generates a context menu component.",
6
+ "factory": "./context-menu/index#contextMenu",
7
+ "schema": "./context-menu/schema.json",
8
+ "aliases": [
9
+ "cm"
10
+ ]
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "properties": {
3
+ "name": {
4
+ "type": "string",
5
+ "minLength": 1,
6
+ "x-prompt": "What is the questions set name?"
7
+ },
8
+ "path": {
9
+ "type": "string",
10
+ "format": "path",
11
+ "description": "The path to create the service."
12
+ },
13
+ "sourceRoot": {
14
+ "type": "string",
15
+ "description": "Nest service source root directory."
16
+ },
17
+ "flat": {
18
+ "type": "boolean",
19
+ "default": false,
20
+ "description": "Flag to indicate if a directory is created.",
21
+ "x-prompt": "Create a directory?"
22
+ },
23
+ "spec": {
24
+ "type": "boolean",
25
+ "default": true,
26
+ "description": "Specifies if a spec file is generated.",
27
+ "x-prompt": "Generate spec file as well?"
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,14 @@
1
+ import { Injectable } from '@nestjs/common';
2
+ import { Context, UserCommand, UserCommandContext, TargetUser } from 'necord';
3
+ import { User } from 'discord.js';
4
+
5
+ @Injectable()
6
+ export class <%= classify(name) %>Commands {
7
+ @UserCommand({ name: <%= name.toLowerCase() %> })
8
+ public async <%= name %>(
9
+ @Context() [interaction]: UserCommandContext,
10
+ @TargetUser() user: User
11
+ ) {
12
+ return interaction.reply({ content: `Hello ${user.username}!` });
13
+ }
14
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "properties": {
3
+ "name": {
4
+ "type": "string",
5
+ "minLength": 1,
6
+ "description": "Command name",
7
+ "x-prompt": "What is the command name?"
8
+ },
9
+ "path": {
10
+ "type": "string",
11
+ "format": "path",
12
+ "description": "The path to create the service."
13
+ },
14
+ "sourceRoot": {
15
+ "type": "string",
16
+ "description": "Nest service source root directory."
17
+ },
18
+ "flat": {
19
+ "type": "boolean",
20
+ "default": false,
21
+ "description": "Flag to indicate if a directory is created.",
22
+ "x-prompt": "Create a directory?"
23
+ },
24
+ "spec": {
25
+ "type": "boolean",
26
+ "default": true,
27
+ "description": "Specifies if a spec file is generated.",
28
+ "x-prompt": "Generate spec file as well?"
29
+ },
30
+ "type": {
31
+ "type": "string",
32
+ "description": "The type of context menu to create.",
33
+ "enum": [
34
+ "message",
35
+ "user"
36
+ ]
37
+ }
38
+ },
39
+ "required": [
40
+ "type"
41
+ ]
42
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "properties": {
3
+ "name": {
4
+ "type": "string",
5
+ "minLength": 1,
6
+ "x-prompt": "What is the questions set name?"
7
+ },
8
+ "path": {
9
+ "type": "string",
10
+ "format": "path",
11
+ "description": "The path to create the service."
12
+ },
13
+ "sourceRoot": {
14
+ "type": "string",
15
+ "description": "Nest service source root directory."
16
+ },
17
+ "flat": {
18
+ "type": "boolean",
19
+ "default": false,
20
+ "description": "Flag to indicate if a directory is created.",
21
+ "x-prompt": "Create a directory?"
22
+ },
23
+ "spec": {
24
+ "type": "boolean",
25
+ "default": true,
26
+ "description": "Specifies if a spec file is generated.",
27
+ "x-prompt": "Generate spec file as well?"
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "properties": {
3
+ "name": {
4
+ "type": "string",
5
+ "minLength": 1,
6
+ "x-prompt": "What is the questions set name?"
7
+ },
8
+ "path": {
9
+ "type": "string",
10
+ "format": "path",
11
+ "description": "The path to create the service."
12
+ },
13
+ "sourceRoot": {
14
+ "type": "string",
15
+ "description": "Nest service source root directory."
16
+ },
17
+ "flat": {
18
+ "type": "boolean",
19
+ "default": false,
20
+ "description": "Flag to indicate if a directory is created.",
21
+ "x-prompt": "Create a directory?"
22
+ },
23
+ "spec": {
24
+ "type": "boolean",
25
+ "default": true,
26
+ "description": "Specifies if a spec file is generated.",
27
+ "x-prompt": "Generate spec file as well?"
28
+ }
29
+ }
30
+ }
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@necord/schematics",
3
3
  "description": "A collection of schematics for Necord projects with NestJS",
4
- "version": "1.1.6",
4
+ "version": "1.1.7",
5
5
  "scripts": {
6
6
  "build": "rimraf -rf dist && tsc -p tsconfig.json",
7
+ "postbuild": "npm run copy:collection && npm run copy:lib",
8
+ "copy:collection": "copyfiles --up 1 src/collection.json dist && copyfiles --up 1 src/**/schema.json dist",
9
+ "copy:lib": "copyfiles --up 1 src/**/files/**/* dist",
7
10
  "prepublish:npm": "npm run build",
8
11
  "publish:npm": "release-it",
9
12
  "prepublish:dev": "npm run build",
@@ -13,7 +16,7 @@
13
16
  "lint": "eslint --ignore-path .gitignore {integration,src}/**/*.ts",
14
17
  "test": "jest"
15
18
  },
16
- "schematics": "./src/collection.json",
19
+ "schematics": "./dist/collection.json",
17
20
  "main": "dist/index.js",
18
21
  "typings": "dist/index.d.ts",
19
22
  "files": [
@@ -37,8 +40,8 @@
37
40
  "dependencies": {
38
41
  "@angular-devkit/core": "14.0.5",
39
42
  "@angular-devkit/schematics": "14.0.5",
40
- "rxjs": "7.8.0",
41
- "@nestjs/schematics": "9.0.0"
43
+ "@nestjs/schematics": "9.0.0",
44
+ "rxjs": "7.8.0"
42
45
  },
43
46
  "devDependencies": {
44
47
  "@commitlint/cli": "17.5.0",
@@ -47,6 +50,7 @@
47
50
  "@types/node": "18.15.6",
48
51
  "@typescript-eslint/eslint-plugin": "5.56.0",
49
52
  "@typescript-eslint/parser": "5.56.0",
53
+ "copyfiles": "^2.4.1",
50
54
  "eslint": "8.38.0",
51
55
  "eslint-config-prettier": "8.8.0",
52
56
  "eslint-plugin-import": "2.27.5",