Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ The following TypeScript features are supported:
- Interfaces with property references to other complex types
- Interfaces with extensions
- Unions
- Intersections
- Type literals
- Type aliases
- Arrays
- Namespaces
Expand Down
41,417 changes: 16,267 additions & 25,150 deletions package-lock.json

Large diffs are not rendered by default.

83 changes: 40 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,51 @@
"intermock": "build/src/cli/index.js"
},
"dependencies": {
"command-line-args": "5.0.2",
"command-line-usage": "5.0.5",
"faker": "4.1.0",
"@faker-js/faker": "^7.6.0",
"command-line-args": "5.2.1",
"command-line-usage": "6.1.3",
"fs-readfile-promise": "3.0.1",
"tslib": "1.10.0",
"typescript": "^3.7.5"
"tslib": "2.5.0",
"typescript": "^4.9.5"
},
"main": "./build/index.js",
"types": "./build/index.d.ts",
"devDependencies": {
"@types/chai": "4.1.3",
"@types/command-line-args": "5.0.0",
"@types/command-line-usage": "5.0.1",
"@types/faker": "4.1.2",
"@types/fs-readfile-promise": "3.0.0",
"@types/mocha": "5.2.0",
"@types/node": "^8.10.45",
"chai": "4.1.2",
"clang-format": "1.4.0",
"clean-webpack-plugin": "^1.0.1",
"closure-webpack-plugin": "^1.2.0",
"copy-webpack-plugin": "^4.6.0",
"css-loader": "^1.0.1",
"husky": "^4.3.6",
"mini-css-extract-plugin": "^0.4.5",
"mocha": "5.2.0",
"mocha-multi-reporters": "1.1.7",
"@types/chai": "4.3.4",
"@types/command-line-args": "5.2.0",
"@types/command-line-usage": "5.0.2",
"@types/faker": "6.6.8",
"@types/fs-readfile-promise": "3.0.1",
"@types/mocha": "10.0.1",
"@types/node": "^18.11.18",
"chai": "4.3.7",
"clang-format": "1.8.0",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
"husky": "^8.0.3",
"mini-css-extract-plugin": "^2.7.2",
"mocha": "^10.2.0",
"mocha-multi-reporters": "1.5.1",
"mocha-notifier-reporter": "0.1.2",
"monaco-editor": "^0.15.6",
"node-sass": "^4.12.0",
"nyc": "12.0.2",
"rimraf": "^2.6.3",
"sass-loader": "^7.1.0",
"source-map-support": "^0.5.12",
"style-loader": "^0.23.1",
"ts-jest": "^22.4.6",
"ts-loader": "^5.3.3",
"ts-node": "6.0.5",
"tslint": "~5.9.1",
"tslint-microsoft-contrib": "~5.0.3",
"tsutils": "~2.26.2",
"uglifyjs-webpack-plugin": "^2.1.2",
"monaco-editor": "^0.34.1",
"node-sass": "^8.0.0",
"nyc": "15.1.0",
"rimraf": "^4.1.2",
"sass-loader": "^13.2.0",
"source-map-support": "^0.5.21",
"style-loader": "^3.3.1",
"ts-jest": "^29.0.5",
"ts-loader": "^9.4.2",
"ts-node": "10.9.1",
"tslint": "~5.20.1",
"tsutils": "~3.21.0",
"watch-cli": "0.2.3",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.3.1",
"webpack-merge": "^4.2.1",
"webpack-notifier": "^1.7.0"
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1",
"webpack-merge": "^5.8.0",
"webpack-notifier": "^1.15.0"
},
"scripts": {
"clean": "rimraf coverage build tmp",
Expand All @@ -70,11 +67,11 @@
"dist": "tsc -p tsconfig.json --outDir ./bin",
"watch": "tsc -w -p tsconfig.json",
"lint": "./node_modules/tslint/bin/tslint -t stylish --project \"tsconfig.json\"",
"format": "./node_modules/clang-format/bin/linux_x64/clang-format -i -style=file src/**/*.ts test/**/*.ts",
"format": "clang-format -i -style=file src/**/*.ts test/**/*.ts",
"precommit": "check-clang-format",
"run-watch": "./node_modules/watch-cli/bin/watch -p \"./**/*.ts\" -c \"npm run cli\"",
"test": "npm run test-only",
"test-only": "./node_modules/mocha/bin/mocha --reporter mocha-multi-reporters --reporter-options configFile=mocha-config.json --no-colors -r ts-node/register test/**/*.spec.ts",
"test-only": "./node_modules/mocha/bin/mocha.js --reporter mocha-multi-reporters --reporter-options configFile=mocha-config.json --no-colors -r ts-node/register test/**/*.spec.ts",
"test-watch": "./node_modules/watch-cli/bin/watch -p \"./**/*.ts\" -c \"npm run build && npm run test\""
},
"nyc": {
Expand Down
16 changes: 10 additions & 6 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ import {mock as IntermockTS, OutputType} from '../lang/ts/intermock';
import {readFiles} from '../lib/read-files';
import {setImportExportSpecifier} from '../lib/resolve-file-imports';


const optionDefinitions = [
{
name: 'files',
alias: 'f',
type: String,
multiple: true,
defaultOption: true
defaultOption: true,
},
{name: 'interfaces', alias: 'i', type: String, multiple: true},
{name: 'help', alias: 'h', type: Boolean},
Expand Down Expand Up @@ -68,7 +67,7 @@ const instructions = [
{
name: 'help',
description: 'Print this usage guide.',
}
},
],
},
];
Expand Down Expand Up @@ -112,12 +111,17 @@ function main() {

return readFiles(options.files).then((files) => {
try {
const result = IntermockTS(
{files, interfaces, isFixedMode, output, importsResolver});
const result = IntermockTS({
files,
interfaces,
isFixedMode,
output,
importsResolver,
});

console.log(result);
} catch (err) {
console.log(err.message);
console.log(err);
}
});
}
Expand Down
Loading