@inspire11/create v0.0.28
๐ฆ @inspire11/create
Run one simple command with interactive project generator to install bootstrapped packages designed to let you hit the ground running.
- ๐ Creating Projects
- ๐งพ Features
- ๐ฉ Setting Up Your Editor
- ๐๐ผ Contributing
- โน๏ธ FAQs
- ๐ฏ Thanks
๐ Creating Projects
You'll need Node v10
or later.
npm init @inspire11
The interactive CLI will help you create and configure your project automatically.
Since this repo includes the CLI and it's tests, you'll only need to fork or clone this project if you want to contribute. If you find this project useful, please consider leaving feedback so others can find it. Thanks!
๐งพ Features
- Write standard, future javascript โ with stable ESNext features โ today (stage 3 or finished features)
- Optionally use typescript to improve tooling, linting, and documentation generation
- Export as a javascript module, making your work fully tree-shakable for consumers capable of using es6 imports (like Rollup, Webpack, or Parcel)
- Export type declarations to improve your downstream development experience
- Backwards compatibility for Node.js-style (CommonJS) imports
- Both strict and flexible typescript configurations available
So we can have nice things:
- Generate API documentation (HTML or JSON) without a mess of JSDoc tags to maintain
- Collocated, atomic, concurrent unit tests with Cypress
- Automatic linting and formatting using ESLint
๐ฉ Setting Up Your Editor
Before you start, consider using an editor with good typescript support.
VS Code (below) is a popular option. Editors with typescript support can provide helpful autocomplete, inline documentation, and code refactoring features.
Also consider installing editor extensions for ESLint. These extensions automatically format your code each time you save, and may quickly become invaluable.
๐๐ผ Contributing
To work on the CLI, clone and build the repo, then use npx
to test it globally.
git clone git@bitbucket.org:inspire11/create.git
cd create
npm i
npm run build
npm run prod
The following tasks make development faster and more interactive:
Command | Description |
---|---|
build | Clean and rebuild the project |
dev | Run the pre-processed script directly via ts-node |
prod | Run the compiled script via node |
test | Lint and unit test the project |
To start working, run the dev
task using npm
.
npm run dev
The dev
task will run the script directly via ts-node
; the test
task will run the test suite in watch mode with Jest. Each time you save, any changes will be rebuilt and retested.
Since only changed files are rebuilt and retested, this workflow remains fast even for large projects.
โน๏ธ FAQs
Why are there two builds? (main
and module
)
The src
of @inspire11/create
is compiled into two separate builds: main
and module
. The main
build is configured to use the CommonJS module system. The module
build uses the new es6 module system.
Because Node.js LTS releases do not yet support the es6 module system, some projects which depend on your project will follow the main
field in package.json
. Tools which support the new system (like Rollup, Webpack, or Parcel) will follow the module
field, giving them the ability to statically analyze your project. These tools can tree-shake your module
build to import only the code they need.
Why put tests next to the source code?
By convention, sample tests in this project are adjacent to the files they test.
- Such tests are easy to find.
- You see at a glance if a part of your project lacks tests.
- Nearby tests can reveal how a part works in context.
- When you move the source (inevitable), you remember to move the test.
- When you rename the source file (inevitable), you remember to rename the test file.
๐ฏ Thanks
Using @inspire11/create
for your project? Please send a pull request to add it to the list!
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago