Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikey-t/swig-cli-init
Npm package for initilizing a fresh swig-cli project
https://github.com/mikey-t/swig-cli-init
Last synced: about 1 month ago
JSON representation
Npm package for initilizing a fresh swig-cli project
- Host: GitHub
- URL: https://github.com/mikey-t/swig-cli-init
- Owner: mikey-t
- License: mit
- Created: 2024-02-24T20:25:34.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-01T20:02:37.000Z (9 months ago)
- Last Synced: 2024-04-23T13:44:35.971Z (8 months ago)
- Language: TypeScript
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# swig-cli-init
An npm script to setup a [swig-cli](https://github.com/mikey-t/swig) project in an opinionated way with ESM and typescript support.
## Requirements
Node.js >= 20 or [Volta](https://docs.volta.sh/guide/getting-started).
[Pnpm](https://pnpm.io/installation) is also recommended, but not required.
## Script Setup Actions
- Create package.json if not present
- Set package.json type to `module`
- Detect valid Node.js version (>= 20)
- If Volta detected, run `volta pin node@20`
- If Node.js version is less than 20, throw an error stating the requirement
- Add tsconfig.json if not present
- Detect if pnpm is installed
- Install dev dependencies, latest versions (using pnpm, if detected):
- swig-cli
- typescript
- tsx
- @mikeyt23/node-cli-utils
- @types/node@20
- Create `swigfile.ts` if not present## Usage
Run this command in the directory you want your swig project initialized in:
```
npx swig-cli-init@latest
```## Notes
This script is re-runnable, so it can also act as an updater since it installs the latest versions of dev dependencies and skips steps that are already complete.
The [pnpm](https://pnpm.io/installation) package manager is preferred and will be used if it is detected as installed, but it not required.
## Roadmap and Ideas
- Add additional options:
- Output directory
- Which Node package manager to use
- ESM vs CommonJS
- Typescript vs vanilla javascript
- Tsx vs ts-node for typescript loader
- Specific version of Node
- Whether or not to include the Node types
- Whether or not to include the '@mikeyt23/node-cli-utils' package
- Whether or not to include swig-cli-modules
- Additional integration tests