Skip to content

Commit

Permalink
Merge pull request #120 from poap-xyz/modify-compilation-types-in-pac…
Browse files Browse the repository at this point in the history
…kages

adding compilation results with extension .d.cts and .d.mts
  • Loading branch information
fermartin17 authored May 13, 2024
2 parents 2dd93c3 + b13d10f commit 5134b0d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 21 deletions.
6 changes: 3 additions & 3 deletions packages/drops/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@poap-xyz/drops",
"version": "0.2.8",
"version": "0.3.0",
"description": "Drops module for the poap.js library",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
Expand Down Expand Up @@ -29,7 +29,7 @@
"node": ">=18"
},
"dependencies": {
"@poap-xyz/providers": "0.2.8",
"@poap-xyz/utils": "0.2.8"
"@poap-xyz/providers": "0.3.0",
"@poap-xyz/utils": "0.3.0"
}
}
6 changes: 3 additions & 3 deletions packages/moments/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@poap-xyz/moments",
"version": "0.2.8",
"version": "0.3.0",
"description": "Moments module for the poap.js library",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
Expand All @@ -26,8 +26,8 @@
"build": "rollup -c --bundleConfigAsCjs"
},
"dependencies": {
"@poap-xyz/providers": "0.2.8",
"@poap-xyz/utils": "0.2.8",
"@poap-xyz/providers": "0.3.0",
"@poap-xyz/utils": "0.3.0",
"uuid": "^9.0.0"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/poaps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@poap-xyz/poaps",
"version": "0.2.8",
"version": "0.3.0",
"description": "Poaps module for the poap.js library",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
Expand All @@ -26,8 +26,8 @@
"build": "rollup -c --bundleConfigAsCjs"
},
"dependencies": {
"@poap-xyz/providers": "0.2.8",
"@poap-xyz/utils": "0.2.8"
"@poap-xyz/providers": "0.3.0",
"@poap-xyz/utils": "0.3.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/providers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@poap-xyz/providers",
"version": "0.2.8",
"version": "0.3.0",
"description": "Providers module for the poap.js library",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
Expand All @@ -26,7 +26,7 @@
"build": "rollup -c --bundleConfigAsCjs"
},
"dependencies": {
"@poap-xyz/utils": "0.2.8",
"@poap-xyz/utils": "0.3.0",
"axios": "^1.6.8",
"lodash.chunk": "^4.2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@poap-xyz/utils",
"version": "0.2.8",
"version": "0.3.0",
"description": "Utils module for the poap.js library",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
Expand Down
18 changes: 18 additions & 0 deletions rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import nodePolyfills from 'rollup-plugin-node-polyfills';

const pkg = require(path.resolve(process.cwd(), 'package.json'));

const replaceExtension = (filePath, newExtension) => {
const currentExtension = path.extname(filePath);
const fileNameWithoutExtension = filePath.slice(0, -currentExtension.length);
return `${fileNameWithoutExtension}.${newExtension}`;
};

const configs = [
{
context: 'window',
Expand Down Expand Up @@ -45,6 +51,18 @@ const configs = [
sourcemap: true,
exports: 'named',
},
{
file: replaceExtension(pkg.typings, 'cts'),
format: 'cjs',
sourcemap: false,
exports: 'named',
},
{
file: replaceExtension(pkg.module, 'd.mts'),
format: 'esm',
sourcemap: false,
exports: 'named',
},
],
external: ['axios'],
plugins: [
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@poap-xyz/drops@workspace:packages/drops"
dependencies:
"@poap-xyz/providers": 0.2.8
"@poap-xyz/utils": 0.2.8
"@poap-xyz/providers": 0.3.0
"@poap-xyz/utils": 0.3.0
languageName: unknown
linkType: soft

Expand All @@ -901,8 +901,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@poap-xyz/moments@workspace:packages/moments"
dependencies:
"@poap-xyz/providers": 0.2.8
"@poap-xyz/utils": 0.2.8
"@poap-xyz/providers": 0.3.0
"@poap-xyz/utils": 0.3.0
"@types/uuid": ^9.0.2
uuid: ^9.0.0
languageName: unknown
Expand All @@ -912,24 +912,24 @@ __metadata:
version: 0.0.0-use.local
resolution: "@poap-xyz/poaps@workspace:packages/poaps"
dependencies:
"@poap-xyz/providers": 0.2.8
"@poap-xyz/utils": 0.2.8
"@poap-xyz/providers": 0.3.0
"@poap-xyz/utils": 0.3.0
languageName: unknown
linkType: soft

"@poap-xyz/providers@*, @poap-xyz/providers@0.2.8, @poap-xyz/providers@workspace:packages/providers":
"@poap-xyz/providers@*, @poap-xyz/providers@0.3.0, @poap-xyz/providers@workspace:packages/providers":
version: 0.0.0-use.local
resolution: "@poap-xyz/providers@workspace:packages/providers"
dependencies:
"@poap-xyz/utils": 0.2.8
"@poap-xyz/utils": 0.3.0
axios: ^1.6.8
axios-mock-adapter: ^1.21.4
jest-fetch-mock: ^3.0.3
lodash.chunk: ^4.2.0
languageName: unknown
linkType: soft

"@poap-xyz/utils@*, @poap-xyz/utils@0.2.8, @poap-xyz/utils@workspace:packages/utils":
"@poap-xyz/utils@*, @poap-xyz/utils@0.3.0, @poap-xyz/utils@workspace:packages/utils":
version: 0.0.0-use.local
resolution: "@poap-xyz/utils@workspace:packages/utils"
languageName: unknown
Expand Down

0 comments on commit 5134b0d

Please sign in to comment.