From d1368ca40403f93c6e0949ef734574ed4c44e773 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Mon, 6 Jan 2025 21:26:52 +0100 Subject: [PATCH] feat: core and core-standalone for did-tools (#167) --- package-lock.json | 14 +++++++------- package.json | 2 +- src/services/build.services.ts | 8 +++++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0021c41..2d15e5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@junobuild/cli-tools": "^0.0.16", "@junobuild/config-loader": "^0.0.7", "@junobuild/core": "^0.1.0", - "@junobuild/did-tools": "^0.0.4", + "@junobuild/did-tools": "^0.0.5", "@junobuild/utils": "^0.0.27", "conf": "^13.0.1", "open": "^10.1.0", @@ -1400,9 +1400,9 @@ } }, "node_modules/@junobuild/did-tools": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@junobuild/did-tools/-/did-tools-0.0.4.tgz", - "integrity": "sha512-M+tpIWxZpHViargA8eZQSnijWB6Yej3F391TSHnvbdJIEvkgeecYKz3DSnAEhRG9ZuWxSg9Y+utZitglIYNKAw==", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@junobuild/did-tools/-/did-tools-0.0.5.tgz", + "integrity": "sha512-HZEFFN67fyAyat3fTpaXOfJwxKbmqcQGBK492q7YASKTZvL2TipF6DoW6YKjLOQWKI16NKD7NB79k0zpuJDDNg==", "license": "MIT", "dependencies": { "@babel/core": "^7.25.2", @@ -7497,9 +7497,9 @@ } }, "@junobuild/did-tools": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@junobuild/did-tools/-/did-tools-0.0.4.tgz", - "integrity": "sha512-M+tpIWxZpHViargA8eZQSnijWB6Yej3F391TSHnvbdJIEvkgeecYKz3DSnAEhRG9ZuWxSg9Y+utZitglIYNKAw==", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@junobuild/did-tools/-/did-tools-0.0.5.tgz", + "integrity": "sha512-HZEFFN67fyAyat3fTpaXOfJwxKbmqcQGBK492q7YASKTZvL2TipF6DoW6YKjLOQWKI16NKD7NB79k0zpuJDDNg==", "requires": { "@babel/core": "^7.25.2", "@babel/plugin-transform-modules-commonjs": "^7.24.8", diff --git a/package.json b/package.json index 7eb48cb..aba4b5d 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@junobuild/cli-tools": "^0.0.16", "@junobuild/config-loader": "^0.0.7", "@junobuild/core": "^0.1.0", - "@junobuild/did-tools": "^0.0.4", + "@junobuild/did-tools": "^0.0.5", "@junobuild/utils": "^0.0.27", "conf": "^13.0.1", "open": "^10.1.0", diff --git a/src/services/build.services.ts b/src/services/build.services.ts index 24310c2..d4ed414 100644 --- a/src/services/build.services.ts +++ b/src/services/build.services.ts @@ -184,13 +184,15 @@ const api = async () => { const outputFile = `${DEVELOPER_PROJECT_SATELLITE_DECLARATIONS_PATH}/satellite.api.${outputLanguage}`; - const readCoreLib = async (): Promise<'core' | 'core-peer'> => { + const readCoreLib = async (): Promise<'core' | 'core-standalone'> => { try { const packageJson = await readFile(join(process.cwd(), 'package.json'), 'utf-8'); const {dependencies} = JSON.parse(packageJson) as {dependencies?: Record}; - return Object.keys(dependencies ?? {}).includes('@junobuild/core') ? 'core-peer' : 'core'; + return Object.keys(dependencies ?? {}).includes('@junobuild/core-standalone') + ? 'core-standalone' + : 'core'; } catch (err: unknown) { - // This should not block the developer therefore we fallback to core + // This should not block the developer therefore we fallback to core which is the common way of using the library return 'core'; } };