Skip to content

shin/tools

Repository files navigation

@shin/tools

A toolset for personal projects

Table of Contents

Configuration

Create a .npmrc file in your code root dir

@shin:registry=https://npm.pkg.github.com

Installation

Install with Github PAT

Add Github PAT to .npmrc file

//npm.pkg.github.com/:_authToken=GITHUB_TOKEN
npm i -D @shin/tools@latest

Install with git manually

Add the script to package.json

"scripts": {
  "install-st": "git clone https://github.com/shin/tools.git && npm run build --prefix tools && npm i -D ./tools"
}
npm run install-st

Usage

Create a st.config.json file in your code root dir

{
  "monorepo": {
    "electron": {
      "dir": "packages/electron"
    },
    "next": {
      "dir": "packages/next",
      "useExports": true
    }
  }
}

Add the script to package.json

"scripts": {
  "st": "tools build"
}

Add the exports to package.json(packages/next) like below

"exports": {
    "./standalone/server": "./.next/standalone/packages/next/server.js"
  }

Features

  • monorepo/
    • packages/
      • electron/
      • next/

In monorepo,

  1. Comment out the line in the standalone server.js because it causes a problem when used in the Electron app.
process.chdir(__dirname)
  1. Electron Forge does not use the local Next.js package correctly, so to run the Next.js standalone server, you need to prepare Next.js resources for Electron to build the bundler.

Dependencies

  • @types/node
  • esbuild
  • glob
  • typescript

License

MIT


Additional Information

Version History

  • 0.0.1
    • Initial Release

Contact

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published