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.
src/
: typescript and scss source filespublic/
: public files exposed by netlify to the users
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:
- set this repo as git remote origin
- checkout to the remote branch
dev
and pull - run
pnpm install
to install all required packages - 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
.
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:
git checkout master
git merge dev --ff-only
git push
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.
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 cmdwhere sass
on Windows, orwhich sass
on macOS or Linux. On windows the path is usuallyC:\Users\<username>\AppData\Roaming\npm\sass.CMD
.
-W
,--watch
: set the mode to watch-X
,--exclude
: excludes the given entries, i.e. reverses the selection-E
,--entry
: the following arguments are entries from the config file-P
,--profile
: the following arguments are profiles from the config file
command | equivalent |
---|---|
pnpm dev |
node builder.mjs -W |
pnpm build |
node builder.mjs |
pnpm build-all |
node builder.mjs -X index:rocket |
pnpm dev -P index
watches and compiles live index.js and index.css from index.ts and index.scsspnpm dev -E about:scss projects:ts
watches about.scss and projects.tspnpm build index:rocket
builds rocket.js from rocket.tspnpm build index:rocket -X
builds everything except rocket.js