Skip to content

Commit

Permalink
Specify version of TypeScript (4.7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jihchi committed Jul 2, 2022
1 parent 959f578 commit 860fe3b
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 50 deletions.
48 changes: 37 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
},
"version": "2.1.0",
"license": "MIT",
"type": "module",
"source": "src/index.ts",
"exports": {
"require": "dist/index.cjs",
"default": "dist/index.js"
},
"main": "dist/index.js",
"module": "dist/vite-plugin-rescript.esm.js",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
"keywords": [
"rollup-plugin",
Expand All @@ -19,17 +25,16 @@
"BuckleScript"
],
"files": [
"dist",
"src"
"dist"
],
"engines": {
"node": "^14 || ^16 || ^18",
"npm": "^7 || ^8"
},
"scripts": {
"build": "tsup src/index.ts",
"build": "tsup",
"format": "prettier --write src test",
"start": "npm run build -- --watch",
"start": "tsup --watch",
"test": "vitest run"
},
"dependencies": {
Expand All @@ -38,9 +43,12 @@
"npm-run-path": "^4.0.1"
},
"devDependencies": {
"@sindresorhus/tsconfig": "^3.0.1",
"@types/debug": "^4.1.7",
"@types/node": "^18.0.0",
"prettier": "2.7.1",
"tsup": "^6.1.3",
"typescript": "^4.7.4",
"vite": "^2.5.3",
"vitest": "^0.1.16"
},
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Plugin } from 'vite';
import execa from 'execa';
import npmRunPath from 'npm-run-path';
import chalk from 'chalk';
import parseCompilerLog from './parseCompilerLog';
import parseCompilerLog from './parseCompilerLog.js';

const logPrefix = chalk.cyan('[@jihchi/vite-plugin-rescript]');

Expand Down
34 changes: 1 addition & 33 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
{
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"include": ["src", "types"],
"compilerOptions": {
"module": "esnext",
"lib": ["dom", "esnext"],
"importHelpers": true,
// output .d.ts declaration files for consumers
"declaration": true,
// output .js.map sourcemap files for consumers
"sourceMap": true,
// match output dir to input dir. e.g. dist/index instead of dist/src/index
"rootDir": "./src",
// stricter type-checking for stronger correctness. Recommended by TS
"strict": true,
// linter checks for common issues
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
// noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative
"noUnusedLocals": true,
"noUnusedParameters": true,
// use Node's module resolution algorithm, instead of the legacy TS one
"moduleResolution": "node",
// transpile JSX to React.createElement
"jsx": "react",
// interop between ESM and CJS modules. Recommended by TS
"esModuleInterop": true,
// significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS
"skipLibCheck": true,
// error out if import and file system have a casing mismatch. Recommended by TS
"forceConsistentCasingInFileNames": true,
// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc`
"noEmit": true,
}
"extends": "@sindresorhus/tsconfig"
}
8 changes: 8 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from 'tsup';

export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
minify: true,
dts: true,
});

0 comments on commit 860fe3b

Please sign in to comment.