Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Drop re-export of @anywidget/vite from main package #398

Merged
merged 4 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/mean-feet-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"anywidget": minor
---

Remove re-export of `@anywidget/vite` from main package

Breaking change. If using our Vite plugin, please make sure to install
`@anywidget/vite` (rather than importing from `anywidget` main package). This
change allows us to version the Vite plugin and anywidget's core separately.

```diff
// vite.config.mjs
import { defineConfig } from "vite";
-- import anywidget from "anywidget/vite";
++ import anywidget from "@anywidget/vite";
```

If you are already using `@anywidget/vite`, there are no changes necessary.
10 changes: 0 additions & 10 deletions packages/anywidget/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ await esbuild.build({
outfile: path.join(dist, "index.js"),
});

// re-export all exports from @anywidget/vite
await fs.writeFile(
path.join(dist, "vite.mjs"),
`export * from "@anywidget/vite";`,
);
await fs.writeFile(
path.join(dist, "vite.cjs"),
`module.exports = require("@anywidget/vite");`,
);

// re-export all exports from @anywidget/types
await fs.writeFile(
path.join(dist, "types.d.ts"),
Expand Down
4 changes: 0 additions & 4 deletions packages/anywidget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
],
"exports": {
".": "./dist/index.js",
"./vite": {
"import": "./dist/vite.mjs",
"require": "./dist/vite.cjs"
},
"./types": {
"types": "./dist/types.d.ts",
"import": "./dist/types.mjs",
Expand Down