Version: 0.8.1
Last Updated: Unknown
This is a start to help bootstrap a new AWS CDK kit.
Requires name, description and stack.
1{2 "presets": [3 [4 "@babel/preset-env",5 {6 "targets": {7 "node": "12"8 }9 }10 ],11 ["@babel/preset-typescript"]12 ]13}
1node_modules/2.env3dist/4lib/
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 "webpack.config.js.ejs": "webpack.config.js",5 "nodemon.json.ejs": "nodemon.json",6 "babelrc.ejs": ".babelrc"7}
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": "./dist",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}
1const path = require('path');2const webpack = require('webpack');3// install to ignore node modules during build4// const nodeExternals = require('webpack-node-externals');5const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');67module.exports = {8 mode: 'production',9 entry: './src/index.ts',10 // externals: [nodeExternals()],11 // devtool: 'source-map',12 resolve: {13 extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],14 },15 output: {16 // library: 'index',17 libraryTarget: 'commonjs',18 path: path.join(__dirname, 'dist'),19 filename: 'index.js',20 },21 target: 'node',22 module: {23 rules: [24 {25 // Include ts, tsx, js, and jsx files.26 test: /\.(ts|js)x?$/,27 exclude: /node_modules/,28 use: [29 {30 loader: 'cache-loader',31 },32 'babel-loader',33 ],34 },35 ],36 },37 plugins: [38 new ForkTsCheckerWebpackPlugin(),39 new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }),40 ],41};