diff --git a/package.json b/package.json index 21d446d..a46a90a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "atom-ide-signature-help", - "main": "./lib/main.js", + "main": "./dist/main.js", "version": "0.14.1", "description": "A replacement of the SignatureHelp functionality from the original Atom-IDE / Nuclide package developed by Facebook.", "keywords": [ @@ -15,6 +15,9 @@ }, "scripts": { "format": "prettier --write .", + "clean": "shx rm -rf dist", + "dev": "npm run clean && cross-env NODE_ENV=development cross-env BABEL_KEEP_MODULES=true rollup -c -w", + "build": "npm run clean && cross-env NODE_ENV=production cross-env BABEL_KEEP_MODULES=true rollup -c", "bump": "ncu -u" }, "package-deps": [ @@ -30,6 +33,11 @@ "@types/node": "^14.14.22", "prettier": "^2.2.1", "npm-check-updates": "^11.1.1", + "rollup": "^2.38.5", + "rollup-plugin-atomic": "^2.0.1", + "shx": "^0.3.3", + "tslib": "^2.1.0", + "typescript": "^4.1.3", "build-commit": "^0.1.4" }, "activationHooks": [ diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..a64ded9 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,19 @@ +import { createPlugins } from "rollup-plugin-atomic" + +const plugins = createPlugins([["ts", { tsconfig: "./lib/tsconfig.json" }, true], "js", "json"]) + +export default [ + { + input: "lib/main.ts", + output: [ + { + dir: "dist", + format: "cjs", + sourcemap: true, + }, + ], + // loaded externally + external: ["atom"], + plugins: plugins, + }, +] diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 0000000..35c5fd1 --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "strict": true, + "strictNullChecks": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noImplicitAny": true, + "noImplicitThis": true, + "noFallthroughCasesInSwitch": true, + "declaration": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "incremental": true, + "inlineSourceMap": true, + "inlineSources": true, + "preserveSymlinks": true, + "removeComments": true, + "jsx": "react", + "jsxFactory": "etch.dom", + "lib": ["ES2018", "dom"], + "target": "ES2018", + "allowJs": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "module": "commonjs", + "moduleResolution": "node", + "importHelpers": false, + "outDir": "../dist" + }, + "compileOnSave": false +}