Skip to content

Commit

Permalink
🔧 chore: Fix package.json exports (#592)
Browse files Browse the repository at this point in the history
## Description

Fix exports field in package.json

## Testing

Explain the quality checks that have been done on the code changes

## Additional Information

- [ ] I read the [contributing docs](../docs/contributing.md) (if this
is your first contribution)

Your ENS/address:

---------

Co-authored-by: Will Cory <[email protected]>
  • Loading branch information
roninjin10 and Will Cory authored Oct 19, 2023
1 parent 32c7f25 commit eb3f734
Show file tree
Hide file tree
Showing 27 changed files with 153 additions and 79 deletions.
3 changes: 2 additions & 1 deletion blockexplorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"require": "./dist/index.cjs",
"types": "./src/index.d.ts",
"default": "./src/index.js"
}
},
"./package.json": "./package.json"
},
"main": "dist/index.cjs",
"module": "src/index.js",
Expand Down
15 changes: 9 additions & 6 deletions bundlers/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
"main": "dist/index.cjs",
"module": "src/index.js",
"types": "types/index.d.ts",
"files": ["dist", "src", "types"],
"export": {
"import": "./src/index.js",
"require": "./dist/index.cjs",
"types": "./types/index.d.ts",
"default": "./dist/index.js"
"exports": {
".": {
"import": "./src/index.js",
"require": "./dist/index.cjs",
"types": "./types/index.d.ts",
"default": "./dist/index.cjs"
},
"./package.json": "./package.json"
},
"files": ["dist", "src", "types"],
"scripts": {
"build": "nx run-many --targets=build:dist,build:types --projects=@evmts/bun-plugin ",
"build:dist": "bun run tsup",
Expand Down
2 changes: 1 addition & 1 deletion bundlers/bun/src/bunFile.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { file } from 'bun'
export const file = require('bun').file
9 changes: 9 additions & 0 deletions bundlers/bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
"main": "dist/index.cjs",
"module": "src/index.js",
"types": "types/src/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./src/index.js",
"require": "./dist/index.cjs",
"types": "./types/src/index.d.ts",
"default": "./dist/index.cjs"
}
},
"files": ["dist", "types", "src"],
"scripts": {
"build": "nx run-many --targets=build:dist,build:types --projects=@evmts/bundler ",
Expand Down
3 changes: 1 addition & 2 deletions bundlers/bundler/src/unplugin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import packageJson from '../package.json'
import { bundler } from './bundler.js'
import { createCache } from './createCache.js'
import { loadConfigAsync } from '@evmts/config'
Expand Down Expand Up @@ -104,7 +103,7 @@ export const unpluginFn = (options = {}) => {
})
return code
},
...{ version: packageJson.version },
...{ version: '0.11.2' },
}
}

Expand Down
11 changes: 10 additions & 1 deletion bundlers/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
"type": "module",
"main": "dist/index.cjs",
"module": "src/index.js",
"types": "src/index.d.ts",
"types": "types/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./src/index.js",
"require": "./dist/index.cjs",
"types": "./types/index.d.ts",
"default": "./dist/index.cjs"
}
},
"files": ["dist", "types", "src"],
"scripts": {
"build": "nx run-many --targets=build:dist,build:types --projects=@evmts/@evmts/esbuild-plugin ",
Expand Down
2 changes: 1 addition & 1 deletion bundlers/rollup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Currently only `@evmts/core` is using this but this could easily be adapted or e

## Autocompletion and Typesafety

For typesafety and autocompletion in your editor add [@evmts/ts-plugin](../ts-plugin) to your tsconfig.json.
For typesafety and autocompletion in your editor add [@evmts/ts-plugin](https://github.com/evmts/evmts-monorepo/tree/main/ts-plugin) to your tsconfig.json.

**Custom Ts plugins are for developer experience only**

Expand Down
11 changes: 10 additions & 1 deletion bundlers/rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
"type": "module",
"main": "dist/index.cjs",
"module": "src/index.js",
"types": "types/index.d.ts",
"types": "types/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./src/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.cjs",
"types": "./types/index.d.ts"
}
},
"files": ["dist", "types", "src"],
"scripts": {
"//test": "vitest",
Expand Down
9 changes: 9 additions & 0 deletions bundlers/rspack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
"main": "dist/index.cjs",
"module": "src/index.js",
"types": "types/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./src/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.cjs",
"types": "./types/index.d.ts"
}
},
"files": ["dist", "types", "src"],
"scripts": {
"build": "nx run-many --targets=build:dist,build:types --projects=@evmts/rspack-plugin ",
Expand Down
2 changes: 1 addition & 1 deletion bundlers/vite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Currently only `@evmts/core` is using this but this could easily be adapted or e

## Autocompletion and Typesafety

For typesafety and autocompletion in your editor add [@evmts/ts-plugin](../ts-plugin) to your tsconfig.json.
For typesafety and autocompletion in your editor add [@evmts/ts-plugin](https://github.com/evmts/evmts-monorepo/tree/main/ts-plugin) to your tsconfig.json.

**Custom Ts plugins are for developer experience only**

Expand Down
9 changes: 9 additions & 0 deletions bundlers/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
"main": "dist/index.cjs",
"module": "src/index.js",
"types": "types/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./src/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.cjs",
"types": "./types/index.d.ts"
}
},
"files": ["dist", "types", "src"],
"scripts": {
"//test": "vitest",
Expand Down
9 changes: 9 additions & 0 deletions bundlers/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
"main": "dist/index.cjs",
"module": "src/index.js",
"types": "types/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./src/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.cjs",
"types": "./types/index.d.ts"
}
},
"files": ["dist", "src", "types"],
"scripts": {
"build": "nx run-many --targets=build:dist,build:types --projects=@evmts/webpack-plugin ",
Expand Down
9 changes: 9 additions & 0 deletions config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
"Will Cory <[email protected]>"
],
"type": "module",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./src/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.cjs",
"types": "./types/src/index.d.ts"
}
},
"main": "dist/index.cjs",
"module": "src/index.js",
"types": "types/src/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions config/src/loadConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { parse } from 'jsonc-parser'
import * as path from 'path'

/**
* Asyncronously loads an EVMts config from the given path
* @type {import("./types.js").LoadConfig}
*/
export const loadConfig = (configFilePath, logger = console) => {
Expand Down
9 changes: 9 additions & 0 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
"Will Cory <[email protected]>"
],
"type": "module",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.cjs",
"types": "./types/index.d.ts"
}
},
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "types/index.d.ts",
Expand Down
14 changes: 7 additions & 7 deletions docs/reference/bundler/modules/unplugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#### Defined in

[bundlers/bundler/src/unplugin.js:17](https://github.com/evmts/evmts-monorepo/blob/main/bundlers/bundler/src/unplugin.js#L17)
[bundlers/bundler/src/unplugin.js:16](https://github.com/evmts/evmts-monorepo/blob/main/bundlers/bundler/src/unplugin.js#L16)

## Functions

Expand All @@ -38,7 +38,7 @@
| Name | Type |
| :------ | :------ |
| `options?` | `Object` |
| `options.compiler?` | ``"foundry"`` \| ``"solc"`` |
| `options.compiler?` | ``"solc"`` \| ``"foundry"`` |

#### Returns

Expand All @@ -59,7 +59,7 @@ ___
| Name | Type |
| :------ | :------ |
| `options?` | `Object` |
| `options.compiler?` | ``"foundry"`` \| ``"solc"`` |
| `options.compiler?` | ``"solc"`` \| ``"foundry"`` |

#### Returns

Expand All @@ -80,7 +80,7 @@ ___
| Name | Type |
| :------ | :------ |
| `options?` | `Object` |
| `options.compiler?` | ``"foundry"`` \| ``"solc"`` |
| `options.compiler?` | ``"solc"`` \| ``"foundry"`` |

#### Returns

Expand All @@ -100,7 +100,7 @@ ___

| Name | Type |
| :------ | :------ |
| `options` | `undefined` \| { `compiler?`: ``"foundry"`` \| ``"solc"`` } |
| `options` | `undefined` \| { `compiler?`: ``"solc"`` \| ``"foundry"`` } |
| `meta` | `UnpluginContextMeta` |

#### Returns
Expand All @@ -122,7 +122,7 @@ ___
| Name | Type |
| :------ | :------ |
| `options?` | `Object` |
| `options.compiler?` | ``"foundry"`` \| ``"solc"`` |
| `options.compiler?` | ``"solc"`` \| ``"foundry"`` |

#### Returns

Expand All @@ -143,7 +143,7 @@ ___
| Name | Type |
| :------ | :------ |
| `options?` | `Object` |
| `options.compiler?` | ``"foundry"`` \| ``"solc"`` |
| `options.compiler?` | ``"solc"`` \| ``"foundry"`` |

#### Returns

Expand Down
2 changes: 2 additions & 0 deletions docs/reference/config/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ ___

**loadConfig**(`configFilePath`, `logger?`): `Required`<[`CompilerConfig`](/reference/config/modules.md#compilerconfig)\>

Asyncronously loads an EVMts config from the given path

#### Parameters

| Name | Type |
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/rollup-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Currently only `@evmts/core` is using this but this could easily be adapted or e

## Autocompletion and Typesafety

For typesafety and autocompletion in your editor add [@evmts/ts-plugin](../ts-plugin) to your tsconfig.json.
For typesafety and autocompletion in your editor add [@evmts/ts-plugin](https://github.com/evmts/evmts-monorepo/tree/main/ts-plugin) to your tsconfig.json.

**Custom Ts plugins are for developer experience only**

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/vite-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Currently only `@evmts/core` is using this but this could easily be adapted or e

## Autocompletion and Typesafety

For typesafety and autocompletion in your editor add [@evmts/ts-plugin](../ts-plugin) to your tsconfig.json.
For typesafety and autocompletion in your editor add [@evmts/ts-plugin](https://github.com/evmts/evmts-monorepo/tree/main/ts-plugin) to your tsconfig.json.

**Custom Ts plugins are for developer experience only**

Expand Down
9 changes: 9 additions & 0 deletions ethers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
"Will Cory <[email protected]>"
],
"type": "module",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./src/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.cjs",
"types": "./types/index.d.ts"
}
},
"main": "dist/index.cjs",
"module": "src/index.js",
"types": "types/index.d.ts",
Expand Down
70 changes: 18 additions & 52 deletions examples/esbuild/build.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,21 @@
import { esbuildPluginEvmts } from '@evmts/esbuild-plugin'
import { build, context } from 'esbuild'
import { start as startLiveServer } from 'live-server'
import { build } from 'esbuild'

const isDev = process.env.NODE_ENV === '"development"'
build({
entryPoints: ['src/index.js'],
outdir: 'dist',
minify: true,
sourcemap: false,
bundle: true,
define: {
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV ?? 'production',
),
},
plugins: [esbuildPluginEvmts()],
// logLevel: "silent",
}).catch((e) => {
console.error(e)
process.exit(1)
})

if (isDev) {
context({
entryPoints: ['src/index.js'],
outdir: 'dist',
minify: false,
sourcemap: true,
bundle: true,
define: {
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV ?? 'production',
),
},
plugins: [esbuildPluginEvmts()],
// logLevel: "silent",
})
.then((ctx) => {
return ctx.watch()
})
.catch((e) => {
console.error(e)
process.exit(1)
})

startLiveServer({
root: 'build',
open: false,
host: 'localhost',
port: 3000,
// logLevel: 0,
})
} else {
build({
entryPoints: ['src/index.js'],
outdir: 'dist',
minify: true,
sourcemap: false,
bundle: true,
define: {
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV ?? 'production',
),
},
plugins: [esbuildPluginEvmts()],
// logLevel: "silent",
}).catch((e) => {
console.error(e)
process.exit(1)
})
}
1 change: 1 addition & 0 deletions examples/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"contributors": [
"Will Cory <[email protected]>"
],
"type": "module",
"scripts": {
"build": "bun run build:dist",
"build:dist": "NODE_ENV=production bun ./build.js",
Expand Down
Loading

1 comment on commit eb3f734

@vercel
Copy link

@vercel vercel bot commented on eb3f734 Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

evmts-docs – ./

evmts-docs-git-main-evmts.vercel.app
evmts-docs-evmts.vercel.app
evmts.dev

Please sign in to comment.