Skip to content

Commit 7e17d6a

Browse files
Copilothotlong
andcommitted
Fix package.json exports and vite configs for plugin packages
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent e68576e commit 7e17d6a

7 files changed

Lines changed: 201 additions & 17 deletions

File tree

packages/plugin-charts/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"version": "0.1.0",
44
"type": "module",
55
"license": "MIT",
6-
"main": "dist/index.umd.js",
7-
"module": "dist/index.mjs",
6+
"main": "dist/index.umd.cjs",
7+
"module": "dist/index.js",
88
"types": "dist/index.d.ts",
99
"exports": {
1010
".": {
1111
"types": "./dist/index.d.ts",
12-
"import": "./dist/index.mjs",
13-
"require": "./dist/index.umd.js"
12+
"import": "./dist/index.js",
13+
"require": "./dist/index.umd.cjs"
1414
}
1515
},
1616
"scripts": {

packages/plugin-charts/vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ export default defineConfig({
2323
fileName: 'index',
2424
},
2525
rollupOptions: {
26-
external: ['react', 'react-dom'],
26+
external: ['react', 'react-dom', '@object-ui/components', '@object-ui/core', '@object-ui/react'],
2727
output: {
2828
globals: {
2929
react: 'React',
3030
'react-dom': 'ReactDOM',
31+
'@object-ui/components': 'ObjectUIComponents',
32+
'@object-ui/core': 'ObjectUICore',
33+
'@object-ui/react': 'ObjectUIReact',
3134
},
3235
},
3336
},

packages/plugin-editor/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"version": "0.1.0",
44
"type": "module",
55
"license": "MIT",
6-
"main": "dist/index.umd.js",
7-
"module": "dist/index.mjs",
6+
"main": "dist/index.umd.cjs",
7+
"module": "dist/index.js",
88
"types": "dist/index.d.ts",
99
"exports": {
1010
".": {
1111
"types": "./dist/index.d.ts",
12-
"import": "./dist/index.mjs",
13-
"require": "./dist/index.umd.js"
12+
"import": "./dist/index.js",
13+
"require": "./dist/index.umd.cjs"
1414
}
1515
},
1616
"scripts": {

packages/plugin-editor/vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ export default defineConfig({
2323
fileName: 'index',
2424
},
2525
rollupOptions: {
26-
external: ['react', 'react-dom'],
26+
external: ['react', 'react-dom', '@object-ui/components', '@object-ui/core', '@object-ui/react'],
2727
output: {
2828
globals: {
2929
react: 'React',
3030
'react-dom': 'ReactDOM',
31+
'@object-ui/components': 'ObjectUIComponents',
32+
'@object-ui/core': 'ObjectUICore',
33+
'@object-ui/react': 'ObjectUIReact',
3134
},
3235
},
3336
},

packages/types/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export type {
220220
// ============================================================================
221221
export type {
222222
CodeEditorSchema,
223-
ChartSchema,
223+
BarChartSchema,
224224
} from './plugin';
225225

226226
// ============================================================================
@@ -236,7 +236,7 @@ import type { DisclosureSchema } from './disclosure';
236236
import type { OverlaySchema } from './overlay';
237237
import type { NavigationSchema } from './navigation';
238238
import type { ComplexSchema } from './complex';
239-
import type { CodeEditorSchema, ChartSchema } from './plugin';
239+
import type { CodeEditorSchema, BarChartSchema } from './plugin';
240240

241241
/**
242242
* Union of all component schemas.
@@ -253,7 +253,7 @@ export type AnySchema =
253253
| NavigationSchema
254254
| ComplexSchema
255255
| CodeEditorSchema
256-
| ChartSchema;
256+
| BarChartSchema;
257257

258258
/**
259259
* Utility type to extract the schema type from a type string.

packages/types/src/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface CodeEditorSchema extends BaseSchema {
6969
*
7070
* @example
7171
* ```typescript
72-
* const chartSchema: ChartSchema = {
72+
* const chartSchema: BarChartSchema = {
7373
* type: 'chart-bar',
7474
* data: [
7575
* { name: 'Jan', value: 400 },
@@ -80,7 +80,7 @@ export interface CodeEditorSchema extends BaseSchema {
8080
* }
8181
* ```
8282
*/
83-
export interface ChartSchema extends BaseSchema {
83+
export interface BarChartSchema extends BaseSchema {
8484
type: 'chart-bar';
8585

8686
/**

0 commit comments

Comments
 (0)