Skip to content

Commit 6013401

Browse files
committed
release: v2.3.0-beta2
1 parent 665b28d commit 6013401

File tree

13 files changed

+47
-34
lines changed

13 files changed

+47
-34
lines changed

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ auto-imports.d.ts
22
node_modules
33
dist
44
components.d.ts
5-
./scripts/
5+
/scripts
6+
/types
7+
.gitignore

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module.exports = {
3737
"no-underscore-dangle": "off",
3838
"@typescript-eslint/ban-ts-comment": "off",
3939
"vue/multi-word-component-names": "off",
40+
"@typescript-eslint/no-explicit-any": ["off"],
4041
},
4142
overrides: [
4243
{

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# [2.3.0-beta2](https://github.com/RennCheung/codemirror-editor-vue3/compare/v2.2.1...v2.3.0-beta2) (2023-03-07)
2+
3+
4+
### Bug Fixes
5+
6+
* Repair the packaging issues lead to cannot be highlighted ([a355314](https://github.com/RennCheung/codemirror-editor-vue3/commit/a3553148a29372ff5eae6396de978a295b0b278e))
7+
8+
9+
110
## [2.2.1](https://github.com/RennCheung/codemirror-editor-vue3/compare/v2.2.0...v2.2.1) (2023-03-03)
211

312

docs/views/demo/home.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
<script lang="ts" setup>
99
import { ref } from "vue";
10-
import Codemirror from "../../../packages/index";
1110
import type { EditorConfiguration } from "codemirror";
11+
import Codemirror from "../../../packages/index";
1212
1313
// language
1414
import "codemirror/mode/javascript/javascript.js";

docs/views/demo/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ for (; i < 9; i++) {
3232
`);
3333
3434
const onChange = (val: string, cm: Editor) => {
35-
console.log(val);
35+
console.log(val, cm);
3636
};
3737
3838
const cmOptions = {

docs/views/demo/log/fclog.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { ref, defineComponent } from "vue";
77
import Codemirror, {
88
createLinkMark,
9-
createLogMark,
109
createLog,
1110
createTitle,
1211
} from "../../../../packages/index";

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"name": "codemirror-editor-vue3",
33
"description": "CodeMirror component for Vue3",
4-
"version": "2.3.0-beta1",
4+
"version": "2.3.0-beta2",
55
"license": "MIT",
6-
"files": ["dist"],
6+
"files": [
7+
"dist"
8+
],
79
"type": "module",
810
"types": "./dist/packages/index.d.ts",
911
"main": "./dist/codemirror-editor-vue3.umd.cjs",
@@ -43,23 +45,24 @@
4345
"dev": "vite",
4446
"build": "vite build",
4547
"build:types": "tsc --emitDeclarationOnly vite build",
46-
"publish-pkg": "vite build && git push && git push --tags && npm publish && npm run deploy-docs",
47-
"publish-beta": "vite build && npm publish --tag=beta",
48+
"publish-pkg": "npm run release && vite build && git push && git push --tags && npm publish && npm run deploy-docs",
49+
"publish-beta": "npm run release && vite build && npm publish --tag=beta",
4850
"docs-dev": "vitepress dev docs --open",
4951
"docs-build": "vitepress build docs",
5052
"docs-serve": "vitepress serve docs",
5153
"deploy-docs": "bash scripts/deploy-docs.sh",
5254
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
53-
"release": "node scripts/release.js",
55+
"release": "node scripts/release.cjs",
56+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
5457
"tsc": "tsc"
5558
},
5659
"dependencies": {
5760
"codemirror": "^5.64.0",
5861
"diff-match-patch": "^1.0.5"
5962
},
6063
"peerDependencies": {
61-
"vue": "3.x",
62-
"codemirror": "5.x",
64+
"vue": "^3.x",
65+
"codemirror": "^5.x",
6366
"diff-match-patch": "^1.0.5"
6467
},
6568
"devDependencies": {

packages/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const CodeMirror = window.CodeMirror || _CodeMirror;
4141
const GlobalCmComponent = install;
4242
const InstallCodemirro = install;
4343

44-
4544
export * from "./src/components/presetMode/log/utils";
4645

4746
export { CodeMirror, GlobalCmComponent, InstallCodemirro, VueCodemirror };

packages/src/components/index.vue

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
</div>
3030
</template>
3131

32-
<script lang="ts"></script>
3332
<script lang="ts" setup>
3433
import type { Ref, PropType, Component } from "vue";
3534
import type { Editor, EditorConfiguration } from "codemirror";
@@ -53,7 +52,7 @@ import { DEFAULT_OPTIONS, emitOptions } from "../config/index";
5352
5453
if (typeof Object.assign !== "function") {
5554
Object.defineProperty(Object, "assign", {
56-
value(target: any, varArgs: any) {
55+
value(target: any) {
5756
if (target == null) {
5857
throw new TypeError("Cannot convert undefined or null to object");
5958
}
@@ -237,19 +236,13 @@ watch(
237236
}
238237
);
239238
240-
watch(
241-
() => props.placeholder,
242-
(val) => {
243-
realCminstance.value?.setOption("placeholder", val);
244-
}
245-
);
246-
watch(
247-
() => props.merge,
248-
(val) => {
249-
handlePresetModeName();
250-
},
251-
{ immediate: true }
252-
);
239+
// watch(
240+
// () => props.placeholder,
241+
// (val) => {
242+
// realCminstance.value?.setOption("placeholder", val);
243+
// }
244+
// );
245+
watch(() => props.merge, handlePresetModeName, { immediate: true });
253246
254247
onBeforeUnmount(() => {
255248
destroy();

playground/demo/merge.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
:options="cmOptions"
55
:height="300"
66
class="cm-component"
7+
original-style
78
@change="onChange"
89
@focus="onFocus"
910
@ready="onReady"
10-
original-style
1111
/>
1212
</template>
1313
<script lang="ts">

playground/demo/placeholder.vue

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
border
66
:height="200"
77
:placeholder="cmPlaceholder"
8+
@ready="onReady"
89
>
910
</Codemirror>
1011
{{ code }}
1112
</template>
1213
<script lang="ts">
1314
import { ref } from "vue";
14-
import type { EditorConfiguration } from "codemirror";
15+
import type { Editor, EditorConfiguration } from "codemirror";
1516
import Codemirror from "codemirror-editor-vue3";
1617
1718
// language
@@ -24,7 +25,7 @@ export default defineComponent({
2425
Codemirror,
2526
},
2627
setup() {
27-
const code = ref("123");
28+
const code = ref("");
2829
const cmPlaceholder = ref("test placeholder");
2930
3031
const cmOptions: EditorConfiguration = {
@@ -33,17 +34,22 @@ export default defineComponent({
3334
3435
cmPlaceholder.value += "1 ";
3536
36-
// const timer = setInterval(() => {
37-
// cmPlaceholder.value += "1 ";
38-
// console.log(cmPlaceholder.value);
39-
// }, 2000);
37+
setInterval(() => {
38+
cmPlaceholder.value += "1 ";
39+
console.log(cmPlaceholder.value);
40+
}, 2000);
4041
// onUnmounted(() => {
4142
// clearInterval(timer);
4243
// });
44+
4345
return {
4446
code,
4547
cmOptions,
4648
cmPlaceholder,
49+
onReady(cm: Editor) {
50+
// console.log(" cm", cm.pl);
51+
console.log(cm.getValue());
52+
},
4753
};
4854
},
4955
});
File renamed without changes.

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default defineConfig({
3636
},
3737
rollupOptions: {
3838
output: {
39+
exports: "named",
3940
name: "codemirror-editor-vue3", // 仓库或组件的名字
4041
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
4142
globals: {

0 commit comments

Comments
 (0)