mirror of https://github.com/abpframework/abp.git
50 changed files with 689 additions and 1745 deletions
@ -0,0 +1,123 @@ |
|||
# Contributing to ABP Angular UI |
|||
|
|||
We would love for you to contribute to ABP Angular UI and help make it even better than it is today. |
|||
|
|||
# Development |
|||
|
|||
Run `yarn` to install all dependencies, then run `yarn prepare:workspace` to prepare the ABP packages (might take 2 minutes). |
|||
|
|||
Run `yarn start` to start the `dev-app`. Navigate to http://localhost:4200/. |
|||
|
|||
|
|||
## Application |
|||
|
|||
The `dev-app` project is the same as the Angular UI template project. `dev-app` is used to see changes instantly. |
|||
|
|||
> Reminder! If you have developed the `dev-app` template, you should do the same for the application and module templates. |
|||
|
|||
For more information, see the [docs.abp.io](https://docs.abp.io) |
|||
|
|||
# Committing changes |
|||
|
|||
Before you commit, please ensure that your code passes the existing unit tests. |
|||
|
|||
New features should be accompanied by new tests. |
|||
|
|||
Every commit should contain only the changes related to the subject of that commit. |
|||
|
|||
## Commit message format |
|||
|
|||
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special |
|||
format that includes a **type**, a **scope** and a **subject**: |
|||
|
|||
``` |
|||
<type>(<scope>): <subject> |
|||
<BLANK LINE> |
|||
<body> |
|||
<BLANK LINE> |
|||
<footer> |
|||
``` |
|||
|
|||
The **header** is mandatory and the **scope** of the header is optional. |
|||
|
|||
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools. |
|||
|
|||
The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any. |
|||
|
|||
``` |
|||
docs(changelog): update changelog to beta.5 |
|||
``` |
|||
|
|||
``` |
|||
fix(release): need to depend on latest rxjs and zone.js |
|||
|
|||
The version in our package.json gets copied to the one we publish, and users need the latest of these. |
|||
``` |
|||
|
|||
### Revert |
|||
|
|||
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted. |
|||
|
|||
### Type |
|||
|
|||
Must be one of the following: |
|||
|
|||
- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
|||
- **ci**: Changes to our CI configuration files and scripts (example scope: scripts) |
|||
- **docs**: Documentation only changes |
|||
- **feat**: A new feature |
|||
- **fix**: A bug fix |
|||
- **perf**: A code change that improves performance |
|||
- **refactor**: A code change that neither fixes a bug nor adds a feature |
|||
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
|||
- **test**: Adding missing tests or correcting existing tests |
|||
- **chore**: Other changes that don't modify src or test files |
|||
|
|||
### Scope |
|||
|
|||
The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages). |
|||
|
|||
The following is the list of supported scopes: |
|||
|
|||
- **core** |
|||
- **theme-shared** |
|||
- **theme-basic** |
|||
- **identity** |
|||
- **tenant-management** |
|||
- **feature-management** |
|||
- **permission-management** |
|||
- **setting-management** |
|||
|
|||
There are currently a few exceptions to the "use package name" rule: |
|||
|
|||
- **packaging**: used for changes that change the npm package layout in all of our packages, e.g. |
|||
public path changes, package.json changes done to all packages, d.ts file/format changes, changes |
|||
to bundles, etc. |
|||
- **scripts**: used for changes that change any script. |
|||
- **template**: used for changes that change `dev-app` and `app` template applications. |
|||
- **changelog**: used for updating the release notes in CHANGELOG.md |
|||
- none/empty string: useful for `style`, `test` and `refactor` changes that are done across all |
|||
packages (e.g. `style: add missing semicolons`) and for docs changes that are not related to a |
|||
specific package (e.g. `docs: fix typo in tutorial`). |
|||
|
|||
### Subject |
|||
|
|||
The subject contains a succinct description of the change: |
|||
|
|||
- use the imperative, present tense: "change" not "changed" nor "changes" |
|||
- don't capitalize the first letter |
|||
- no dot (.) at the end |
|||
|
|||
### Body |
|||
|
|||
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". |
|||
The body should include the motivation for the change and contrast this with previous behavior. |
|||
|
|||
### Footer |
|||
|
|||
The footer should contain any information about **Breaking Changes** and is also the place to |
|||
reference GitHub issues that this commit **Closes**. |
|||
|
|||
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this. |
|||
|
|||
# Thanks for contributing! |
|||
@ -1,98 +1,24 @@ |
|||
# NgPacks |
|||
# Abp Ng Packages |
|||
|
|||
This project was generated using [Nx](https://nx.dev). |
|||
<a href="https://github.com/abpframework/abp/actions?query=workflow%3AAngular"></a> |
|||
<a href="https://github.com/abpframework/abp/labels/ui-angular"></a> |
|||
<a href="https://github.com/abpframework/abp/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Aui-angular"></a> |
|||
<a href="https://npmjs.org/package/@abp/ng.core"></a> |
|||
 |
|||
|
|||
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="450"></p> |
|||
## Getting started |
|||
|
|||
🔎 **Smart, Extensible Build Framework** |
|||
Run `yarn` to install all dependencies. |
|||
|
|||
## Quick Start & Documentation |
|||
Run `yarn start` to start the `dev-app`. Navigate to http://localhost:4200/. |
|||
|
|||
[Nx Documentation](https://nx.dev/angular) |
|||
## Development |
|||
|
|||
[10-minute video showing all Nx features](https://nx.dev/getting-started/intro) |
|||
### Application |
|||
The `dev-app` project is the same as the Angular UI template project. `dev-app` is used to see changes instantly. |
|||
|
|||
[Interactive Tutorial](https://nx.dev/tutorial/01-create-application) |
|||
> Reminder! If you have developed the `dev-app` template, you should do the same for the application and module templates. |
|||
|
|||
## Adding capabilities to your workspace |
|||
For more information, see the [docs.abp.io](https://docs.abp.io) |
|||
|
|||
Nx supports many plugins which add capabilities for developing different types of applications and different tools. |
|||
|
|||
These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well. |
|||
|
|||
Below are our core plugins: |
|||
|
|||
- [Angular](https://angular.io) |
|||
- `ng add @nrwl/angular` |
|||
- [React](https://reactjs.org) |
|||
- `ng add @nrwl/react` |
|||
- Web (no framework frontends) |
|||
- `ng add @nrwl/web` |
|||
- [Nest](https://nestjs.com) |
|||
- `ng add @nrwl/nest` |
|||
- [Express](https://expressjs.com) |
|||
- `ng add @nrwl/express` |
|||
- [Node](https://nodejs.org) |
|||
- `ng add @nrwl/node` |
|||
|
|||
There are also many [community plugins](https://nx.dev/community) you could add. |
|||
|
|||
## Generate an application |
|||
|
|||
Run `ng g @nrwl/angular:app my-app` to generate an application. |
|||
|
|||
> You can use any of the plugins above to generate applications as well. |
|||
|
|||
When using Nx, you can create multiple applications and libraries in the same workspace. |
|||
|
|||
## Generate a library |
|||
|
|||
Run `ng g @nrwl/angular:lib my-lib` to generate a library. |
|||
|
|||
> You can also use any of the plugins above to generate libraries as well. |
|||
|
|||
Libraries are shareable across libraries and applications. They can be imported from `@ng-packs/mylib`. |
|||
|
|||
## Development server |
|||
|
|||
Run `ng serve my-app` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. |
|||
|
|||
## Code scaffolding |
|||
|
|||
Run `ng g component my-component --project=my-app` to generate a new component. |
|||
|
|||
## Build |
|||
|
|||
Run `ng build my-app` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. |
|||
|
|||
## Running unit tests |
|||
|
|||
Run `ng test my-app` to execute the unit tests via [Jest](https://jestjs.io). |
|||
|
|||
Run `nx affected:test` to execute the unit tests affected by a change. |
|||
|
|||
## Running end-to-end tests |
|||
|
|||
Run `ng e2e my-app` to execute the end-to-end tests via [Cypress](https://www.cypress.io). |
|||
|
|||
Run `nx affected:e2e` to execute the end-to-end tests affected by a change. |
|||
|
|||
## Understand your workspace |
|||
|
|||
Run `nx dep-graph` to see a diagram of the dependencies of your projects. |
|||
|
|||
## Further help |
|||
|
|||
Visit the [Nx Documentation](https://nx.dev/angular) to learn more. |
|||
|
|||
## ☁ Nx Cloud |
|||
|
|||
### Distributed Computation Caching & Distributed Task Execution |
|||
|
|||
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-cloud-card.png"></p> |
|||
|
|||
Nx Cloud pairs with Nx in order to enable you to build and test code more rapidly, by up to 10 times. Even teams that are new to Nx can connect to Nx Cloud and start saving time instantly. |
|||
|
|||
Teams using Nx gain the advantage of building full-stack applications with their preferred framework alongside Nx’s advanced code generation and project dependency graph, plus a unified experience for both frontend and backend developers. |
|||
|
|||
Visit [Nx Cloud](https://nx.app/) to learn more. |
|||
If would you like contribute, see the [contribution guideline](./CONTRIBUTING.md). |
|||
@ -1,43 +0,0 @@ |
|||
import { Config } from '@abp/ng.core'; |
|||
|
|||
const baseUrl = 'http://localhost:4200'; |
|||
|
|||
export const environment = { |
|||
test: true, |
|||
production: false, |
|||
hmr: false, |
|||
application: { |
|||
baseUrl, |
|||
name: 'MyProjectName', |
|||
logoUrl: '', |
|||
}, |
|||
oAuthConfig: { |
|||
issuer: 'https://localhost:44305', |
|||
redirectUri: baseUrl, |
|||
clientId: 'MyProjectName_App', |
|||
responseType: 'code', |
|||
scope: 'offline_access MyProjectName', |
|||
}, |
|||
apis: { |
|||
default: { |
|||
url: 'https://localhost:44305', |
|||
rootNamespace: 'MyCompanyName.MyProjectName', |
|||
}, |
|||
AbpFeatureManagement: { |
|||
url: 'https://localhost:44305', |
|||
rootNamespace: 'Volo.Abp', |
|||
}, |
|||
AbpPermissionManagement: { |
|||
url: 'https://localhost:44305', |
|||
rootNamespace: 'Volo.Abp.PermissionManagement', |
|||
}, |
|||
AbpTenantManagement: { |
|||
url: 'https://localhost:44305', |
|||
rootNamespace: 'Volo.Abp.TenantManagement', |
|||
}, |
|||
AbpIdentity: { |
|||
url: 'https://localhost:44305', |
|||
rootNamespace: 'Volo.Abp', |
|||
}, |
|||
}, |
|||
} as Config.Environment; |
|||
@ -0,0 +1,5 @@ |
|||
{ |
|||
"version": "1.0.0", |
|||
"packages": ["dist/packages/*"], |
|||
"npmClient": "yarn" |
|||
} |
|||
@ -0,0 +1,5 @@ |
|||
{ |
|||
"version": "4.4.0", |
|||
"packages": ["packages/*"], |
|||
"npmClient": "yarn" |
|||
} |
|||
@ -1,4 +1,3 @@ |
|||
export function isNumber(value: string | number): boolean { |
|||
/* tslint:disable-next-line:triple-equals */ |
|||
return value == Number(value); |
|||
} |
|||
|
|||
@ -0,0 +1,79 @@ |
|||
import execa from 'execa'; |
|||
import fse from 'fs-extra'; |
|||
|
|||
class FileCopy { |
|||
src: string; |
|||
dest: string; |
|||
options?: fse.CopyOptions; |
|||
|
|||
constructor(filecopyOrSrc: FileCopy | string) { |
|||
if (typeof filecopyOrSrc === 'string') { |
|||
this.src = filecopyOrSrc; |
|||
this.dest = filecopyOrSrc; |
|||
} else { |
|||
this.src = filecopyOrSrc.src; |
|||
this.dest = filecopyOrSrc.dest; |
|||
this.options = filecopyOrSrc.options; |
|||
} |
|||
} |
|||
} |
|||
|
|||
const PACKAGE_TO_BUILD = 'schematics'; |
|||
const FILES_TO_COPY_AFTER_BUILD: (FileCopy | string)[] = [ |
|||
{ src: 'src/commands/proxy-add/schema.json', dest: 'commands/proxy-add/schema.json' }, |
|||
{ src: 'src/commands/proxy-index/schema.json', dest: 'commands/proxy-index/schema.json' }, |
|||
{ src: 'src/commands/proxy-refresh/schema.json', dest: 'commands/proxy-refresh/schema.json' }, |
|||
{ src: 'src/commands/proxy-remove/schema.json', dest: 'commands/proxy-remove/schema.json' }, |
|||
{ src: 'src/commands/api/files-enum', dest: 'commands/api/files-enum' }, |
|||
{ src: 'src/commands/api/files-model', dest: 'commands/api/files-model' }, |
|||
{ src: 'src/commands/api/files-service', dest: 'commands/api/files-service' }, |
|||
{ src: 'src/commands/api/schema.json', dest: 'commands/api/schema.json' }, |
|||
{ src: 'src/collection.json', dest: 'collection.json' }, |
|||
'package.json', |
|||
'README.md', |
|||
]; |
|||
|
|||
async function* copyPackageFile(packageName: string, filecopy: FileCopy | string) { |
|||
filecopy = new FileCopy(filecopy); |
|||
const { src, dest, options = { overwrite: true } } = filecopy; |
|||
|
|||
await fse.copy( |
|||
`../packages/${packageName}/${src}`, |
|||
`../dist/packages/${packageName}/${dest}`, |
|||
options, |
|||
); |
|||
|
|||
yield filecopy; |
|||
} |
|||
|
|||
async function* copyPackageFiles(packageName: string) { |
|||
for (const filecopy of FILES_TO_COPY_AFTER_BUILD) { |
|||
yield* copyPackageFile(packageName, filecopy); |
|||
} |
|||
} |
|||
|
|||
(async () => { |
|||
try { |
|||
await fse.remove(`../dist/packages/${PACKAGE_TO_BUILD}`); |
|||
|
|||
await execa( |
|||
'tsc', |
|||
[ |
|||
'-p', |
|||
`packages/${PACKAGE_TO_BUILD}/tsconfig.json`, |
|||
'--outDir', |
|||
`dist/packages/${PACKAGE_TO_BUILD}`, |
|||
], |
|||
{ |
|||
stdout: 'inherit', |
|||
cwd: '../', |
|||
}, |
|||
); |
|||
|
|||
for await (const filecopy of copyPackageFiles(PACKAGE_TO_BUILD)) { |
|||
// do nothing
|
|||
} |
|||
} catch (error) { |
|||
process.exit(1); |
|||
} |
|||
})(); |
|||
@ -0,0 +1,101 @@ |
|||
import program from 'commander'; |
|||
import execa from 'execa'; |
|||
|
|||
(async () => { |
|||
program.option('-i, --noInstall', 'skip updating package.json and installation', false); |
|||
program.option('-c, --skipNgcc', 'skip ngcc', false); |
|||
|
|||
program.parse(process.argv); |
|||
|
|||
try { |
|||
if (!program.noInstall) { |
|||
await execa('yarn', ['install'], { stdout: 'inherit', cwd: '../' }); |
|||
} |
|||
|
|||
// await execa(
|
|||
// 'yarn',
|
|||
// [
|
|||
// 'symlink',
|
|||
// 'copy',
|
|||
// '--angular',
|
|||
// '--prod',
|
|||
// '--no-watch',
|
|||
// '--sync',
|
|||
// '--packages',
|
|||
// '@abp/ng.core,@abp/ng.theme.shared,@abp/ng.components',
|
|||
// ],
|
|||
// { stdout: 'inherit', cwd: '../' },
|
|||
// );
|
|||
|
|||
// await execa(
|
|||
// 'yarn',
|
|||
// [
|
|||
// 'symlink',
|
|||
// 'copy',
|
|||
// '--angular',
|
|||
// '--prod',
|
|||
// '--no-watch',
|
|||
// '--packages',
|
|||
// '@abp/ng.feature-management,@abp/ng.permission-management,@abp/ng.account.core',
|
|||
// ],
|
|||
// { stdout: 'inherit', cwd: '../' },
|
|||
// );
|
|||
|
|||
// await execa(
|
|||
// 'yarn',
|
|||
// [
|
|||
// 'symlink',
|
|||
// 'copy',
|
|||
// '--angular',
|
|||
// '--prod',
|
|||
// '--no-watch',
|
|||
// '--all-packages',
|
|||
// '--excluded-packages',
|
|||
// '@abp/ng.schematics,@abp/ng.core,@abp/ng.theme.shared,@abp/ng.components,@abp/ng.feature-management,@abp/ng.permission-management,@abp/ng.account.core',
|
|||
// ],
|
|||
// { stdout: 'inherit', cwd: '../' },
|
|||
// );
|
|||
|
|||
await execa( |
|||
'yarn', |
|||
['nx', 'run-many', '--target', 'build', '--projects', 'core,theme-shared,components'], |
|||
{ stdout: 'inherit', cwd: '../' }, |
|||
); |
|||
|
|||
await execa( |
|||
'yarn', |
|||
[ |
|||
'nx', |
|||
'run-many', |
|||
'--target', |
|||
'build', |
|||
'--projects', |
|||
'feature-management,permission-management,account-core', |
|||
'--parallel', |
|||
], |
|||
{ stdout: 'inherit', cwd: '../' }, |
|||
); |
|||
|
|||
await execa( |
|||
'yarn', |
|||
[ |
|||
'nx', |
|||
'run-many', |
|||
'--target', |
|||
'build', |
|||
'--all', |
|||
'--exclude', |
|||
'schematics,core,theme-shared,components,feature-management,permission-management,account-core', |
|||
'--parallel', |
|||
], |
|||
{ stdout: 'inherit', cwd: '../' }, |
|||
); |
|||
|
|||
// if (!program.skipNgcc) await execa('yarn', ['compile:ivy'], { stdout: 'inherit', cwd: '../' });
|
|||
} catch (error) { |
|||
console.error(error.stderr); |
|||
process.exit(1); |
|||
} |
|||
|
|||
process.exit(0); |
|||
})(); |
|||
@ -0,0 +1,30 @@ |
|||
{ |
|||
"name": "scripts", |
|||
"version": "1.0.0", |
|||
"description": "ABP helper scripts", |
|||
"main": "index.js", |
|||
"scripts": { |
|||
"build": "ts-node -r tsconfig-paths/register build.ts", |
|||
"build:prod": "ts-node -r tsconfig-paths/register prod-build.ts", |
|||
"build:schematics": "ts-node -r tsconfig-paths/register build-schematics.ts", |
|||
"publish-packages": "ts-node -r tsconfig-paths/register publish.ts", |
|||
"replace-with-tilde": "ts-node -r tsconfig-paths/register replace-with-tilde.ts" |
|||
}, |
|||
"author": "", |
|||
"dependencies": { |
|||
"babel-preset-node6": "^11.0.0", |
|||
"commander": "^4.1.1", |
|||
"execa": "^2.0.3", |
|||
"fs-extra": "^8.1.0", |
|||
"glob": "^7.1.6", |
|||
"prompt-confirm": "^2.0.4" |
|||
}, |
|||
"devDependencies": { |
|||
"@types/fs-extra": "^8.0.1", |
|||
"@types/node": "^13.1.2", |
|||
"esm": "^3.2.25", |
|||
"ts-node": "^8.5.4", |
|||
"tsconfig-paths": "^3.9.0", |
|||
"typescript": "^3.7.4" |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
import execa from 'execa'; |
|||
import fse from 'fs-extra'; |
|||
|
|||
(async () => { |
|||
await execa('yarn', ['ng', 'build', '--prod'], { |
|||
stdout: 'inherit', |
|||
cwd: '..', |
|||
}); |
|||
|
|||
await execa('yarn', ['install', '--ignore-scripts'], { |
|||
stdout: 'inherit', |
|||
cwd: '../../../templates/app/angular', |
|||
}); |
|||
|
|||
await fse.remove('../../../templates/app/angular/node_modules/@abp'); |
|||
await fse.copy('../node_modules/@abp', '../../../templates/app/angular/node_modules/@abp', { |
|||
overwrite: true, |
|||
}); |
|||
|
|||
// TODO: Will be removed in v3.1, it is added to fix the prod build error
|
|||
await fse.copy( |
|||
'../node_modules/@swimlane', |
|||
'../../../templates/app/angular/node_modules/@swimlane', |
|||
{ |
|||
overwrite: true, |
|||
}, |
|||
); |
|||
|
|||
await execa('yarn', ['ng', 'build', '--prod'], { |
|||
stdout: 'inherit', |
|||
cwd: '../../../templates/app/angular', |
|||
}); |
|||
})(); |
|||
@ -0,0 +1,90 @@ |
|||
import program from 'commander'; |
|||
import execa from 'execa'; |
|||
import fse from 'fs-extra'; |
|||
import replaceWithPreview from './replace-with-preview'; |
|||
|
|||
program |
|||
.option( |
|||
'-v, --nextVersion <version>', |
|||
'next semantic version. Available versions: ["major", "minor", "patch", "premajor", "preminor", "prepatch", "prerelease", "or type a custom version"]', |
|||
) |
|||
.option('-r, --registry <registry>', 'target npm server registry') |
|||
.option('-p, --preview', 'publishes with preview tag') |
|||
.option('-r, --rc', 'publishes with next tag') |
|||
.option('-g, --skipGit', 'skips git push'); |
|||
|
|||
program.parse(process.argv); |
|||
|
|||
(async () => { |
|||
const versions = ['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', 'prerelease']; |
|||
|
|||
if (!program.nextVersion) { |
|||
console.error('Please provide a version with --nextVersion attribute'); |
|||
process.exit(1); |
|||
} |
|||
|
|||
const registry = program.registry || 'https://registry.npmjs.org'; |
|||
|
|||
try { |
|||
await fse.remove('../dist/packages'); |
|||
|
|||
await execa('yarn', ['install', '--ignore-scripts'], { stdout: 'inherit', cwd: '../' }); |
|||
|
|||
await fse.rename('../lerna.version.json', '../lerna.json'); |
|||
|
|||
await execa( |
|||
'yarn', |
|||
[ |
|||
'lerna', |
|||
'version', |
|||
program.nextVersion, |
|||
'--yes', |
|||
'--no-commit-hooks', |
|||
'--skip-git', |
|||
'--force-publish', |
|||
], |
|||
{ stdout: 'inherit', cwd: '../' }, |
|||
); |
|||
|
|||
await fse.rename('../lerna.json', '../lerna.version.json'); |
|||
|
|||
await execa('yarn', ['replace-with-tilde']); |
|||
|
|||
if (program.preview) await replaceWithPreview(program.nextVersion); |
|||
|
|||
await execa('yarn', ['build', '--noInstall', '--skipNgcc'], { stdout: 'inherit' }); |
|||
|
|||
await execa('yarn', ['build:schematics'], { stdout: 'inherit' }); |
|||
|
|||
await fse.rename('../lerna.publish.json', '../lerna.json'); |
|||
|
|||
let tag: string; |
|||
if (program.preview) tag = 'preview'; |
|||
if (program.rc) tag = 'next'; |
|||
|
|||
await execa( |
|||
'yarn', |
|||
['lerna', 'exec', '--', `"npm publish --registry ${registry}${tag ? ` --tag ${tag}` : ''}"`], |
|||
{ |
|||
stdout: 'inherit', |
|||
cwd: '../', |
|||
}, |
|||
); |
|||
|
|||
await fse.rename('../lerna.json', '../lerna.publish.json'); |
|||
|
|||
if (!program.preview && !program.skipGit) { |
|||
await execa('git', ['add', '../packages/*', '../package.json', '../lerna.version.json'], { |
|||
stdout: 'inherit', |
|||
}); |
|||
await execa('git', ['commit', '-m', 'Upgrade ng package versions', '--no-verify'], { |
|||
stdout: 'inherit', |
|||
}); |
|||
} |
|||
} catch (error) { |
|||
console.error(error.stderr); |
|||
process.exit(1); |
|||
} |
|||
|
|||
process.exit(0); |
|||
})(); |
|||
@ -0,0 +1,19 @@ |
|||
import fse from 'fs-extra'; |
|||
|
|||
export default async function(version: string) { |
|||
const corePkgPath = '../packages/core/package.json'; |
|||
try { |
|||
const corePkg = await fse.readJSON(corePkgPath); |
|||
|
|||
await fse.writeJSON( |
|||
corePkgPath, |
|||
{ |
|||
...corePkg, |
|||
dependencies: { ...corePkg.dependencies, '@abp/utils': version }, |
|||
}, |
|||
{ spaces: 2 }, |
|||
); |
|||
} catch (error) { |
|||
console.error(error); |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
import execa from 'execa'; |
|||
import fse from 'fs-extra'; |
|||
import glob from 'glob'; |
|||
|
|||
async function replace(filePath: string) { |
|||
const pkg = await fse.readJson(filePath); |
|||
|
|||
const { dependencies } = pkg; |
|||
|
|||
if (!dependencies) return; |
|||
|
|||
Object.keys(dependencies).forEach(key => { |
|||
if (key.includes('@abp/') && key !== '@abp/utils') { |
|||
dependencies[key] = dependencies[key].replace('^', '~'); |
|||
} |
|||
}); |
|||
|
|||
await fse.writeJson(filePath, { ...pkg, dependencies }, { spaces: 2 }); |
|||
} |
|||
|
|||
glob('../packages/**/package.json', {}, (er, files) => { |
|||
files.forEach(path => { |
|||
if (path.includes('node_modules')) { |
|||
return; |
|||
} |
|||
|
|||
replace(path); |
|||
}); |
|||
}); |
|||
@ -0,0 +1,17 @@ |
|||
{ |
|||
"compilerOptions": { |
|||
"module": "commonjs", |
|||
"declaration": true, |
|||
"removeComments": true, |
|||
"emitDecoratorMetadata": true, |
|||
"experimentalDecorators": true, |
|||
"target": "es2017", |
|||
"sourceMap": true, |
|||
"outDir": "./dist", |
|||
"baseUrl": "./", |
|||
"incremental": true, |
|||
"esModuleInterop": true, |
|||
"types": ["node"] |
|||
}, |
|||
"exclude": ["node_modules", "dist"] |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
## Code scaffolding |
|||
|
|||
Run `ng generate component component-name --project {{package-name}}` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project {{package-name}}`. |
|||
> Note: Don't forget to add `--project {{package-name}}` or else it will be added to the default project in your `angular.json` file. |
|||
|
|||
## Build |
|||
|
|||
Run `ng build {{package-name}}` to build the project. The build artifacts will be stored in the `dist/` directory. |
|||
|
|||
## Publishing |
|||
|
|||
After building your library with `ng build {{package-name}}`, go to the dist folder `cd dist/{{package-name}}` and run `npm publish`. |
|||
|
|||
## Running unit tests |
|||
|
|||
Run `ng test {{package-name}}` to execute the unit tests via [Karma](https://karma-runner.github.io). |
|||
|
|||
## Further help |
|||
|
|||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). |
|||
@ -0,0 +1,32 @@ |
|||
// Karma configuration file, see link for more information
|
|||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|||
|
|||
module.exports = function(config) { |
|||
config.set({ |
|||
basePath: '', |
|||
frameworks: ['jasmine', '@angular-devkit/build-angular'], |
|||
plugins: [ |
|||
require('karma-jasmine'), |
|||
require('karma-chrome-launcher'), |
|||
require('karma-jasmine-html-reporter'), |
|||
require('karma-coverage-istanbul-reporter'), |
|||
require('@angular-devkit/build-angular/plugins/karma'), |
|||
], |
|||
client: { |
|||
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
|||
}, |
|||
coverageIstanbulReporter: { |
|||
dir: require('path').join(__dirname, '../../coverage/{{package-name}}'), |
|||
reports: ['html', 'lcovonly', 'text-summary'], |
|||
fixWebpackSourcePaths: true, |
|||
}, |
|||
reporters: ['progress', 'kjhtml'], |
|||
port: 9876, |
|||
colors: true, |
|||
logLevel: config.LOG_INFO, |
|||
autoWatch: true, |
|||
browsers: ['Chrome'], |
|||
singleRun: false, |
|||
restartOnFileChange: true, |
|||
}); |
|||
}; |
|||
@ -0,0 +1,18 @@ |
|||
{ |
|||
"extends": "../../tsconfig.json", |
|||
"compilerOptions": { |
|||
"outDir": "../../out-tsc/lib", |
|||
"target": "es2015", |
|||
"declaration": true, |
|||
"inlineSources": true, |
|||
"types": [], |
|||
"lib": ["dom", "es2018"] |
|||
}, |
|||
"angularCompilerOptions": { |
|||
"enableIvy": false, |
|||
"skipTemplateCodegen": true, |
|||
"strictMetadataEmit": true, |
|||
"enableResourceInlining": true |
|||
}, |
|||
"exclude": ["src/test.ts", "**/*.spec.ts"] |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"extends": "./tsconfig.lib.json", |
|||
"angularCompilerOptions": { |
|||
"enableIvy": false |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
{ |
|||
"extends": "../../tsconfig.json", |
|||
"compilerOptions": { |
|||
"outDir": "../../out-tsc/spec", |
|||
"types": [ |
|||
"jasmine", |
|||
"node" |
|||
] |
|||
}, |
|||
"files": [ |
|||
"src/test.ts" |
|||
], |
|||
"include": [ |
|||
"**/*.spec.ts", |
|||
"**/*.d.ts" |
|||
] |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
{ |
|||
"extends": "../../tslint.json", |
|||
"rules": { |
|||
"directive-selector": [ |
|||
true, |
|||
"attribute", |
|||
"lib", |
|||
"camelCase" |
|||
], |
|||
"component-selector": [ |
|||
true, |
|||
"element", |
|||
"lib", |
|||
"kebab-case" |
|||
] |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
Loading…
Reference in new issue