FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: test suite and bugfixes by osnoser1 · Pull Request #11 · limitless-angular/limitless-angular · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (1) .json  (6) .mts  (1) .ts  (55) .yaml  (1) .yml  (2) dotfile  (1) All 7 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
48 changes: 48 additions & 0 deletions .github/workflows/autofix.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: autofix.ci

on:
pull_request:
branches:
- main
permissions:
contents: read

jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'pnpm'

- run: pnpm install
- uses: nrwl/nx-set-shas@v4

- name: Check if sanity is affected
id: check-sanity
run: |
AFFECTED=$(pnpm nx show projects --affected --base=origin/main)
if echo "$AFFECTED" | grep -q "^sanity$"; then
echo "is_affected=true" >> $GITHUB_OUTPUT
else
echo "is_affected=false" >> $GITHUB_OUTPUT
fi

- name: Run pkg-pr-new publish
if: steps.check-sanity.outputs.is_affected == 'true'
run: |
echo "Building sanity"
pnpm nx run sanity:build
echo "Running pkg-pr-new publish"
pnpx pkg-pr-new publish --compact './dist/packages/sanity'

- run: pnpm nx affected -t lint --fix
- run: pnpm nx format:write

- uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:

# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: npx nx-cloud record -- echo Hello World
- run: npx nx affected -t lint build
- run: npx nx affected -t build test
1 change: 1 addition & 0 deletions .prettierignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/.nx/cache
/.nx/workspace-data
.angular
pnpm-lock.yaml
9 changes: 7 additions & 2 deletions eslint.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ export default [
'error',
{
ignoredFiles: [
'{projectRoot}/{eslint,tailwind,vite}.config.{js,cjs,mjs,ts}',
'{projectRoot}/{eslint,tailwind,vite,vitest}.config.{js,cjs,mjs,ts,mts}',
],
ignoredDependencies: [
'@limitless-angular/sanity',
'lru-cache',
'vitest',
'@testing-library/angular',
],
ignoredDependencies: ['@limitless-angular/sanity', 'lru-cache'],
},
],
// TODO: what?
Expand Down
5 changes: 4 additions & 1 deletion nx.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"default",
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/eslint.config.js",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)"
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/src/test-setup.[jt]s",
"!{projectRoot}/test-setup.[jt]s"
],
"sharedGlobals": []
},
Expand Down
9 changes: 9 additions & 0 deletions package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
"@angular/compiler": "~19.0.3",
"@angular/core": "~19.0.3",
"@angular/platform-browser": "~19.0.3",
"@angular/platform-browser-dynamic": "~19.0.3",
"@angular/platform-server": "~19.0.3",
"@angular/router": "~19.0.3",
"@nx/angular": "20.2.2",
"rxjs": "~7.8.0",
"tslib": "^2.3.0"
},
"devDependencies": {
"@analogjs/vite-plugin-angular": "^1.9.0",
"@analogjs/vitest-angular": "^1.9.0",
"@angular-devkit/schematics": "~19.0.4",
"@angular/build": "~19.0.4",
"@angular/cli": "~19.0.4",
Expand All @@ -36,19 +39,23 @@
"@nx/eslint": "20.2.2",
"@nx/eslint-plugin": "20.2.2",
"@nx/js": "20.2.2",
"@nx/vite": "^20.0.0",
"@nx/workspace": "20.2.2",
"@schematics/angular": "~19.0.4",
"@swc-node/register": "~1.9.1",
"@swc/core": "~1.5.7",
"@swc/helpers": "~0.5.11",
"@tailwindcss/typography": "^0.5.13",
"@testing-library/angular": "^17.3.6",
"@testing-library/dom": "^10.4.0",
"@types/eslint__js": "^8.42.3",
"@types/express": "4.17.14",
"@types/node": "~20.17.9",
"angular-eslint": "^19.0.2",
"autoprefixer": "^10.4.0",
"eslint": "^9.8.0",
"eslint-config-prettier": "^9.0.0",
"jsdom": "^22.0.0",
"jsonc-eslint-parser": "^2.1.0",
"ng-packagr": "~19.0.1",
"nx": "20.2.2",
Expand All @@ -59,6 +66,8 @@
"tsx": "^4.19.2",
"typescript": "~5.6.3",
"typescript-eslint": "^8.0.0",
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^2.0.0",
"yargs": "^17.7.2"
},
"pnpm": {
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,30 @@ import { serializeBlock } from '../utils';
let-renderNode="renderNode"
>
<ng-template #listItemChildren>
@for (
child of serializeBlock({ node, isInline: false }).children;
track child._key
) {
@if (node.style && node.style !== 'normal') {
<ng-container
*ngTemplateOutlet="
renderNode;
context: { $implicit: child, isInline: true, components }
context: {
$implicit: getNodeWithoutListItem(node),
index,
isInline: false,
components,
}
"
/>
} @else {
@for (
child of serializeBlock({ node, isInline: false }).children;
track child._key
) {
<ng-container
*ngTemplateOutlet="
renderNode;
context: { $implicit: child, isInline: true, components }
"
/>
}
}
</ng-template>

Expand Down Expand Up @@ -77,5 +91,12 @@ export class ListItemComponent {
>
>('listItemTmpl');

getNodeWithoutListItem = (node: PortableTextListItemBlock) => {
// Wrap any other style in whatever the block serializer says to use
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { listItem, ...blockNode } = node;
return blockNode;
};

protected readonly serializeBlock = serializeBlock;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import {
ChangeDetectionStrategy,
Component,
inject,
TemplateRef,
viewChild,
ViewEncapsulation,
} from '@angular/core';
import { NgComponentOutlet, NgTemplateOutlet } from '@angular/common';

import { PortableTextListBlock, TemplateContext } from '../types';
import { MISSING_COMPONENT_HANDLER } from '../tokens';
import { TemplateContext, PortableTextListBlock } from '../types';
import { trackBy } from '../utils';
import { unknownListStyleWarning } from '../warnings';

@Component({
selector: 'lib-list',
Expand Down Expand Up @@ -55,9 +58,10 @@ import { trackBy } from '../utils';
</ol>
}
@default {
<!-- TODO: remove class when warning msg be implemented -->
<ul [class]="'unknown__pt__list__' + node.listItem">
<ng-container *ngTemplateOutlet="children" />
<ul>
<ng-container *ngTemplateOutlet="children" />{{
handleMissingComponent(node)
}}
</ul>
}
}
Expand Down Expand Up @@ -98,6 +102,16 @@ export class ListComponent {
'listTmpl',
);

missingHandler = inject(MISSING_COMPONENT_HANDLER);

handleMissingComponent(node: PortableTextListBlock) {
const style = node.listItem || 'bullet';
this.missingHandler(unknownListStyleWarning(style), {
nodeType: 'listStyle',
type: style,
});
}

protected getChildNode(
child: PortableTextListBlock['children'][0],
index: number,
Expand Down
Loading

Back | FazBrowse Home | New Git URL