Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
elbakerino committed Oct 3, 2024
2 parents 1927675 + 39a013e commit 1eb7e00
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
7 changes: 4 additions & 3 deletions packages/kit-codemirror/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui-schema/kit-codemirror",
"version": "0.1.0",
"version": "0.1.1",
"description": "CodeMirror v6 as React Component, with hooks and stuff - but only the necessities.",
"homepage": "https://ui-schema.bemit.codes/docs/kit-codemirror/kit-codemirror",
"author": {
Expand Down Expand Up @@ -41,8 +41,9 @@
"react": "^17.0 || ^18.0",
"react-dom": "^17.0 || ^18.0"
},
"main": "index.js",
"module": "esm/index.js",
"main": "./index.js",
"module": "./esm/index.js",
"types": "./index.d.ts",
"scripts": {
"dtsgen": "tsc -d --emitDeclarationOnly --pretty && merge-dirs build/dts build && rm -rf build/dts && rm -rf build/**/*.test.*"
},
Expand Down
7 changes: 4 additions & 3 deletions packages/material-code/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui-schema/material-code",
"version": "0.4.3",
"version": "0.4.4",
"description": "Code editor widgets using CodeMirror, with Material-UI styling for UI-Schema",
"homepage": "https://ui-schema.bemit.codes/docs/material-code/material-code",
"author": {
Expand Down Expand Up @@ -34,8 +34,9 @@
"bugs": {
"url": "https://github.com/ui-schema/react-codemirror/issues"
},
"main": "index.js",
"module": "esm/index.js",
"main": "./index.js",
"module": "./esm/index.js",
"types": "./index.d.ts",
"scripts": {
"dtsgen": "tsc -d --emitDeclarationOnly --pretty && merge-dirs build/dts/material-code/src build && rm -rf build/dts && rm -rf build/**/*.test.* build/**/*.mock.*",
"__release": "cp package.json build/ && cp package-lock.json build/ && cp README.md build/ && npm publish build"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { StoreKeyType, Trans, TransTitle, WidgetProps, WithScalarValue } from '@ui-schema/ui-schema'
import { CodeMirrorOnChange } from '@ui-schema/kit-codemirror/useCodeMirror'
import { WidgetCodeProps } from '@ui-schema/material-code'
import { WidgetCodeProps } from '@ui-schema/material-code/WidgetCode'
import MenuItem from '@mui/material/MenuItem'
import Select, { SelectChangeEvent } from '@mui/material/Select'
import { List } from 'immutable'
Expand Down
22 changes: 20 additions & 2 deletions packerConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
const path = require('path');
const {packer, webpack} = require('lerna-packer');
const {makeModulePackageJson, copyRootPackageJson, transformForEsModule} = require('lerna-packer/packer/modulePackages');
const {makeModulePackageJson, copyRootPackageJson} = require('lerna-packer/packer/modulePackages');

/**
* based on `transformForEsModule` but with the legacy syntax, for CJS and non strict ESM
*/
const transformForCommon = ({level, root, dir}) => {
return {
sideEffects: false,
module:
path.join(
'../'.repeat(level + 1),
'esm',
dir.slice(root.length + 1).replace(/\\/g, '/').split(/\//g).join('/'),
'index.js',
).replace(/\\/g, '/'),
main: './index.js',
types: './index.d.ts',
}
}

const legacyBabelTargets = [
{
Expand Down Expand Up @@ -65,7 +83,7 @@ packer({
}, __dirname, {
afterEsModules: (packages, pathBuild) => {
return Promise.all([
makeModulePackageJson(transformForEsModule)(packages, pathBuild),
makeModulePackageJson(transformForCommon)(packages, pathBuild),
copyRootPackageJson()(packages, pathBuild),
])
},
Expand Down

0 comments on commit 1eb7e00

Please sign in to comment.