Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: include __transpiled folder in the package #583

Merged
merged 2 commits into from
Apr 2, 2024
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 .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();
Loading