Skip to content
Merged
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
"tsc-installer": "tsc -p ./src/install/tsconfig.json",
"doc": "node utils/doclint/cli.js",
"test-infra": "node utils/doclint/check_public_api/test/test.js && node utils/doclint/preprocessor/test.js && node utils/testrunner/test/test.js",
"lint": "npm run eslint && npm run tsc && npm run doc && npm run check-deps && npm run test-types && npm run test-infra",
"lint": "npm run eslint && npm run tsc && npm run doc && npm run check-deps && npm run generate-channels && npm run test-types && npm run test-infra",
"debug-test": "node --inspect-brk test/test.js",
"clean": "rimraf lib && rimraf types",
"prepare": "node install-from-github.js",
"build": "node utils/runWebpack.js --mode='development' && tsc -p . && npm run generate-types",
"watch": "node utils/runWebpack.js --mode='development' --watch --silent | tsc -w -p .",
"test-types": "npm run generate-types && npx -p [email protected] tsc -p utils/generate_types/test/tsconfig.json && npm run typecheck-tests",
"generate-types": "node utils/generate_types/",
"generate-channels": "node utils/generate_channels.js",
"typecheck-tests": "tsc -p ./test/",
"roll-browser": "node utils/roll_browser.js",
"jest": "jest",
Expand Down
10 changes: 8 additions & 2 deletions src/rpc/channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@ export type RouteAbortParams = {
errorCode?: string,
};
export type RouteAbortOptions = {

errorCode?: string,
};
export type RouteAbortResult = void;
export type RouteContinueParams = {
Expand Down Expand Up @@ -2064,7 +2064,13 @@ export type RouteFulfillParams = {
isBase64?: boolean,
};
export type RouteFulfillOptions = {

status?: number,
headers?: {
name: string,
value: string,
}[],
body?: string,
isBase64?: boolean,
};
export type RouteFulfillResult = void;

Expand Down
17 changes: 15 additions & 2 deletions utils/generate_channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,18 @@ validator_ts.push(`
}
`);

fs.writeFileSync(path.join(__dirname, '..', 'src', 'rpc', 'channels.ts'), channels_ts.join('\n'), 'utf-8');
fs.writeFileSync(path.join(__dirname, '..', 'src', 'rpc', 'validator.ts'), validator_ts.join('\n'), 'utf-8');
let hasChanges = false;

function writeFile(filePath, content) {
const existing = fs.readFileSync(filePath, 'utf8');
if (existing === content)
return;
hasChanges = true;
const root = path.join(__dirname, '..');
console.log(`Writing //${path.relative(root, filePath)}`);
fs.writeFileSync(filePath, content, 'utf8');
}

writeFile(path.join(__dirname, '..', 'src', 'rpc', 'channels.ts'), channels_ts.join('\n'));
writeFile(path.join(__dirname, '..', 'src', 'rpc', 'validator.ts'), validator_ts.join('\n'));
process.exit(hasChanges ? 1 : 0);