Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 17 #247

Merged
merged 7 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 56 additions & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,37 @@
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json"],
"project": true,
"createDefaultProgram": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:@angular-eslint/all",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-max-inline-declarations": "off", // We use that mostly for testing, so it's fine
"@angular-eslint/no-forward-ref": "off", // We sometimes need it
"@angular-eslint/prefer-on-push-component-change-detection": "off",
"@angular-eslint/use-component-selector": "off", // Some components are not template-able and thus do not need selector
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/no-confusing-void-expression": "off", // Don't create unncessary closure and we prefer code tersity anyway
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extraneous-class": "off", // We have component without any logic in TS
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unnecessary-condition": "off", // This is very unfortunate, but there are too many dangerous false-positive, see https://github.com/typescript-eslint/typescript-eslint/issues/1798
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off", // Usually a good idea, but sometimes dangerous false-positive
"@typescript-eslint/unbound-method": "off",
"@angular-eslint/directive-selector": [
"error",
{
Expand All @@ -30,23 +51,28 @@
"style": "kebab-case"
}
],
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{
"allowArgumentsExplicitlyTypedAsAny": true
}
],
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": {
// We want to use promise in Rxjs subscribes without caring about the promise result
"arguments": false,
"properties": false
}
}
],
"no-restricted-globals": [
"error",
"atob",
Expand All @@ -61,14 +87,32 @@
"navigator",
"sessionStorage",
"window"
],
"prefer-const": ["error"]
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {}
"extends": ["plugin:@angular-eslint/template/all"],
"rules": {
"@angular-eslint/template/alt-text": "off", // We don't care as much as we should about a11y
"@angular-eslint/template/attributes-order": "off", // TODO: We want to enable this, but autofix mess up our code, and it's too much manual changes
"@angular-eslint/template/button-has-type": "off",
"@angular-eslint/template/click-events-have-key-events": "off", // We don't care as much as we should about a11y
"@angular-eslint/template/i18n": "off",
"@angular-eslint/template/interactive-supports-focus": "off", // We don't care as much as we should about a11y
"@angular-eslint/template/label-has-associated-control": "off", // We don't care as much as we should about a11y
"@angular-eslint/template/no-any": "off", // Unfortunately, some libs force us to use this
"@angular-eslint/template/no-autofocus": "off",
"@angular-eslint/template/no-call-expression": "off",
"@angular-eslint/template/no-inline-styles": "off", // We sometimes use short inlie styles
"@angular-eslint/template/prefer-ngsrc": "off", // TODO: experiment with ngsrc and see if we need to use it or not
"@angular-eslint/template/eqeqeq": [
"error",
{
"allowNullOrUndefined": true
}
]
}
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
path: dist/
- uses: crazy-max/ghaction-github-pages@v3
with:
build_dir: dist/demo
build_dir: dist/demo/browser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
16 changes: 6 additions & 10 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/demo",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"browser": "src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": [],
"allowedCommonJsDependencies": ["graphql-tag", "zen-observable"],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
Expand All @@ -49,8 +47,6 @@
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
Expand All @@ -75,10 +71,10 @@
},
"configurations": {
"production": {
"browserTarget": "demo:build:production"
"buildTarget": "demo:build:production"
},
"development": {
"browserTarget": "demo:build:development"
"buildTarget": "demo:build:development"
}
},
"defaultConfiguration": "development"
Expand All @@ -87,7 +83,7 @@
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/assets"],
Expand Down
4 changes: 2 additions & 2 deletions e2e/src/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {AppPage} from './app.po';
test.describe('Demo', () => {
let app: AppPage;

test.beforeEach(async ({page}) => {
test.beforeEach(({page}) => {
app = new AppPage(page);
});

Expand Down Expand Up @@ -38,7 +38,7 @@ test.describe('Demo', () => {

// Search something else, and expect to read the searched value when bluring the field
await page.fill(inputSelector, 'any search 3');
await (await page.locator(inputSelector)).blur();
await page.locator(inputSelector).blur();
expect(await page.inputValue(inputSelector)).toEqual('name-16');

// Unselect model by entering empty field with ENTER key
Expand Down
100 changes: 50 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,77 +15,77 @@
"build-lib": "yarn clean && yarn build-natural && yarn build-natural-editor",
"build-natural": "ng build natural && cp -rv README.md dist/natural/ && cd dist/natural && yarn version --no-git-tag-version --new-version `git describe --tags --always`",
"build-natural-editor": "ng build natural-editor && cd dist/natural-editor && yarn version --no-git-tag-version --new-version `git describe --tags --always`",
"build-demo": "yarn build-natural && yarn build-natural-editor && ng build demo --aot --base-href /natural/ && cp dist/demo/index.html dist/demo/404.html",
"serve-demo": "echo '💡 open http://localhost:8000/natural/' && mkdir -p dist/server && ln -fs ../demo dist/server/natural && php -S localhost:8000 -t dist/server/",
"build-demo": "yarn build-natural && yarn build-natural-editor && ng build demo --aot --base-href /natural/ && cp dist/demo/browser/index.html dist/demo/browser/404.html",
"serve-demo": "echo '💡 open http://localhost:8000/natural/' && mkdir -p dist/server && ln -fs ../demo/browser dist/server/natural && php -S localhost:8000 -t dist/server/",
"llink": "cd dist/natural && (yarn unlink ; yarn link) && cd ../natural-editor && (yarn unlink ; yarn link)"
},
"private": true,
"dependencies": {
"@angular/animations": "^16.1.2",
"@angular/cdk": "^16.1.1",
"@angular/common": "^16.1.2",
"@angular/compiler": "^16.1.2",
"@angular/core": "^16.1.2",
"@angular/forms": "^16.1.2",
"@angular/localize": "^16.1.2",
"@angular/material": "^16.1.1",
"@angular/platform-browser": "^16.1.2",
"@angular/platform-browser-dynamic": "^16.1.2",
"@angular/router": "^16.1.2",
"@apollo/client": "^3.7.16",
"@graphql-tools/mock": "^9.0.0",
"@ngbracket/ngx-layout": "^16.0.0",
"apollo-angular": "^5.0.0",
"crypto-es": "^2.0.3",
"@angular/animations": "^17.2.2",
"@angular/cdk": "^17.2.1",
"@angular/common": "^17.2.2",
"@angular/compiler": "^17.2.2",
"@angular/core": "^17.2.2",
"@angular/forms": "^17.2.2",
"@angular/localize": "^17.2.2",
"@angular/material": "^17.2.1",
"@angular/platform-browser": "^17.2.2",
"@angular/platform-browser-dynamic": "^17.2.2",
"@angular/router": "^17.2.2",
"@apollo/client": "^3.9.5",
"@graphql-tools/mock": "^9.0.2",
"@ngbracket/ngx-layout": "^17.0.1",
"apollo-angular": "^6.0.0",
"crypto-es": "^2.1.0",
"extract-files": "^13.0.0",
"graphql": "^16.7.1",
"graphql": "^16.8.1",
"lodash-es": "^4.17.21",
"prosemirror-commands": "^1.5.2",
"prosemirror-dropcursor": "^1.8.1",
"prosemirror-gapcursor": "^1.3.2",
"prosemirror-history": "^1.3.2",
"prosemirror-inputrules": "^1.2.1",
"prosemirror-inputrules": "^1.4.0",
"prosemirror-keymap": "^1.2.2",
"prosemirror-menu": "^1.2.2",
"prosemirror-model": "^1.19.2",
"prosemirror-menu": "^1.2.4",
"prosemirror-model": "^1.19.4",
"prosemirror-schema-basic": "^1.2.2",
"prosemirror-schema-list": "^1.3.0",
"prosemirror-state": "^1.4.3",
"prosemirror-tables": "^1.3.4",
"prosemirror-view": "^1.31.5",
"prosemirror-tables": "^1.3.5",
"prosemirror-view": "^1.33.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.3",
"type-fest": "^4.2.0",
"zone.js": "~0.13.1"
"tslib": "^2.6.2",
"type-fest": "^4.10.3",
"zone.js": "~0.14.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.1.1",
"@angular-eslint/builder": "16.0.3",
"@angular-eslint/eslint-plugin": "16.0.3",
"@angular-eslint/eslint-plugin-template": "16.0.3",
"@angular-eslint/schematics": "16.0.3",
"@angular-eslint/template-parser": "16.0.3",
"@angular/cli": "^16.1.1",
"@angular/compiler-cli": "^16.1.2",
"@angular/language-service": "^16.1.2",
"@playwright/test": "^1.35.1",
"@types/jasmine": "~4.3.4",
"@types/jasminewd2": "^2.0.10",
"@types/lodash-es": "^4.17.7",
"@angular-devkit/build-angular": "^17.2.1",
"@angular-eslint/builder": "17.2.1",
"@angular-eslint/eslint-plugin": "17.2.1",
"@angular-eslint/eslint-plugin-template": "17.2.1",
"@angular-eslint/schematics": "17.2.1",
"@angular-eslint/template-parser": "17.2.1",
"@angular/cli": "^17.2.1",
"@angular/compiler-cli": "^17.2.2",
"@angular/language-service": "^17.2.2",
"@playwright/test": "^1.41.2",
"@types/jasmine": "~5.1.4",
"@types/jasminewd2": "^2.0.13",
"@types/lodash-es": "^4.17.12",
"@types/node": "^16.0",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"eslint": "^8.39.0",
"jasmine-core": "~5.0.1",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"eslint": "^8.53.0",
"jasmine-core": "~5.1.2",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.4.2",
"karma": "~6.4.3",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "^2.2.0",
"karma-coverage": "^2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"ng-packagr": "^16.1.0",
"prettier": "2.8.8",
"ts-node": "^10.6.0",
"typescript": "~5.1.3"
"ng-packagr": "^17.2.0",
"prettier": "3.2.5",
"ts-node": "^10.9.2",
"typescript": "~5.3.3"
}
}
51 changes: 51 additions & 0 deletions projects/natural-editor/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,57 @@
}
]
}
},
{
"files": ["*.html"],
"rules": {
"@angular-eslint/template/i18n": [
"error",
{
"checkId": false,
"ignoreAttributes": [
"autocomplete",
"charset",
"class",
"color",
"colspan",
"dir",
"fill",
"for",
"formArrayName",
"formControlName",
"formGroupName",
"height",
"href",
"id",
"lang",
"list",
"name",
"ngClass",
"ngProjectAs",
"role",
"routerLink",
"routerLinkActive",
"src",
"stroke",
"stroke-width",
"style",
"svgIcon",
"tabindex",
"target",
"type",
"value",
"viewBox",
"width",
"xmlns",
"align",
"naturalIcon",
"naturalCustomCss",
"fontIcon"
]
}
]
}
}
]
}
8 changes: 4 additions & 4 deletions projects/natural-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"tslib": "^2.5.3"
},
"peerDependencies": {
"@angular/common": "^16.1.0",
"@angular/core": "^16.1.0",
"@angular/forms": "^16.1.0",
"@angular/material": "^16.1.0",
"@angular/common": "^17.2.0",
"@angular/core": "^17.2.0",
"@angular/forms": "^17.2.0",
"@angular/material": "^17.2.0",
"@ecodev/natural": ">50.0"
}
}
Loading
Loading