Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

alexdima/typescript-with-globs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript with globs

Simple utility that understands glob patterns in tsconfig.json.

Friends don't let friends maintain lists of files.

Installing

Install side-by-side with typescript. e.g.:

npm install typescript
npm install typescript-with-globs

Using

Add a new property called filesGlob where you can use glob patterns: e.g. tsconfig.json:

{
    "compilerOptions": {
        "module": "amd",
        "outDir": "out",
        "target": "es5"
    },
    "filesGlob": [
        "src/*.ts",
        "lib/*.d.ts",
        "node_modules/monaco-editor-core/monaco.d.ts"
    ]
}

Instead of tsc, run tscg (note the extra g in the name). This first updates tsconfig.json with the found files and then invokes tsc with the same arguments.

The files property is generated with all the filenames the glob has found. e.g. updated tsconfig.json:

{
  "compilerOptions": {
    "module": "amd",
    "outDir": "out",
    "target": "es5"
  },
  "filesGlob": [
    "src/*.ts",
    "lib/*.d.ts",
    "node_modules/monaco-editor-core/monaco.d.ts"
  ],
  "files": [
    "src/languageFeatures.ts",
    "src/mode.ts",
    "src/monaco.contribution.ts",
    "src/tokenization.ts",
    "src/typescript.ts",
    "src/worker.ts",
    "src/workerManager.ts",
    "lib/lib-es6-ts.d.ts",
    "lib/lib-ts.d.ts",
    "lib/typescriptServices.d.ts",
    "node_modules/monaco-editor-core/monaco.d.ts"
  ]
}

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published