Skip to content

Commit

Permalink
feat: angular-devkit and initial generators
Browse files Browse the repository at this point in the history
  • Loading branch information
edusperoni committed Oct 4, 2024
1 parent 9cf8bc4 commit c829299
Show file tree
Hide file tree
Showing 60 changed files with 5,770 additions and 1,462 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"overrides": [
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
},
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {},
Expand Down
28 changes: 28 additions & 0 deletions .verdaccio/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# path to a directory with all packages
storage: ../tmp/local-registry/storage

# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
maxage: 60m

packages:
'**':
# give all users (including non-authenticated users) full access
# because it is a local registry
access: $all
publish: $all
unpublish: $all

# if package is not available locally, proxy requests to npm registry
proxy: npmjs

# log settings
logs:
type: stdout
format: pretty
level: warn

publish:
allow_offline: true # set offline to true to allow publish offline
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.validate": ["json"]
}
12 changes: 11 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
"@nx/eslint:lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
},
"@nx/js:tsc": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
}
},
"namedInputs": {
Expand All @@ -49,5 +54,10 @@
"nxCloudAccessToken": "NWJjY2UzMjctM2Q2Yy00ODZlLWExYjktNzE3YTRmMzRmMWQwfHJlYWQ=",
"parallel": 2,
"useInferencePlugins": false,
"defaultBase": "main"
"defaultBase": "main",
"release": {
"version": {
"preVersionCommand": "yarn nx run-many -t build"
}
}
}
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@nativescript/core": "~8.8.0",
"@nativescript/theme": "~3.0.2",
"@ngx-translate/core": "~15.0.0",
"@nx/devkit": "19.7.4",
"nativescript-fonticon": "~8.1.3",
"rxjs": "^7.8.0",
"zone.js": "~0.14.6"
Expand All @@ -70,8 +71,13 @@
"@nx/jest": "19.7.4",
"@nx/js": "19.7.4",
"@nx/node": "19.7.4",
"@nx/plugin": "19.7.4",
"@nx/workspace": "19.7.4",
"@schematics/angular": "18.2.4",
"@swc-node/register": "~1.9.1",
"@swc/cli": "~0.3.12",
"@swc/core": "~1.5.7",
"@swc/helpers": "~0.5.11",
"@types/jasmine": "5.1.4",
"@types/jest": "29.5.13",
"@types/node": "^20.0.0",
Expand Down Expand Up @@ -107,7 +113,8 @@
"ts-jest": "29.1.1",
"ts-node": "10.9.2",
"tslib": "^2.6.0",
"typescript": "~5.5.0"
"typescript": "~5.5.0",
"verdaccio": "^5.0.4"
},
"xplat": {
"prefix": "nativescript",
Expand All @@ -118,5 +125,8 @@
"nx format:write --files",
"nx affected:lint --fix --files"
]
},
"nx": {
"includedScripts": []
}
}
32 changes: 32 additions & 0 deletions packages/angular-devkit/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
},
{
"files": ["./package.json", "./generators.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/nx-plugin-checks": "error"
}
}
]
}
11 changes: 11 additions & 0 deletions packages/angular-devkit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# angular-devkit

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build angular-devkit` to build the library.

## Running unit tests

Run `nx test angular-devkit` to execute the unit tests via [Jest](https://jestjs.io).
22 changes: 22 additions & 0 deletions packages/angular-devkit/generators.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"generators": {
"component": {
"factory": "./src/generators/component/component",
"schema": "./src/generators/component/schema.json",
"aliases": ["c"],
"description": "Generate an Angular Component."
},
"directive": {
"factory": "./src/generators/directive/directive",
"schema": "./src/generators/directive/schema.json",
"aliases": ["d"],
"description": "Generate an Angular directive."
},
"pipe": {
"factory": "./src/generators/pipe/pipe",
"schema": "./src/generators/pipe/schema.json",
"description": "Generate an Angular Pipe",
"aliases": ["p"]
}
}
}
10 changes: 10 additions & 0 deletions packages/angular-devkit/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* eslint-disable */
export default {
displayName: 'angular-devkit',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/packages/angular-devkit',
};
17 changes: 17 additions & 0 deletions packages/angular-devkit/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "angular-devkit",
"version": "0.0.1",
"dependencies": {
"@nx/devkit": "19.7.4",
"tslib": "^2.3.0",
"@nx/js": "19.7.4",
"typescript": "~5.5.0",
"@phenomnomnominal/tsquery": "5.0.1",
"@typescript-eslint/type-utils": "7.18.0",
"semver": "7.6.3"
},
"type": "commonjs",
"main": "./src/index.js",
"typings": "./src/index.d.ts",
"generators": "./generators.json"
}
64 changes: 64 additions & 0 deletions packages/angular-devkit/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "angular-devkit",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/angular-devkit/src",
"projectType": "library",
"release": {
"version": {
"generatorOptions": {
"packageRoot": "dist/{projectRoot}",
"currentVersionResolver": "git-tag"
}
}
},
"tags": [],
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/packages/angular-devkit",
"main": "packages/angular-devkit/src/index.ts",
"tsConfig": "packages/angular-devkit/tsconfig.lib.json",
"assets": [
"packages/angular-devkit/*.md",
{
"input": "./packages/angular-devkit/src",
"glob": "**/!(*.ts)",
"output": "./src"
},
{
"input": "./packages/angular-devkit/src",
"glob": "**/*.d.ts",
"output": "./src"
},
{
"input": "./packages/angular-devkit",
"glob": "generators.json",
"output": "."
},
{
"input": "./packages/angular-devkit",
"glob": "executors.json",
"output": "."
}
]
}
},
"nx-release-publish": {
"options": {
"packageRoot": "dist/{projectRoot}"
}
},
"lint": {
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/angular-devkit/jest.config.ts"
}
}
}
}
Loading

0 comments on commit c829299

Please sign in to comment.