编辑器Prosemirror
将所有 prosemiror 库组合到一个单一位置的软件包
使用量
import EditorProsemirror from '@atlaskit/editor-prosemirror';
可找到详细的文件和示例使用 这里。 。 。 .
代码
有一些代码可以帮助迁移. 但是,他们应该只运行一次 和手动在AFE repo.
- 乐观编辑 - prosemir-usage
此选项可用于将所有 prosemiror 库用到新软件包中 :
// before
import { DecorationSet } from 'prosemirror-view';
// after
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
如何运行
在下面运行此脚本
npx @atlaskit/codemod-cli --parser tsx --extensions ts,tsx --transform packages/editor/editor-prosemirror/codemods/optimistic-next-editor-prosemirror-usage/ packages
解决问题
如果您在下面得到这样的错误 :
import { Binding, NodePath, Scope } from '@babel/traverse';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at compileFunction (<anonymous>)
at Object.compileFunction (node:vm:360:18)
从中去除符号 bail 插件 babel.config.shared.js 文档.
不要承诺这个变化
// file: babel.config.shared.js
/** This override runs the tokens babel plugin on converted packages */
{
test: ['packages/'],
// exclude plugin when building itself, or the tokens package it depends on
exclude: [
'packages/monorepo-tooling',
'packages/design-system/tokens',
'packages/design-system/eslint-plugin',
'packages/design-system/storybook-addon',
'packages/platform/feature-flags-codemods',
],
plugins: [
// Comment out this block
//[
// './packages/design-system/tokens/babel-plugin',
// {
// shouldUseAutoFallback: true,
// },
//],
],
},
出版
版本突起和出版是通过变换器工作流程进行管理的.