Skip to content

Commit

Permalink
chore: 🚧 update dependencies and small refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
luffynando committed Dec 20, 2024
1 parent 09864e0 commit 2490162
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 38 deletions.
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-check
import nodecfdiConfig from '@nodecfdi/eslint-config';

const { defineConfig } = nodecfdiConfig(import.meta.dirname, { vitest: true });
const { defineConfig } = nodecfdiConfig(import.meta.dirname, { vitest: true, sonarjs: true });

export default defineConfig();
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,34 @@
"version": "pnpm run build && pnpm run changelog"
},
"devDependencies": {
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@jsprismarine/typedoc-material-theme": "^1.0.4",
"@commitlint/cli": "^19.6.1",
"@commitlint/config-conventional": "^19.6.0",
"@nodecfdi/cfdi-core": "^0.5.0",
"@nodecfdi/cfdi-expresiones": "^3.0.2",
"@nodecfdi/eslint-config": "^2.0.2",
"@nodecfdi/prettier-config": "^1.2.0",
"@nodecfdi/tsconfig": "^1.7.2",
"@types/node": "^20.16.5",
"@types/pdfmake": "^0.2.9",
"@vitest/coverage-istanbul": "^2.0.5",
"auto-changelog": "^2.4.0",
"eslint": "^9.10.0",
"husky": "^9.1.5",
"@nodecfdi/eslint-config": "^2.4.1",
"@nodecfdi/prettier-config": "^1.4.0",
"@nodecfdi/tsconfig": "^1.7.3",
"@types/node": "^22.10.2",
"@types/pdfmake": "^0.2.10",
"@vitest/coverage-istanbul": "^2.1.8",
"auto-changelog": "^2.5.0",
"eslint": "^9.17.0",
"husky": "^9.1.7",
"is-in-ci": "^1.0.0",
"np": "^10.0.7",
"pdfmake": "^0.2.12",
"prettier": "^3.3.3",
"np": "^10.1.0",
"pdfmake": "^0.2.16",
"prettier": "^3.4.2",
"tshy": "^3.0.2",
"typedoc": "^0.26.7",
"typescript": "^5.6.2",
"vitest": "^2.0.5"
"typedoc": "^0.27.5",
"typedoc-github-theme": "^0.2.0",
"typescript": "^5.7.2",
"vitest": "^2.1.8"
},
"peerDependencies": {
"@nodecfdi/cfdi-core": ">=0.5.0",
"@nodecfdi/cfdi-expresiones": ">=3.0.2",
"@types/pdfmake": ">=0.2.9",
"pdfmake": ">=0.2.9"
"@types/pdfmake": ">=0.2.10",
"pdfmake": ">=0.2.16"
},
"peerDependenciesMeta": {
"@types/pdfmake": {
Expand Down Expand Up @@ -138,7 +138,7 @@
]
},
"prettier": "@nodecfdi/prettier-config",
"packageManager": "pnpm@9.10.0",
"packageManager": "pnpm@9.15.1",
"publishConfig": {
"access": "public",
"tag": "latest"
Expand Down
12 changes: 6 additions & 6 deletions src/abstract_invoice_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import { DiscoverExtractor } from '@nodecfdi/cfdi-expresiones';
import normalizeSpace from '#src/utils/normalize_space';

export default abstract class AbstractInvoiceData {
protected declare _emisor: XmlNodeInterface;
declare protected _emisor: XmlNodeInterface;

protected declare _receptor: XmlNodeInterface;
declare protected _receptor: XmlNodeInterface;

protected declare _timbreFiscalDigital: XmlNodeInterface;
declare protected _timbreFiscalDigital: XmlNodeInterface;

protected declare _qrUrl: string;
declare protected _qrUrl: string;

protected declare _tfdSourceString: string;
declare protected _tfdSourceString: string;

protected _logo: string | undefined;

protected _additionalFields: { title: string; value: string }[] | undefined;

protected declare _legendFooter: string;
declare protected _legendFooter: string;

public emisor(): XmlNodeInterface {
return this._emisor;
Expand Down
8 changes: 4 additions & 4 deletions src/builders/abstract_pdf_maker_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import {
} from '#src/types';

export default class AbstractPdfMakerBuilder<T extends AbstractInvoiceData> {
protected declare _documentTranslator: DocumentTranslatorInterface<T>;
declare protected _documentTranslator: DocumentTranslatorInterface<T>;

protected declare _catalogs: CatalogsData;
declare protected _catalogs: CatalogsData;

protected declare _documentOptions: DocumentOptions;
declare protected _documentOptions: DocumentOptions;

protected declare _options?: BufferOptions;
declare protected _options?: BufferOptions;

protected _primaryColor = '#359136';

Expand Down
7 changes: 3 additions & 4 deletions src/builders/browser/pdf_maker_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ export default class PdfMakerBuilder<

protected async buildPdf(data: T): Promise<pdfMake.TCreatedPdf> {
const vfsFonts = await import('pdfmake/build/vfs_fonts.js');
const vfs = 'default' in vfsFonts ? vfsFonts.default : undefined;
if (vfs && !this._overrideVFS) {
this._overrideVFS = vfs.pdfMake.vfs;
const vfs = 'default' in vfsFonts ? vfsFonts.default : vfsFonts;
if (!this._overrideVFS) {
this._overrideVFS = vfs as unknown as Record<string, string>;
}

const pdfTemplate = this._documentTranslator.translate(
Expand All @@ -87,7 +87,6 @@ export default class PdfMakerBuilder<
this._bgGrayColor,
);

// eslint-disable-next-line import-x/no-named-as-default-member
return pdfMake.createPdf(pdfTemplate, this.layouts(), this._overrideFonts, this._overrideVFS);
}

Expand Down
3 changes: 1 addition & 2 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"plugin": ["@jsprismarine/typedoc-material-theme"],
"themeColor": "#badc69",
"plugin": ["typedoc-github-theme"],
"entryPoints": ["./src"],
"entryPointStrategy": "expand",
"out": "./docs"
Expand Down

0 comments on commit 2490162

Please sign in to comment.