-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add scripts that on release will publish transpiled template to…
… npm (#575)
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ | |
], | ||
"author": "Fran Mendez <[email protected]> (fmvilas.com)", | ||
"license": "Apache-2.0", | ||
"files": [ | ||
"__transpiled" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/asyncapi/html-template.git" | ||
|
@@ -30,7 +33,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": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |