Skip to content

Commit

Permalink
fix(core,react,vue): misnamed entry points generated by vite (#1708)
Browse files Browse the repository at this point in the history
* fix(react,vue): output to index.mjs - not index.mjs.js

* chore(app): bump publint, @nrwl/devkit, @typescript*, vite-plugin-dts, classnames, @vitejs/plugin-vue, vue-tsc

* fix(1687): bad hyperlink in MDXX

* fix(core): umd bundle name

* fix(core): vite.umd.config.ts typing issue

* fix(typescript): get rid of TypeScript error on tsconfig.json at root-level of monorepo

* fix(typescript): add excludes to top-level tsconfigs

* fix(typescript): extra comma
  • Loading branch information
nstuyvesant committed Dec 27, 2023
1 parent 3e24b92 commit 882bf01
Show file tree
Hide file tree
Showing 13 changed files with 296 additions and 238 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"packageManager": "yarn@4.0.2",
"prettier": "./prettier.config.mjs",
"devDependencies": {
"@nrwl/devkit": "^17.2.6",
"@nrwl/devkit": "^17.2.7",
"@storybook/addon-essentials": "~7.6.6",
"@storybook/addon-interactions": "~7.6.6",
"@storybook/addon-links": "~7.6.6",
Expand All @@ -40,15 +40,15 @@
"@storybook/theming": "~7.6.6",
"@storybook/vue3": "~7.6.6",
"@storybook/vue3-vite": "~7.6.6",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.1",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"eslint-plugin-storybook": "^0.6.15",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"typedoc": "^0.25.4",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite-plugin-dts": "^3.6.4",
"vite-plugin-dts": "^3.7.0",
"vitest": "^1.1.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/stories/tutorials/0-api.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ barChart.services.events.addEventListener("bar-mouseover", e => console.log(e.de
## API Reference
Our full API reference docs can be found [here](https://carbon-design-system.github.io/carbon-charts/documentation/).

To get an idea of all the possible configurations in every chart type, see [here](https://carbon-design-system.github.io/carbon-charts/documentation/modules/_interfaces_charts_.html).
To get an idea of all the possible configurations in every chart type, see [here](https://charts.carbondesignsystem.com/documentation/modules/interfaces.html).
2 changes: 1 addition & 1 deletion packages/core/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default defineConfig({
rollupOptions: {
external: ['d3', 'd3-cloud', 'd3-sankey'], // latter two not included in d3
output: {
entryFileNames: '[name].mjs', // force mjs extension for ESM build
entryFileNames: '[name].mjs',
chunkFileNames: '[name]-[hash].mjs',
}
}
Expand Down
7 changes: 5 additions & 2 deletions packages/core/vite.umd.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { fileURLToPath } from 'url'
import { defineConfig } from 'vite'
import { defineConfig, type Plugin } from 'vite'
import replace from '@rollup/plugin-replace'

export default defineConfig({
build: {
rollupOptions: {
output: {
entryFileNames: 'bundle.umd.js'
},
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
})
}) as Plugin
]
},
outDir: 'dist/umd',
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.2.1",
"classnames": "^2.3.2",
"classnames": "^2.4.0",
"concurrently": "^8.2.2",
"d3": "^7.8.5",
"d3-cloud": "^1.2.7",
Expand All @@ -62,7 +62,7 @@
"storybook": "~7.6.6",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite-plugin-dts": "^3.6.4"
"vite-plugin-dts": "^3.7.0"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 5 additions & 3 deletions packages/react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export default defineConfig({
chunkSizeWarningLimit: 600,
lib: {
entry: 'src/index.ts',
formats: ['es'],
fileName: 'index.mjs'
formats: ['es']
},
rollupOptions: {
external: ['react', 'react-dom']
external: ['react', 'react-dom'],
output: {
entryFileNames: '[name].mjs'
}
}
},
plugins: [react(), dts()]
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"d3-cloud": "^1.2.7",
"d3-sankey": "^0.12.3",
"eslint": "^8.56.0",
"publint": "^0.2.6",
"publint": "^0.2.7",
"storybook": "~7.6.6",
"svelte": "^4.2.8",
"svelte-check": "^3.6.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
"devDependencies": {
"@stackblitz/sdk": "^1.9.0",
"@types/d3": "^7.4.3",
"@vitejs/plugin-vue": "^4.5.2",
"@vitejs/plugin-vue": "^5.0.0",
"concurrently": "^8.2.2",
"d3": "^7.8.5",
"d3-cloud": "^1.2.7",
"d3-sankey": "^0.12.3",
"storybook": "~7.6.6",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite-plugin-dts": "^3.6.4",
"vue-tsc": "^1.8.26"
"vite-plugin-dts": "^3.7.0",
"vue-tsc": "^1.8.27"
},
"publishConfig": {
"access": "public",
Expand Down
8 changes: 5 additions & 3 deletions packages/vue/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ export default defineConfig({
chunkSizeWarningLimit: 600,
lib: {
entry: 'src/index.ts',
formats: ['es'],
fileName: 'index.mjs'
formats: ['es']
},
rollupOptions: {
external: ['vue']
external: ['vue'],
output: {
entryFileNames: '[name].mjs'
}
}
},
resolve: {
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Common tsconfig for IDEs
// Common tsconfig for IDEs except for angular and svelte
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
Expand All @@ -21,5 +21,6 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true
}
},
"exclude": ["packages/angular", "packages/svelte"]
}
5 changes: 3 additions & 2 deletions tsconfig.vite.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Common vite tsconfig for React, Svelte, and Vue
// Common vite tsconfig for all packages except angular
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "bundler",
"skipLibCheck": true
}
},
"exclude": ["packages/angular"]
}

0 comments on commit 882bf01

Please sign in to comment.