Commit b3e46994 authored by mohoff's avatar mohoff Committed by Richard Crosby

refactor: outsource dev scripts from package.json to scripts/dev

parent 094de8f9
{
"ignore": ["**/*.test.ts"],
"watch": ["src", "example"],
"ext": "ts,json,yaml,yml"
"ignore": [
"**/*.test.ts"
],
"watch": [
"src",
"example",
"scripts/dev"
],
"ext": "ts,js,json,yaml,yml"
}
......@@ -11,7 +11,7 @@
"author": "Brickblock Engineering <dev@brickblock.io>",
"license": "MIT",
"scripts": {
"health": "ts-node scripts/healthcheck.ts",
"health": "ts-node -T scripts/healthcheck.ts",
"lint": "yarn lint:ts && yarn lint:json && yarn lint:markdown",
"lint:ts": "eslint --ext [.ts] src scripts",
"lint:ts:fix": "eslint --fix --ext [.ts] src scripts",
......@@ -23,11 +23,11 @@
"watch": "tsc --watch",
"clean": "rimraf build/",
"build": "tsc",
"dev:load:commonjs": "yarn build; echo 'Loaded Config:\n'; cross-env RUNTIME_ENVIRONMENT=development time node -p -e 'const StrongConfig = require(\"./lib\"); JSON.stringify((new StrongConfig({ configPath: \"example/\", schemaPath:\"example/schema.json\" })).load())' | jq .",
"dev:load:es6": "echo 'Loaded Config:\n'; cross-env RUNTIME_ENVIRONMENT=development time ts-node -T -p -e 'import StrongConfig from \"./src\"; JSON.stringify((new StrongConfig({ configPath: \"example/\", schemaPath:\"example/schema.json\" })).load())' | jq .",
"dev:load:commonjs": "yarn build; echo 'Loaded Config:\n'; cross-env RUNTIME_ENVIRONMENT=development time node scripts/dev/load-commonjs.js | jq .",
"dev:load:es6": "echo 'Loaded Config:\n'; cross-env RUNTIME_ENVIRONMENT=development time ts-node -T scripts/dev/load-es6.ts | jq .",
"dev:load": "yarn dev:load:es6",
"dev:load:watch": "nodemon --exec 'yarn dev:load:es6'",
"dev:validate": "echo 'Validation Result:\n'; cross-env RUNTIME_ENVIRONMENT=development time ts-node -T -p -e 'import StrongConfig from \"./src\"; (new StrongConfig({ configPath: \"example/\", schemaPath:\"example/schema.json\" })).validate()'",
"dev:validate": "echo 'Validation Result:\n'; cross-env RUNTIME_ENVIRONMENT=development time ts-node -T scripts/dev/validate.ts",
"dev:validate:watch": "nodemon --exec 'yarn dev:validate'"
},
"devDependencies": {
......
// eslint-disable-next-line @typescript-eslint/no-var-requires
const StrongConfig = require('../../lib')
const strongConfig = new StrongConfig({
configPath: 'example/',
schemaPath: 'example/schema.json',
})
const config = strongConfig.load()
console.log(JSON.stringify(config))
import StrongConfig from '../../src'
const strongConfig = new StrongConfig({
configPath: 'example/',
schemaPath: 'example/schema.json',
})
const config = strongConfig.load()
console.log(JSON.stringify(config))
import StrongConfig from '../../src'
const strongConfig = new StrongConfig({
configPath: 'example/',
schemaPath: 'example/schema.json',
})
const validationResult = strongConfig.validate()
console.log(validationResult)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment