Skip to content

Commit 0a9b99d

Browse files
generate d ts files
1 parent 91d94df commit 0a9b99d

File tree

4 files changed

+80
-10
lines changed

4 files changed

+80
-10
lines changed

molstar-extension/esbuild.config.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { argv } from 'node:process';
22
import * as esbuild from 'esbuild';
3-
import {sassPlugin} from 'esbuild-sass-plugin'
3+
import { sassPlugin } from 'esbuild-sass-plugin'
44
import copyStaticFiles from 'esbuild-copy-static-files';
5+
import { dtsPlugin } from 'esbuild-plugin-d.ts'
56

67
const
78
productionMode = ('development' !== (argv[2] || process.env.NODE_ENV)),
89
target = 'chrome100,firefox100,safari15'.split(',');
910

10-
console.log(`${ productionMode ? 'production' : 'development' } build`);
11+
console.log(`${productionMode ? 'production' : 'development'} build`);
1112

1213
const staticFilesPluginOptions = {
1314
src: './src',
@@ -22,7 +23,7 @@ const buildLib = await esbuild.context({
2223
outdir: './lib',
2324
platform: 'browser',
2425
tsconfig: 'tsconfig.json',
25-
plugins: [copyStaticFiles(staticFilesPluginOptions)]
26+
plugins: [copyStaticFiles(staticFilesPluginOptions), dtsPlugin()]
2627
})
2728

2829
const buildCSS = await esbuild.context({
@@ -44,7 +45,7 @@ const buildCSS = await esbuild.context({
4445
// bundle TS
4546
const buildTS = await esbuild.context({
4647

47-
entryPoints: [ 'src/viewer/app.ts' ],
48+
entryPoints: ['src/viewer/app.ts'],
4849
format: "esm",
4950
bundle: true,
5051
target,

molstar-extension/package-lock.json

+68-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

molstar-extension/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "molstar-volseg",
3-
"version": "0.0.7",
3+
"version": "0.0.9",
44
"type": "module",
55
"description": "MolStar extension for visualizing volumetric and segmentation data",
66
"repository": {
@@ -20,7 +20,8 @@
2020
"build-site": "npm run bundle -- production && mkdir ./site && cp ./build/* ./site/.",
2121
"start": "npm run bundle -- development",
2222
"rebuild": "npm run clean && npm run build",
23-
"version": "npm run rebuild && cpx .npmignore lib/"
23+
"version": "npm run rebuild && cpx .npmignore lib/",
24+
"build:types": "tsc -d --declarationDir dist/lib --declarationMap --emitDeclarationOnly"
2425
},
2526
"files": [
2627
"lib/",
@@ -48,6 +49,7 @@
4849
"cpx2": "^7.0.1",
4950
"esbuild": "0.21.4",
5051
"esbuild-copy-static-files": "^0.1.0",
52+
"esbuild-plugin-d.ts": "^1.2.3",
5153
"esbuild-sass-plugin": "^3",
5254
"typescript": "^5.4.5"
5355
},

molstar-extension/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compilerOptions": {
3+
"allowJs": true,
34
"declaration": true,
45
"target": "ES2018",
56
"alwaysStrict": true,
@@ -22,4 +23,5 @@
2223
},
2324
"include": [ "src/**/*", "src/extensions/volumes-and-segmentations", "src/extensions/meshes", "src/extensions/cvsx-extension" ],
2425
// "exclude": [ "src/servers/**/*", "src/perf-tests/*", "src/cli/**/*" ]
25-
}
26+
}
27+

0 commit comments

Comments
 (0)