mirror of https://github.com/abpframework/abp.git
19 changed files with 25 additions and 329 deletions
@ -0,0 +1,2 @@ |
|||||
|
@abp:registry=https://www.myget.org/F/abp-nightly/npm |
||||
|
|
||||
@ -1,25 +0,0 @@ |
|||||
{ |
|
||||
"extends": ["../../.eslintrc.json"], |
|
||||
"ignorePatterns": ["!**/*"], |
|
||||
"overrides": [ |
|
||||
{ |
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], |
|
||||
"rules": {} |
|
||||
}, |
|
||||
{ |
|
||||
"files": ["*.ts", "*.tsx"], |
|
||||
"rules": {} |
|
||||
}, |
|
||||
{ |
|
||||
"files": ["*.js", "*.jsx"], |
|
||||
"rules": {} |
|
||||
}, |
|
||||
{ |
|
||||
"files": ["./package.json", "./generators.json"], |
|
||||
"parser": "jsonc-eslint-parser", |
|
||||
"rules": { |
|
||||
"@nx/nx-plugin-checks": "error" |
|
||||
} |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
@ -1,11 +0,0 @@ |
|||||
# generators |
|
||||
|
|
||||
This library was generated with [Nx](https://nx.dev). |
|
||||
|
|
||||
## Building |
|
||||
|
|
||||
Run `nx build generators` to build the library. |
|
||||
|
|
||||
## Running unit tests |
|
||||
|
|
||||
Run `nx test generators` to execute the unit tests via [Jest](https://jestjs.io). |
|
||||
@ -1,9 +0,0 @@ |
|||||
{ |
|
||||
"generators": { |
|
||||
"generate-proxy": { |
|
||||
"factory": "./src/generators/generate-proxy/generator", |
|
||||
"schema": "./src/generators/generate-proxy/schema.json", |
|
||||
"description": "generate-proxy generator" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,10 +0,0 @@ |
|||||
/* eslint-disable */ |
|
||||
export default { |
|
||||
displayName: 'generators', |
|
||||
preset: '../../jest.preset.js', |
|
||||
transform: { |
|
||||
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }], |
|
||||
}, |
|
||||
moduleFileExtensions: ['ts', 'js', 'html'], |
|
||||
coverageDirectory: '../../coverage/packages/generators', |
|
||||
}; |
|
||||
@ -1,6 +0,0 @@ |
|||||
{ |
|
||||
"name": "@abp/generators", |
|
||||
"version": "0.0.1", |
|
||||
"type": "commonjs", |
|
||||
"generators": "./generators.json" |
|
||||
} |
|
||||
@ -1,66 +0,0 @@ |
|||||
{ |
|
||||
"name": "generators", |
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json", |
|
||||
"sourceRoot": "packages/generators/src", |
|
||||
"projectType": "library", |
|
||||
"targets": { |
|
||||
"build": { |
|
||||
"executor": "@nx/js:tsc", |
|
||||
"outputs": ["{options.outputPath}"], |
|
||||
"options": { |
|
||||
"outputPath": "dist/packages/generators", |
|
||||
"main": "packages/generators/src/index.ts", |
|
||||
"tsConfig": "packages/generators/tsconfig.lib.json", |
|
||||
"assets": [ |
|
||||
"packages/generators/*.md", |
|
||||
{ |
|
||||
"input": "./packages/generators/src", |
|
||||
"glob": "**/!(*.ts)", |
|
||||
"output": "./src" |
|
||||
}, |
|
||||
{ |
|
||||
"input": "./packages/generators/src", |
|
||||
"glob": "**/*.d.ts", |
|
||||
"output": "./src" |
|
||||
}, |
|
||||
{ |
|
||||
"input": "./packages/generators", |
|
||||
"glob": "generators.json", |
|
||||
"output": "." |
|
||||
}, |
|
||||
{ |
|
||||
"input": "./packages/generators", |
|
||||
"glob": "executors.json", |
|
||||
"output": "." |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
}, |
|
||||
"lint": { |
|
||||
"executor": "@nx/linter:eslint", |
|
||||
"outputs": ["{options.outputFile}"], |
|
||||
"options": { |
|
||||
"lintFilePatterns": [ |
|
||||
"packages/generators/**/*.ts", |
|
||||
"packages/generators/package.json", |
|
||||
"packages/generators/generators.json" |
|
||||
] |
|
||||
} |
|
||||
}, |
|
||||
"test": { |
|
||||
"executor": "@nx/jest:jest", |
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], |
|
||||
"options": { |
|
||||
"jestConfig": "packages/generators/jest.config.ts", |
|
||||
"passWithNoTests": true |
|
||||
}, |
|
||||
"configurations": { |
|
||||
"ci": { |
|
||||
"ci": true, |
|
||||
"codeCoverage": true |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"tags": [] |
|
||||
} |
|
||||
@ -1 +0,0 @@ |
|||||
const variable = "<%= name %>"; |
|
||||
@ -1,20 +0,0 @@ |
|||||
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; |
|
||||
import { Tree, readProjectConfiguration } from '@nx/devkit'; |
|
||||
|
|
||||
import { generateProxyGenerator } from './generator'; |
|
||||
import { GenerateProxyGeneratorSchema } from './schema'; |
|
||||
|
|
||||
describe('generate-proxy generator', () => { |
|
||||
let tree: Tree; |
|
||||
const options: GenerateProxyGeneratorSchema = { name: 'test' }; |
|
||||
|
|
||||
beforeEach(() => { |
|
||||
tree = createTreeWithEmptyWorkspace(); |
|
||||
}); |
|
||||
|
|
||||
it('should run successfully', async () => { |
|
||||
await generateProxyGenerator(tree, options); |
|
||||
const config = readProjectConfiguration(tree, 'test'); |
|
||||
expect(config).toBeDefined(); |
|
||||
}); |
|
||||
}); |
|
||||
@ -1,15 +0,0 @@ |
|||||
import { GenerateProxyGeneratorSchema } from './schema'; |
|
||||
import { Tree } from '@nrwl/devkit'; |
|
||||
import { wrapAngularDevkitSchematic } from '@nx/devkit/ngcli-adapter'; |
|
||||
|
|
||||
export default async function (host: Tree, schema: GenerateProxyGeneratorSchema) { |
|
||||
const runAngularLibrarySchematic = wrapAngularDevkitSchematic('@abp/ng.schematics', 'proxy-add'); |
|
||||
|
|
||||
await runAngularLibrarySchematic(host, { |
|
||||
...schema, |
|
||||
}); |
|
||||
|
|
||||
return () => { |
|
||||
console.log(`proxy added '${schema.target}`); |
|
||||
}; |
|
||||
} |
|
||||
@ -1,9 +0,0 @@ |
|||||
export interface GenerateProxyGeneratorSchema { |
|
||||
module: string; |
|
||||
apiName: string; |
|
||||
source: string; |
|
||||
target: string; |
|
||||
url: string; |
|
||||
serviceType: string; |
|
||||
entryPoint: string; |
|
||||
} |
|
||||
@ -1,94 +0,0 @@ |
|||||
{ |
|
||||
"$schema": "https://json-schema.org/schema", |
|
||||
"$id": "GenerateProxy", |
|
||||
"title": "", |
|
||||
"type": "object", |
|
||||
"properties": { |
|
||||
"module": { |
|
||||
"description": "Backend module name", |
|
||||
"type": "string", |
|
||||
"$default": { |
|
||||
"$source": "argv", |
|
||||
"index": 0 |
|
||||
}, |
|
||||
"x-prompt": "Please enter backend module name. (default: \"app\")" |
|
||||
}, |
|
||||
"apiName": { |
|
||||
"description": "Backend api name, a.k.a. remoteServiceName", |
|
||||
"type": "string", |
|
||||
"$default": { |
|
||||
"$source": "argv", |
|
||||
"index": 1 |
|
||||
}, |
|
||||
"x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")" |
|
||||
}, |
|
||||
"source": { |
|
||||
"description": "Source Angular project for API definition URL & root namespace resolution", |
|
||||
"type": "string", |
|
||||
"$default": { |
|
||||
"$source": "argv", |
|
||||
"index": 2 |
|
||||
}, |
|
||||
"x-prompt": "Please enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" |
|
||||
}, |
|
||||
"target": { |
|
||||
"description": "Target Angular project to place the generated code", |
|
||||
"type": "string", |
|
||||
"$default": { |
|
||||
"$source": "argv", |
|
||||
"index": 3 |
|
||||
}, |
|
||||
"x-prompt": "Please enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" |
|
||||
}, |
|
||||
"url": { |
|
||||
"description": "Url for API definition", |
|
||||
"type": "string", |
|
||||
"$default": { |
|
||||
"$source": "argv", |
|
||||
"index": 4 |
|
||||
}, |
|
||||
"x-prompt": "Please enter URL for API definition (default: API Name's url in environment file)" |
|
||||
}, |
|
||||
"serviceType": { |
|
||||
"description": "Service type to the generated code", |
|
||||
"type": "string", |
|
||||
"$default": { |
|
||||
"$source": "argv", |
|
||||
"index": 5 |
|
||||
}, |
|
||||
"enum": [ |
|
||||
"application", |
|
||||
"integration", |
|
||||
"all" |
|
||||
], |
|
||||
"x-prompt": { |
|
||||
"message": "Specifies the service type to generate. `application`, `integration` and `all`, Default value: `application`", |
|
||||
"type": "list", |
|
||||
"items": [ |
|
||||
{ |
|
||||
"value": "all", |
|
||||
"label": "All" |
|
||||
}, |
|
||||
{ |
|
||||
"value": "application", |
|
||||
"label": "Application" |
|
||||
}, |
|
||||
{ |
|
||||
"value": "integration", |
|
||||
"label": "Integration" |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
}, |
|
||||
"entryPoint": { |
|
||||
"description": "Target Angular project to place the generated code", |
|
||||
"type": "string", |
|
||||
"$default": { |
|
||||
"$source": "argv", |
|
||||
"index": 6 |
|
||||
}, |
|
||||
"x-prompt": "Please enter target entry point to place the generated code. (default: null)" |
|
||||
} |
|
||||
}, |
|
||||
"required": [] |
|
||||
} |
|
||||
@ -1,16 +0,0 @@ |
|||||
{ |
|
||||
"extends": "../../tsconfig.base.json", |
|
||||
"compilerOptions": { |
|
||||
"module": "commonjs" |
|
||||
}, |
|
||||
"files": [], |
|
||||
"include": [], |
|
||||
"references": [ |
|
||||
{ |
|
||||
"path": "./tsconfig.lib.json" |
|
||||
}, |
|
||||
{ |
|
||||
"path": "./tsconfig.spec.json" |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
@ -1,10 +0,0 @@ |
|||||
{ |
|
||||
"extends": "./tsconfig.json", |
|
||||
"compilerOptions": { |
|
||||
"outDir": "../../dist/out-tsc", |
|
||||
"declaration": true, |
|
||||
"types": ["node"] |
|
||||
}, |
|
||||
"include": ["src/**/*.ts"], |
|
||||
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] |
|
||||
} |
|
||||
@ -1,9 +0,0 @@ |
|||||
{ |
|
||||
"extends": "./tsconfig.json", |
|
||||
"compilerOptions": { |
|
||||
"outDir": "../../dist/out-tsc", |
|
||||
"module": "commonjs", |
|
||||
"types": ["jest", "node"] |
|
||||
}, |
|
||||
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] |
|
||||
} |
|
||||
Loading…
Reference in new issue