Skip to content

Commit 9c78cea

Browse files
authored
feat: ๐ŸŽธ add generators to create community/event/podcast (#314)
* feat: ๐ŸŽธ add generators to create community/event/podcast โœ… Closes: #164
1 parent 0a240a3 commit 9c78cea

35 files changed

+2073
-37
lines changed

โ€Ž.eslintrc.jsonโ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"ignorePatterns": ["**/*"],
44
"plugins": ["@nx", "html"],
55
"overrides": [
6+
{
7+
"files": "*.json",
8+
"parser": "jsonc-eslint-parser",
9+
"rules": {}
10+
},
611
{
712
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
813
"rules": {

โ€Ž.vscode/extensions.jsonโ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"recommendations": [
33
"nrwl.angular-console",
44
"esbenp.prettier-vscode",
5-
"dbaeumer.vscode-eslint"
5+
"dbaeumer.vscode-eslint",
6+
"firsttris.vscode-jest-runner"
67
]
78
}

โ€Ž.vscode/settings.jsonโ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.validate": ["json"]
3+
}

โ€Žjest.config.tsโ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { getJestProjectsAsync } from '@nx/jest';
2+
3+
export default async () => ({
4+
projects: await getJestProjectsAsync(),
5+
});

โ€Žjest.preset.jsโ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const nxPreset = require('@nx/jest/preset').default;
2+
3+
module.exports = { ...nxPreset };

โ€Žlibs/plugin/.eslintrc.jsonโ€Ž

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["./package.json", "./generators.json"],
19+
"parser": "jsonc-eslint-parser",
20+
"rules": {
21+
"@nx/nx-plugin-checks": "error"
22+
}
23+
}
24+
]
25+
}

โ€Žlibs/plugin/README.mdโ€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# plugin
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Building
6+
7+
Run `nx build plugin` to build the library.
8+
9+
## Running unit tests
10+
11+
Run `nx test plugin` to execute the unit tests via [Jest](https://jestjs.io).
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"generators": {
3+
"create-community": {
4+
"factory": "./src/generators/create-community/generator",
5+
"schema": "./src/generators/create-community/schema.json",
6+
"description": "Create a new community"
7+
},
8+
"create-podcast": {
9+
"factory": "./src/generators/create-podcast/generator",
10+
"schema": "./src/generators/create-podcast/schema.json",
11+
"description": "Create a new podcast"
12+
},
13+
"create-event": {
14+
"factory": "./src/generators/create-event/generator",
15+
"schema": "./src/generators/create-event/schema.json",
16+
"description": "Create a new event"
17+
}
18+
}
19+
}

โ€Žlibs/plugin/jest.config.tsโ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'plugin',
4+
preset: '../jest.preset.js',
5+
transform: {
6+
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
7+
},
8+
moduleFileExtensions: ['ts', 'js', 'html'],
9+
coverageDirectory: '../coverage/libs/plugin',
10+
};

โ€Žlibs/plugin/package.jsonโ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "@angular-hub/plugin",
3+
"version": "0.0.1",
4+
"dependencies": {
5+
"@nx/devkit": "19.3.1",
6+
"tslib": "^2.3.0"
7+
},
8+
"type": "commonjs",
9+
"main": "./src/index.js",
10+
"typings": "./src/index.d.ts",
11+
"private": true,
12+
"generators": "./generators.json"
13+
}

0 commit comments

Comments
ย (0)