Skip to content

Dev 1185 crear pipeline ngx jsonapi #374

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

Merged
merged 10 commits into from
Aug 4, 2025
Merged
Show file tree
Hide file tree
Changes from 8 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
58 changes: 0 additions & 58 deletions .circleci/config.yml

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
47 changes: 6 additions & 41 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/template/process-inline-templates"
"plugin:@angular-eslint/recommended",
"prettier",
"plugin:@typescript-eslint/recommended"
],
"plugins": [
"eslint-plugin-no-null",
"eslint-plugin-unicorn",
"prettier",
"eslint-plugin-rxjs"
],
"rules": {
Expand Down Expand Up @@ -149,41 +150,15 @@
"error",
"multi-line"
],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"default-case": "off",
"eol-last": "off",
"guard-for-in": "off",
"import/no-default-export": "off",
"import/no-deprecated": "off",
"import/no-extraneous-dependencies": "off",
"import/no-internal-modules": "off",
"import/no-unassigned-import": "off",
"import/order": "off",
"jsdoc/no-types": "off",
"linebreak-style": "off",
"max-len": "off",
"max-lines": [
"error",
1000
],
"new-parens": "off",
"newline-per-chained-call": "off",
"no-cond-assign": "off",
"no-duplicate-case": "error",
"no-duplicate-imports": "error",
"no-empty": "error",
"no-extra-bind": "error",
"no-extra-semi": "off",
"no-irregular-whitespace": "off",
"no-magic-numbers": "off",
"no-new-func": "error",
"no-null/no-null": "off",
"no-plusplus": [
"error",
{
Expand All @@ -199,10 +174,7 @@
"no-sequences": "error",
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-trailing-spaces": "off",
"no-useless-constructor": "off",
"no-void": "error",
"object-shorthand": "off",
"padding-line-between-statements": [
"error",
{
Expand All @@ -211,11 +183,7 @@
"next": "return"
}
],
"no-underscore-dangle": "off",
"prefer-const": "off",
"prefer-object-spread": "error",
"prefer-template": "off",
"quote-props": "off",
"unicorn/filename-case": [
"error",
{
Expand All @@ -230,11 +198,8 @@
"rxjs/no-unsafe-switchmap": "error",
"rxjs/no-unsafe-takeuntil": "error",
"rxjs/throw-error": "error",
"space-before-function-paren": "off",
"space-in-parens": [
"off",
"never"
],
"@typescript-eslint/no-explicit-any": "off",
"indent": "off",
"yoda": "error"
}
},
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: version 3
on: [push]
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node 16
uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: Install dependencies
run: yarn install
- name: Prettier check
run: yarn prettier:check
- name: Lint
run: yarn lint
- name: Test
run: yarn test
- name: Build
run: yarn build:jsonapi
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// .prettierrc.js
module.exports = {
...require("./node_modules/reyesoft-ci/js/rules/.prettierrc.js"),
printWidth: 140,
tabWidth: 4
};
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.1] - 2025-08-01

- Changed CircleCI to GitHub Action and command fix

## [Unreleased]

## [2.3.0-dev-test] - 2023-08-11
Expand Down
3 changes: 3 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,8 @@
"@schematics/angular:directive": {
"prefix": "bc"
}
},
"cli": {
"analytics": false
}
}
4 changes: 2 additions & 2 deletions build/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function _compilePackagesWithNgc(pkg: string): Promise<void> {
*
* See https://github.com/ngrx/platform/issues/94
*/
let [exportPath, moduleName]: Array<string> = /\/testing$/.test(pkg)
const [exportPath, moduleName]: Array<string> = /\/testing$/.test(pkg)
? [pkg.replace(/(.*\/)testing/i, 'testing'), 'testing']
: [pkg, 'index'];

Expand Down Expand Up @@ -283,7 +283,7 @@ export async function removePackagesFolder(config: Config): Promise<void> {
* Deploy build artifacts to repos
*/
export async function publishToRepo(config: Config): Promise<void> {
for (let pkg of util.getTopLevelPackages(config)) {
for (const pkg of util.getTopLevelPackages(config)) {
const SOURCE_DIR: string = `./dist/${pkg}`;
const REPO_URL: string = `git@github.com:ngrx/${pkg}-builds.git`;
const REPO_DIR: string = `./tmp/${pkg}`;
Expand Down
2 changes: 1 addition & 1 deletion build/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async function runTask(name: string, taskFn: () => Promise<any>): Promise<void>

export function createBuilder(tasks: Array<TaskDef>) {
return async function(config: Config) {
for (let [name, runner] of tasks) {
for (const [name, runner] of tasks) {
await runTask(name, () => runner(config));
}
};
Expand Down
4 changes: 1 addition & 3 deletions demo/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import { JsonapiCore } from 'ngx-jsonapi';
export class AppComponent /* implements OnInit */ {
public loading: string = '';

public constructor(
private jsonapiCore: JsonapiCore
) {
public constructor(private jsonapiCore: JsonapiCore) {
jsonapiCore.loadingsStart = (): void => {
this.loading = 'LOADING...';
};
Expand Down
2 changes: 1 addition & 1 deletion demo/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const appRoutes: Routes = [
SharedModule,
RouterModule.forRoot(appRoutes, { useHash: true }),
NgxJsonapiModule.forRoot({
url: environment.api_saldo,
url: environment.api_saldo
})
],
declarations: [AppComponent],
Expand Down
4 changes: 2 additions & 2 deletions demo/app/authors/authors-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const routes: Routes = [
];

@NgModule({
imports: [ RouterModule.forChild(routes) ],
exports: [ RouterModule ]
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class AuthorsRoutingModule {}
2 changes: 1 addition & 1 deletion demo/app/authors/authors.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class Author extends Resource {

public relationships: {
books: DocumentCollection<Book>;
photos: DocumentCollection<Photo>
photos: DocumentCollection<Photo>;
} = {
books: new DocumentCollection<Book>(),
photos: new DocumentCollection<Photo>()
Expand Down
10 changes: 5 additions & 5 deletions demo/app/authors/components/author.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export class AuthorComponent {
) {
route.params.subscribe(({ id }) => {
authorsService.get(id, { include: ['books', 'photos'], ttl: 100 }).subscribe(
author => {
(author) => {
this.author = author;
},
error => console.error('Could not load author.', error)
(error) => console.error('Could not load author.', error)
);
});
}
Expand All @@ -33,7 +33,7 @@ export class AuthorComponent {
Add a new author
*/
public newAuthor(): void {
let author: Author = this.authorsService.new();
const author: Author = this.authorsService.new();
author.attributes.name = prompt('New author name:', 'John Doe');
if (!author.attributes.name) {
return;
Expand All @@ -44,7 +44,7 @@ export class AuthorComponent {
.save
/* { include: ['book'] } */
()
.subscribe(success => {
.subscribe((success) => {
console.log('author saved', author.toObject());
});
}
Expand All @@ -56,7 +56,7 @@ export class AuthorComponent {
this.author.attributes.name = prompt('Author name:', this.author.attributes.name);
console.log('author data for save with book include', this.author.toObject({ include: ['books'] }));
console.log('author data for save without any include', this.author.toObject());
this.author.save(/* { include: ['book'] } */).subscribe(success => {
this.author.save(/* { include: ['book'] } */).subscribe((success) => {
console.log('author saved', this.author.toObject());
});
}
Expand Down
10 changes: 7 additions & 3 deletions demo/app/authors/components/authors.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ import { ActivatedRoute } from '@angular/router';
export class AuthorsComponent {
public authors: DocumentCollection<Author>;

public constructor(private route: ActivatedRoute, private authorsService: AuthorsService, booksService: BooksService) {
public constructor(
private route: ActivatedRoute,
private authorsService: AuthorsService,
booksService: BooksService
) {
route.queryParams.subscribe(({ page }) => {
authorsService
.all({
Expand All @@ -23,10 +27,10 @@ export class AuthorsComponent {
ttl: 3600
})
.subscribe(
authors => {
(authors) => {
this.authors = authors;
},
error => console.error('Could not load authors :(', error)
(error) => console.error('Could not load authors :(', error)
);
});
}
Expand Down
4 changes: 2 additions & 2 deletions demo/app/books/books-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const routes: Routes = [
];

@NgModule({
imports: [ RouterModule.forChild(routes) ],
exports: [ RouterModule ]
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class BooksRoutingModule {}
2 changes: 1 addition & 1 deletion demo/app/books/books.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class Book extends Resource {
};

public relationships: {
author: DocumentResource<Author>
author: DocumentResource<Author>;
photos: DocumentCollection<Photo>;
} = {
author: new DocumentResource<Author>(),
Expand Down
6 changes: 3 additions & 3 deletions demo/app/books/components/book.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ export class BookComponent {
) {
route.params.subscribe(({ id }) => {
booksService.get(id, { include: ['author', 'photos'] }).subscribe(
book => {
(book) => {
this.book = book;
console.log('success book', this.book);
},
error => console.log('error books controll', error)
(error) => console.log('error books controll', error)
);
});
}

public getAuthorName(book: Resource): string {
let data: Resource = <Resource>book.relationships.author.data;
const data: Resource = <Resource>book.relationships.author.data;

return data.attributes ? data.attributes.name : '';
}
Expand Down
Loading