3.0.1 • Published 15 days ago

@niiwin/core v3.0.1

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
15 days ago

Niiwin

This repo contains the source code for the Niiwin Rails engine and npm package. Find out more about Niiwin at https://niiwin.ca

Getting started for Niiwin Core Developers

Follow these steps if you are a Niiwin Core Developer and you work on the Niiwin RubyGem, npm package, or dev toolchain:

Prerequisites

You'll need the following installed to continue setting up your development environment:

  • A Ruby version manager/switcher (rbenv, rvm, chruby, asdf, etc.)
  • Node.js (14.21.3+)
  • Yarn (1.22.0+)
  • Postgresql (9.6+)
  • Redis (6+)
  • Optional: The 1Password CLI1

Install Ruby

This assumes you have rbenv installed, though another Ruby version manager will also work.

  • Check that the required Ruby version 3.2.2 is installed: rbenv versions
  • Install it if it's not installed yet: rbenv install 3.2.2
  • Set global Ruby version to 3.2.2: rbenv global 3.2.2

Install the Niiwin gem

Since you are developing the Niiwin gem alongside an application, you will clone the Niiwin code repo and use a locally sourced version of the gem:

  • cd into the directory where you want to keep the Niiwin Gem.
  • Clone the repo git clone git@github.com:animikii/niiwin.git

Install dependencies

Make sure you are in the Niiwin gem root directory, then:

bundle install
yarn install
yarn build

Activate the repository-level shared .gitconfig

This allows all devs to share git settings (such as commits to automatically ignore when blaming) for the project.

git config --local include.path ../.gitconfig

Generate a new Niiwin App

You will use a locally sourced version of the niiwin-init script. In order to do so you will specify a custom path to the Niiwin gem source (/path/to/local/niiwin). Note that you can use this approach also to test the niiwin-init script itself:

/path/to/local/niiwin/bin/niiwin-init --name my-awesome-app --path /path/to/local/niiwin

Once the script is done, cd into the new app's root directory and start the app:

.bin/dev

In a browser, visit http://localhost:3000, and log in with the SoftwareDeveloper credentials:

  • Email: software-developer@niiwin.dev
  • Password: niiwin

Now you can start working on the new Niiwin App, or on the Niiwin Engine itself.

NOTE: when providing a custom path to the niiwin gem to the niiwin-init script, that absolute path will be inserted into the app's Gemfile for the niiwin entry. If you plan on sharing the app's code with other developers, you should change the absolute path to the niiwin gem to a relative one: Change gem "niiwin", path: "/absolute/path/to/niiwin" to gem "niiwin", path: "../niiwin".