Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
generate-swap-project
Advanced tools
Generate An ES.Next/StandardJS/UnitTest Ready, Github or Gitlab Project in Seconds! − A generator for SWAP projects −
Check out the following repository to see what a project generated with generate-swap-project
looks like out the box:
$ npm install --global generate generate-swap-project
$ gen swap-project
Should scaffold the project in the destination path you choose when asked.
.
├─┬ src/
| ├─┬ tests/
| | └─ index.test.js
| ├─┬ assets/
| | └─┬ img/
| | └── ...
| └─┬ lib/
| └─ index.js
├── contributing.md
├── .editorconfig
├── .git
├── .gitattributes
├── .gitignore
├── .gitlab-ci.yml
├── index.js
├── LICENSE
├── node_modules
├── .npmrc
├── package.json
├── README.md
└── .travis.yml
my-swap-app
projectswap-project:default
Runs the project
task.
$ gen swap-project
or
$ gen swap-project:default
swap-project:project
Generate the whole project in the directory choosen by the user when in ask to the question.
Runs all the following tasks in the following order:
prompt
dest
package
gitignore
gitattributes
editorconfig
npmrc
contributing
license
main
readme
travis
gitlabci
git
$ gen swap-project
or
$ gen swap-project:default
swap-project:prompt
Ask the user for all the required data for all the tasks in this generator.
$ gen swap-project:prompt
swap-project:dest
Set the destination directory for generated files.
$ gen swap-project:dest
swap-project:package
Generate a package.json
file.
$ gen swap-project:package
The file includes:
swap-project:git
Create a local git repository, add all files in the directory and create a first commit.
$ gen swap-project:git
swap-project:gitignore
Generate a file .gitignore
in the destination directory.
$ gen swap-project:gitignore
swap-project:gitattributes
Generate a file .gitattributes
in the destination directory.
$ gen swap-project:gitattributes
swap-project:editorconfig
Generate a file .editorconfig
in the destination directory.
$ gen swap-project:editorconfig
swap-project:npmrc
Generate a file .npmrc
in the destination directory.
$ gen swap-project:npmrc
swap-project:contributing
Generate a file .contributing.md
in the destination directory.
$ gen swap-project:contributing
swap-project:lincense
Generate a file LICENSE
in the destination directory.
$ gen swap-project:lincense
swap-project:main
Generate a file main.js
in the destination directory.
$ gen swap-project:main
swap-project:readme
Generate a file README.md
in the destination directory.
$ gen swap-project:readme
swap-project:travis
Generate a file .travis
in the destination directory.
$ gen swap-project:travis
swap-project:gitlabci
Generate a file .gitlab-ci.yml
in the destination directory.
$ gen swap-project:gitlabci
The codebase is written using the ESNext Specification (ECMAScript Stage 0), following the StandardJS Code Style
We use:
See the contribution guide in a separated document.
Get the latest node engine (example with nvm
):
$ nvm install lts/carbon
Install yarn from npm (for development only):
$ npm install --global yarn
All the rest of the development dependencies are local.
Clone the repo and install dependencies:
$ git clone git@github.com:sirap-group/generate-swap-project.git
$ cd generate-swap-project
$ yarn install
Finally, run the test pipeline:
$ yarn pipeline:test
Task Command | Task description |
---|---|
yarn clear | Delete the ./build/ and ./dist repositories |
yarn lint | Lint source files |
yarn lint:esnext | Lint ESNext source files |
yarn build | Build the whole distribution |
yarn build:assets | Build all the assets |
yarn build:assets:img | Build the images assets |
yarn build:assets:templates | Build the templates assets |
yarn build:lib | Build only the lib |
yarn build:tests | Build only the tests |
yarn build:docs | [TODO] Build only the docs |
yarn test | Run the tests in ./dist/tests/ |
yarn tests | An alias for yarn test |
yarn travis | Run the travis script |
yarn docs | [TODO] Serve the docs |
yarn pipeline | Run the complete pipeline |
yarn pipeline:test | Run the required jobs to run the tests, then run the tests |
yarn pipeline:build | Run the required jobs to build the dist, then build the dist |
yarn pipeline:docs | [TODO] Run the required jobs to serve the docs, then serve the docs |
yarn pipeline:build:tests | Run the required jobs to build the docs, then build the docs |
yarn pipeline:build:lib | Run the required jobs to build the docs, then build the docs |
yarn pipeline:build:docs | [TODO] Run the required jobs to build the docs, then build the docs |
yarn release | An alias to yarn release:patch |
yarn release:prerelease | Release and publish a new semver version (x.y.z-rc+1) |
yarn release:patch | Release and publish a new patch semver version (x.y.z+1 ) |
yarn release:minor | Release and publish a new minor semver version (x.y+1.z=0 ) |
yarn release:major | Release and publish a new major semver version (x+1.y=0.z=0 ) |
B.D.D. means Behavior-Driven-Development
The project is ready to code in BDD mode. Just run the bdd
yarn command:
$ yarn bdd
The project will be lint, built, the BDD unit tests will be run, and the process will watch for any file changes to loop over the previous tasks (lint
, build
, test
, watch
).
The task yarn pipeline:build
generate a ./dist
folder in the repository's root directory but this folder is not part of the git repository (there is an entry in the .gitignore
file). However the dist folder is included in the package.json#files
field.
Thus to release a new, lets say, "patch" version, just run:
$ yarn release:patch
The whole build pipeline is run locally (lint, transpile, test) and then a new git tag and a new npm tag are pushed up.
Rémi Becheras
Copyright © 2018 Groupe SIRAP
This software is open source software under the terms of the MIT license.
See LICENSE
FAQs
Generate An ES.Next/StandardJS/UnitTest Ready, Github or Gitlab Project in Seconds! − A generator for SWAP projects −
The npm package generate-swap-project receives a total of 0 weekly downloads. As such, generate-swap-project popularity was classified as not popular.
We found that generate-swap-project demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.