Skip to content
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
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,20 @@ jobs:

- name: Install and build base
working-directory: base
run: corepack yarn@1.22.22 install --frozen-lockfile && corepack yarn@1.22.22 build
run: |
package_manager="$(node -p "require('./package.json').packageManager || ''")"
case "$package_manager" in
yarn@1.*)
corepack yarn install --frozen-lockfile && corepack yarn build
;;
yarn@*)
corepack yarn install --immutable && corepack yarn build
;;
*)
corepack yarn@1.22.22 install --frozen-lockfile &&
corepack yarn@1.22.22 build
;;
esac

- name: Restore pull request Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
Expand Down
44 changes: 44 additions & 0 deletions packages/importer-angular/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"root": true,
"ignorePatterns": ["dist/**/*", "out-tsc/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["tsconfig.json"]
},
"extends": ["plugin:@angular-eslint/recommended"],
"plugins": ["@typescript-eslint"],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": ["lib", "oneschema"],
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": ["lib", "oneschema"],
"style": "camelCase"
}
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"]
}
]
}
9 changes: 9 additions & 0 deletions packages/importer-angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
"tsConfig": "projects/oneschema/tsconfig.spec.json",
"karmaConfig": "projects/oneschema/karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/oneschema/**/*.ts",
"projects/oneschema/**/*.html"
]
}
}
}
}
Expand Down
13 changes: 11 additions & 2 deletions packages/importer-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"check": "tsc --noEmit -p tsconfig.json",
"fix": "true",
"lint": "ng lint",
"check": "eslint projects && tsc --noEmit -p tsconfig.json",
"fix": "eslint projects --fix",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"test:ci": "ng test --watch=false --browsers=ChromeHeadlessCI",
Expand All @@ -28,10 +29,18 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.2.12",
"@angular-eslint/builder": "16.3.1",
"@angular-eslint/eslint-plugin": "16.3.1",
"@angular-eslint/eslint-plugin-template": "16.3.1",
"@angular-eslint/schematics": "16.3.1",
"@angular-eslint/template-parser": "16.3.1",
"@angular/cli": "~16.2.12",
"@angular/compiler-cli": "^16.2.12",
"@oneschema/importer": "^0.7.0",
"@types/jasmine": "~4.0.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"jasmine-core": "~4.2.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/importer-angular/projects/oneschema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import { OneSchemaService } from './oneschema.service'
template: `<button (click)="launch()">Open OneSchema</button>`,
styles: [],
})
export class OneSchemaButton implements OnDestroy {
export class OneSchemaButtonComponent implements OnDestroy {
constructor(public oneschema: OneSchemaService) {
this.oneschema.on('success', this.onSuccess)
this.oneschema.on('error', this.onError)
Expand Down Expand Up @@ -133,7 +133,7 @@ import { OneSchemaService } from '@oneschema/angular'
`,
],
})
export class OneSchemaIframe implements AfterViewInit {
export class OneSchemaIframeComponent implements AfterViewInit {
@ViewChild('oneschema') iframe?: ElementRef<HTMLIFrameElement>

constructor(public oneschema: OneSchemaService) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { OneSchemaService } from './oneschema.service'
</button>`,
styles: [],
})
// This class name is part of the published @oneschema/angular API.
// eslint-disable-next-line @angular-eslint/component-class-suffix
export class OneSchemaButton {
constructor(public oneschema: OneSchemaService) {}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ModuleWithProviders, NgModule } from '@angular/core'
import { OneSchemaService } from './oneschema.service'
import { OneSchemaImporterClass, OneSchemaParams } from '@oneschema/importer'
import { OneSchemaParams } from '@oneschema/importer'
import { OneSchemaParamsService } from './oneschema.params'
import { OneSchemaButton } from './oneschema.button'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { OneSchemaService } from './oneschema.service'
template: `<button (click)="launch()">Open OneSchema</button>`,
styles: [],
})
export class OneSchemaButton {
export class OneSchemaButtonComponent {
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
constructor(public oneschema: OneSchemaService) {}

launch() {
Expand All @@ -22,18 +22,18 @@ export class OneSchemaButton {
template: ``,
styles: [],
})
export class OneSchemaListener implements OnDestroy {
export class OneSchemaListenerComponent implements OnDestroy {
constructor(public oneschema: OneSchemaService) {
this.oneschema.on('success', this.onSuccess)
this.oneschema.on('error', this.onError)
this.oneschema.on('cancel', this.onCancel)
}

onSuccess(data: any) {
onSuccess(_data: unknown) {
// handle success
}

onError(error: any) {
onError(_error: unknown) {
// handle error
}

Expand Down Expand Up @@ -63,7 +63,7 @@ export class OneSchemaListener implements OnDestroy {
`,
],
})
export class OneSchemaIframe implements AfterViewInit {
export class OneSchemaIframeComponent implements AfterViewInit {
@ViewChild('oneschema') iframe?: ElementRef<HTMLIFrameElement>

constructor(public oneschema: OneSchemaService) {}
Expand Down
Loading
Loading