Skip to content

Commit

Permalink
Add transpilation step
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysbalevicius committed May 30, 2024
1 parent df1d7d7 commit 4ecc3c2
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 9 deletions.
24 changes: 19 additions & 5 deletions V3Frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions V3Frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "V3Frontend/scripts/build.js",
"scripts": {
"build": "node ./scripts/build",
"generate": "npx buf generate .."
"generate": "npx buf generate ..",
"transpile": "tsc"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
Expand All @@ -16,6 +17,7 @@
"@bufbuild/protoc-gen-es": "^1.9.0"
},
"devDependencies": {
"glob": "^10.4.1"
"glob": "^10.4.1",
"typescript": "^5.4.5"
}
}
7 changes: 5 additions & 2 deletions V3Frontend/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ const exec = command =>
);
}

await exec('npm run transpile');
await exec('rm -rf MF');

const dirs = [...new Set(Object.keys(pbIndex).map(dir => dir.split('/').at(0)))];

// Move generated proto definitions to root dir
for (const dir of dirs)
{
await exec(`mv ${SCHEMA_ROOT_DIR}/${dir} .`);
await exec(`mv build/${SCHEMA_ROOT_DIR}/${dir} .`);
}
await exec(`rm -rf MF`);
await exec(`rm -rf build`);
})();
22 changes: 22 additions & 0 deletions V3Frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"target": "es2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"outDir": "./build", /* Redirect output structure to the directory. */
"rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"strict": true, /* Enable all strict type-checking options. */
"declaration": true,

"typeRoots": [
"node_modules/@types"
],
"allowJs": true,
/* List of folders to include type definitions from. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": [
"./MF",
]
}

0 comments on commit 4ecc3c2

Please sign in to comment.