feat(core): Added type paths configuration for TypeScript, improved BelliniClient with optional API endpoint and publicationName, and refined imports with JavaScript extensions.

This commit is contained in:
Philipp Kunz 2025-02-03 14:12:23 +01:00
parent 189b642721
commit f1b1bdb35a
11 changed files with 130 additions and 21 deletions

11
changelog.md Normal file
View File

@ -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

View File

@ -23,8 +23,15 @@
"@types/node": "^20.8.7" "@types/node": "^20.8.7"
}, },
"dependencies": { "dependencies": {
"@api.global/typedrequest": "^3.1.10",
"@api.global/typedrequest-interfaces": "^3.0.19", "@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/smartlog-interfaces": "^3.0.2",
"@push.rocks/smartpromise": "^4.2.2",
"@push.rocks/smartstate": "^2.0.19",
"@tsclass/tsclass": "^4.4.0" "@tsclass/tsclass": "^4.4.0"
}, },
"repository": { "repository": {
@ -49,5 +56,19 @@
], ],
"pnpm": { "pnpm": {
"overrides": {} "overrides": {}
},
"eslintConfig": {
"rules": {
"import/extensions": [
"error",
"always",
{
"js": "never",
"ts": "never",
"jsx": "never",
"tsx": "never"
}
]
}
} }
} }

67
pnpm-lock.yaml generated
View File

@ -8,12 +8,33 @@ importers:
.: .:
dependencies: dependencies:
'@api.global/typedrequest':
specifier: ^3.1.10
version: 3.1.10
'@api.global/typedrequest-interfaces': '@api.global/typedrequest-interfaces':
specifier: ^3.0.19 specifier: ^3.0.19
version: 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': '@push.rocks/smartlog-interfaces':
specifier: ^3.0.2 specifier: ^3.0.2
version: 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': '@tsclass/tsclass':
specifier: ^4.4.0 specifier: ^4.4.0
version: 4.4.0 version: 4.4.0
@ -51,8 +72,8 @@ packages:
'@api.global/typedrequest@3.1.10': '@api.global/typedrequest@3.1.10':
resolution: {integrity: sha512-EiCp44XVcMjBvEs4oM1nMUaeY4ySU0Pzt3+mDwVG5DNP6EV87Nwancbr2jKScvaFNel9eeDgGtgEnFBKjOnApA==} resolution: {integrity: sha512-EiCp44XVcMjBvEs4oM1nMUaeY4ySU0Pzt3+mDwVG5DNP6EV87Nwancbr2jKScvaFNel9eeDgGtgEnFBKjOnApA==}
'@api.global/typedserver@3.0.55': '@api.global/typedserver@3.0.58':
resolution: {integrity: sha512-tBH2LxN2wufhNA9S/9frki/OrnPHZ/U7DCzuaSZGMf2kHhU/ZuIF46BEgaVoTCl3oU5U91mzsBfSMgO1WNwl6Q==} resolution: {integrity: sha512-JOs6luHoryKtpIMBZiQTTXVv9UeE011Ij01Ljy3nB6jd9L8EQLmlH2VLFykNifEggv6OhqgaDU+g8u2C0WJZGQ==}
'@api.global/typedsocket@3.0.1': '@api.global/typedsocket@3.0.1':
resolution: {integrity: sha512-xojiAVNXtHoxkpBo8U2HHJG8FrVXXuLvDNndSHXwx4C9VslUwDn5zSCI+PdBl8iAg+ZuBmKjqkpZZ9sL6DC5yQ==} resolution: {integrity: sha512-xojiAVNXtHoxkpBo8U2HHJG8FrVXXuLvDNndSHXwx4C9VslUwDn5zSCI+PdBl8iAg+ZuBmKjqkpZZ9sL6DC5yQ==}
@ -248,8 +269,8 @@ packages:
'@design.estate/dees-comms@1.0.27': '@design.estate/dees-comms@1.0.27':
resolution: {integrity: sha512-GvzTUwkV442LD60T08iqSoqvhA02Mou5lFvvqBPc4yBUiU7cZISqBx+76xvMgMIEI9Dx9JfTl4/2nW8MoVAanw==} resolution: {integrity: sha512-GvzTUwkV442LD60T08iqSoqvhA02Mou5lFvvqBPc4yBUiU7cZISqBx+76xvMgMIEI9Dx9JfTl4/2nW8MoVAanw==}
'@design.estate/dees-domtools@2.1.1': '@design.estate/dees-domtools@2.3.2':
resolution: {integrity: sha512-ZYe7rt2pOWZ6av4YDc88i+Li9WquOHuvE4Xyf+Wo9jAZ37XyTw53wzzviaW3zDG77ggX2VlCLFkAs8Tm5Lf4gg==} resolution: {integrity: sha512-RfXR2t67M9kaCoF6CBkKJtVdsdp6p1O7S1OaWjrs8V0S3277ch4bSYfO+8f+QYweXKkI6Tr2PKaq3PIlwFSC1g==}
'@design.estate/dees-element@2.0.39': '@design.estate/dees-element@2.0.39':
resolution: {integrity: sha512-AQdGU/+GmWmU5M5pDf+GWT7GU8UN073WZvtIkfqQZemxd35HYU1vpi629m8/PjKd5dIHAU7QN2mKb6IQ8anPgw==} resolution: {integrity: sha512-AQdGU/+GmWmU5M5pDf+GWT7GU8UN073WZvtIkfqQZemxd35HYU1vpi629m8/PjKd5dIHAU7QN2mKb6IQ8anPgw==}
@ -2738,6 +2759,17 @@ packages:
kuler@2.0.0: kuler@2.0.0:
resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} 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: lit-element@4.1.1:
resolution: {integrity: sha512-HO9Tkkh34QkTeUmEdNYhMT8hzLid7YlMlATSi1q4q17HE5d9mrrEHJ/o8O2D0cMi182zK1F3v7x0PWFjrhXFew==} resolution: {integrity: sha512-HO9Tkkh34QkTeUmEdNYhMT8hzLid7YlMlATSi1q4q17HE5d9mrrEHJ/o8O2D0cMi182zK1F3v7x0PWFjrhXFew==}
@ -4149,7 +4181,7 @@ snapshots:
'@push.rocks/webrequest': 3.0.37 '@push.rocks/webrequest': 3.0.37
'@push.rocks/webstream': 1.0.10 '@push.rocks/webstream': 1.0.10
'@api.global/typedserver@3.0.55': '@api.global/typedserver@3.0.58':
dependencies: dependencies:
'@api.global/typedrequest': 3.1.10 '@api.global/typedrequest': 3.1.10
'@api.global/typedrequest-interfaces': 3.0.19 '@api.global/typedrequest-interfaces': 3.0.19
@ -4190,8 +4222,10 @@ snapshots:
lit: 3.2.1 lit: 3.2.1
transitivePeerDependencies: transitivePeerDependencies:
- bufferutil - bufferutil
- react
- supports-color - supports-color
- utf-8-validate - utf-8-validate
- vue
'@api.global/typedsocket@3.0.1': '@api.global/typedsocket@3.0.1':
dependencies: dependencies:
@ -4205,8 +4239,10 @@ snapshots:
'@push.rocks/smarturl': 3.1.0 '@push.rocks/smarturl': 3.1.0
transitivePeerDependencies: transitivePeerDependencies:
- bufferutil - bufferutil
- react
- supports-color - supports-color
- utf-8-validate - utf-8-validate
- vue
'@aws-crypto/crc32@5.2.0': '@aws-crypto/crc32@5.2.0':
dependencies: dependencies:
@ -4778,7 +4814,7 @@ snapshots:
'@push.rocks/smartdelay': 3.0.5 '@push.rocks/smartdelay': 3.0.5
broadcast-channel: 7.0.0 broadcast-channel: 7.0.0
'@design.estate/dees-domtools@2.1.1': '@design.estate/dees-domtools@2.3.2':
dependencies: dependencies:
'@api.global/typedrequest': 3.1.10 '@api.global/typedrequest': 3.1.10
'@design.estate/dees-comms': 1.0.27 '@design.estate/dees-comms': 1.0.27
@ -4795,19 +4831,24 @@ snapshots:
'@push.rocks/webrequest': 3.0.37 '@push.rocks/webrequest': 3.0.37
'@push.rocks/websetup': 3.0.19 '@push.rocks/websetup': 3.0.19
'@push.rocks/webstore': 2.0.20 '@push.rocks/webstore': 2.0.20
lenis: 1.1.20
lit: 3.2.1 lit: 3.2.1
sweet-scroll: 4.0.0 sweet-scroll: 4.0.0
transitivePeerDependencies: transitivePeerDependencies:
- react
- supports-color - supports-color
- vue
'@design.estate/dees-element@2.0.39': '@design.estate/dees-element@2.0.39':
dependencies: dependencies:
'@design.estate/dees-domtools': 2.1.1 '@design.estate/dees-domtools': 2.3.2
'@push.rocks/isounique': 1.0.5 '@push.rocks/isounique': 1.0.5
'@push.rocks/smartrx': 3.0.7 '@push.rocks/smartrx': 3.0.7
lit: 3.2.1 lit: 3.2.1
transitivePeerDependencies: transitivePeerDependencies:
- react
- supports-color - supports-color
- vue
'@esbuild/aix-ppc64@0.23.1': '@esbuild/aix-ppc64@0.23.1':
optional: true optional: true
@ -5013,7 +5054,7 @@ snapshots:
'@git.zone/tstest@1.0.96(@aws-sdk/credential-providers@3.738.0)(socks@2.8.3)': '@git.zone/tstest@1.0.96(@aws-sdk/credential-providers@3.738.0)(socks@2.8.3)':
dependencies: dependencies:
'@api.global/typedserver': 3.0.55 '@api.global/typedserver': 3.0.58
'@git.zone/tsbundle': 2.2.5 '@git.zone/tsbundle': 2.2.5
'@git.zone/tsrun': 1.3.3 '@git.zone/tsrun': 1.3.3
'@push.rocks/consolecolor': 2.0.2 '@push.rocks/consolecolor': 2.0.2
@ -5036,10 +5077,12 @@ snapshots:
- gcp-metadata - gcp-metadata
- kerberos - kerberos
- mongodb-client-encryption - mongodb-client-encryption
- react
- snappy - snappy
- socks - socks
- supports-color - supports-color
- utf-8-validate - utf-8-validate
- vue
'@hapi/bourne@3.0.0': {} '@hapi/bourne@3.0.0': {}
@ -5537,7 +5580,9 @@ snapshots:
'@push.rocks/smartpromise': 4.2.2 '@push.rocks/smartpromise': 4.2.2
fake-indexeddb: 6.0.0 fake-indexeddb: 6.0.0
transitivePeerDependencies: transitivePeerDependencies:
- react
- supports-color - supports-color
- vue
'@push.rocks/smartobject@1.0.12': '@push.rocks/smartobject@1.0.12':
dependencies: dependencies:
@ -5637,7 +5682,7 @@ snapshots:
'@push.rocks/smartsocket@2.0.27': '@push.rocks/smartsocket@2.0.27':
dependencies: dependencies:
'@api.global/typedrequest-interfaces': 3.0.19 '@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/isohash': 2.0.1
'@push.rocks/isounique': 1.0.5 '@push.rocks/isounique': 1.0.5
'@push.rocks/lik': 6.1.0 '@push.rocks/lik': 6.1.0
@ -5653,8 +5698,10 @@ snapshots:
socket.io-client: 4.7.5 socket.io-client: 4.7.5
transitivePeerDependencies: transitivePeerDependencies:
- bufferutil - bufferutil
- react
- supports-color - supports-color
- utf-8-validate - utf-8-validate
- vue
'@push.rocks/smartspawn@3.0.3': '@push.rocks/smartspawn@3.0.3':
dependencies: dependencies:
@ -8062,6 +8109,8 @@ snapshots:
kuler@2.0.0: {} kuler@2.0.0: {}
lenis@1.1.20: {}
lit-element@4.1.1: lit-element@4.1.1:
dependencies: dependencies:
'@lit-labs/ssr-dom-shim': 1.3.0 '@lit-labs/ssr-dom-shim': 1.3.0

8
ts/00_commitinfo_data.ts Normal file
View File

@ -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'
}

View File

@ -1,2 +1,12 @@
const removeme = {}; // @api.global scope
export { removeme }; 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 {
}

View File

@ -1,8 +1,9 @@
import * as plugins from './api.plugins.js'; import * as plugins from './api.plugins.js';
export interface IBelliniClientOptions { export interface IBelliniClientOptions {
publicationName: string; publicationName?: string;
smartstatePart?: plugins.smartstate.StatePart<any, IBelliniClientState>; smartstatePart?: plugins.smartstate.StatePart<any, IBelliniClientState>;
apiEndpoint?: string;
} }
export interface IBelliniClientState { export interface IBelliniClientState {
@ -10,7 +11,6 @@ export interface IBelliniClientState {
} }
export class BelliniClient { export class BelliniClient {
private apiEndpoint = 'https://connect.api.global/bellini';
public smartstatePart: plugins.smartstate.StatePart<any, IBelliniClientState>; public smartstatePart: plugins.smartstate.StatePart<any, IBelliniClientState>;
public options: IBelliniClientOptions; public options: IBelliniClientOptions;
@ -42,7 +42,7 @@ export class BelliniClient {
await this.init(); await this.init();
const getArticles = const getArticles =
new plugins.typedrequest.TypedRequest<plugins.belliniInterfaces.IRequest_Any_Bellini_GetArticles>( new plugins.typedrequest.TypedRequest<plugins.belliniInterfaces.IRequest_Any_Bellini_GetArticles>(
this.apiEndpoint, this.options.apiEndpoint,
'getArticles', 'getArticles',
); );
const response = await getArticles.fire({ const response = await getArticles.fire({

View File

@ -1,5 +1,5 @@
// @bellini scope // @bellini scope
import * as belliniInterfaces from '@bellini/interfaces'; import * as belliniInterfaces from '@bellini.io/interfaces';
export { belliniInterfaces }; export { belliniInterfaces };

View File

@ -1,4 +1,4 @@
import * as plugins from './bellini-interfaces.plugins'; import * as plugins from './bellini-interfaces.plugins.js';
export interface IBelliniImage { export interface IBelliniImage {
dimensions: string; dimensions: string;

View File

@ -1,5 +1,5 @@
import * as plugins from './bellini-interfaces.plugins'; import * as plugins from './bellini-interfaces.plugins.js';
import * as objectInterfaces from './bellini-interfaces.objects'; import * as objectInterfaces from './bellini-interfaces.objects.js';
// tslint:disable-next-line: class-name // tslint:disable-next-line: class-name
export interface IRequest_Any_Bellini_GetArticles export interface IRequest_Any_Bellini_GetArticles

View File

@ -1,2 +1,2 @@
export * from './bellini-interfaces.objects'; export * from './bellini-interfaces.objects.js';
export * from './bellini-interfaces.requests'; export * from './bellini-interfaces.requests.js';

View File

@ -9,7 +9,17 @@
"esModuleInterop": true, "esModuleInterop": true,
"verbatimModuleSyntax": true, "verbatimModuleSyntax": true,
"baseUrl": ".", "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": [ "exclude": [
"dist_*/**/*.d.ts" "dist_*/**/*.d.ts"