@pdfme/common 5.3.8-dev.4 → 5.3.8-dev.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/cjs/__tests__/dynamicTemplate.test.js +9 -9
  2. package/dist/cjs/__tests__/dynamicTemplate.test.js.map +1 -1
  3. package/dist/cjs/__tests__/expression.test.js +45 -45
  4. package/dist/cjs/__tests__/expression.test.js.map +1 -1
  5. package/dist/cjs/__tests__/helper.test.js +46 -47
  6. package/dist/cjs/__tests__/helper.test.js.map +1 -1
  7. package/dist/cjs/src/dynamicTemplate.js +4 -4
  8. package/dist/cjs/src/dynamicTemplate.js.map +1 -1
  9. package/dist/cjs/src/index.js +34 -34
  10. package/dist/cjs/src/index.js.map +1 -1
  11. package/dist/esm/__tests__/dynamicTemplate.test.js +1 -1
  12. package/dist/esm/__tests__/dynamicTemplate.test.js.map +1 -1
  13. package/dist/esm/__tests__/expression.test.js +1 -1
  14. package/dist/esm/__tests__/expression.test.js.map +1 -1
  15. package/dist/esm/__tests__/helper.test.js +2 -3
  16. package/dist/esm/__tests__/helper.test.js.map +1 -1
  17. package/dist/esm/src/dynamicTemplate.js +1 -1
  18. package/dist/esm/src/dynamicTemplate.js.map +1 -1
  19. package/dist/esm/src/index.js +5 -5
  20. package/dist/esm/src/index.js.map +1 -1
  21. package/dist/node/__tests__/dynamicTemplate.test.js +9 -9
  22. package/dist/node/__tests__/dynamicTemplate.test.js.map +1 -1
  23. package/dist/node/__tests__/expression.test.js +45 -45
  24. package/dist/node/__tests__/expression.test.js.map +1 -1
  25. package/dist/node/__tests__/helper.test.js +46 -47
  26. package/dist/node/__tests__/helper.test.js.map +1 -1
  27. package/dist/node/src/dynamicTemplate.js +4 -4
  28. package/dist/node/src/dynamicTemplate.js.map +1 -1
  29. package/dist/node/src/index.js +34 -34
  30. package/dist/node/src/index.js.map +1 -1
  31. package/dist/types/src/dynamicTemplate.d.ts +1 -1
  32. package/dist/types/src/expression.d.ts +1 -1
  33. package/dist/types/src/helper.d.ts +1 -1
  34. package/dist/types/src/index.d.ts +6 -6
  35. package/dist/types/src/types.d.ts +0 -2
  36. package/eslint.config.mjs +22 -0
  37. package/package.json +2 -2
  38. package/set-version.js +1 -1
  39. package/src/dynamicTemplate.ts +2 -2
  40. package/src/expression.ts +1 -1
  41. package/src/helper.ts +1 -1
  42. package/src/index.ts +6 -6
  43. package/src/types.ts +0 -2
  44. package/tsconfig.esm.json +2 -1
  45. package/.eslintrc.cjs +0 -3
@@ -0,0 +1,22 @@
1
+ import { fileURLToPath } from 'url';
2
+ import { dirname, resolve } from 'path';
3
+
4
+ const __filename = fileURLToPath(import.meta.url);
5
+ const __dirname = dirname(__filename);
6
+
7
+ // Import the root config
8
+ const rootConfigPath = resolve(__dirname, '../../eslint.config.mjs');
9
+ const rootConfig = await import(rootConfigPath);
10
+
11
+ export default [
12
+ ...rootConfig.default,
13
+ {
14
+ files: ['src/**/*.ts'],
15
+ languageOptions: {
16
+ parserOptions: {
17
+ project: ['./tsconfig.esm.json'],
18
+ tsconfigRootDir: __dirname,
19
+ },
20
+ },
21
+ },
22
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/common",
3
- "version": "5.3.8-dev.4",
3
+ "version": "5.3.8-dev.42",
4
4
  "sideEffects": false,
5
5
  "author": "hand-dot",
6
6
  "license": "MIT",
@@ -42,7 +42,7 @@
42
42
  "build:esm": "tsc -p tsconfig.esm.json",
43
43
  "build:node": "tsc -p tsconfig.node.json",
44
44
  "clean": "rimraf dist",
45
- "lint": "eslint --ext .ts src",
45
+ "lint": "eslint --ext .ts src --config eslint.config.mjs --no-error-on-unmatched-pattern",
46
46
  "test": "jest",
47
47
  "prune": "ts-prune src",
48
48
  "prettier": "prettier --write 'src/**/*.ts'"
package/set-version.js CHANGED
@@ -28,4 +28,4 @@ try {
28
28
  } catch (error) {
29
29
  console.error('Error replacing PDFME_VERSION:', error);
30
30
  updateVersion('x.x.x');
31
- }
31
+ }
@@ -1,5 +1,5 @@
1
- import { Schema, Template, BasePdf, BlankPdf, CommonOptions } from './types';
2
- import { cloneDeep, isBlankPdf } from './helper';
1
+ import { Schema, Template, BasePdf, BlankPdf, CommonOptions } from './types.js';
2
+ import { cloneDeep, isBlankPdf } from './helper.js';
3
3
 
4
4
  interface ModifyTemplateForDynamicTableArg {
5
5
  template: Template;
package/src/expression.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as acorn from 'acorn';
2
2
  import type { Node as AcornNode, Identifier, Property } from 'estree';
3
- import type { SchemaPageArray } from './types';
3
+ import type { SchemaPageArray } from './types.js';
4
4
 
5
5
  const expressionCache = new Map<string, (context: Record<string, unknown>) => unknown>();
6
6
  const parseDataCache = new Map<string, Record<string, unknown>>();
package/src/helper.ts CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  BlankPdf,
10
10
  LegacySchemaPageArray,
11
11
  SchemaPageArray,
12
- } from './types';
12
+ } from './types.js';
13
13
  import {
14
14
  Inputs as InputsSchema,
15
15
  UIOptions as UIOptionsSchema,
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {PDFME_VERSION} from './version';
1
+ import {PDFME_VERSION} from './version.js';
2
2
  import {
3
3
  MM_TO_PT_RATIO,
4
4
  PT_TO_MM_RATIO,
@@ -6,7 +6,7 @@ import {
6
6
  BLANK_PDF,
7
7
  ZOOM,
8
8
  DEFAULT_FONT_NAME,
9
- } from './constants';
9
+ } from './constants.js';
10
10
  import type {
11
11
  ChangeSchemaItem,
12
12
  ChangeSchemas,
@@ -36,7 +36,7 @@ import type {
36
36
  UIProps,
37
37
  PreviewProps,
38
38
  DesignerProps,
39
- } from './types';
39
+ } from './types.js';
40
40
  import {
41
41
  cloneDeep,
42
42
  getFallbackFontName,
@@ -58,9 +58,9 @@ import {
58
58
  isHexValid,
59
59
  getInputFromTemplate,
60
60
  isBlankPdf,
61
- } from './helper';
62
- import { getDynamicTemplate } from './dynamicTemplate';
63
- import { replacePlaceholders } from './expression';
61
+ } from './helper.js';
62
+ import { getDynamicTemplate } from './dynamicTemplate.js';
63
+ import { replacePlaceholders } from './expression.js';
64
64
 
65
65
  export {
66
66
  PDFME_VERSION,
package/src/types.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { PDFPage, PDFDocument } from '@pdfme/pdf-lib';
3
- /** @ts-ignore -- optional interface, will gracefully degrade to `any` if `antd` isn't installed **/
4
3
  import type { ThemeConfig, GlobalToken } from 'antd';
5
- /** @ts-ignore -- optional interface, will gracefully degrade to `any` if `form-render` isn't installed*/
6
4
  import type { WidgetProps as _PropPanelWidgetProps, Schema as _PropPanelSchema } from 'form-render';
7
5
  import {
8
6
  Lang,
package/tsconfig.esm.json CHANGED
@@ -2,9 +2,10 @@
2
2
  "extends": "../../tsconfig.base",
3
3
  "compilerOptions": {
4
4
  "module": "ESNext",
5
+ "moduleResolution": "nodenext",
5
6
  "outDir": "./dist/esm",
6
7
  "declaration": true,
7
8
  "declarationDir": "dist/types",
8
9
  "skipLibCheck": true
9
10
  }
10
- }
11
+ }
package/.eslintrc.cjs DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: ['../../eslint.base.js'],
3
- };