Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Revert note about declarationDir. Update ts to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tarasyuk committed Jun 1, 2018
1 parent 1efbdf4 commit b060934
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,26 @@ npm run type-check -- --watch
Either run the following:

```sh
npm install --save-dev typescript@2.7.2
npm install --save-dev @babel/[email protected].44
npm install --save-dev @babel/[email protected].44
npm install --save-dev @babel/[email protected].44
npm install --save-dev @babel/[email protected].44
npm install --save-dev @babel/[email protected].44
npm install --save-dev @babel/[email protected].44
npm install --save-dev typescript@2.9.1
npm install --save-dev @babel/[email protected].49
npm install --save-dev @babel/[email protected].49
npm install --save-dev @babel/[email protected].49
npm install --save-dev @babel/[email protected].49
npm install --save-dev @babel/[email protected].49
npm install --save-dev @babel/[email protected].49
```

or make sure that you add the appropriate `"devDependencies"` entries to your `package.json` and run `npm install`:

```json
"devDependencies": {
"@babel/cli": "^7.0.0-beta.44",
"@babel/core": "^7.0.0-beta.44",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.44",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.44",
"@babel/preset-env": "^7.0.0-beta.44",
"@babel/preset-typescript": "^7.0.0-beta.44",
"typescript": "^2.8.1"
"@babel/cli": "^7.0.0-beta.49",
"@babel/core": "^7.0.0-beta.49",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.49",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.49",
"@babel/preset-env": "^7.0.0-beta.49",
"@babel/preset-typescript": "^7.0.0-beta.49",
"typescript": "^2.9.1"
}
```

Expand All @@ -67,6 +67,8 @@ Then run
tsc --init --declaration --allowSyntheticDefaultImports --target esnext --outDir lib
```

**Note:** TypeScript also provides a `--declarationDir` option which specifies an output directory for generated declaration files (`.d.ts` files). For our uses where `--emitDeclarationOnly` is turned on, `--outDir` works equivalently.

## Create your `.babelrc`

Then copy the `.babelrc` in this repo, or the below:
Expand Down Expand Up @@ -105,7 +107,7 @@ Install the [@babel/preset-react](https://www.npmjs.com/package/@babel/preset-re

```sh
npm install --save react react-dom @types/react @types/react-dom
npm install --save-dev @babel/[email protected].44
npm install --save-dev @babel/[email protected].49
```

### Update `.babelrc`
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"build": "tsc --emitDeclarationOnly && babel src --out-dir lib --extensions \".ts,.tsx\""
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.44",
"@babel/core": "^7.0.0-beta.44",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.44",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.44",
"@babel/preset-env": "^7.0.0-beta.44",
"@babel/preset-typescript": "^7.0.0-beta.44",
"typescript": "^2.8.1"
"@babel/cli": "^7.0.0-beta.49",
"@babel/core": "^7.0.0-beta.49",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.49",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.49",
"@babel/preset-env": "^7.0.0-beta.49",
"@babel/preset-typescript": "^7.0.0-beta.49",
"typescript": "^2.9.1"
}
}
8 changes: 6 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
// "declaration": "lib", /* Output directory for generated declaration files. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "lib", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
Expand Down Expand Up @@ -42,7 +43,7 @@
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */

/* Source Map Options */
Expand All @@ -54,5 +55,8 @@
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */

/* Advanced Options */
// "declarationDir": "lib" /* Output directory for generated declaration files. */
}
}

0 comments on commit b060934

Please sign in to comment.