Skip to content

Commit

Permalink
🐛 fix: Use correct version in bundler plugin (#402)
Browse files Browse the repository at this point in the history
## Description

Previously plugin defaulted to 0.0.0. Make it use package.json version

## 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 Jul 30, 2023
1 parent 8f11961 commit 4f532eb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-camels-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@evmts/bundler": patch
---

Fixed version of plugin defaulting to 0.0.0 instead of the package.json version
2 changes: 1 addition & 1 deletion bundlers/bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "types/index.d.ts",
"types": "types/src/index.d.ts",
"files": [
"dist",
"types",
Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion bundlers/bundler/src/unplugin.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as packageJson from '../package.json'
import { bundler } from './bundler'
import { unpluginFn } from './unplugin'
import { loadConfig } from '@evmts/config'
Expand Down Expand Up @@ -59,7 +60,7 @@ describe('unpluginFn', () => {
it('should create the plugin correctly', async () => {
const plugin = unpluginFn({}, {} as any)
expect(plugin.name).toEqual('@evmts/rollup-plugin')
expect((plugin as any).version).toEqual('0.0.0')
expect((plugin as any).version).toEqual(packageJson.version)

// call buildstart with mockPlugin as this
await plugin.buildStart?.call(mockPlugin)
Expand Down
3 changes: 2 additions & 1 deletion bundlers/bundler/src/unplugin.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as packageJson from '../package.json'
import { bundler } from './bundler'
import { type ResolvedConfig, loadConfig } from '@evmts/config'
import { existsSync } from 'fs'
Expand Down Expand Up @@ -43,7 +44,7 @@ export const unpluginFn: UnpluginFactory<

return {
name: '@evmts/rollup-plugin',
version: '0.0.0',
version: packageJson.version,
async buildStart() {
config = loadConfig(process.cwd())
moduleResolver = bundler(config, console)
Expand Down
11 changes: 4 additions & 7 deletions bundlers/bundler/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"extends": "@evmts/tsconfig/base.json",
"compilerOptions": {
"rootDir": "src",
"composite": true,
"outDir": "types",
"skipLibCheck": true
"skipLibCheck": true,
"resolveJsonModule": true
},
"include": [
"src",
"src/**/*.json"
]
}
"include": ["src", "src/**/*.json", "package.json"]
}

1 comment on commit 4f532eb

@vercel
Copy link

@vercel vercel bot commented on 4f532eb Jul 30, 2023

Choose a reason for hiding this comment

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

Deployment failed with the following error:

Resource is limited - try again in 8 hours (more than 100, code: "api-deployments-free-per-day").

Please sign in to comment.