Skip to content

Commit

Permalink
Fixed emit typing when dispatch CodeMirror.ts
Browse files Browse the repository at this point in the history
Update dependencies.
  • Loading branch information
logue committed Jan 19, 2024
1 parent 83fdb97 commit 92044b6
Show file tree
Hide file tree
Showing 9 changed files with 332 additions and 457 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ dist-ssr
*.local
/src/Meta.ts
docs/
stats.html
stats.html
*.tsbuildinfo
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2023 Masashi Yoshikawa
Copyright (c) 2022-2024 Masashi Yoshikawa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "vue-codemirror6",
"version": "1.2.0",
"version": "1.2.2",
"license": "MIT",
"description": "CodeMirror6 Component for vue2 and vue3.",
"keywords": [
Expand Down Expand Up @@ -60,14 +60,14 @@
"scripts": {
"dev": "vite",
"clean": "rimraf node_modules/.vite",
"type-check": "tsc --noEmit --composite false",
"build": "run-p type-check \"build-only {@}\" --",
"build:analyze": "vite build --mode=analyze",
"build:clean": "rimraf dist docs",
"build:docs": "vite build --mode=docs",
"build-only": "vite build",
"lint": "eslint . --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint && prettier . --write",
"preview": "vite preview --mode=docs",
"build-only": "vite build",
"type-check": "vue-tsc --build --force",
"prepare": "husky install",
"version": "auto-changelog -p && git add CHANGELOG.md"
},
Expand All @@ -76,21 +76,21 @@
"vue-demi": "latest"
},
"peerDependencies": {
"vue": "^2.7.14 || ^3.2"
"vue": "^2.7.14 || ^3.4"
},
"devDependencies": {
"@codemirror/lang-javascript": "^6.2.1",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-markdown": "^6.2.3",
"@codemirror/lang-vue": "^0.1.2",
"@tsconfig/node-lts": "^20.1.0",
"@types/node": "^20.10.5",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@vitejs/plugin-vue": "^4.5.2",
"@vue/compiler-sfc": "^3.3.13",
"@vue/eslint-config-prettier": "^8.0.0",
"@codemirror/lang-markdown": "^6.2.4",
"@codemirror/lang-vue": "0.1.2",
"@tsconfig/node-lts": "^20.1.1",
"@types/node": "^20.11.5",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@vitejs/plugin-vue": "^5.0.3",
"@vue/compiler-sfc": "^3.4.15",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/tsconfig": "^0.5.1",
"@vueuse/core": "^10.7.0",
"@vueuse/core": "^10.7.2",
"bootstrap": "^5.3.2",
"eslint": "^8.56.0",
"eslint-config-standard-with-typescript": "^43.0.0",
Expand All @@ -99,28 +99,28 @@
"eslint-linter-browserify": "^8.56.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.5.0",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-tsdoc": "^0.2.17",
"eslint-plugin-vue": "latest",
"eslint-plugin-vuejs-accessibility": "^2.2.0",
"eslint-plugin-vuejs-accessibility": "^2.2.1",
"eslint-plugin-yaml": "^0.5.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.1",
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
"rollup-plugin-visualizer": "^5.11.0",
"sass": "^1.69.5",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.70.0",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite": "^5.0.12",
"vite-plugin-banner": "^0.7.1",
"vite-plugin-checker": "^0.6.2",
"vite-plugin-dts": "^3.6.4",
"vue": "^3.3.13",
"vue-eslint-parser": "^9.3.2",
"vue-markdown-wasm": "^0.3.14",
"vue-tsc": "^1.8.25"
"vite-plugin-dts": "^3.7.1",
"vue": "^3.4.15",
"vue-eslint-parser": "^9.4.0",
"vue-markdown-wasm": "^0.4.0",
"vue-tsc": "^1.8.27"
},
"husky": {
"hooks": {
Expand Down
3 changes: 2 additions & 1 deletion src/components/CodeMirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ export default defineComponent({

// console.log(view.state.doc.toString(), tr);
// state.toString() is not defined, so use toJSON and toText function to convert string.
context.emit('update:modelValue', (tr.state.doc as any).toString());
context.emit('update:modelValue', tr.state.doc);
// Emit EditorState
context.emit('change', tr.state);
},
Expand Down Expand Up @@ -656,6 +656,7 @@ export default defineComponent({
const extendSelectionsBy = (f: any): void =>
view.value.dispatch({
selection: EditorSelection.create(
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
selection.value.ranges.map((r: SelectionRange) => r.extend(f(r)))
),
});
Expand Down
15 changes: 3 additions & 12 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": [
"env.d.ts",
"src/**/*",
"src/**/*.vue",
"src-docs/**/*",
"src-docs/**/*.vue"
],
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"declaration": true,
"noEmit": false,
"emitDeclarationOnly": true,
"noEmit": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"vue-codemirror6": ["./src/index.ts"]
"@/*": ["./src/*"]
}
}
}
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
{ "path": "./tsconfig.node.json" },
],
}
5 changes: 4 additions & 1 deletion tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
"vite.config.*",
"vitest.config.*",
"cypress.config.*",
"nightwatch.conf.*",
"playwright.config.*",
"package.json"
],
"compilerOptions": {
"composite": true,
"resolveJsonModule": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"noEmit": true,
"types": ["node"]
}
}
3 changes: 1 addition & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ export default defineConfig(({ mode, command }): UserConfig => {
// https://github.com/fi3ework/vite-plugin-checker
checker({
typescript: true,
vueTsc: true,
// vueTsc: true,
eslint: { lintCommand: 'eslint' },
}),
// vite-plugin-banner
// https://github.com/chengpeiquan/vite-plugin-banner
// @ts-expect-error
banner(`/**
* ${pkg.name}
*
Expand Down
Loading

0 comments on commit 92044b6

Please sign in to comment.