@opra/common 1.0.0-alpha.32 → 1.0.0-alpha.34

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.
@@ -6,7 +6,7 @@ const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
6
6
  const putil_merge_1 = tslib_1.__importDefault(require("putil-merge"));
7
7
  const index_js_1 = require("../../schema/index.js");
8
8
  const constants_js_1 = require("../constants.js");
9
- const CLASS_NAME_PATTERN = /^(.*)(Collection|Singleton|Resource|Controller)$/;
9
+ const CLASS_NAME_PATTERN = /^(.*)(Controller)$/;
10
10
  function HttpControllerDecoratorFactory(options) {
11
11
  const decoratorChain = [];
12
12
  /**
@@ -2,7 +2,7 @@ import omit from 'lodash.omit';
2
2
  import merge from 'putil-merge';
3
3
  import { OpraSchema } from '../../schema/index.js';
4
4
  import { HTTP_CONTROLLER_METADATA } from '../constants.js';
5
- const CLASS_NAME_PATTERN = /^(.*)(Collection|Singleton|Resource|Controller)$/;
5
+ const CLASS_NAME_PATTERN = /^(.*)(Controller)$/;
6
6
  export function HttpControllerDecoratorFactory(options) {
7
7
  const decoratorChain = [];
8
8
  /**
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
package/package.json CHANGED
@@ -1,47 +1,16 @@
1
1
  {
2
2
  "name": "@opra/common",
3
- "version": "1.0.0-alpha.32",
3
+ "version": "1.0.0-alpha.34",
4
4
  "description": "Opra common package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/panates/opra.git",
10
- "directory": "packages/common"
11
- },
12
- "type": "module",
13
- "module": "./esm/index.js",
14
- "main": "./cjs/index.js",
15
- "browser": "./browser.js",
16
- "types": "./types/index.d.ts",
17
- "scripts": {
18
- "compile": "tsc",
19
- "prebuild": "npm run check && npm run lint && npm run clean",
20
- "build": "npm run build:cjs && npm run build:esm && npm run build:browser",
21
- "build:cjs": "tsc -b tsconfig-build-cjs.json",
22
- "build:esm": "tsc -b tsconfig-build-esm.json",
23
- "build:browser": "node esbuild.mjs",
24
- "postbuild": "cp package.json ../../LICENSE ../../build/common && cp ../../package.cjs.json ../../build/common/cjs/package.json",
25
- "lint": "eslint . --max-warnings=0",
26
- "lint:fix": "eslint . --max-warnings=0 --fix",
27
- "format": "prettier . --write --log-level=warn",
28
- "check": "madge --circular src/**",
29
- "test": "jest --passWithNoTests",
30
- "cover": "jest --passWithNoTests --collect-coverage",
31
- "clean": "npm run clean:src && npm run clean:test && npm run clean:dist && npm run clean:cover",
32
- "clean:src": "ts-cleanup -s src --all",
33
- "clean:test": "ts-cleanup -s test --all",
34
- "clean:dist": "rimraf ../../build/client",
35
- "clean:cover": "rimraf ../../coverage/client",
36
- "antlr4": "java -jar ./tools/antlr4-4.12.1-SNAPSHOT-complete.jar -Dlanguage=TypeScript ./src/filter/antlr/OpraFilter.g4 -visitor"
37
- },
38
7
  "dependencies": {
39
- "@browsery/antlr4": "^4.13.1-patch-1",
40
- "@browsery/highland": "^2.13.5",
41
- "@browsery/http-parser": "^0.5.8",
42
- "@browsery/i18next": "^23.11.5",
43
- "@browsery/type-is": "^1.6.18-r3",
44
- "fast-tokenizer": "^1.3.0",
8
+ "@browsery/antlr4": "^4.13.3-r1",
9
+ "@browsery/highland": "^2.13.6-r2",
10
+ "@browsery/http-parser": "^0.5.9-r1",
11
+ "@browsery/i18next": "^23.12.3-r1",
12
+ "@browsery/type-is": "^1.6.18-r5",
13
+ "fast-tokenizer": "^1.6.1",
45
14
  "lodash.omit": "^4.5.0",
46
15
  "putil-isplainobject": "^1.1.5",
47
16
  "putil-merge": "^3.13.0",
@@ -51,34 +20,52 @@
51
20
  "super-fast-md5": "^1.0.3",
52
21
  "tslib": "^2.6.3",
53
22
  "uid": "^2.0.1",
54
- "valgen": "^5.6.0"
23
+ "valgen": "^5.8.2"
55
24
  },
56
- "devDependencies": {
57
- "@browsery/fs": "^0.4.0",
58
- "@browsery/stream": "^4.3.0",
59
- "@browsery/util": "^0.12.5",
60
- "@types/encodeurl": "^1.0.2",
61
- "@types/lodash.omit": "^4.5.9",
62
- "@types/validator": "^13.12.0",
63
- "path-browserify": "^1.0.1",
64
- "ts-gems": "^3.4.0"
25
+ "type": "module",
26
+ "exports": {
27
+ ".": {
28
+ "import": {
29
+ "types": "./types/index.d.ts",
30
+ "default": "./esm/index.js"
31
+ },
32
+ "require": {
33
+ "types": "./types/index.d.ts",
34
+ "default": "./cjs/index.js"
35
+ },
36
+ "browser": {
37
+ "types": "./types/index.d.ts",
38
+ "import": "./browser/index.mjs",
39
+ "require": "./browser/index.cjs",
40
+ "default": "./browser/index.mjs"
41
+ },
42
+ "default": "./esm/index.js"
43
+ },
44
+ "./package.json": "./package.json"
45
+ },
46
+ "main": "./cjs/index.js",
47
+ "module": "./esm/index.js",
48
+ "browser": "./browser/index.cjs",
49
+ "types": "./types/index.d.ts",
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "https://github.com/panates/opra.git",
53
+ "directory": "packages/common"
65
54
  },
66
55
  "engines": {
67
56
  "node": ">=16.0",
68
57
  "npm": ">=7.0.0"
69
58
  },
70
59
  "files": [
71
- "bin/",
72
60
  "cjs/",
73
61
  "esm/",
74
- "umd/",
62
+ "browser/",
75
63
  "types/",
76
64
  "LICENSE",
77
- "README.md",
78
- "browser.js"
65
+ "README.md"
79
66
  ],
80
67
  "keywords": [
81
68
  "opra",
82
69
  "common"
83
70
  ]
84
- }
71
+ }
@@ -1,5 +1,5 @@
1
1
  import { OpraSchema } from '../../schema/index.js';
2
- import type { ApiDocument } from '../api-document';
2
+ import type { ApiDocument } from '../api-document.js';
3
3
  import { DocumentElement } from './document-element.js';
4
4
  import type { DocumentInitContext } from './document-init-context';
5
5
  export declare namespace ApiBase {
@@ -1,14 +1,14 @@
1
1
  import { Type } from 'ts-gems';
2
2
  import type { ApiDocument } from '../api-document.js';
3
3
  import { kDataTypeMap } from '../constants.js';
4
- import type { ComplexType } from '../data-type/complex-type';
5
- import type { DataType } from '../data-type/data-type';
6
- import type { EnumType } from '../data-type/enum-type';
7
- import type { MappedType } from '../data-type/mapped-type';
8
- import type { MixinType } from '../data-type/mixin-type';
9
- import type { SimpleType } from '../data-type/simple-type';
4
+ import type { ComplexType } from '../data-type/complex-type.js';
5
+ import type { DataType } from '../data-type/data-type.js';
6
+ import type { EnumType } from '../data-type/enum-type.js';
7
+ import type { MappedType } from '../data-type/mapped-type.js';
8
+ import type { MixinType } from '../data-type/mixin-type.js';
9
+ import type { SimpleType } from '../data-type/simple-type.js';
10
10
  import type { DataTypeMap } from './data-type-map.js';
11
- import type { DocumentElement } from './document-element';
11
+ import type { DocumentElement } from './document-element.js';
12
12
  /**
13
13
  * @class DocumentNode
14
14
  */
@@ -4,8 +4,8 @@ import { FieldsProjection, ResponsiveMap } from '../../helpers/index.js';
4
4
  import { OpraSchema } from '../../schema/index.js';
5
5
  import type { DocumentElement } from '../common/document-element.js';
6
6
  import { DocumentInitContext } from '../common/document-init-context.js';
7
- import type { ApiField } from './api-field';
8
- import type { ComplexType } from './complex-type';
7
+ import type { ApiField } from './api-field.js';
8
+ import type { ComplexType } from './complex-type.js';
9
9
  import { DataType } from './data-type.js';
10
10
  import Field = OpraSchema.Field;
11
11
  export declare const FIELD_PATH_PATTERN: RegExp;
@@ -6,7 +6,7 @@ import { DocumentElement } from '../common/document-element.js';
6
6
  import type { ComplexType } from './complex-type.js';
7
7
  import { ComplexTypeBase } from './complex-type-base.js';
8
8
  import { DataType } from './data-type.js';
9
- import type { MixinType } from './mixin-type';
9
+ import type { MixinType } from './mixin-type.js';
10
10
  /**
11
11
  * @namespace MappedType
12
12
  */
@@ -1,3 +1,3 @@
1
1
  import { Type } from 'ts-gems';
2
- import type { DataType } from '../data-type';
2
+ import type { DataType } from '../data-type.js';
3
3
  export declare function createMappedClass(source: string | Type, config: any, options?: DataType.Options): any;
@@ -1,4 +1,4 @@
1
- import type { ApiField } from '../data-type/api-field';
1
+ import type { ApiField } from '../data-type/api-field.js';
2
2
  export interface ApiFieldDecorator {
3
3
  (options?: ApiField.Options): PropertyDecorator;
4
4
  }
@@ -1,6 +1,6 @@
1
1
  import { StrictOmit, Type, TypeThunkAsync } from 'ts-gems';
2
- import type { HttpController } from '../http/http-controller';
3
- import type { HttpParameter } from '../http/http-parameter';
2
+ import type { HttpController } from '../http/http-controller.js';
3
+ import type { HttpParameter } from '../http/http-parameter.js';
4
4
  export interface HttpControllerDecorator<T extends HttpControllerDecorator<any> = HttpControllerDecorator<any>> extends ClassDecorator {
5
5
  Cookie(name: string | RegExp, optionsOrType?: StrictOmit<HttpParameter.Options, 'location'> | string | Type | false): T;
6
6
  Header(name: string | RegExp, optionsOrType?: StrictOmit<HttpParameter.Options, 'location'> | string | TypeThunkAsync | false): T;
@@ -5,7 +5,7 @@ import type { HttpParameter } from '../http/http-parameter.js';
5
5
  import { HttpRequestBody } from '../http/http-request-body.js';
6
6
  import { HttpOperationDecorator } from './http-operation.decorator.js';
7
7
  /** Augmentation **/
8
- declare module '../http/http-operation' {
8
+ declare module '../http/http-operation.js' {
9
9
  /**
10
10
  * HttpOperationConstructor
11
11
  */
@@ -1,5 +1,4 @@
1
- import { RecognitionException } from '@browsery/antlr4';
2
- import { Recognizer } from '@browsery/antlr4/typings/Recognizer';
1
+ import { Recognizer } from '@browsery/antlr4';
3
2
  export declare class SyntaxError extends TypeError {
4
3
  }
5
4
  export declare class FilterValidationError extends TypeError {
@@ -12,12 +11,12 @@ export declare class FilterParseError extends Error {
12
11
  offendingSymbol?: any;
13
12
  line: number;
14
13
  column: number;
15
- e: RecognitionException | undefined;
14
+ e: Error | undefined;
16
15
  constructor(message: string, args: {
17
16
  recognizer: Recognizer<any>;
18
17
  offendingSymbol?: any;
19
18
  line: number;
20
19
  column: number;
21
- e: RecognitionException | undefined;
20
+ e: Error | undefined;
22
21
  });
23
22
  }
@@ -1,5 +1,4 @@
1
- import { ErrorListener, RecognitionException } from '@browsery/antlr4';
2
- import { Recognizer } from '@browsery/antlr4/typings/Recognizer';
1
+ import { ErrorListener, RecognitionException, Recognizer } from '@browsery/antlr4';
3
2
  import { FilterParseError } from './errors.js';
4
3
  export declare class OpraErrorListener extends ErrorListener<any> {
5
4
  errors: FilterParseError[];