Browse Source

remove tslint comments

pull/9837/head
mehmet-erim 5 years ago
parent
commit
762344b5f6
  1. 15
      npm/ng-packs/nx/ng-packs/.gitignore
  2. 123
      npm/ng-packs/nx/ng-packs/CONTRIBUTING.md
  3. 104
      npm/ng-packs/nx/ng-packs/README.md
  4. 43
      npm/ng-packs/nx/ng-packs/apps/dev-app/src/environments/environment.regression.ts
  5. 5
      npm/ng-packs/nx/ng-packs/lerna.publish.json
  6. 5
      npm/ng-packs/nx/ng-packs/lerna.version.json
  7. 7
      npm/ng-packs/nx/ng-packs/package.json
  8. 2
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/abstracts/ng-model.component.ts
  9. 1
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/directives/for.directive.ts
  10. 1
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/models/utility.ts
  11. 1
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/strategies/context.strategy.ts
  12. 1
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/tests/route-utils.spec.ts
  13. 1
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/utils/common-utils.ts
  14. 2
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/utils/generator-utils.ts
  15. 1
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/utils/lazy-load-utils.ts
  16. 1
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/utils/number-utils.ts
  17. 1
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts
  18. 1
      npm/ng-packs/nx/ng-packs/packages/core/src/lib/validators/credit-card.validator.ts
  19. 3
      npm/ng-packs/nx/ng-packs/packages/schematics/src/utils/angular/ast-utils.ts
  20. 6
      npm/ng-packs/nx/ng-packs/packages/schematics/src/utils/angular/config.ts
  21. 1
      npm/ng-packs/nx/ng-packs/packages/schematics/src/utils/angular/json-utils.ts
  22. 1
      npm/ng-packs/nx/ng-packs/packages/schematics/src/utils/angular/workspace-models.ts
  23. 1
      npm/ng-packs/nx/ng-packs/packages/theme-basic/src/lib/components/nav-items/languages.component.ts
  24. 2
      npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/components/abstract-actions/abstract-actions.component.ts
  25. 17
      npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.ts
  26. 4
      npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/directives/prop-data.directive.ts
  27. 1
      npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/actions.ts
  28. 1
      npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/entity-actions.ts
  29. 3
      npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/entity-props.ts
  30. 2
      npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/form-props.ts
  31. 1
      npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/props.ts
  32. 1
      npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/toolbar-actions.ts
  33. 1
      npm/ng-packs/nx/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts
  34. 1
      npm/ng-packs/nx/ng-packs/packages/theme-shared/src/lib/components/chart/chart.component.ts
  35. 79
      npm/ng-packs/nx/ng-packs/scripts/build-schematics.ts
  36. 101
      npm/ng-packs/nx/ng-packs/scripts/build.ts
  37. 0
      npm/ng-packs/nx/ng-packs/scripts/index.js
  38. 30
      npm/ng-packs/nx/ng-packs/scripts/package.json
  39. 33
      npm/ng-packs/nx/ng-packs/scripts/prod-build.ts
  40. 90
      npm/ng-packs/nx/ng-packs/scripts/publish.ts
  41. 19
      npm/ng-packs/nx/ng-packs/scripts/replace-with-preview.ts
  42. 29
      npm/ng-packs/nx/ng-packs/scripts/replace-with-tilde.ts
  43. 17
      npm/ng-packs/nx/ng-packs/scripts/tsconfig.json
  44. 20
      npm/ng-packs/nx/ng-packs/source-code-requirements/README.md
  45. 32
      npm/ng-packs/nx/ng-packs/source-code-requirements/karma.conf.js
  46. 18
      npm/ng-packs/nx/ng-packs/source-code-requirements/tsconfig.lib.json
  47. 6
      npm/ng-packs/nx/ng-packs/source-code-requirements/tsconfig.lib.prod.json
  48. 17
      npm/ng-packs/nx/ng-packs/source-code-requirements/tsconfig.spec.json
  49. 17
      npm/ng-packs/nx/ng-packs/source-code-requirements/tslint.json
  50. 1565
      npm/ng-packs/scripts/package-lock.json

15
npm/ng-packs/nx/ng-packs/.gitignore

@ -1,13 +1,22 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# generic ignore files
*.gitignore.*
# compiled output
/dist
/tmp
/out-tsc
/dist
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events.json
speed-measure-plugin.json
# IDEs and editors
/.idea
.project
@ -23,6 +32,7 @@
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
@ -37,3 +47,6 @@ testem.log
# System Files
.DS_Store
Thumbs.db
!**/[Pp]ackages/*
*.internal.*

123
npm/ng-packs/nx/ng-packs/CONTRIBUTING.md

@ -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!

104
npm/ng-packs/nx/ng-packs/README.md

@ -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">![action badge](https://img.shields.io/github/workflow/status/abpframework/abp/Angular)</a>
<a href="https://github.com/abpframework/abp/labels/ui-angular">![issues](https://img.shields.io/github/issues/abpframework/abp/ui-angular)</a>
<a href="https://github.com/abpframework/abp/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Aui-angular">![pull requests](https://img.shields.io/github/issues-pr-raw/abpframework/abp/ui-angular)</a>
<a href="https://npmjs.org/package/@abp/ng.core">![npm](https://img.shields.io/npm/dm/@abp/ng.core)</a>
![npm version](https://img.shields.io/npm/v/@abp/ng.core?label=version)
<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).

43
npm/ng-packs/nx/ng-packs/apps/dev-app/src/environments/environment.regression.ts

@ -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;

5
npm/ng-packs/nx/ng-packs/lerna.publish.json

@ -0,0 +1,5 @@
{
"version": "1.0.0",
"packages": ["dist/packages/*"],
"npmClient": "yarn"
}

5
npm/ng-packs/nx/ng-packs/lerna.version.json

@ -0,0 +1,5 @@
{
"version": "4.4.0",
"packages": ["packages/*"],
"npmClient": "yarn"
}

7
npm/ng-packs/nx/ng-packs/package.json

@ -29,7 +29,11 @@
"dep-graph": "nx dep-graph",
"help": "nx help",
"compile:ivy": "yarn ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points --tsconfig './tsconfig.prod.json' --source node_modules",
"postinstall": "node ./decorate-angular-cli.js && yarn compile:ivy"
"postinstall": "node ./decorate-angular-cli.js && yarn compile:ivy",
"build:schematics": "cd scripts && yarn && yarn build:schematics && cd ..",
"dev:schematics": "tsc -p packages/schematics/tsconfig.json -w",
"ci": "yarn affected:lint && yarn affected:build && yarn affected:test",
"lerna": "lerna"
},
"private": true,
"devDependencies": {
@ -106,7 +110,6 @@
"rxjs": "~6.6.0",
"should-quote": "^1.0.0",
"snq": "^1.0.3",
"symlink-manager": "^1.5.0",
"ts-jest": "27.0.3",
"ts-node": "~9.1.1",
"ts-toolbelt": "6.15.4",

2
npm/ng-packs/nx/ng-packs/packages/core/src/lib/abstracts/ng-model.component.ts

@ -2,7 +2,6 @@ import { ChangeDetectorRef, Component, Injector, Input } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
// Not an abstract class on purpose. Do not change!
// tslint:disable-next-line: use-component-selector
@Component({ template: '' })
export class AbstractNgModelComponent<T = any, U = T> implements ControlValueAccessor {
protected _value: T;
@ -41,7 +40,6 @@ export class AbstractNgModelComponent<T = any, U = T> implements ControlValueAcc
}
constructor(public injector: Injector) {
// tslint:disable-next-line: deprecation
this.cdRef = injector.get(ChangeDetectorRef);
}

1
npm/ng-packs/nx/ng-packs/packages/core/src/lib/directives/for.directive.ts

@ -125,7 +125,6 @@ export class ForDirective implements OnChanges {
private projectItems(items: any[]): void {
if (!items.length && this.emptyRef) {
this.vcRef.clear();
// tslint:disable-next-line: no-unused-expression
this.vcRef.createEmbeddedView(this.emptyRef).rootNodes;
this.isShowEmptyRef = true;
this.differ = null;

1
npm/ng-packs/nx/ng-packs/packages/core/src/lib/models/utility.ts

@ -1,4 +1,3 @@
/* tslint:disable:ban-types */
import { TemplateRef, Type } from '@angular/core';
export type DeepPartial<T> = Partible<T> extends never

1
npm/ng-packs/nx/ng-packs/packages/core/src/lib/strategies/context.strategy.ts

@ -4,7 +4,6 @@ import { InferredContextOf, InferredInstanceOf } from '../models';
export abstract class ContextStrategy<T = any> {
constructor(public context: Partial<ContextType<T>>) {}
/* tslint:disable-next-line:no-unused-variable */
setContext(componentRef?: ComponentRef<InferredInstanceOf<T>>): Partial<ContextType<T>> {
return this.context;
}

1
npm/ng-packs/nx/ng-packs/packages/core/src/lib/tests/route-utils.spec.ts

@ -5,7 +5,6 @@ import { RouterOutletComponent } from '../components';
import { RoutesService } from '../services/routes.service';
import { findRoute, getRoutePath } from '../utils/route-utils';
// tslint:disable-next-line
@Component({ template: '' })
class DummyComponent {}

1
npm/ng-packs/nx/ng-packs/packages/core/src/lib/utils/common-utils.ts

@ -1,5 +1,4 @@
export function noop() {
// tslint:disable-next-line: only-arrow-functions
const fn = function () {};
return fn;
}

2
npm/ng-packs/nx/ng-packs/packages/core/src/lib/utils/generator-utils.ts

@ -1,5 +1,3 @@
// tslint:disable: no-bitwise
export function uuid(a?: any): string {
return a
? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16)

1
npm/ng-packs/nx/ng-packs/packages/core/src/lib/utils/lazy-load-utils.ts

@ -33,7 +33,6 @@ export function fromLazyLoad<T extends Event>(
}
function createErrorHandler(observer: Observer<Event>, element: HTMLElement) {
/* tslint:disable-next-line:only-arrow-functions */
return function (event: Event | string) {
clearCallbacks(element);
element.parentNode.removeChild(element);

1
npm/ng-packs/nx/ng-packs/packages/core/src/lib/utils/number-utils.ts

@ -1,4 +1,3 @@
export function isNumber(value: string | number): boolean {
/* tslint:disable-next-line:triple-equals */
return value == Number(value);
}

1
npm/ng-packs/nx/ng-packs/packages/core/src/lib/utils/rxjs-utils.ts

@ -1,4 +1,3 @@
// tslint:disable: max-line-length
import { Observable, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

1
npm/ng-packs/nx/ng-packs/packages/core/src/lib/validators/credit-card.validator.ts

@ -22,7 +22,6 @@ function isValidCreditCard(value: string): boolean {
for (let i = value.length; i > 0; i--) {
const digit = Number(value[i - 1]) * multiplier;
/* tslint:disable-next-line:no-bitwise */
checksum += (digit % 10) + ~~(digit / 10);
multiplier = (multiplier * 2) % 3;

3
npm/ng-packs/nx/ng-packs/packages/schematics/src/utils/angular/ast-utils.ts

@ -411,7 +411,7 @@ export function addSymbolToNgModuleMetadata(
importPath: string | null = null,
): Change[] {
const nodes = getDecoratorMetadata(source, 'NgModule', '@angular/core');
let node: any = nodes[0]; // tslint:disable-line:no-any
let node: any = nodes[0];
// Find the decorator declaration.
if (!node) {
@ -470,7 +470,6 @@ export function addSymbolToNgModuleMetadata(
}
if (!node) {
// tslint:disable-next-line: no-console
console.error('No app module found. Please add your new class to your component.');
return [];

6
npm/ng-packs/nx/ng-packs/packages/schematics/src/utils/angular/config.ts

@ -100,7 +100,7 @@ export interface AppConfig {
| string
| {
input?: string;
[name: string]: any; // tslint:disable-line:no-any
[name: string]: any;
}
)[];
/**
@ -119,7 +119,7 @@ export interface AppConfig {
| string
| {
input: string;
[name: string]: any; // tslint:disable-line:no-any
[name: string]: any;
}
)[];
/**
@ -130,7 +130,7 @@ export interface AppConfig {
* Name and corresponding file for environment config.
*/
environments?: {
[name: string]: any; // tslint:disable-line:no-any
[name: string]: any;
};
appShell?: {
app: string;

1
npm/ng-packs/nx/ng-packs/packages/schematics/src/utils/angular/json-utils.ts

@ -151,7 +151,6 @@ export function appendValueInAstArray(
) {
let indentStr = _buildIndent(indent);
let index = node.start.offset + 1;
// tslint:disable-next-line: no-any
let newNodes: any[] | undefined;
if (node.elements.length > 0) {

1
npm/ng-packs/nx/ng-packs/packages/schematics/src/utils/angular/workspace-models.ts

@ -175,6 +175,5 @@ export interface WorkspaceTargets<TProjectType extends ProjectType = ProjectType
'app-shell'?: AppShellBuilderTarget;
'extract-i18n'?: ExtractI18nBuilderTarget;
// TODO(hans): change this any to unknown when google3 supports TypeScript 3.0.
// tslint:disable-next-line:no-any
[key: string]: any;
}

1
npm/ng-packs/nx/ng-packs/packages/theme-basic/src/lib/components/nav-items/languages.component.ts

@ -6,7 +6,6 @@ import snq from 'snq';
@Component({
selector: 'abp-languages',
// tslint:disable-next-line: component-max-inline-declarations
template: `
<div
*ngIf="(dropdownLanguages$ | async)?.length > 0"

2
npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/components/abstract-actions/abstract-actions.component.ts

@ -3,7 +3,6 @@ import { ActionData, ActionList } from '../../models/actions';
import { ExtensionsService } from '../../services/extensions.service';
import { EXTENSIONS_ACTION_TYPE, EXTENSIONS_IDENTIFIER } from '../../tokens/extensions.token';
// tslint:disable: directive-class-suffix
// Fix for https://github.com/angular/angular/issues/23904
// @dynamic
@Directive()
@ -19,7 +18,6 @@ export abstract class AbstractActionsComponent<L extends ActionList<any>> extend
constructor(injector: Injector) {
super();
// tslint:disable-next-line
this.getInjected = injector.get.bind(injector);
const extensions = injector.get(ExtensionsService);
const name = injector.get(EXTENSIONS_IDENTIFIER);

17
npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/components/extensible-table/extensible-table.component.ts

@ -1,9 +1,9 @@
import {
ListService,
ConfigStateService,
getShortDateFormat,
getShortDateShortTimeFormat,
getShortTimeFormat,
ListService,
PermissionService,
} from '@abp/ng.core';
import { formatDate } from '@angular/common';
@ -11,25 +11,25 @@ import {
ChangeDetectionStrategy,
Component,
Inject,
InjectFlags,
InjectionToken,
Injector,
Input,
LOCALE_ID,
OnChanges,
SimpleChanges,
TemplateRef,
TrackByFunction,
Type,
InjectionToken,
InjectFlags,
SimpleChanges,
OnChanges,
} from '@angular/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ePropType } from '../../enums/props.enum';
import { EntityActionList } from '../../models/entity-actions';
import { EntityProp, EntityPropList } from '../../models/entity-props';
import { PropData } from '../../models/props';
import { ExtensionsService } from '../../services/extensions.service';
import { EXTENSIONS_IDENTIFIER } from '../../tokens/extensions.token';
import { EntityActionList } from '../../models/entity-actions';
const DEFAULT_ACTIONS_COLUMN_WIDTH = 150;
@Component({
@ -58,6 +58,8 @@ export class ExtensibleTableComponent<R = any> implements OnChanges {
getInjected: <T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags) => T;
hasAtLeastOnePermittedAction: boolean;
readonly columnWidths: number[];
readonly propList: EntityPropList<R>;
@ -66,14 +68,11 @@ export class ExtensibleTableComponent<R = any> implements OnChanges {
readonly trackByFn: TrackByFunction<EntityProp<R>> = (_, item) => item.name;
hasAtLeastOnePermittedAction: boolean;
constructor(
@Inject(LOCALE_ID) private locale: string,
private config: ConfigStateService,
injector: Injector,
) {
// tslint:disable-next-line
this.getInjected = injector.get.bind(injector);
const extensions = injector.get(ExtensionsService);
const name = injector.get(EXTENSIONS_IDENTIFIER);

4
npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/directives/prop-data.directive.ts

@ -1,3 +1,4 @@
/* eslint-disable @angular-eslint/no-input-rename */
import {
Directive,
Injector,
@ -17,13 +18,11 @@ export class PropDataDirective<L extends PropList<any>>
extends PropData<InferredData<L>>
implements OnChanges, OnDestroy
{
/* tslint:disable:no-input-rename */
@Input('abpPropDataFromList') readonly propList: L;
@Input('abpPropDataWithRecord') readonly record: InferredData<L>['record'];
@Input('abpPropDataAtIndex') readonly index: number;
/* tslint:enable:no-input-rename */
readonly getInjected: InferredData<L>['getInjected'];
@ -34,7 +33,6 @@ export class PropDataDirective<L extends PropList<any>>
) {
super();
// tslint:disable-next-line
this.getInjected = injector.get.bind(injector);
}

1
npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/actions.ts

@ -1,4 +1,3 @@
/* tslint:disable:variable-name */
import { LinkedList } from '@abp/utils';
import { InjectFlags, InjectionToken, Type } from '@angular/core';
import { O } from 'ts-toolbelt';

1
npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/entity-actions.ts

@ -1,4 +1,3 @@
/* tslint:disable:variable-name */
import { Type } from '@angular/core';
import { O } from 'ts-toolbelt';
import {

3
npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/entity-props.ts

@ -1,7 +1,7 @@
/* tslint:disable:variable-name */
import { Type } from '@angular/core';
import { Observable, of } from 'rxjs';
import { O } from 'ts-toolbelt';
import { ActionCallback } from './actions';
import {
Prop,
PropCallback,
@ -11,7 +11,6 @@ import {
Props,
PropsFactory,
} from './props';
import { ActionCallback } from './actions';
export class EntityPropList<R = any> extends PropList<R, EntityProp<R>> {}

2
npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/form-props.ts

@ -1,4 +1,3 @@
/* tslint:disable:variable-name */
import { ABP } from '@abp/ng.core';
import { Injector, Type } from '@angular/core';
import { AsyncValidatorFn, ValidatorFn } from '@angular/forms';
@ -76,7 +75,6 @@ export class FormPropData<R = any> extends PropData<R> {
constructor(injector: Injector, public readonly record: R) {
super();
// tslint:disable-next-line
this.getInjected = injector.get.bind(injector);
}
}

1
npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/props.ts

@ -1,4 +1,3 @@
/* tslint:disable:variable-name */
import { LinkedList } from '@abp/utils';
import { InjectFlags, InjectionToken, Type } from '@angular/core';
import { O } from 'ts-toolbelt';

1
npm/ng-packs/nx/ng-packs/packages/theme-shared/extensions/src/lib/models/toolbar-actions.ts

@ -1,4 +1,3 @@
/* tslint:disable:variable-name */
import { Type } from '@angular/core';
import { O } from 'ts-toolbelt';
import {

1
npm/ng-packs/nx/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts

@ -31,7 +31,6 @@ export class BreadcrumbComponent implements OnInit {
ngOnInit(): void {
this.subscription.addOne(
this.routerEvents.getNavigationEvents('End').pipe(
// tslint:disable-next-line:deprecation
startWith(null),
map(() => this.routes.search({ path: getRoutePath(this.router) })),
),

1
npm/ng-packs/nx/ng-packs/packages/theme-shared/src/lib/components/chart/chart.component.ts

@ -70,7 +70,6 @@ export class ChartComponent implements AfterViewInit, OnDestroy {
testChartJs() {
try {
// tslint:disable-next-line: no-unused-expression
Chart;
} catch (error) {
throw new Error(`Chart is not found. Import the Chart from app.module like shown below:

79
npm/ng-packs/nx/ng-packs/scripts/build-schematics.ts

@ -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);
}
})();

101
npm/ng-packs/nx/ng-packs/scripts/build.ts

@ -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
npm/ng-packs/nx/ng-packs/scripts/index.js

30
npm/ng-packs/nx/ng-packs/scripts/package.json

@ -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"
}
}

33
npm/ng-packs/nx/ng-packs/scripts/prod-build.ts

@ -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',
});
})();

90
npm/ng-packs/nx/ng-packs/scripts/publish.ts

@ -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);
})();

19
npm/ng-packs/nx/ng-packs/scripts/replace-with-preview.ts

@ -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);
}
}

29
npm/ng-packs/nx/ng-packs/scripts/replace-with-tilde.ts

@ -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);
});
});

17
npm/ng-packs/nx/ng-packs/scripts/tsconfig.json

@ -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"]
}

20
npm/ng-packs/nx/ng-packs/source-code-requirements/README.md

@ -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).

32
npm/ng-packs/nx/ng-packs/source-code-requirements/karma.conf.js

@ -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,
});
};

18
npm/ng-packs/nx/ng-packs/source-code-requirements/tsconfig.lib.json

@ -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"]
}

6
npm/ng-packs/nx/ng-packs/source-code-requirements/tsconfig.lib.prod.json

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

17
npm/ng-packs/nx/ng-packs/source-code-requirements/tsconfig.spec.json

@ -0,0 +1,17 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

17
npm/ng-packs/nx/ng-packs/source-code-requirements/tslint.json

@ -0,0 +1,17 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"lib",
"camelCase"
],
"component-selector": [
true,
"element",
"lib",
"kebab-case"
]
}
}

1565
npm/ng-packs/scripts/package-lock.json

File diff suppressed because it is too large
Loading…
Cancel
Save