Version: 0.8.1
Last Updated: Unknown
Bootstrapped using forge ts-lib.
No variables required.
1node_modules/2.env3lib/
1#!/usr/bin/env node2const path = require('path');3const fs = require('fs');4const dir = __dirname;5const cwd = process.cwd();6const map = JSON.parse(7 fs.readFileSync(path.resolve(dir, './map.json'), 'utf-8'),8);910let filesErr = [];1112const build = ({ dependencies, data, file, output, basedir }) => {13 dependencies.ejs.renderFile(file, data, {}, function (err, str) {14 // str => Rendered HTML string15 if (err) {16 filesErr.push(output);17 throw err;18 }1920 const outputFilePath = `${basedir}/${output}`;21 dependencies.fs.outputFileSync(outputFilePath, str);22 });23};2425module.exports = async function (options) {26 console.log('Bridging Forge npm package starter');27 try {28 const files = await options.dependencies.recursiveReaddir(dir, ['!*.ejs']);29 const basedir = options.data.basedir30 ? path.resolve(cwd, options.data.basedir)31 : cwd;3233 for (const file of files) {34 let filepath = file.replace(dir + '/', '');35 console.log(`\t - Scaffolding: ${filepath}`);36 build({ ...options, file, output: map[filepath], basedir });37 }3839 return options;40 } catch (err) {41 console.error(err);42 }43};
1{2 "gitignore.ejs": ".gitignore",3 "tsconfig.json.ejs": "tsconfig.json",4 "nodemon.json.ejs": "nodemon.json"5}
1{2 "watch": [3 "src"4 ],5 "ignore": [6 "src/**/*.test.ts"7 ],8 "ext": "ts,mjs,js,json,graphql",9 "exec": "ts-node ./src/index.ts",10 "legacyWatch": true11}
1{2 "compilerOptions": {3 "target": "ES2016",4 "module": "commonjs",5 "outDir": "./lib",6 "strict": false,7 "types": [8 "node"9 ],10 "sourceMap": true,11 "declaration": true,12 "resolveJsonModule": true,13 "moduleResolution": "node",14 "noUnusedLocals": true,15 "noUnusedParameters": true,16 "noImplicitReturns": true,17 "noFallthroughCasesInSwitch": true,18 "esModuleInterop": true19 },20 "include": [21 "src/**/*"22 ],23 "exclude": [24 "node_modules",25 "**/*.test.ts"26 ]27}