Skip to content

Commit 1eb7e00

Browse files
committed
Merge branch 'develop'
2 parents 1927675 + 39a013e commit 1eb7e00

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
lines changed

packages/kit-codemirror/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ui-schema/kit-codemirror",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "CodeMirror v6 as React Component, with hooks and stuff - but only the necessities.",
55
"homepage": "https://ui-schema.bemit.codes/docs/kit-codemirror/kit-codemirror",
66
"author": {
@@ -41,8 +41,9 @@
4141
"react": "^17.0 || ^18.0",
4242
"react-dom": "^17.0 || ^18.0"
4343
},
44-
"main": "index.js",
45-
"module": "esm/index.js",
44+
"main": "./index.js",
45+
"module": "./esm/index.js",
46+
"types": "./index.d.ts",
4647
"scripts": {
4748
"dtsgen": "tsc -d --emitDeclarationOnly --pretty && merge-dirs build/dts build && rm -rf build/dts && rm -rf build/**/*.test.*"
4849
},

packages/material-code/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ui-schema/material-code",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"description": "Code editor widgets using CodeMirror, with Material-UI styling for UI-Schema",
55
"homepage": "https://ui-schema.bemit.codes/docs/material-code/material-code",
66
"author": {
@@ -34,8 +34,9 @@
3434
"bugs": {
3535
"url": "https://github.com/ui-schema/react-codemirror/issues"
3636
},
37-
"main": "index.js",
38-
"module": "esm/index.js",
37+
"main": "./index.js",
38+
"module": "./esm/index.js",
39+
"types": "./index.d.ts",
3940
"scripts": {
4041
"dtsgen": "tsc -d --emitDeclarationOnly --pretty && merge-dirs build/dts/material-code/src build && rm -rf build/dts && rm -rf build/**/*.test.* build/**/*.mock.*",
4142
"__release": "cp package.json build/ && cp package-lock.json build/ && cp README.md build/ && npm publish build"

packages/material-code/src/WidgetCodeSelectable/WidgetCodeSelectable.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { StoreKeyType, Trans, TransTitle, WidgetProps, WithScalarValue } from '@ui-schema/ui-schema'
33
import { CodeMirrorOnChange } from '@ui-schema/kit-codemirror/useCodeMirror'
4-
import { WidgetCodeProps } from '@ui-schema/material-code'
4+
import { WidgetCodeProps } from '@ui-schema/material-code/WidgetCode'
55
import MenuItem from '@mui/material/MenuItem'
66
import Select, { SelectChangeEvent } from '@mui/material/Select'
77
import { List } from 'immutable'

packerConfig.js

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
const path = require('path');
22
const {packer, webpack} = require('lerna-packer');
3-
const {makeModulePackageJson, copyRootPackageJson, transformForEsModule} = require('lerna-packer/packer/modulePackages');
3+
const {makeModulePackageJson, copyRootPackageJson} = require('lerna-packer/packer/modulePackages');
4+
5+
/**
6+
* based on `transformForEsModule` but with the legacy syntax, for CJS and non strict ESM
7+
*/
8+
const transformForCommon = ({level, root, dir}) => {
9+
return {
10+
sideEffects: false,
11+
module:
12+
path.join(
13+
'../'.repeat(level + 1),
14+
'esm',
15+
dir.slice(root.length + 1).replace(/\\/g, '/').split(/\//g).join('/'),
16+
'index.js',
17+
).replace(/\\/g, '/'),
18+
main: './index.js',
19+
types: './index.d.ts',
20+
}
21+
}
422

523
const legacyBabelTargets = [
624
{
@@ -65,7 +83,7 @@ packer({
6583
}, __dirname, {
6684
afterEsModules: (packages, pathBuild) => {
6785
return Promise.all([
68-
makeModulePackageJson(transformForEsModule)(packages, pathBuild),
86+
makeModulePackageJson(transformForCommon)(packages, pathBuild),
6987
copyRootPackageJson()(packages, pathBuild),
7088
])
7189
},

0 commit comments

Comments
 (0)