Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ts): auto generate tsconfig.json #4776

Merged
merged 24 commits into from Jan 23, 2019
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
94f5386
Bundle `@types/node` into `nuxt-ts` distribution
kevinmarrec Jan 16, 2019
ffdb67c
feat(ts): Autogenerated tsconfig.json
kevinmarrec Jan 16, 2019
f2c9cb0
fix(examples): Update typescript examples
kevinmarrec Jan 16, 2019
0591cfa
fix(ts): Add `dist` & `tsconfig.json` to `pakage.json` files
kevinmarrec Jan 16, 2019
a82f4a5
fix: add missing new line at the end of generated `tsconfig.json`
kevinmarrec Jan 17, 2019
5a43f09
add suffix if needed to `tsconfig.json` types during package build
kevinmarrec Jan 17, 2019
ea49d17
use `readJSON` over `readJSONSync`
kevinmarrec Jan 17, 2019
d925c69
fix indentation in `nuxt-ts/tsconfig.json`
kevinmarrec Jan 17, 2019
bcd9a61
use writeJson instead of writeFile
kevinmarrec Jan 17, 2019
0397272
split `nuxt-ts/src` in 2 functions + rootDir parametr + add tests
kevinmarrec Jan 17, 2019
1028711
add `fs-extra` to dependencies to prevent build warning
kevinmarrec Jan 18, 2019
1db91a6
JSON everywhere instead of JSON/Json
kevinmarrec Jan 18, 2019
9358a93
fix: missing call to generateTsConfigIfMissing
kevinmarrec Jan 18, 2019
18ce8ad
Merge branch 'dev' into autogenerate-tsconfig
kevinmarrec Jan 19, 2019
c349626
ask confirmation for tsconfig.json generation
kevinmarrec Jan 19, 2019
909bd8e
improvement: let compilerOptions.module as default
kevinmarrec Jan 20, 2019
fa053bc
improvements
kevinmarrec Jan 20, 2019
1bb8ec2
move from github link to friendly linkable local path
kevinmarrec Jan 20, 2019
b0f475b
add resolveJsonModule in default config
husayt Jan 21, 2019
7f3d6f3
Merge remote-tracking branch 'official/dev' into autogenerate-tsconfig
kevinmarrec Jan 21, 2019
5cb2419
Move `nuxt-ts` logic to `@nuxt/typescript`
kevinmarrec Jan 21, 2019
ce3bf2d
Merge remote-tracking branch 'official/dev' into autogenerate-tsconfig
kevinmarrec Jan 21, 2019
473b464
Merge branch 'dev' into autogenerate-tsconfig
pi0 Jan 22, 2019
0976aa2
Upgrade to `ts-node@8.0.1`
kevinmarrec Jan 22, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

JSON everywhere instead of JSON/Json

  • Loading branch information...
kevinmarrec committed Jan 18, 2019
commit 1db91a60a70a17053fdf3c6ab32170246fa61c0e
@@ -1,4 +1,4 @@
import { readJSON, writeJson } from 'fs-extra'
import { readJSON, writeJSON } from 'fs-extra'

export default {
build: true,
@@ -29,7 +29,7 @@ export default {
return type + suffix
})

await writeJson(pkg.resolvePath('tsconfig.json'), tsconfig, { spaces: 2 })
await writeJSON(pkg.resolvePath('tsconfig.json'), tsconfig, { spaces: 2 })
}
}
}
@@ -1,12 +1,12 @@
import { resolve } from 'path'
import { existsSync, writeJsonSync } from 'fs-extra'
import { existsSync, writeJSONSync } from 'fs-extra'
import { register } from 'ts-node'

export function generateTsConfigIfMissing(rootDir = '.') {
const tsConfigPath = resolve(rootDir, 'tsconfig.json')

if (!existsSync(tsConfigPath)) {
writeJsonSync(tsConfigPath, {
writeJSONSync(tsConfigPath, {
extends: 'nuxt-ts',
compilerOptions: {
baseUrl: '.'
@@ -1,5 +1,5 @@
import { resolve } from 'path'
import { mkdirp, exists, readJson, remove } from 'fs-extra'
import { mkdirp, exists, readJSON, remove } from 'fs-extra'
import { register } from 'ts-node'
import { generateTsConfigIfMissing, registerTsNode } from '../../distributions/nuxt-ts/src'

@@ -17,7 +17,7 @@ describe('nuxt-ts', () => {
const tsConfigPath = resolve(rootDir, 'tsconfig.json')

expect(await exists(tsConfigPath)).toBe(true)
expect(await readJson(tsConfigPath)).toEqual({
expect(await readJSON(tsConfigPath)).toEqual({
extends: 'nuxt-ts',
compilerOptions: {
baseUrl: '.'
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.