read-bsconfig
Advanced tools
Comparing version 1.0.2 to 1.0.3
68
index.js
@@ -0,1 +1,59 @@ | ||
// @flow | ||
/*:: | ||
export type BsDependency = string | ||
export type BsRuleGenerator = { | ||
name: string, | ||
command: string | ||
} | ||
export type BsJsxVersion = boolean | number | ||
export type BsReasonSpecs = { | ||
'react-jsx': BsJsxVersion | ||
} | ||
export type BsJsPostBuild = { | ||
cmd: string | ||
} | ||
export type BsModuleFormat = | ||
| 'commonjs' | ||
| 'amdjs' | ||
| 'amdjs-global' | ||
| 'es6' | ||
| 'es6-global' | ||
export type BsPackageSpec = | ||
| BsModuleFormat | ||
| { module: BsModuleFormat, 'in-source': boolean } | ||
export type BsConfig = { | ||
version: string, | ||
name: string, | ||
namespace: boolean, | ||
sources: any, // TODO: fill in this definition | ||
'bs-dependencies': BsDependency[], | ||
'bs-dev-dependencies': BsDependency[], | ||
generators: BsRuleGenerator[], | ||
'cut-generators': boolean, | ||
reason: BsReasonSpecs, | ||
'bsc-flags': string[], | ||
'ppx-flags': string[], | ||
'js-post-build': BsJsPostBuild, | ||
'package-specs': BsPackageSpec[], | ||
ocamllex: string, | ||
ocamlyacc: string, | ||
menhir: string, | ||
entries: any, // TODO: fill in this definition | ||
'generate-merlin': boolean, | ||
'use-stdlib': boolean, | ||
'bs-external-includes': string[], | ||
refmt: string, | ||
'refmt-flags': string[], | ||
suffix: string | ||
} | ||
*/ | ||
const { readFile, readFileSync } = require('fs') | ||
@@ -7,3 +65,6 @@ const path = require('path') | ||
function readBsConfig(cwd = process.cwd(), enableCache = true) { | ||
function readBsConfig( | ||
cwd /*: string */ = process.cwd(), | ||
enableCache /*: boolean */ = true | ||
) /*: Promise<BsConfig> */ { | ||
if (asyncConfigCache[cwd] && enableCache) return asyncConfigCache[cwd] | ||
@@ -24,3 +85,6 @@ | ||
function readBsConfigSync(cwd = process.cwd(), enableCache = true) { | ||
function readBsConfigSync( | ||
cwd /*: string */ = process.cwd(), | ||
enableCache /*: boolean */ = true | ||
) /*: BsConfig */ { | ||
if (syncConfigCache[cwd] && enableCache) return syncConfigCache[cwd] | ||
@@ -27,0 +91,0 @@ |
{ | ||
"name": "read-bsconfig", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Library for reading the bsconfig.json for BuckleScript", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/rrdelaney/read-bsconfig.git" | ||
"url": "git+https://github.com/reasonml-community/reason-scripts.git" | ||
}, | ||
@@ -17,9 +17,11 @@ "author": "Ryan Delaney <rrdelaney@outlook.com>", | ||
"bugs": { | ||
"url": "https://github.com/rrdelaney/read-bsconfig/issues" | ||
"url": "https://github.com/reasonml-community/reason-scripts/issues" | ||
}, | ||
"homepage": "https://github.com/rrdelaney/read-bsconfig#readme", | ||
"homepage": "https://github.com/reasonml-community/reason-scripts#readme", | ||
"dependencies": { | ||
"json5": "^0.5.1" | ||
}, | ||
"files": ["index.js"], | ||
"files": [ | ||
"index.js" | ||
], | ||
"devDependencies": { | ||
@@ -26,0 +28,0 @@ "jest": "^21.0.1" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
4589
81
1
0