PoliTo-Rocket-Team / website-old

Static files of the PoliTo Rocket Team website
2 stars 0 forks source link
scss typescript

Old PoliTo Rocket Team Website

These are the source files of the old PRT website written in html, typescript, and scss. This repository is now archived: please refer to website-new for the new SvelteKit website.

File structure

Contribute

Since typescript and scss must be compiled, a bundler (rollup) is used, along with sass compiler. The pnpm package manager is used instead of npm (why?). Thus, in order to contribute, follow the steps:

  1. set this repo as git remote origin
  2. checkout to the remote branch dev and pull
  3. run pnpm install to install all required packages
  4. set "SASS" entry in .env file to the path to sass compiler

If you're using vscode and live server extension, set its root settings to /public.

About branches

The master branch is the production one, whose public folder is hosted by netlify on the official url. Any relatively big, new feature must be implemented on the dev branch before release on the master. The current state of the dev branch can be seen at dev.politorocketteam.it.

When merging the two branches, please use fast forwarding when possible. Instead of using github merge features (which would delete the dev branch), do the following on the cmd:

If some commits were made on the master branch, before working on the dev one, run git merge master in the cmd after checkout to dev.

Build and develop

The builder.mjs node script compiles and/or watches ts and scss files in the src folder based on the configuration of the file src/config.json.

node builder.mjs <...args>
pnpm build <...args>

To watch and compile scss files, it relies on the SASS executable of your machine, since the npm package of sass allows only one-time compilation. Thus, you must set the "SASS" entry of your .env file to the path of the sass executable.

If the sass executable is on your PATH, you can locate it via cmd where sass on Windows, or which sass on macOS or Linux. On windows the path is usually C:\Users\<username>\AppData\Roaming\npm\sass.CMD.

Flags

Scripts

command equivalent
pnpm dev node builder.mjs -W
pnpm build node builder.mjs
pnpm build-all node builder.mjs -X index:rocket

Examples