[
  {
    "path": ".babelrc",
    "content": "{\n  \"presets\": [\n    \"@babel/preset-typescript\"\n  ],\n  \"plugins\": [\n    \"@babel/plugin-proposal-class-properties\",\n    \"@babel/plugin-proposal-object-rest-spread\",\n    \"@babel/plugin-syntax-dynamic-import\"\n  ]\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "# logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# npm output\nnode_modules/\n\n# lock files\npackage-lock.json\nyarn.lock\npnpm-lock.yaml\n\n# macOS\n.DS_Store\n\n# nuxtron dev output\nbin\nworkspace\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 Shiono Yoshihide\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\"><img src=\"https://i.imgur.com/PTqXTbx.png\"></p>\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/nuxtron\"><img src=\"https://img.shields.io/npm/v/nuxtron.svg\"></a>\n  <a href=\"https://www.npmjs.com/package/nuxtron\"><img src=\"https://img.shields.io/npm/dt/nuxtron.svg\"></a>\n</p>\n\nBuild a [Nuxt.js](https://nuxtjs.org/) + [Electron](https://electronjs.org/) app for speed ⚡\n\n(The screenshot above is a top page of [examples/with-javascript](./examples/with-javascript).)\n\n## Support\n\n| nuxtron | nuxt |\n| --- | --- |\n| `v0.x` | `v2.x` |\n\n## My Belief for Nuxtron\n\n1. Show a way of developing desktop apps only web knowledge\n1. Easy to use\n1. Be transparent and open to OSS developers\n\n## Usage\n\n### Install\n\n```bash\n$ npm install --global nuxtron\n```\n\n### Create Application\n\nTo create `my-app`, just run the command below:\n\n```bash\n$ nuxtron init my-app\n```\n\n### Create Application with Template\n\nYou can use `examples/*` apps as a template.\n\nTo create the `examples/with-typescript` app, run the command below:\n\n```bash\n$ nuxtron init my-app --example with-typescript\n```\n\n### Development Mode\n\nRun `npm run dev`, and nuxtron automatically launches an electron app.\n\n```json\n{\n  \"scripts\": {\n    \"dev\": \"nuxtron\"\n  }\n}\n```\n\n### Production Build\n\nRun `npm run build`, and nuxtron outputs packaged bundles under the `dist` folder.\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"nuxtron build\"\n  }\n}\n```\n\n### Build Options\n\nTo build Windows 32 bit version, run `npm run build:win32` like below:\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"nuxtron build\",\n    \"build:all\": \"nuxtron build --all\",\n    \"build:win32\": \"nuxtron build --win --ia32\",\n    \"build:win64\": \"nuxtron build --win --x64\",\n    \"build:mac\": \"nuxtron build --mac --x64\",\n    \"build:linux\": \"nuxtron build --linux\"\n  }\n}\n```\n\n**CAUTION**: To build macOS binary, your host machine must be macOS!\n\n### Build Configuration\n\nEdit `electron-builder.yml` properties for custom build configuration.\n\n```yml\nappId: com.example.nuxtron\nproductName: My Nuxtron App\ncopyright: Copyright © 2019 Shiono Yoshihide\ndirectories:\n  output: dist\n  buildResources: resources\nfiles:\n  - from: .\n    filter:\n      - package.json\n      - app\npublish: null\n```\n\nFor more information, please check out [electron-builder official configuration documents](https://www.electron.build/configuration/configuration/).\n\n## Examples\n\nSee [examples](./examples) folder for more information.\n\nOr you can start the example app by `nuxtron init <app-name> --example <example-dirname>`.\n\nTo list all examples, just type the command below:\n\n```bash\n$ nuxtron list\n```\n\n### [examples/custom-build-options](./examples/custom-build-options)\n\n```bash\n$ nuxtron init my-app --example custom-build-options\n```\n\n### [examples/with-javascript](./examples/with-javascript)\n\n```bash\n$ nuxtron init my-app --example with-javascript\n```\n\n### [examples/with-typescript](./examples/with-typescript)\n\n```bash\n$ nuxtron init my-app --example with-typescript\n```\n\n## Develop `examples/*`\n\n```bash\n$ git clone https://github.com/saltyshiomix/nuxtron.git\n$ cd nuxtron\n$ yarn\n$ yarn dev <EXAMPLE-FOLDER-NAME>\n```\n\n## Related\n\n- [Nextron](https://github.com/saltyshiomix/nextron) - ⚡ Electron + NEXT.js ⚡\n"
  },
  {
    "path": "dev.js",
    "content": "const { remove, existsSync } = require('fs-extra');\nconst { resolve } = require('path');\nconst { execSync } = require('child_process');\nconst chalk = require('chalk');\n\nasync function detectPackageManager() {\n  const { promisify } = require('util');\n  const { exec: defaultExec } = require('child_process');\n  const cwd = process.cwd();\n  const exec = promisify(defaultExec);\n  let pm = 'yarn';\n  try {\n    await exec(`${pm} -v`, { cwd });\n  } catch (_) {\n    pm = 'pnpm';\n    try {\n      await exec(`${pm} -v`, { cwd });\n    } catch (_ignore) {\n      pm = 'npm';\n      try {\n        await exec(`${pm} -v`, { cwd });\n      } catch (_) {\n        pm = undefined;\n      }\n    }\n  }\n  if (pm === undefined) {\n    console.log(chalk.red('No available package manager! (`yarn`, `pnpm` or `npm` is needed)'));\n    process.exit(1);\n  }\n  return pm;\n}\n\nasync function dev() {\n  process.env.NODE_ENV = 'testing';\n\n  let example = 'with-javascript';\n  if (3 <= process.argv.length) {\n    const newExample = process.argv[2];\n    if (!existsSync(resolve(__dirname, `examples/${newExample}`))) {\n      console.log(chalk.red(`Not found examples/${newExample}`));\n      console.log('');\n      process.exit(1);\n    }\n    example = newExample;\n  }\n\n  await remove('workspace');\n\n  execSync('node ' + resolve(__dirname, 'bin/nuxtron') + ` init workspace --example ${example}`, {\n    cwd: __dirname,\n    stdio: 'inherit',\n  });\n\n  const pm = await detectPackageManager();\n  execSync(`${pm} install && ${pm} run dev`, {\n    cwd: resolve(__dirname, 'workspace'),\n    stdio: 'inherit',\n  });\n}\n\ndev();\n"
  },
  {
    "path": "examples/_template/gitignore.txt",
    "content": "node_modules\n*.log\n.nuxt\napp\ndist\n"
  },
  {
    "path": "examples/_template/js/main/background.js",
    "content": "import { app } from 'electron';\nimport serve from 'electron-serve';\nimport {\n  createWindow,\n  exitOnChange,\n} from './helpers';\n\nconst isProd = process.env.NODE_ENV === 'production';\n\nif (isProd) {\n  serve({ directory: 'app' });\n} else {\n  exitOnChange();\n  app.setPath('userData', `${app.getPath('userData')} (development)`);\n}\n\n(async () => {\n  await app.whenReady();\n\n  const mainWindow = createWindow('main', {\n    width: 1000,\n    height: 600,\n  });\n\n  if (isProd) {\n    await mainWindow.loadURL('app://./home');\n  } else {\n    const port = process.argv[2];\n    await mainWindow.loadURL(`http://localhost:${port}/home`);\n    mainWindow.webContents.openDevTools();\n  }\n})();\n\napp.on('window-all-closed', () => {\n  app.quit();\n});\n"
  },
  {
    "path": "examples/_template/js/main/helpers/create-window.js",
    "content": "import {\n  screen,\n  BrowserWindow,\n} from 'electron';\nimport * as Store from 'electron-store';\n\nexport default function createWindow(windowName, options) {\n  const key = 'window-state';\n  const name = `window-state-${windowName}`;\n  const store = new Store({ name });\n  const defaultSize = {\n    width: options.width,\n    height: options.height,\n  };\n  let state = {};\n  let win;\n\n  const restore = () => store.get(key, defaultSize);\n\n  const getCurrentPosition = () => {\n    const position = win.getPosition();\n    const size = win.getSize();\n    return {\n      x: position[0],\n      y: position[1],\n      width: size[0],\n      height: size[1],\n    };\n  };\n\n  const windowWithinBounds = (windowState, bounds) => {\n    return (\n      windowState.x >= bounds.x &&\n      windowState.y >= bounds.y &&\n      windowState.x + windowState.width <= bounds.x + bounds.width &&\n      windowState.y + windowState.height <= bounds.y + bounds.height\n    );\n  };\n\n  const resetToDefaults = () => {\n    const bounds = screen.getPrimaryDisplay().bounds;\n    return Object.assign({}, defaultSize, {\n      x: (bounds.width - defaultSize.width) / 2,\n      y: (bounds.height - defaultSize.height) / 2\n    });\n  };\n\n  const ensureVisibleOnSomeDisplay = (windowState) => {\n    const visible = screen.getAllDisplays().some(display => {\n      return windowWithinBounds(windowState, display.bounds)\n    });\n    if (!visible) {\n      // Window is partially or fully not visible now.\n      // Reset it to safe defaults.\n      return resetToDefaults();\n    }\n    return windowState;\n  };\n\n  const saveState = () => {\n    if (!win.isMinimized() && !win.isMaximized()) {\n      Object.assign(state, getCurrentPosition());\n    }\n    store.set(key, state);\n  };\n\n  state = ensureVisibleOnSomeDisplay(restore());\n\n  win = new BrowserWindow({\n    ...options,\n    ...state,\n    webPreferences: {\n      nodeIntegration: true,\n    },\n  });\n\n  win.on('close', saveState);\n\n  return win;\n};\n"
  },
  {
    "path": "examples/_template/js/main/helpers/exit-on-change.js",
    "content": "import { watchFile } from 'fs';\nimport { join } from 'path';\nimport { app } from 'electron';\n\nexport default function exitOnChange() {\n  watchFile(join(process.cwd(), 'app/background.js'), () => {\n    app.exit(0);\n  });\n};\n"
  },
  {
    "path": "examples/_template/js/main/helpers/index.js",
    "content": "import createWindow from './create-window';\nimport exitOnChange from './exit-on-change';\n\nexport {\n  createWindow,\n  exitOnChange,\n};\n"
  },
  {
    "path": "examples/_template/ts/main/background.ts",
    "content": "import { app } from 'electron';\nimport serve from 'electron-serve';\nimport {\n  createWindow,\n  exitOnChange,\n} from './helpers';\n\nconst isProd: boolean = process.env.NODE_ENV === 'production';\n\nif (isProd) {\n  serve({ directory: 'app' });\n} else {\n  exitOnChange();\n  app.setPath('userData', `${app.getPath('userData')} (development)`);\n}\n\n(async () => {\n  await app.whenReady();\n\n  const mainWindow = createWindow('main', {\n    width: 1000,\n    height: 600,\n  });\n\n  if (isProd) {\n    await mainWindow.loadURL('app://./home');\n  } else {\n    const port = process.argv[2];\n    await mainWindow.loadURL(`http://localhost:${port}/home`);\n    mainWindow.webContents.openDevTools();\n  }\n})();\n\napp.on('window-all-closed', () => {\n  app.quit();\n});\n"
  },
  {
    "path": "examples/_template/ts/main/helpers/create-window.ts",
    "content": "import {\n  screen,\n  BrowserWindow,\n  BrowserWindowConstructorOptions,\n  Rectangle,\n} from 'electron';\nimport Store from 'electron-store';\n\nexport default (windowName: string, options: BrowserWindowConstructorOptions): BrowserWindow => {\n  const key = 'window-state';\n  const name = `window-state-${windowName}`;\n  const store = new Store({ name });\n  const defaultSize = {\n    width: options.width,\n    height: options.height,\n  };\n  let state = {};\n  let win: BrowserWindow;\n\n  const restore = () => store.get(key, defaultSize);\n\n  const getCurrentPosition = () => {\n    const position = win.getPosition();\n    const size = win.getSize();\n    return {\n      x: position[0],\n      y: position[1],\n      width: size[0],\n      height: size[1],\n    };\n  };\n\n  const windowWithinBounds = (windowState: Rectangle, bounds: Rectangle) => {\n    return (\n      windowState.x >= bounds.x &&\n      windowState.y >= bounds.y &&\n      windowState.x + windowState.width <= bounds.x + bounds.width &&\n      windowState.y + windowState.height <= bounds.y + bounds.height\n    );\n  };\n\n  const resetToDefaults = () => {\n    const bounds = screen.getPrimaryDisplay().bounds;\n    return Object.assign({}, defaultSize, {\n      x: (bounds.width - defaultSize.width) / 2,\n      y: (bounds.height - defaultSize.height) / 2,\n    });\n  };\n\n  const ensureVisibleOnSomeDisplay = (windowState: Rectangle) => {\n    const visible = screen.getAllDisplays().some(display => {\n      return windowWithinBounds(windowState, display.bounds);\n    });\n    if (!visible) {\n      // Window is partially or fully not visible now.\n      // Reset it to safe defaults.\n      return resetToDefaults();\n    }\n    return windowState;\n  };\n\n  const saveState = () => {\n    if (!win.isMinimized() && !win.isMaximized()) {\n      Object.assign(state, getCurrentPosition());\n    }\n    store.set(key, state);\n  };\n\n  state = ensureVisibleOnSomeDisplay(restore());\n\n  const browserOptions: BrowserWindowConstructorOptions = {\n    ...options,\n    ...state,\n    webPreferences: {\n      nodeIntegration: true,\n    },\n  };\n  win = new BrowserWindow(browserOptions);\n\n  win.on('close', saveState);\n\n  return win;\n};\n"
  },
  {
    "path": "examples/_template/ts/main/helpers/exit-on-change.ts",
    "content": "import { watchFile } from 'fs';\nimport { join } from 'path';\nimport { app } from 'electron';\n\nexport default function exitOnChange(): void {\n  watchFile(join(process.cwd(), 'app/background.js'), () => {\n    app.exit(0);\n  });\n};\n"
  },
  {
    "path": "examples/_template/ts/main/helpers/index.ts",
    "content": "import createWindow from './create-window';\nimport exitOnChange from './exit-on-change';\n\nexport {\n  createWindow,\n  exitOnChange,\n};\n"
  },
  {
    "path": "examples/custom-build-options/README.md",
    "content": "<p align=\"center\"><img src=\"https://i.imgur.com/PTqXTbx.png\"></p>\n\n## Usage\n\n```bash\n# create an app\n$ nuxtron init my-app --example custom-build-options\n\n# install dependencies\n$ cd my-app\n$ yarn (or `npm install`)\n\n# development mode\n$ yarn dev (or `npm run dev`)\n\n# production build\n$ yarn build (or `npm run build`)\n\n# production build for all platform\n$ yarn build:all (or `npm run build:all`)\n\n# production build for windows 32 bit\n$ yarn build:win (or `npm run build:win`)\n\n# production build for macOS 64 bit\n$ yarn build:mac (or `npm run build:mac`)\n\n# production build for Linux\n$ yarn build:linux (or `npm run build:linux`)\n```\n"
  },
  {
    "path": "examples/custom-build-options/electron-builder.yml",
    "content": "appId: com.example.nuxtron\nproductName: My Nuxtron App\ncopyright: Copyright © 2019 Shiono Yoshihide\ndirectories:\n  output: dist\n  buildResources: resources\nfiles:\n  - from: .\n    filter:\n      - package.json\n      - app\npublish: null\n"
  },
  {
    "path": "examples/custom-build-options/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"custom-build-options\",\n  \"description\": \"My application description\",\n  \"version\": \"1.0.0\",\n  \"author\": \"Shiono Yoshihide <shiono.yoshihide@gmail.com>\",\n  \"main\": \"app/background.js\",\n  \"scripts\": {\n    \"dev\": \"nuxtron\",\n    \"build\": \"nuxtron build\",\n    \"build:all\": \"nuxtron build --all\",\n    \"build:win\": \"nuxtron build --win --ia32\",\n    \"build:mac\": \"nuxtron build --mac --x64\",\n    \"build:linux\": \"nuxtron build --linux\"\n  },\n  \"dependencies\": {\n    \"electron-serve\": \"^1.0.0\",\n    \"electron-store\": \"^6.0.1\"\n  },\n  \"devDependencies\": {\n    \"electron\": \"^10.1.5\",\n    \"electron-builder\": \"^22.9.1\",\n    \"nuxt\": \"^2.14.7\",\n    \"nuxtron\": \"^0.3.1\"\n  }\n}\n"
  },
  {
    "path": "examples/custom-build-options/renderer/nuxt.config.js",
    "content": "export default {\n  head: {\n    title: 'Nuxtron (custom-build-options)',\n  },\n  build: {\n    extend: (config) => {\n      config.target = 'electron-renderer';\n    },\n  },\n}\n"
  },
  {
    "path": "examples/custom-build-options/renderer/pages/about.vue",
    "content": "<template>\n  <div class=\"container\">\n    <img src=\"/nuxt-black.png\">\n    <h2>Thank you for testing Nuxtron</h2>\n    <p>Loaded from the {{ name }}</p>\n    <p>\n      <NuxtLink to=\"/home\">\n        Back home\n      </NuxtLink>\n    </p>\n  </div>\n</template>\n\n<script>\nexport default {\n  asyncData ({ req }) {\n    return {\n      name: process.static ? 'static' : (process.server ? 'server' : 'client'),\n    }\n  }\n}\n</script>\n\n<style scoped>\n.container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  height: 100%;\n  width: 100%;\n  background: black;\n  color: white;\n  font-family: \"Lucida Console\", Monaco, monospace;\n  padding-top: 100px;\n  text-align: center;\n}\na {\n  color: white;\n}\n</style>"
  },
  {
    "path": "examples/custom-build-options/renderer/pages/home.vue",
    "content": "<template>\n  <div class=\"container\">\n    <img src=\"/nuxt.png\">\n    <h2>Hello Nuxtron.</h2>\n    <p>Loaded from the {{ name }}</p>\n    <p>\n      <NuxtLink to=\"/about\">\n        About\n      </NuxtLink>\n    </p>\n  </div>\n</template>\n\n<script>\nexport default {\n  asyncData ({ req }) {\n    return {\n      name: process.static ? 'static' : (process.server ? 'server' : 'client'),\n    }\n  }\n}\n</script>\n\n<style scoped>\n.container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  height: 100%;\n  width: 100%;\n  background: white;\n  color: black;\n  font-family: \"Lucida Console\", Monaco, monospace;\n  padding-top: 100px;\n  text-align: center;\n}\na {\n  color: black;\n}\n</style>\n"
  },
  {
    "path": "examples/with-javascript/README.md",
    "content": "<p align=\"center\"><img src=\"https://i.imgur.com/PTqXTbx.png\"></p>\n\n## Usage\n\n```bash\n# create an app\n$ nuxtron init my-app --example with-javascript\n\n# install dependencies\n$ cd my-app\n$ yarn (or `npm install`)\n\n# development mode\n$ yarn dev (or `npm run dev`)\n\n# production build\n$ yarn build (or `npm run build`)\n```\n"
  },
  {
    "path": "examples/with-javascript/electron-builder.yml",
    "content": "appId: com.example.nuxtron\nproductName: My Nuxtron App\ncopyright: Copyright © 2019 Shiono Yoshihide\ndirectories:\n  output: dist\n  buildResources: resources\nfiles:\n  - from: .\n    filter:\n      - package.json\n      - app\npublish: null\n"
  },
  {
    "path": "examples/with-javascript/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"with-javascript\",\n  \"description\": \"My application description\",\n  \"version\": \"1.0.0\",\n  \"author\": \"Shiono Yoshihide <shiono.yoshihide@gmail.com>\",\n  \"main\": \"app/background.js\",\n  \"scripts\": {\n    \"dev\": \"nuxtron\",\n    \"build\": \"nuxtron build\"\n  },\n  \"dependencies\": {\n    \"electron-serve\": \"^1.0.0\",\n    \"electron-store\": \"^6.0.1\"\n  },\n  \"devDependencies\": {\n    \"electron\": \"^10.1.5\",\n    \"electron-builder\": \"^22.9.1\",\n    \"nuxt\": \"^2.14.7\",\n    \"nuxtron\": \"^0.3.1\"\n  }\n}\n"
  },
  {
    "path": "examples/with-javascript/renderer/nuxt.config.js",
    "content": "export default {\n  head: {\n    title: 'Nuxtron (with-javascript)',\n  },\n  build: {\n    extend: (config) => {\n      config.target = 'electron-renderer';\n    },\n  },\n}\n"
  },
  {
    "path": "examples/with-javascript/renderer/pages/about.vue",
    "content": "<template>\n  <div class=\"container\">\n    <img src=\"/nuxt-black.png\">\n    <h2>Thank you for testing Nuxtron</h2>\n    <p>Loaded from the {{ name }}</p>\n    <p>\n      <NuxtLink to=\"/home\">\n        Back home\n      </NuxtLink>\n    </p>\n  </div>\n</template>\n\n<script>\nexport default {\n  asyncData ({ req }) {\n    return {\n      name: process.static ? 'static' : (process.server ? 'server' : 'client'),\n    }\n  }\n}\n</script>\n\n<style scoped>\n.container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  height: 100%;\n  width: 100%;\n  background: black;\n  color: white;\n  font-family: \"Lucida Console\", Monaco, monospace;\n  padding-top: 100px;\n  text-align: center;\n}\na {\n  color: white;\n}\n</style>"
  },
  {
    "path": "examples/with-javascript/renderer/pages/home.vue",
    "content": "<template>\n  <div class=\"container\">\n    <img src=\"/nuxt.png\">\n    <h2>Hello Nuxtron.</h2>\n    <p>Loaded from the {{ name }}</p>\n    <p>\n      <NuxtLink to=\"/about\">\n        About\n      </NuxtLink>\n    </p>\n  </div>\n</template>\n\n<script>\nexport default {\n  asyncData ({ req }) {\n    return {\n      name: process.static ? 'static' : (process.server ? 'server' : 'client'),\n    }\n  }\n}\n</script>\n\n<style scoped>\n.container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  height: 100%;\n  width: 100%;\n  background: white;\n  color: black;\n  font-family: \"Lucida Console\", Monaco, monospace;\n  padding-top: 100px;\n  text-align: center;\n}\na {\n  color: black;\n}\n</style>\n"
  },
  {
    "path": "examples/with-typescript/README.md",
    "content": "<p align=\"center\"><img src=\"https://i.imgur.com/PTqXTbx.png\"></p>\n\n## Usage\n\n```bash\n# create an app\n$ nuxtron init my-app --example with-typescript\n\n# install dependencies\n$ cd my-app\n$ yarn (or `npm install`)\n\n# development mode\n$ yarn dev (or `npm run dev`)\n\n# production build\n$ yarn build (or `npm run build`)\n```\n"
  },
  {
    "path": "examples/with-typescript/electron-builder.yml",
    "content": "appId: com.example.nuxtron\nproductName: My Nuxtron App\ncopyright: Copyright © 2019 Shiono Yoshihide\ndirectories:\n  output: dist\n  buildResources: resources\nfiles:\n  - from: .\n    filter:\n      - package.json\n      - app\npublish: null\n"
  },
  {
    "path": "examples/with-typescript/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"with-typescript\",\n  \"description\": \"My application description\",\n  \"version\": \"1.0.0\",\n  \"author\": \"Shiono Yoshihide <shiono.yoshihide@gmail.com>\",\n  \"main\": \"app/background.js\",\n  \"scripts\": {\n    \"dev\": \"nuxtron\",\n    \"build\": \"nuxtron build\"\n  },\n  \"dependencies\": {\n    \"electron-serve\": \"^1.0.0\",\n    \"electron-store\": \"^6.0.1\"\n  },\n  \"devDependencies\": {\n    \"@nuxt/typescript\": \"^2.8.1\",\n    \"@types/node\": \"^12.7.12\",\n    \"electron\": \"^10.1.5\",\n    \"electron-builder\": \"^22.9.1\",\n    \"nuxt\": \"^2.14.7\",\n    \"nuxtron\": \"^0.3.1\",\n    \"typescript\": \"^3.6.4\"\n  }\n}\n"
  },
  {
    "path": "examples/with-typescript/renderer/nuxt.config.js",
    "content": "export default {\n  head: {\n    title: 'Nuxtron (with-typescript)',\n  },\n  build: {\n    extend: (config) => {\n      config.target = 'electron-renderer';\n    },\n  },\n}\n"
  },
  {
    "path": "examples/with-typescript/renderer/pages/about.vue",
    "content": "<template>\n  <div class=\"container\">\n    <img src=\"/nuxt-black.png\">\n    <h2>Thank you for testing Nuxtron</h2>\n    <p>Loaded from the {{ name }}</p>\n    <p>\n      <NuxtLink to=\"/home\">\n        Back home\n      </NuxtLink>\n    </p>\n  </div>\n</template>\n\n<script>\nexport default {\n  asyncData ({ req }) {\n    return {\n      name: process.static ? 'static' : (process.server ? 'server' : 'client'),\n    }\n  }\n}\n</script>\n\n<style scoped>\n.container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  height: 100%;\n  width: 100%;\n  background: black;\n  color: white;\n  font-family: \"Lucida Console\", Monaco, monospace;\n  padding-top: 100px;\n  text-align: center;\n}\na {\n  color: white;\n}\n</style>"
  },
  {
    "path": "examples/with-typescript/renderer/pages/home.vue",
    "content": "<template>\n  <div class=\"container\">\n    <img src=\"/nuxt.png\">\n    <h2>Hello Nuxtron.</h2>\n    <p>Loaded from the {{ name }}</p>\n    <p>\n      <NuxtLink to=\"/about\">\n        About\n      </NuxtLink>\n    </p>\n  </div>\n</template>\n\n<script>\nexport default {\n  asyncData ({ req }) {\n    return {\n      name: process.static ? 'static' : (process.server ? 'server' : 'client'),\n    }\n  }\n}\n</script>\n\n<style scoped>\n.container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  height: 100%;\n  width: 100%;\n  background: white;\n  color: black;\n  font-family: \"Lucida Console\", Monaco, monospace;\n  padding-top: 100px;\n  text-align: center;\n}\na {\n  color: black;\n}\n</style>\n"
  },
  {
    "path": "examples/with-typescript/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"esnext\",\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"jsx\": \"preserve\",\n    \"strict\": true,\n    \"sourceMap\": true,\n    \"importHelpers\": true,\n    \"esModuleInterop\": true,\n    \"emitDecoratorMetadata\": true,\n    \"experimentalDecorators\": true\n  },\n  \"exclude\": [\n    \"node_modules\"\n  ]\n}\n"
  },
  {
    "path": "lib/logger.ts",
    "content": "import chalk from 'chalk';\n\nconst log = (text: string) => {\n  console.log(chalk`{cyan [nuxtron]} ${text}`);\n};\n\nexport default log;\n"
  },
  {
    "path": "lib/nuxtron-build.ts",
    "content": "import fs from 'fs-extra';\nimport path from 'path';\nimport { SpawnSyncOptions } from 'child_process';\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport spawn from 'cross-spawn';\nimport { getNuxtronConfig } from './webpack/helpers';\nimport log from './logger';\n\nconst args = arg({\n  '--help': Boolean,\n  '--version': Boolean,\n  '--all': Boolean,\n  '--win': Boolean,\n  '--mac': Boolean,\n  '--linux': Boolean,\n  '--x64': Boolean,\n  '--ia32': Boolean,\n  '--armv7l': Boolean,\n  '--arm64': Boolean,\n  '--config': String,\n  '-h': '--help',\n  '-v': '--version',\n  '-w': '--win',\n  '-m': '--mac',\n  '-l': '--linux',\n  '-c': '--config',\n});\n\nif (args['--help']) {\n  console.log(chalk`\n    {bold.cyan nuxtron build} - Build and export the application for production deployment\n\n    {bold USAGE}\n\n      {bold $} {cyan nuxtron build} --help\n      {bold $} {cyan nuxtron build} [options]\n\n    {bold OPTIONS}\n\n      --help,    -h  shows this help message\n      --version, -v  displays the current version of nuxtron\n      --all          builds for Windows, macOS and Linux\n      --win,     -w  builds for Windows, accepts target list (see https://goo.gl/jYsTEJ)\n      --mac,     -m  builds for macOS, accepts target list (see https://goo.gl/5uHuzj)\n      --linux,   -l  builds for Linux, accepts target list (see https://goo.gl/4vwQad) \n      --x64          builds for x64\n      --ia32         builds for ia32\n      --armv7l       builds for armv7l\n      --arm64        builds for arm64\n  `);\n  process.exit(0);\n}\n\nconst cwd = process.cwd();\nconst spawnOptions: SpawnSyncOptions = {\n  cwd,\n  stdio: 'inherit',\n};\n\nasync function build() {\n  // Ignore missing dependencies\n  process.env.ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES = 'true';\n\n  const rendererSrcDir = getNuxtronConfig().rendererSrcDir || 'renderer';\n\n  try {\n    log('Clearing previous builds');\n    fs.removeSync(path.join(cwd, 'app'));\n    fs.removeSync(path.join(cwd, 'dist'));\n    fs.removeSync(path.join(cwd, rendererSrcDir, '.nuxt'));\n\n    log('Building renderer process');\n    const outdir = path.join(cwd, rendererSrcDir, 'dist');\n    const appdir = path.join(cwd, 'app');\n    spawn.sync('nuxt', ['build', path.join(cwd, rendererSrcDir)], spawnOptions);\n    spawn.sync('nuxt', ['generate', path.join(cwd, rendererSrcDir)], spawnOptions);\n    fs.copySync(outdir, appdir);\n    fs.removeSync(outdir);\n\n    log('Building main process');\n    spawn.sync('node', [path.join(__dirname, 'webpack/build.production.js')], spawnOptions);\n\n    log('Packaging - please wait a moment');\n    spawn.sync('electron-builder', createBuilderArgs(), spawnOptions);\n\n    log('See `dist` directory');\n  } catch (err) {\n    console.log(chalk`\n\n{bold.red Cannot build electron packages:}\n{bold.yellow ${err}}\n`);\n    process.exit(1);\n  }\n}\n\nfunction createBuilderArgs() {\n  let results = [];\n  if (args['--config']) {\n    results.push('--config');\n    results.push(args['--config'] || 'electron-builder.yml');\n  }\n  if (args['--all']) {\n    results.push('-wml');\n    results.push(...createArchArgs());\n  } else {\n    args['--win'] && results.push('--win');\n    args['--mac'] && results.push('--mac');\n    args['--linux'] && results.push('--linux');\n    results.push(...createArchArgs());\n  }\n  return results;\n}\n\nfunction createArchArgs() {\n  let archArgs = [];\n  args['--x64'] && archArgs.push('--x64');\n  args['--ia32'] && archArgs.push('--ia32');\n  args['--armv7l'] && archArgs.push('--armv7l');\n  args['--arm64'] && archArgs.push('--arm64');\n  return archArgs;\n}\n\nbuild();\n"
  },
  {
    "path": "lib/nuxtron-dev.ts",
    "content": "import {\n  ChildProcess,\n  SpawnSyncOptions,\n} from 'child_process';\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport spawn from 'cross-spawn';\nimport delay from 'delay';\nimport webpack from 'webpack';\nimport {\n  getNuxtronConfig,\n  getWebpackConfig,\n} from './webpack/helpers';\n\nconst args = arg({\n  '--help': Boolean,\n  '--version': Boolean,\n  '--port': Number,\n  '--custom-server': String,\n  '-h': '--help',\n  '-v': '--version',\n  '-p': '--port',\n  '-c': '--custom-server',\n});\n\nif (args['--help']) {\n  console.log(chalk`\n    {bold.cyan nuxtron dev} - Starts the nuxtron application in development mode\n\n    {bold USAGE}\n\n      {bold $} {cyan nuxtron dev} --help\n      {bold $} {cyan nuxtron dev}\n\n    {bold OPTIONS}\n\n      --help,    -h  shows this help message\n      --version, -v  displays the current version of nuxtron\n  `);\n  process.exit(0);\n}\n\nconst rendererPort = args['--port'] || 8888;\n\nconst spawnOptions: SpawnSyncOptions = {\n  cwd: process.cwd(),\n  stdio: 'inherit',\n};\n\nasync function dev() {\n  const { rendererSrcDir } = getNuxtronConfig();\n\n  let firstCompile = true;\n  let watching: any;\n  let mainProcess: ChildProcess;\n  let rendererProcess: ChildProcess;\n\n  const startMainProcess = () => {\n    mainProcess = spawn('electron', ['.', `${rendererPort}`], {\n      detached: true,\n      ...spawnOptions,\n    });\n    mainProcess.unref();\n  };\n\n  const startRendererProcess = () => {\n    const child = spawn('nuxt', ['-p', rendererPort, rendererSrcDir || 'renderer'], spawnOptions);\n    child.on('close', () => {\n      process.exit(0);\n    });\n    return child;\n  };\n\n  const killWholeProcess = () => {\n    if (watching) {\n      watching.close(() => {});\n    }\n    if (mainProcess) {\n      mainProcess.kill();\n    }\n    if (rendererProcess) {\n      rendererProcess.kill();\n    }\n  };\n\n  process.on('SIGINT', killWholeProcess);\n  process.on('SIGTERM', killWholeProcess);\n  process.on('exit', killWholeProcess);\n\n  rendererProcess = startRendererProcess();\n\n  // wait until renderer process is ready\n  await delay(8000);\n\n  const compiler = webpack(getWebpackConfig('development'));\n\n  watching = compiler.watch({}, async (err: any) => {\n    if (err) {\n      console.error(err.stack || err);\n      if (err.details) {\n        console.error(err.details);\n      }\n    }\n\n    if (firstCompile) {\n      firstCompile = false;\n    }\n\n    if (!err) {\n      if (!firstCompile) {\n        if (mainProcess) {\n          mainProcess.kill();\n        }\n      }\n      startMainProcess();\n    }\n  });\n}\n\ndev();\n"
  },
  {
    "path": "lib/nuxtron-init.ts",
    "content": "import fs from 'fs-extra';\nimport path from 'path';\nimport { execSync } from 'child_process';\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport log from './logger';\n\nconst cwd = process.cwd();\n\nconst args = arg({\n  '--help': Boolean,\n  '--version': Boolean,\n  '--template': String,\n  '--example': '--template',\n  '-h': '--help',\n  '-v': '--version',\n  '-t': '--template',\n  '-e': '--template',\n});\n\nif (args['--version']) {\n  const pkg = require(path.resolve(__dirname, '../package.json'));\n  console.log(`nuxtron v${pkg.version}`);\n  process.exit(0);\n}\n\nif (args['--help'] || (!args._[0])) {\n  console.log(chalk`\n    {bold.cyan nuxtron} - ⚡ Electron + Nuxt.js ⚡\n\n    {bold USAGE}\n\n      {bold $} {cyan nuxtron init} --help\n      {bold $} {cyan nuxtron init} {underline my-app}\n      {bold $} {cyan nuxtron init} {underline my-app} [--example {underline example_folder_name}]\n\n    {bold OPTIONS}\n\n      --help,    -h                      shows this help message\n      --version, -v                      displays the current version of nuxtron\n      --example, -e {underline example_folder_name}  sets the example as a template\n  `);\n  process.exit(0);\n}\n\nfunction detectPackageManager() {\n  let pm: string | undefined = 'yarn';\n  try {\n    execSync(`${pm} -v`, { cwd });\n  } catch (_) {\n    pm = 'pnpm';\n    try {\n      execSync(`${pm} -v`, { cwd });\n    } catch (_ignore) {\n      pm = 'npm';\n      try {\n        execSync(`${pm} -v`, { cwd });\n      } catch (_) {\n        pm = undefined;\n      }\n    }\n  }\n  if (pm === undefined) {\n    console.log(chalk.red('No available package manager! (`yarn`, `pnpm` or `npm` is needed)'));\n    process.exit(1);\n  }\n  return pm;\n}\n\nconst example = args['--template'] || args['--example'] || 'with-javascript';\nif (!fs.existsSync(path.resolve(__dirname, `../examples/${example}`))) {\n  console.log(chalk.red(`Not found examples/${example}`));\n  process.exit(1);\n}\n\nfunction init(name: string) {\n  log('Copy template');\n  const ext = fs.existsSync(path.resolve(__dirname, `../examples/${example}/tsconfig.json`)) ? 'ts' : 'js';\n  fs.copySync(path.resolve(__dirname, `../examples/_template/gitignore.txt`), path.join(cwd, `${name}/.gitignore`));\n  fs.copySync(path.resolve(__dirname, `../examples/_template/${ext}`), path.join(cwd, name));\n  fs.copySync(path.resolve(__dirname, `../examples/${example}`), path.join(cwd, name));\n\n  log('Set meta information');\n  const pkg = path.resolve(cwd, `${name}/package.json`);\n  const content = fs.readJSONSync(pkg);\n  content.name = name;\n  if (process.env.NODE_ENV === 'testing') {\n    content.devDependencies.nuxtron = cwd;\n  }\n  fs.writeJSONSync(pkg, {...content}, {spaces: 2});\n\n  let cmd: string;\n  const pm = detectPackageManager();\n  switch (pm) {\n    case 'yarn':\n      cmd = 'yarn && yarn dev';\n      break;\n    case 'pnpm':\n      cmd = 'pnpm install && pnpm run dev';\n      break;\n    default:\n      cmd = 'npm install && npm run dev';\n      break;\n  }\n  log(`Run \\`${cmd}\\` inside of \"${name}\" to start the app`);\n}\n\ninit(args._[0] || 'my-nuxtron-app');\n"
  },
  {
    "path": "lib/nuxtron-list.ts",
    "content": "import fs from 'fs';\nimport path from 'path';\nimport arg from 'arg';\nimport chalk from 'chalk';\n\nconst args = arg({\n  '--help': Boolean,\n  '--version': Boolean,\n  '-h': '--help',\n  '-v': '--version',\n});\n\nif (args['--version']) {\n  const pkg = require(path.resolve(__dirname, '../package.json'));\n  console.log(`nuxtron v${pkg.version}`);\n  process.exit(0);\n}\n\nif (args['--help']) {\n  console.log(chalk`\n    {bold.cyan nuxtron} - ⚡ Electron + Nuxt.js ⚡\n\n    {bold USAGE}\n\n      {bold $} {cyan nuxtron list} --help\n      {bold $} {cyan nuxtron list}\n\n    {bold OPTIONS}\n\n      --help,     -h   shows this help message\n      --version,  -v   displays the current version of nuxtron\n  `);\n  process.exit(0);\n}\n\nlet names = fs.readdirSync(path.resolve(__dirname, '../examples'));\nnames = names.filter(name => name.toLowerCase() !== '_template' && name.toLowerCase() !== '.ds_store');\n\nconsole.log(chalk`\n  {bold.cyan Available examples (${names.length.toString()}):}\n`);\n\nfor (let i = 0; i < names.length; i++) {\n  console.log(chalk`    {bold - ${names[i]}}`);\n}\n\nconsole.log(chalk`\n  {bold USAGE}\n\n    {bold $} {cyan nuxtron init} {underline my-app} [--example {underline example_folder_name}]\n\n  If you want to use \"{underline with-typescript}\", just type the command below:\n\n    {bold $} nuxtron init my-app --example {underline with-typescript}\n`);\n"
  },
  {
    "path": "lib/nuxtron.ts",
    "content": "import path from 'path';\nimport chalk from 'chalk';\nimport spawn from 'cross-spawn';\n\nconst defaultCommand = 'dev';\nconst commands = new Set([\n  'list',\n  'init',\n  'build',\n  defaultCommand,\n]);\n\nlet cmd = process.argv[2];\nlet args: string[] = [];\nlet nodeArgs: string[] = [];\n\nif (new Set(['--version', '-v']).has(cmd)) {\n  const pkg = require(path.resolve(__dirname, '../package.json'));\n  console.log(`nuxtron v${pkg.version}`);\n  process.exit(0);\n}\n\nif (new Set(['--help', '-h']).has(cmd)) {\n  console.log(chalk`\n    {bold.cyan nuxtron} - ⚡ Electron + Nuxt.js ⚡\n    {bold USAGE}\n      {bold $} {cyan nuxtron init} --help\n      {bold $} {cyan nuxtron init} {underline my-app}\n      {bold $} {cyan nuxtron init} {underline my-app} [--example {underline example_folder_name}]\n  `);\n  process.exit(0);\n}\n\nconst inspectArg = process.argv.find(arg => arg.includes('--inspect'));\nif (inspectArg) {\n  nodeArgs.push(inspectArg);\n}\n\nif (commands.has(cmd)) {\n  args = process.argv.slice(3);\n} else {\n  cmd = defaultCommand;\n  args = process.argv.slice(2);\n}\n\nconst defaultEnv = cmd === 'dev' ? 'development' : 'production';\nprocess.env.NODE_ENV = process.env.NODE_ENV || defaultEnv;\n\nconst cli = path.join(__dirname, `nuxtron-${cmd}`);\n\nconst startProcess = () => {\n  const proc = spawn('node', [...nodeArgs, cli, ...args], { stdio: 'inherit' });\n  proc.on('close', (code: number, signal: string) => {\n    if (code !== null) {\n      process.exit(code);\n    }\n    if (signal) {\n      if (signal === 'SIGKILL') {\n        process.exit(137);\n      }\n      process.exit(1);\n    }\n    process.exit(0);\n  });\n  proc.on('error', (err) => {\n    console.error(err);\n    process.exit(1);\n  });\n  return proc;\n}\n\nconst proc = startProcess();\n\nconst wrapper = () => {\n  if (proc) {\n    proc.kill();\n  }\n}\nprocess.on('SIGINT', wrapper);\nprocess.on('SIGTERM', wrapper);\nprocess.on('exit', wrapper);\n"
  },
  {
    "path": "lib/webpack/build.production.ts",
    "content": "import webpack from 'webpack';\nimport { getWebpackConfig } from './helpers';\n\nconst compiler = webpack(getWebpackConfig('production'));\n\ncompiler.run((err: Error, stats: webpack.Stats) => {\n  err && console.error(err.stack || err);\n  stats.hasErrors() && console.error(stats.toString());\n});\n"
  },
  {
    "path": "lib/webpack/helpers.ts",
    "content": "import fs from 'fs';\nimport path from 'path';\nimport merge from 'webpack-merge';\nimport configure from './webpack.config';\n\nconst cwd = process.cwd();\nconst ext = fs.existsSync(path.join(cwd, 'tsconfig.json')) ? '.ts' : '.js';\n\nconst getNuxtronConfig = () => {\n  const configPath = path.join(cwd, 'nuxtron.config.js');\n  if (fs.existsSync(configPath)) {\n    return require(configPath);\n  } else {\n    return {};\n  }\n};\n\nconst getWebpackConfig = (env: 'development' | 'production') => {\n  const { mainSrcDir, webpack } = getNuxtronConfig();\n  const userConfig = merge(configure(env), {\n    entry: {\n      background: path.join(cwd, mainSrcDir || 'main', `background${ext}`),\n    },\n    output: {\n      filename: '[name].js',\n      path: path.join(cwd, 'app'),\n    },\n  });\n\n  const userWebpack = webpack || {};\n  if (typeof userWebpack === 'function') {\n    return userWebpack(userConfig, env);\n  } else {\n    return merge(userConfig, userWebpack);\n  }\n};\n\nexport {\n  getNuxtronConfig,\n  getWebpackConfig,\n};\n"
  },
  {
    "path": "lib/webpack/webpack.config.ts",
    "content": "import path from 'path';\nimport webpack from 'webpack';\n\nconst cwd = process.cwd();\nconst externals = require(path.join(cwd, 'package.json')).dependencies;\n\nexport default (env: 'development' | 'production'): webpack.Configuration => ({\n  mode: env,\n  target: 'electron-main',\n  node: {\n    __dirname: false,\n    __filename: false,\n  },\n  externals: [...Object.keys(externals || {})],\n  devtool: 'source-map',\n  resolve: {\n    extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],\n    modules: [path.join(cwd, 'app'), 'node_modules'],\n  },\n  output: {\n    libraryTarget: 'commonjs2',\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.(js|ts)x?$/,\n        use: {\n          loader: 'babel-loader',\n          options: {\n            cacheDirectory: true,\n            presets: ['@babel/preset-typescript'],\n          },\n        },\n        exclude: [\n          /node_modules/,\n          path.join(cwd, 'renderer'),\n        ],\n      },\n    ],\n  },\n  plugins: [\n    new webpack.EnvironmentPlugin({\n      NODE_ENV: env,\n    }),\n  ],\n});\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"nuxtron\",\n  \"version\": \"0.3.1\",\n  \"description\": \"⚡ Nuxt.js + Electron ⚡\",\n  \"repository\": \"git@github.com:saltyshiomix/nuxtron.git\",\n  \"author\": \"Shiono Yoshihide <shiono.yoshihide@gmail.com>\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/saltyshiomix/nuxtron\",\n  \"keywords\": [\n    \"electron\",\n    \"nuxt\",\n    \"nuxtjs\",\n    \"nuxt.js\",\n    \"vue\",\n    \"vuejs\",\n    \"vue.js\",\n    \"nuxtron\"\n  ],\n  \"bugs\": {\n    \"url\": \"https://github.com/saltyshiomix/nuxtron/issues\",\n    \"email\": \"shiono.yoshihide@gmail.com\"\n  },\n  \"files\": [\n    \"bin\",\n    \"examples\"\n  ],\n  \"bin\": {\n    \"nuxtron\": \"bin/nuxtron.js\"\n  },\n  \"scripts\": {\n    \"predev\": \"npm run build\",\n    \"dev\": \"node dev\",\n    \"prebuild\": \"rimraf bin\",\n    \"build\": \"rollup -c\",\n    \"prepublishOnly\": \"cross-env NODE_ENV=production npm run build\"\n  },\n  \"dependencies\": {\n    \"@babel/core\": \"^7.12.3\",\n    \"@babel/preset-typescript\": \"^7.12.1\",\n    \"arg\": \"^4.1.3\",\n    \"babel-loader\": \"^8.1.0\",\n    \"chalk\": \"^4.1.0\",\n    \"cross-spawn\": \"^7.0.3\",\n    \"delay\": \"^4.4.0\",\n    \"fs-extra\": \"^9.0.1\",\n    \"webpack\": \"^5.2.0\",\n    \"webpack-merge\": \"^5.2.0\"\n  },\n  \"devDependencies\": {\n    \"@babel/plugin-proposal-class-properties\": \"^7.12.1\",\n    \"@babel/plugin-proposal-object-rest-spread\": \"^7.12.1\",\n    \"@babel/plugin-syntax-dynamic-import\": \"^7.8.3\",\n    \"@rollup/plugin-babel\": \"^5.2.1\",\n    \"@rollup/plugin-commonjs\": \"^16.0.0\",\n    \"@rollup/plugin-node-resolve\": \"^10.0.0\",\n    \"@types/cross-spawn\": \"^6.0.2\",\n    \"@types/fs-extra\": \"^9.0.2\",\n    \"@types/node\": \"^14.14.5\",\n    \"cross-env\": \"^7.0.2\",\n    \"rimraf\": \"^3.0.2\",\n    \"rollup\": \"^2.32.1\",\n    \"rollup-plugin-auto-external\": \"^2.0.0\",\n    \"rollup-plugin-terser\": \"^7.0.2\",\n    \"typescript\": \"^4.0.5\"\n  }\n}\n"
  },
  {
    "path": "rollup.config.js",
    "content": "import external from 'rollup-plugin-auto-external';\nimport resolve from '@rollup/plugin-node-resolve';\nimport babel from '@rollup/plugin-babel';\nimport commonjs from '@rollup/plugin-commonjs';\nimport { terser } from 'rollup-plugin-terser';\n\nconst extensions = ['.js', '.jsx', '.ts'];\n\nconst coreConfig = {\n  plugins: [\n    external(),\n    resolve({\n      extensions,\n    }),\n    babel({\n      extensions,\n      exclude: /node_modules/,\n    }),\n    commonjs(),\n    (process.env.NODE_ENV === 'production' && terser()),\n  ],\n  external: [\n  ],\n};\n\nconst cliConfig = (src) => ({\n  input: src,\n  output: {\n    dir: 'bin',\n    format: 'cjs',\n    banner: '#!/usr/bin/env node',\n  },\n  ...coreConfig,\n});\n\nconst config = (src, dist) => ({\n  input: src,\n  output: {\n    file: dist,\n    format: 'cjs',\n  },\n  ...coreConfig,\n});\n\nexport default [\n  cliConfig('lib/nuxtron.ts'),\n  cliConfig('lib/nuxtron-init.ts'),\n  cliConfig('lib/nuxtron-dev.ts'),\n  cliConfig('lib/nuxtron-build.ts'),\n  cliConfig('lib/nuxtron-list.ts'),\n  config('lib/webpack/build.production.ts', 'bin/webpack/build.production.js'),\n];\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"esnext\",\n    \"module\": \"commonjs\",\n    \"moduleResolution\": \"node\",\n    \"strict\": true,\n    \"skipLibCheck\": true,\n    \"esModuleInterop\": true\n  },\n  \"include\": [\n    \"lib\"\n  ]\n}\n"
  }
]