nuxt-codemirror 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.d.mts +4 -1
- package/dist/module.d.ts +4 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +10 -8
- package/dist/runtime/getDefaultExtensions.d.ts +0 -1
- package/dist/runtime/getDefaultExtensions.js +2 -12
- package/dist/types.d.mts +1 -7
- package/dist/types.d.ts +1 -7
- package/package.json +17 -5
package/dist/module.d.mts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
|
|
3
|
+
interface ModuleOptions {
|
|
4
|
+
devtools?: boolean;
|
|
5
|
+
}
|
|
3
6
|
declare const _default: _nuxt_schema.NuxtModule<_nuxt_schema.ModuleOptions, _nuxt_schema.ModuleOptions, false>;
|
|
4
7
|
|
|
5
|
-
export { _default as default };
|
|
8
|
+
export { type ModuleOptions, _default as default };
|
package/dist/module.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
|
|
3
|
+
interface ModuleOptions {
|
|
4
|
+
devtools?: boolean;
|
|
5
|
+
}
|
|
3
6
|
declare const _default: _nuxt_schema.NuxtModule<_nuxt_schema.ModuleOptions, _nuxt_schema.ModuleOptions, false>;
|
|
4
7
|
|
|
5
|
-
export { _default as default };
|
|
8
|
+
export { type ModuleOptions, _default as default };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -5,28 +5,30 @@ const module = defineNuxtModule({
|
|
|
5
5
|
name: "nuxt-codemirror",
|
|
6
6
|
configKey: "nuxtCodemirror"
|
|
7
7
|
},
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
defaults: {
|
|
9
|
+
// devtools: false,
|
|
10
|
+
},
|
|
10
11
|
setup(_options, _nuxt) {
|
|
11
|
-
const
|
|
12
|
+
const resolver = createResolver(import.meta.url);
|
|
13
|
+
_nuxt.options.alias["#codemirror"] = resolver.resolve("./runtime");
|
|
12
14
|
addComponent({
|
|
13
15
|
name: "NuxtCodeMirror",
|
|
14
|
-
filePath: resolve("./runtime/components/NuxtCodeMirror.vue")
|
|
16
|
+
filePath: resolver.resolve("./runtime/components/NuxtCodeMirror.vue")
|
|
15
17
|
});
|
|
16
18
|
addImports({
|
|
17
19
|
name: "useNuxtCodeMirror",
|
|
18
20
|
as: "useNuxtCodeMirror",
|
|
19
|
-
from: resolve("./runtime/composables/useNuxtCodeMirror.ts")
|
|
21
|
+
from: resolver.resolve("./runtime/composables/useNuxtCodeMirror.ts")
|
|
20
22
|
});
|
|
21
23
|
addTypeTemplate({
|
|
22
24
|
filename: "nuxt-codemirror.d.ts",
|
|
23
|
-
src: resolve("./runtime/types/nuxt-codemirror.d.ts")
|
|
25
|
+
src: resolver.resolve("./runtime/types/nuxt-codemirror.d.ts")
|
|
24
26
|
});
|
|
25
27
|
extendViteConfig((config) => {
|
|
26
28
|
config.resolve = config.resolve || {};
|
|
27
29
|
config.resolve.alias = config.resolve.alias || {};
|
|
28
|
-
config.resolve.alias["@codemirror/state"] = resolve(_nuxt.options.rootDir, "node_modules/@codemirror/state");
|
|
29
|
-
config.resolve.alias["@codemirror/view"] = resolve(_nuxt.options.rootDir, "node_modules/@codemirror/view");
|
|
30
|
+
config.resolve.alias["@codemirror/state"] = resolver.resolve(_nuxt.options.rootDir, "node_modules/@codemirror/state");
|
|
31
|
+
config.resolve.alias["@codemirror/view"] = resolver.resolve(_nuxt.options.rootDir, "node_modules/@codemirror/view");
|
|
30
32
|
});
|
|
31
33
|
}
|
|
32
34
|
});
|
|
@@ -29,16 +29,6 @@ import { lintKeymap } from "@codemirror/lint";
|
|
|
29
29
|
import { defaultLightThemeOption } from "./theme/light.js";
|
|
30
30
|
export * from "@codemirror/theme-one-dark";
|
|
31
31
|
export * from "./theme/light.js";
|
|
32
|
-
export const minimalSetup = (() => [
|
|
33
|
-
highlightSpecialChars(),
|
|
34
|
-
history(),
|
|
35
|
-
drawSelection(),
|
|
36
|
-
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
|
|
37
|
-
keymap.of([
|
|
38
|
-
...defaultKeymap,
|
|
39
|
-
...historyKeymap
|
|
40
|
-
])
|
|
41
|
-
])();
|
|
42
32
|
export const basicSetup = (options = {}) => {
|
|
43
33
|
let keymaps = [];
|
|
44
34
|
if (options.closeBracketsKeymap !== false) {
|
|
@@ -100,9 +90,9 @@ export const getDefaultExtensions = (optios = {}) => {
|
|
|
100
90
|
}
|
|
101
91
|
if (defaultBasicSetup) {
|
|
102
92
|
if (typeof defaultBasicSetup === "boolean") {
|
|
103
|
-
getExtensions.push(basicSetup());
|
|
93
|
+
getExtensions.push(basicSetup({ highlightSpecialChars: true, lineNumbers: true, history: true, drawSelection: true, syntaxHighlighting: true, defaultKeymap: true, historyKeymap: true }));
|
|
104
94
|
} else {
|
|
105
|
-
getExtensions.unshift(
|
|
95
|
+
getExtensions.unshift(basicSetup(defaultBasicSetup));
|
|
106
96
|
}
|
|
107
97
|
}
|
|
108
98
|
if (placeholderStr) {
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { default as Module } from './module.js'
|
|
4
|
-
|
|
5
|
-
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
-
|
|
7
|
-
export { default } from './module.js'
|
|
1
|
+
export { type ModuleOptions, default } from './module.js'
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { default as Module } from './module'
|
|
4
|
-
|
|
5
|
-
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
-
|
|
7
|
-
export { default } from './module'
|
|
1
|
+
export { type ModuleOptions, default } from './module'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-codemirror",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "Nuxt codemirror module",
|
|
5
5
|
"repository": "https://github.com/ThimoDEV/nuxt-codemirror",
|
|
6
6
|
"homepage": "https://github.com/ThimoDEV/nuxt-codemirror#readme",
|
|
@@ -28,14 +28,22 @@
|
|
|
28
28
|
"dev:build": "nuxi build playground",
|
|
29
29
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
30
30
|
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
31
|
+
"client:build": "nuxt prepare client && nuxi generate client",
|
|
32
|
+
"client:dev": "nuxi dev client --port 3300",
|
|
33
|
+
"docs": "nuxt dev docs",
|
|
34
|
+
"docs:build": "nuxt build docs",
|
|
35
|
+
"docs:prepare": "nuxt prepare docs",
|
|
36
|
+
"docs:dev": "nuxt dev docs",
|
|
37
|
+
"docs:preview": "nuxt preview docs",
|
|
38
|
+
"docs:start": "node .output/server/index.mjs",
|
|
31
39
|
"lint": "eslint .",
|
|
40
|
+
"lint:fix": "eslint --fix .",
|
|
32
41
|
"test": "vitest run",
|
|
33
42
|
"test:watch": "vitest watch",
|
|
34
43
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
35
44
|
},
|
|
36
45
|
"dependencies": {
|
|
37
46
|
"@babel/runtime": "^7.26.10",
|
|
38
|
-
"@codemirror/lang-javascript": "^6.2.3",
|
|
39
47
|
"@codemirror/autocomplete": "^6.18.6",
|
|
40
48
|
"@codemirror/commands": "^6.8.0",
|
|
41
49
|
"@codemirror/language": "^6.10.8",
|
|
@@ -44,10 +52,11 @@
|
|
|
44
52
|
"@codemirror/state": "6.5.2",
|
|
45
53
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
46
54
|
"@codemirror/view": "6.36.4",
|
|
47
|
-
"@nuxt/kit": "^3.16.
|
|
55
|
+
"@nuxt/kit": "^3.16.1"
|
|
48
56
|
},
|
|
49
57
|
"devDependencies": {
|
|
50
58
|
"@nuxt/devtools": "^2.2.1",
|
|
59
|
+
"@nuxt/devtools-ui-kit": "^1.6.4",
|
|
51
60
|
"@nuxt/eslint-config": "^1.2.0",
|
|
52
61
|
"@nuxt/module-builder": "^0.8.4",
|
|
53
62
|
"@nuxt/schema": "^3.16.0",
|
|
@@ -60,10 +69,13 @@
|
|
|
60
69
|
"vitest": "^3.0.8",
|
|
61
70
|
"vue-tsc": "2.0.29"
|
|
62
71
|
},
|
|
72
|
+
"resolutions": {
|
|
73
|
+
"vue-tsc": "2.2.2"
|
|
74
|
+
},
|
|
63
75
|
"keywords": [
|
|
64
76
|
"nuxt",
|
|
65
77
|
"codemirror",
|
|
66
78
|
"vue"
|
|
67
79
|
],
|
|
68
|
-
"packageManager": "pnpm@10.6.
|
|
69
|
-
}
|
|
80
|
+
"packageManager": "pnpm@10.6.5"
|
|
81
|
+
}
|