Skip to content

Commit

Permalink
feat: include __transpiled folder in the package (#583)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukasz Gornicki <[email protected]>
  • Loading branch information
Gmin2 and derberg authored Apr 2, 2024
1 parent ad72bcf commit 0fbc57b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ coverage
scripts
sample
vscode
test
test
!__transpiled
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"generate:readme:toc": "markdown-toc -i README.md",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION",
"copy:sources": "node ./scripts/copy-sources.js",
"prepublishOnly": "npm run generate:assets",
"prepublishOnly": "npm run generate:assets && npm run transpile",
"transpile": "node ./scripts/transpile.js",
"test": "npm run test:library && npm run test:generator"
},
"publishConfig": {
Expand Down
16 changes: 16 additions & 0 deletions scripts/transpile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { transpileFiles } = require("@asyncapi/generator-react-sdk");
const path = require("path");

async function transpileTemplate() {
try {
const templateContentDir = path.join(__dirname, "../template");
console.log("Template content directory:", templateContentDir);
const outputDir = path.join(__dirname, "../__transpiled");
console.log("Output directory for transpiled files:", outputDir);
await transpileFiles(templateContentDir, outputDir, { recursive: true });
} catch (error) {
console.log("Error during template transpilation:", err)
}
}

transpileTemplate();

0 comments on commit 0fbc57b

Please sign in to comment.