Skip to content

Commit 62ca778

Browse files
committed
refactor: migrate app.js to app.ts
1 parent d43e357 commit 62ca778

File tree

7 files changed

+156
-86
lines changed

7 files changed

+156
-86
lines changed

assets/style.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,14 @@ body {
2323
padding-left: 4px;
2424
padding-right: 4px;
2525
}
26+
27+
.markmap-highlight-area {
28+
position: absolute;
29+
width: var(--mm-highlight-width);
30+
height: var(--mm-highlight-height);
31+
left: var(--mm-highlight-x);
32+
top: var(--mm-highlight-y);
33+
z-index: -1;
34+
background: #ff02;
35+
transform: scale(1.2);
36+
}

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@
103103
"@types/lodash.debounce": "^4.0.7",
104104
"@types/node": "^20.4.2",
105105
"@types/vscode": "~1.75.0",
106+
"@types/vscode-webview": "^1.57.5",
106107
"del-cli": "^5.1.0",
107108
"husky": "^8.0.3",
108109
"lodash.debounce": "^4.0.8",
109-
"markmap-common": "0.17.3-beta.4",
110-
"markmap-lib": "0.17.3-beta.4",
111-
"markmap-render": "0.17.3-beta.4",
112-
"markmap-toolbar": "0.17.3-beta.4",
110+
"markmap-common": "0.17.3-alpha.8",
111+
"markmap-lib": "0.17.3-alpha.8",
112+
"markmap-render": "0.17.3-alpha.8",
113+
"markmap-toolbar": "0.17.3-alpha.8",
114+
"markmap-view": "0.17.3-alpha.8",
113115
"read-pkg-up": "^10.0.0",
114116
"vscode-uri": "^3.0.7"
115117
}

pnpm-lock.yaml

Lines changed: 45 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rollup.config.mjs

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { defineConfig } from 'rollup';
12
import { defineExternal, definePlugins } from '@gera2ld/plaid-rollup';
23
import { createRequire } from 'module';
34
import { dirname } from 'path';
@@ -10,28 +11,42 @@ async function getVersion(module) {
1011
return packageJson.version;
1112
}
1213

13-
export default async () => {
14-
const replaceValues = {
15-
'process.env.TOOLBAR_VERSION': JSON.stringify(
16-
await getVersion('markmap-toolbar'),
17-
),
18-
};
14+
const replaceValues = {
15+
'process.env.TOOLBAR_VERSION': JSON.stringify(
16+
await getVersion('markmap-toolbar'),
17+
),
18+
};
1919

20-
const external = defineExternal(['path', 'vscode']);
21-
const rollupConfig = {
22-
input: {
23-
extension: 'src/extension.ts',
24-
postbuild: 'src/postbuild.ts',
25-
},
26-
plugins: definePlugins({
27-
replaceValues,
28-
}),
29-
external,
30-
output: {
31-
format: 'cjs',
32-
dir: 'dist',
33-
},
34-
};
20+
const external = defineExternal(['path', 'vscode']);
3521

36-
return rollupConfig;
37-
};
22+
export default defineConfig([{
23+
input: {
24+
extension: 'src/extension.ts',
25+
postbuild: 'src/postbuild.ts',
26+
},
27+
plugins: definePlugins({
28+
replaceValues,
29+
}),
30+
external,
31+
output: {
32+
format: 'cjs',
33+
dir: 'dist',
34+
},
35+
}, {
36+
input: {
37+
app: 'src/app.ts',
38+
},
39+
plugins: definePlugins({
40+
replaceValues,
41+
}),
42+
external: ['markmap-common', 'markmap-toolbar', 'markmap-view'],
43+
output: {
44+
format: 'iife',
45+
dir: 'dist',
46+
globals: {
47+
'markmap-common': 'markmap',
48+
'markmap-toolbar': 'markmap',
49+
'markmap-view': 'markmap',
50+
}
51+
},
52+
}]);

0 commit comments

Comments
 (0)