From f1b1bdb35aac13474bb07d6b62554c13c44f311b Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Mon, 3 Feb 2025 14:12:23 +0100 Subject: [PATCH] feat(core): Added type paths configuration for TypeScript, improved BelliniClient with optional API endpoint and publicationName, and refined imports with JavaScript extensions. --- changelog.md | 11 ++++ package.json | 21 ++++++ pnpm-lock.yaml | 67 +++++++++++++++++--- ts/00_commitinfo_data.ts | 8 +++ ts/bellini.plugins.ts | 14 +++- ts_api/api.classes.belliniclient.ts | 6 +- ts_api/api.plugins.ts | 2 +- ts_interfaces/bellini-interfaces.objects.ts | 2 +- ts_interfaces/bellini-interfaces.requests.ts | 4 +- ts_interfaces/index.ts | 4 +- tsconfig.json | 12 +++- 11 files changed, 130 insertions(+), 21 deletions(-) create mode 100644 changelog.md create mode 100644 ts/00_commitinfo_data.ts diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..032bf04 --- /dev/null +++ b/changelog.md @@ -0,0 +1,11 @@ +# Changelog + +## 2025-02-03 - 1.1.0 - feat(core) +Added type paths configuration for TypeScript, improved BelliniClient with optional API endpoint and publicationName, and refined imports with JavaScript extensions. + +- Updated 'tsconfig.json' to include type paths for better module resolution for '@bellini.io/api', '@bellini_private/catalog', and '@bellini.io/interfaces'. +- Refactored 'IBelliniClientOptions' to include optional 'apiEndpoint' and 'publicationName'. +- Changed module imports in several files to use '.js' extension for better compliance with ES modules. + +## 2025-02-03 - 1.0.1 - Initial Release +Initial release of the project diff --git a/package.json b/package.json index 26ff896..45a9fa9 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,15 @@ "@types/node": "^20.8.7" }, "dependencies": { + "@api.global/typedrequest": "^3.1.10", "@api.global/typedrequest-interfaces": "^3.0.19", + "@api.global/typedserver": "^3.0.58", + "@design.estate/dees-domtools": "^2.3.2", + "@design.estate/dees-element": "^2.0.39", + "@push.rocks/smartdelay": "^3.0.5", "@push.rocks/smartlog-interfaces": "^3.0.2", + "@push.rocks/smartpromise": "^4.2.2", + "@push.rocks/smartstate": "^2.0.19", "@tsclass/tsclass": "^4.4.0" }, "repository": { @@ -49,5 +56,19 @@ ], "pnpm": { "overrides": {} + }, + "eslintConfig": { + "rules": { + "import/extensions": [ + "error", + "always", + { + "js": "never", + "ts": "never", + "jsx": "never", + "tsx": "never" + } + ] + } } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d35930c..67d901d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,12 +8,33 @@ importers: .: dependencies: + '@api.global/typedrequest': + specifier: ^3.1.10 + version: 3.1.10 '@api.global/typedrequest-interfaces': specifier: ^3.0.19 version: 3.0.19 + '@api.global/typedserver': + specifier: ^3.0.58 + version: 3.0.58 + '@design.estate/dees-domtools': + specifier: ^2.3.2 + version: 2.3.2 + '@design.estate/dees-element': + specifier: ^2.0.39 + version: 2.0.39 + '@push.rocks/smartdelay': + specifier: ^3.0.5 + version: 3.0.5 '@push.rocks/smartlog-interfaces': specifier: ^3.0.2 version: 3.0.2 + '@push.rocks/smartpromise': + specifier: ^4.2.2 + version: 4.2.2 + '@push.rocks/smartstate': + specifier: ^2.0.19 + version: 2.0.19 '@tsclass/tsclass': specifier: ^4.4.0 version: 4.4.0 @@ -51,8 +72,8 @@ packages: '@api.global/typedrequest@3.1.10': resolution: {integrity: sha512-EiCp44XVcMjBvEs4oM1nMUaeY4ySU0Pzt3+mDwVG5DNP6EV87Nwancbr2jKScvaFNel9eeDgGtgEnFBKjOnApA==} - '@api.global/typedserver@3.0.55': - resolution: {integrity: sha512-tBH2LxN2wufhNA9S/9frki/OrnPHZ/U7DCzuaSZGMf2kHhU/ZuIF46BEgaVoTCl3oU5U91mzsBfSMgO1WNwl6Q==} + '@api.global/typedserver@3.0.58': + resolution: {integrity: sha512-JOs6luHoryKtpIMBZiQTTXVv9UeE011Ij01Ljy3nB6jd9L8EQLmlH2VLFykNifEggv6OhqgaDU+g8u2C0WJZGQ==} '@api.global/typedsocket@3.0.1': resolution: {integrity: sha512-xojiAVNXtHoxkpBo8U2HHJG8FrVXXuLvDNndSHXwx4C9VslUwDn5zSCI+PdBl8iAg+ZuBmKjqkpZZ9sL6DC5yQ==} @@ -248,8 +269,8 @@ packages: '@design.estate/dees-comms@1.0.27': resolution: {integrity: sha512-GvzTUwkV442LD60T08iqSoqvhA02Mou5lFvvqBPc4yBUiU7cZISqBx+76xvMgMIEI9Dx9JfTl4/2nW8MoVAanw==} - '@design.estate/dees-domtools@2.1.1': - resolution: {integrity: sha512-ZYe7rt2pOWZ6av4YDc88i+Li9WquOHuvE4Xyf+Wo9jAZ37XyTw53wzzviaW3zDG77ggX2VlCLFkAs8Tm5Lf4gg==} + '@design.estate/dees-domtools@2.3.2': + resolution: {integrity: sha512-RfXR2t67M9kaCoF6CBkKJtVdsdp6p1O7S1OaWjrs8V0S3277ch4bSYfO+8f+QYweXKkI6Tr2PKaq3PIlwFSC1g==} '@design.estate/dees-element@2.0.39': resolution: {integrity: sha512-AQdGU/+GmWmU5M5pDf+GWT7GU8UN073WZvtIkfqQZemxd35HYU1vpi629m8/PjKd5dIHAU7QN2mKb6IQ8anPgw==} @@ -2738,6 +2759,17 @@ packages: kuler@2.0.0: resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} + lenis@1.1.20: + resolution: {integrity: sha512-UE64mlJEN4W8DWP2tfHzPzygk94Q2BhjzeG/YHWoyeMJ2Fd6XziBCNN+IvHwmB4GkmKIYxgr0+TvRYTSAMTMFA==} + peerDependencies: + react: '>=17.0.0' + vue: '>=3.0.0' + peerDependenciesMeta: + react: + optional: true + vue: + optional: true + lit-element@4.1.1: resolution: {integrity: sha512-HO9Tkkh34QkTeUmEdNYhMT8hzLid7YlMlATSi1q4q17HE5d9mrrEHJ/o8O2D0cMi182zK1F3v7x0PWFjrhXFew==} @@ -4149,7 +4181,7 @@ snapshots: '@push.rocks/webrequest': 3.0.37 '@push.rocks/webstream': 1.0.10 - '@api.global/typedserver@3.0.55': + '@api.global/typedserver@3.0.58': dependencies: '@api.global/typedrequest': 3.1.10 '@api.global/typedrequest-interfaces': 3.0.19 @@ -4190,8 +4222,10 @@ snapshots: lit: 3.2.1 transitivePeerDependencies: - bufferutil + - react - supports-color - utf-8-validate + - vue '@api.global/typedsocket@3.0.1': dependencies: @@ -4205,8 +4239,10 @@ snapshots: '@push.rocks/smarturl': 3.1.0 transitivePeerDependencies: - bufferutil + - react - supports-color - utf-8-validate + - vue '@aws-crypto/crc32@5.2.0': dependencies: @@ -4778,7 +4814,7 @@ snapshots: '@push.rocks/smartdelay': 3.0.5 broadcast-channel: 7.0.0 - '@design.estate/dees-domtools@2.1.1': + '@design.estate/dees-domtools@2.3.2': dependencies: '@api.global/typedrequest': 3.1.10 '@design.estate/dees-comms': 1.0.27 @@ -4795,19 +4831,24 @@ snapshots: '@push.rocks/webrequest': 3.0.37 '@push.rocks/websetup': 3.0.19 '@push.rocks/webstore': 2.0.20 + lenis: 1.1.20 lit: 3.2.1 sweet-scroll: 4.0.0 transitivePeerDependencies: + - react - supports-color + - vue '@design.estate/dees-element@2.0.39': dependencies: - '@design.estate/dees-domtools': 2.1.1 + '@design.estate/dees-domtools': 2.3.2 '@push.rocks/isounique': 1.0.5 '@push.rocks/smartrx': 3.0.7 lit: 3.2.1 transitivePeerDependencies: + - react - supports-color + - vue '@esbuild/aix-ppc64@0.23.1': optional: true @@ -5013,7 +5054,7 @@ snapshots: '@git.zone/tstest@1.0.96(@aws-sdk/credential-providers@3.738.0)(socks@2.8.3)': dependencies: - '@api.global/typedserver': 3.0.55 + '@api.global/typedserver': 3.0.58 '@git.zone/tsbundle': 2.2.5 '@git.zone/tsrun': 1.3.3 '@push.rocks/consolecolor': 2.0.2 @@ -5036,10 +5077,12 @@ snapshots: - gcp-metadata - kerberos - mongodb-client-encryption + - react - snappy - socks - supports-color - utf-8-validate + - vue '@hapi/bourne@3.0.0': {} @@ -5537,7 +5580,9 @@ snapshots: '@push.rocks/smartpromise': 4.2.2 fake-indexeddb: 6.0.0 transitivePeerDependencies: + - react - supports-color + - vue '@push.rocks/smartobject@1.0.12': dependencies: @@ -5637,7 +5682,7 @@ snapshots: '@push.rocks/smartsocket@2.0.27': dependencies: '@api.global/typedrequest-interfaces': 3.0.19 - '@api.global/typedserver': 3.0.55 + '@api.global/typedserver': 3.0.58 '@push.rocks/isohash': 2.0.1 '@push.rocks/isounique': 1.0.5 '@push.rocks/lik': 6.1.0 @@ -5653,8 +5698,10 @@ snapshots: socket.io-client: 4.7.5 transitivePeerDependencies: - bufferutil + - react - supports-color - utf-8-validate + - vue '@push.rocks/smartspawn@3.0.3': dependencies: @@ -8062,6 +8109,8 @@ snapshots: kuler@2.0.0: {} + lenis@1.1.20: {} + lit-element@4.1.1: dependencies: '@lit-labs/ssr-dom-shim': 1.3.0 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts new file mode 100644 index 0000000..617382d --- /dev/null +++ b/ts/00_commitinfo_data.ts @@ -0,0 +1,8 @@ +/** + * autocreated commitinfo by @push.rocks/commitinfo + */ +export const commitinfo = { + name: '@bellini.io/bellini', + version: '1.1.0', + description: 'the bellini main application' +} diff --git a/ts/bellini.plugins.ts b/ts/bellini.plugins.ts index 29aa9da..5dd24d6 100644 --- a/ts/bellini.plugins.ts +++ b/ts/bellini.plugins.ts @@ -1,2 +1,12 @@ -const removeme = {}; -export { removeme }; +// @api.global scope +import * as typedserver from '@api.global/typedserver'; +import * as typedrequestInterfaces from '@api.global/typedrequest-interfaces'; + +export { typedserver, typedrequestInterfaces }; + +// @push.rocks scope +import * as smartdelay from '@push.rocks/smartdelay'; + +export { + +} \ No newline at end of file diff --git a/ts_api/api.classes.belliniclient.ts b/ts_api/api.classes.belliniclient.ts index ae15265..9c8ea5a 100644 --- a/ts_api/api.classes.belliniclient.ts +++ b/ts_api/api.classes.belliniclient.ts @@ -1,8 +1,9 @@ import * as plugins from './api.plugins.js'; export interface IBelliniClientOptions { - publicationName: string; + publicationName?: string; smartstatePart?: plugins.smartstate.StatePart; + apiEndpoint?: string; } export interface IBelliniClientState { @@ -10,7 +11,6 @@ export interface IBelliniClientState { } export class BelliniClient { - private apiEndpoint = 'https://connect.api.global/bellini'; public smartstatePart: plugins.smartstate.StatePart; public options: IBelliniClientOptions; @@ -42,7 +42,7 @@ export class BelliniClient { await this.init(); const getArticles = new plugins.typedrequest.TypedRequest( - this.apiEndpoint, + this.options.apiEndpoint, 'getArticles', ); const response = await getArticles.fire({ diff --git a/ts_api/api.plugins.ts b/ts_api/api.plugins.ts index 4a0cc7f..5ec373a 100644 --- a/ts_api/api.plugins.ts +++ b/ts_api/api.plugins.ts @@ -1,5 +1,5 @@ // @bellini scope -import * as belliniInterfaces from '@bellini/interfaces'; +import * as belliniInterfaces from '@bellini.io/interfaces'; export { belliniInterfaces }; diff --git a/ts_interfaces/bellini-interfaces.objects.ts b/ts_interfaces/bellini-interfaces.objects.ts index 6bf93fd..4873624 100644 --- a/ts_interfaces/bellini-interfaces.objects.ts +++ b/ts_interfaces/bellini-interfaces.objects.ts @@ -1,4 +1,4 @@ -import * as plugins from './bellini-interfaces.plugins'; +import * as plugins from './bellini-interfaces.plugins.js'; export interface IBelliniImage { dimensions: string; diff --git a/ts_interfaces/bellini-interfaces.requests.ts b/ts_interfaces/bellini-interfaces.requests.ts index 81f4746..3ab8f57 100644 --- a/ts_interfaces/bellini-interfaces.requests.ts +++ b/ts_interfaces/bellini-interfaces.requests.ts @@ -1,5 +1,5 @@ -import * as plugins from './bellini-interfaces.plugins'; -import * as objectInterfaces from './bellini-interfaces.objects'; +import * as plugins from './bellini-interfaces.plugins.js'; +import * as objectInterfaces from './bellini-interfaces.objects.js'; // tslint:disable-next-line: class-name export interface IRequest_Any_Bellini_GetArticles diff --git a/ts_interfaces/index.ts b/ts_interfaces/index.ts index 5b6671b..a69f700 100644 --- a/ts_interfaces/index.ts +++ b/ts_interfaces/index.ts @@ -1,2 +1,2 @@ -export * from './bellini-interfaces.objects'; -export * from './bellini-interfaces.requests'; +export * from './bellini-interfaces.objects.js'; +export * from './bellini-interfaces.requests.js'; diff --git a/tsconfig.json b/tsconfig.json index dc20ee9..39badb4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,17 @@ "esModuleInterop": true, "verbatimModuleSyntax": true, "baseUrl": ".", - "paths": {} + "paths": { + "@bellini.io/api": [ + "./ts_api/index.js" + ], + "@bellini_private/catalog": [ + "./ts_catalog/index.js" + ], + "@bellini.io/interfaces": [ + "./ts_interfaces/index.js" + ] + } }, "exclude": [ "dist_*/**/*.d.ts"