Skip to content

Commit

Permalink
ci: require Tui prefix for type alias
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Oct 7, 2023
1 parent 839fe33 commit ba00d55
Show file tree
Hide file tree
Showing 23 changed files with 1,581 additions and 1,345 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- id: matrix
if: env.TAIGA_FAMILY_BOT_IS_AUTHOR == 'true'
if: env.IS_TAIGA_FAMILY_BOT_PR_AUTHOR == 'true'
run: |
if [[ "${{ env.IS_RELEASE_BRANCH }}" == "false" ]]; then
echo "value=$PR_JOBS_NAME" >> $GITHUB_OUTPUT
Expand Down
35 changes: 24 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,34 @@ jobs:
if: ${{ !contains(github.head_ref, 'release/') }}
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: actions/[email protected]
if: env.SUPPORT_AUTO_PUSH == 'true'
with:
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}
- uses: taiga-family/ci/actions/setup/[email protected]
- run: |
echo "${{github.event.pull_request.head.ref}}"
echo "${{github.head_ref}}"
echo "${{ github.repository }}"
echo "${{ github.event.repository.name }}"
echo "${{github.event.pull_request.head.repo.full_name}}"
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npm run typecheck
- run: npm run cspell -- --no-progress
- run: npm run prettier ${{ env.SUPPORT_AUTO_PUSH == 'true' && '-- --write' || '-- --check' }}
- run: npm run stylelint ${{ env.SUPPORT_AUTO_PUSH == 'true' && '-- --fix' || '' }}
- run: npm run lint ${{ env.SUPPORT_AUTO_PUSH == 'true' && '-- --fix' || '' }}
- run: |
if [[ "${{ env.SUPPORT_AUTO_PUSH }}" == "true" ]]; then
npm run prettier -- --write
npm run stylelint -- --fix
npm run lint -- --fix
else
npm run prettier -- --check
npm run stylelint -- --fix
npm run lint -- --fix
fi
- name: Apply changes after linting
if: env.SUPPORT_AUTO_PUSH == 'true'
uses: taiga-family/ci/actions/auto/[email protected]
uses: taiga-family/ci/actions/auto/[email protected]
with:
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }}

concurrency:
group: lint-${{ github.workflow }}-${{ github.ref }}
Expand Down
2,765 changes: 1,483 additions & 1,282 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"@taiga-ui/browserslist-config": "0.2.0",
"@taiga-ui/commitlint-config": "0.2.1",
"@taiga-ui/cspell-config": "0.13.0",
"@taiga-ui/eslint-plugin-experience": "0.7.5",
"@taiga-ui/eslint-plugin-experience": "0.8.1",
"@taiga-ui/prettier-config": "0.3.1",
"@taiga-ui/stylelint-config": "0.5.1",
"@testing-library/cypress": "9.0.0",
Expand Down
6 changes: 3 additions & 3 deletions projects/addon-doc/components/code/code.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Inject,
Input,
} from '@angular/core';
import {RawLoaderContent} from '@taiga-ui/addon-doc/interfaces';
import {TuiRawLoaderContent} from '@taiga-ui/addon-doc/interfaces';
import {TUI_DOC_EXAMPLE_MARKDOWN_CODE_PROCESSOR} from '@taiga-ui/addon-doc/tokens';
import {tuiRawLoad} from '@taiga-ui/addon-doc/utils';
import {TuiHandler} from '@taiga-ui/cdk';
Expand All @@ -19,7 +19,7 @@ import {map, switchMap} from 'rxjs/operators';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TuiDocCodeComponent {
private readonly rawLoader$$ = new BehaviorSubject<RawLoaderContent>('');
private readonly rawLoader$$ = new BehaviorSubject<TuiRawLoaderContent>('');

@Input()
filename = '';
Expand All @@ -35,7 +35,7 @@ export class TuiDocCodeComponent {
) {}

@Input()
set code(code: RawLoaderContent) {
set code(code: TuiRawLoaderContent) {
this.rawLoader$$.next(code);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ import {BehaviorSubject, Subject} from 'rxjs';

const SERIALIZED_SUFFIX = '$';

export type DocumentationPropertyType = 'input-output' | 'input' | 'output' | null;
export type TuiDocumentationPropertyType = 'input-output' | 'input' | 'output' | null;

/**
* @deprecated: use {@link TuiDocumentationPropertyType}
* TODO: remove in v4.0
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export type DocumentationPropertyType = TuiDocumentationPropertyType;

// @bad TODO: refactor output and value sync
@Directive({
Expand All @@ -31,7 +38,7 @@ export class TuiDocDocumentationPropertyConnectorDirective<T>
documentationPropertyName = '';

@Input()
documentationPropertyMode: DocumentationPropertyType = null;
documentationPropertyMode: TuiDocumentationPropertyType = null;

@Input()
documentationPropertyType = '';
Expand Down
11 changes: 9 additions & 2 deletions projects/addon-doc/interfaces/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ export interface TuiDocPageGroup extends TuiDocPageBase {
readonly subPages: readonly TuiDocPage[];
}

export type RawLoaderContent = Promise<{default: string}> | string;
export type TuiRawLoaderContent = Promise<{default: string}> | string;

/**
* @deprecated: use {@link TuiRawLoaderContent}
* TODO: remove in v4.0
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export type RawLoaderContent = TuiRawLoaderContent;

export const TUI_EXAMPLE_PRIMARY_FILE_NAME = {
TS: `TypeScript`,
Expand All @@ -25,7 +32,7 @@ export const TUI_EXAMPLE_PRIMARY_FILE_NAME = {
} as const;

export type TuiDocExample =
| Record<string, RawLoaderContent>
| Record<string, TuiRawLoaderContent>
| {
[TUI_EXAMPLE_PRIMARY_FILE_NAME.HTML]?: string;
[TUI_EXAMPLE_PRIMARY_FILE_NAME.LESS]?: string;
Expand Down
4 changes: 2 additions & 2 deletions projects/addon-doc/utils/raw-load.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {RawLoaderContent} from '@taiga-ui/addon-doc/interfaces';
import {TuiRawLoaderContent} from '@taiga-ui/addon-doc/interfaces';

export async function tuiRawLoad(content: RawLoaderContent): Promise<string> {
export async function tuiRawLoad(content: TuiRawLoaderContent): Promise<string> {
return content instanceof Promise ? (await content).default : content;
}
1 change: 1 addition & 0 deletions projects/core/tokens/ordered-short-week-days.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {TUI_SHORT_WEEK_DAYS} from './i18n';
/**
* @deprecated
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export type WEEK_DAYS_NAMES = [string, string, string, string, string, string, string];

const convertToSundayFirstWeekFormat = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';
import {TuiSafeHtml} from '@taiga-ui/cdk';
import {TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core';

Expand All @@ -10,15 +10,15 @@ import {TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core';
changeDetection,
})
export class ExampleTuiAvatarComponent {
readonly exampleOptions: RawLoaderContent = import(
readonly exampleOptions: TuiRawLoaderContent = import(
'./examples/import/define-options.md?raw'
);

readonly exampleModule: RawLoaderContent = import(
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: RawLoaderContent = import(
readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Component, Inject} from '@angular/core';
import {FormControl} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';
import {TUI_RATING_OPTIONS, TuiRatingOptions} from '@taiga-ui/kit';

@Component({
Expand All @@ -13,15 +13,15 @@ import {TUI_RATING_OPTIONS, TuiRatingOptions} from '@taiga-ui/kit';
encapsulation,
})
export class ExampleTuiRatingComponent {
readonly exampleModule: RawLoaderContent = import(
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: RawLoaderContent = import(
readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

readonly exampleOptions: RawLoaderContent = import(
readonly exampleOptions: TuiRawLoaderContent = import(
'./examples/import/define-options.md?raw'
);

Expand Down
8 changes: 4 additions & 4 deletions projects/demo/src/modules/components/tag/tag.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component, TemplateRef, ViewChild} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';
import {TuiSizeL, TuiSizeS} from '@taiga-ui/core';
import {TuiStatus} from '@taiga-ui/kit';
import {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';
Expand All @@ -15,15 +15,15 @@ export class ExampleTuiTagComponent {
@ViewChild('errorIcon')
errorTemplate?: TemplateRef<Record<string, unknown>>;

readonly exampleOptions: RawLoaderContent = import(
readonly exampleOptions: TuiRawLoaderContent = import(
'./examples/import/define-options.md?raw'
);

readonly exampleModule: RawLoaderContent = import(
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: RawLoaderContent = import(
readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component, Inject} from '@angular/core';
import {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';
import {changeDetection} from '@demo/emulate/change-detection';
import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';
import {TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core';

@Component({
Expand All @@ -10,11 +10,11 @@ import {TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core';
changeDetection,
})
export class ExampleTuiAvatarComponent {
readonly exampleModule: RawLoaderContent = import(
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: RawLoaderContent = import(
readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';
import {TuiSizeL, TuiSizeXS} from '@taiga-ui/core';

@Component({
Expand All @@ -9,11 +9,11 @@ import {TuiSizeL, TuiSizeXS} from '@taiga-ui/core';
changeDetection,
})
export class ExampleTuiBadgeAlertComponent {
readonly exampleModule: RawLoaderContent = import(
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: RawLoaderContent = import(
readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';
import {TuiSizeS, TuiSizeXL} from '@taiga-ui/core';
import {TuiStatus} from '@taiga-ui/kit';

Expand All @@ -10,11 +10,11 @@ import {TuiStatus} from '@taiga-ui/kit';
changeDetection,
})
export class ExampleTuiBadgeComponent {
readonly exampleModule: RawLoaderContent = import(
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: RawLoaderContent = import(
readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';

@Component({
selector: 'example-badged-content',
templateUrl: './badged-content.template.html',
changeDetection,
})
export class ExampleTuiBadgeAlertComponent {
readonly exampleModule: RawLoaderContent = import(
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: RawLoaderContent = import(
readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';
import {TuiSizeL, TuiSizeXS} from '@taiga-ui/core';

@Component({
Expand All @@ -9,11 +9,11 @@ import {TuiSizeL, TuiSizeXS} from '@taiga-ui/core';
changeDetection,
})
export class ExampleTuiButtonComponent {
readonly exampleModule: RawLoaderContent = import(
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: RawLoaderContent = import(
readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';

@Component({
selector: 'example-compass',
templateUrl: './compass.template.html',
changeDetection,
})
export class ExampleTuiCompassComponent {
readonly exampleModule: RawLoaderContent = import(
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: RawLoaderContent = import(
readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

Expand Down
6 changes: 3 additions & 3 deletions projects/demo/src/modules/experimental/fade/fade.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';

@Component({
selector: 'example-fade',
Expand All @@ -9,11 +9,11 @@ import {RawLoaderContent, TuiDocExample} from '@taiga-ui/addon-doc';
changeDetection,
})
export class ExampleTuiFadeComponent {
readonly exampleModule: RawLoaderContent = import(
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);

readonly exampleHtml: RawLoaderContent = import(
readonly exampleHtml: TuiRawLoaderContent = import(
'./examples/import/insert-template.md?raw'
);

Expand Down
Loading

0 comments on commit ba00d55

Please sign in to comment.