Skip to content

Commit e334fc6

Browse files
committed
feat: convert to typescript
1 parent b3b336c commit e334fc6

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "atom-ide-signature-help",
3-
"main": "./lib/main.js",
3+
"main": "./dist/main.js",
44
"version": "0.14.1",
55
"description": "A replacement of the SignatureHelp functionality from the original Atom-IDE / Nuclide package developed by Facebook.",
66
"keywords": [
@@ -15,6 +15,9 @@
1515
},
1616
"scripts": {
1717
"format": "prettier --write .",
18+
"clean": "shx rm -rf dist",
19+
"dev": "npm run clean && cross-env NODE_ENV=development cross-env BABEL_KEEP_MODULES=true rollup -c -w",
20+
"build": "npm run clean && cross-env NODE_ENV=production cross-env BABEL_KEEP_MODULES=true rollup -c",
1821
"bump": "ncu -u"
1922
},
2023
"package-deps": [
@@ -30,6 +33,11 @@
3033
"@types/node": "^14.14.22",
3134
"prettier": "^2.2.1",
3235
"npm-check-updates": "^11.1.1",
36+
"rollup": "^2.38.5",
37+
"rollup-plugin-atomic": "^2.0.1",
38+
"shx": "^0.3.3",
39+
"tslib": "^2.1.0",
40+
"typescript": "^4.1.3",
3341
"build-commit": "^0.1.4"
3442
},
3543
"activationHooks": [

rollup.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { createPlugins } from "rollup-plugin-atomic"
2+
3+
const plugins = createPlugins([["ts", { tsconfig: "./lib/tsconfig.json" }, true], "js", "json"])
4+
5+
export default [
6+
{
7+
input: "lib/main.ts",
8+
output: [
9+
{
10+
dir: "dist",
11+
format: "cjs",
12+
sourcemap: true,
13+
},
14+
],
15+
// loaded externally
16+
external: ["atom"],
17+
plugins: plugins,
18+
},
19+
]

src/tsconfig.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"compilerOptions": {
3+
"strict": true,
4+
"strictNullChecks": true,
5+
"noUnusedLocals": true,
6+
"noUnusedParameters": true,
7+
"noImplicitReturns": true,
8+
"noImplicitAny": true,
9+
"noImplicitThis": true,
10+
"noFallthroughCasesInSwitch": true,
11+
"declaration": true,
12+
"emitDecoratorMetadata": true,
13+
"experimentalDecorators": true,
14+
"incremental": true,
15+
"inlineSourceMap": true,
16+
"inlineSources": true,
17+
"preserveSymlinks": true,
18+
"removeComments": true,
19+
"jsx": "react",
20+
"jsxFactory": "etch.dom",
21+
"lib": ["ES2018", "dom"],
22+
"target": "ES2018",
23+
"allowJs": true,
24+
"esModuleInterop": true,
25+
"resolveJsonModule": true,
26+
"module": "commonjs",
27+
"moduleResolution": "node",
28+
"importHelpers": false,
29+
"outDir": "../dist"
30+
},
31+
"compileOnSave": false
32+
}

0 commit comments

Comments
 (0)