Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed Jan 17, 2024
1 parent 0519493 commit 3a080d4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
16 changes: 0 additions & 16 deletions examples/import-global.ts

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@thaitype/data-viewer-server",
"version": "0.3.0-canary.3",
"description": "Display Node.js data with live-reload in a web-based table viewer.",
"type": "module",
"main": "./dist/main.js",
"module": "./dist/main.mjs",
"types": "./dist/main.d.ts",
Expand All @@ -23,10 +24,10 @@
"src/**"
],
"scripts": {
"all": "run-s lint build",
"all": "run-s clean lint build:global",
"build": "tsup src/main.ts --dts --format esm,cjs",
"build:global2": "tsc --project tsconfig.global.json",
"build:global": "tsup src/globals.ts --format esm",
"build:global": "tsc --project tsconfig.global.json",
"release": "npm run build && changeset publish",
"format": "prettier -w src",
"lint": "tsc --noEmit && eslint ./src && prettier -c src",
Expand Down
7 changes: 0 additions & 7 deletions src/globals.d.ts

This file was deleted.

5 changes: 5 additions & 0 deletions src/globals.js → src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
import * as _ from './main.js';
// eslint-disable-next-line no-undef
Object.assign(global, _);

declare global {
type DataViewer = _.DataViewer;
const $dataViewer: typeof _.dataViewer;
}
9 changes: 9 additions & 0 deletions tsconfig.global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"declaration": true,
"declarationMap": true
},
"exclude": []
}
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,7 @@
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
},
"include": ["./src/**/*"],
"exclude": ["./src/globals.ts"]
}

0 comments on commit 3a080d4

Please sign in to comment.