A boilerplate for React projects in Typescript, with inline css and multimedia resource inclusion (in the form of base64 strings), that builds and packages everything using Webpack into a single html file.
Ideal for SPAs (Single Page Applications), or to practice on TypeScript.
... and open up its root directory
(You can skip to step 3, if you already have yarn).
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
Source: https://classic.yarnpkg.com/lang/en/docs/install/#debian-stable
(You can skip to step 4, if you already have one of the latest versions of node).
node -v
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
Restart your terminal window. Then verify that nvm was successfully installed:
command -v nvm
nvm ls-remote
Will list all of the nodejs versions available for download.
Copy the version code of the latest LTS version of node and paste it in place of XX.XX.XX
in the command below:
nvm install XX.XX.XX
This will install the version of node you selected.
Source: https://medium.com/nethues-technologies/how-to-update-node-version-on-linux-9f18450e70dc
yarn install
... in the project's root directory, to install this project's dependencies.
yarn run build
... this will generate the (production-ready) file /dist/index.html
, which you can open from any browser.
or:
yarn run dev-build
... this will instead generate a development build with un-minified names and errors (easier to debug), always at the same location /dist/index.html
.
http://www.7timer.info/bin/api.pl?lon=113.17&lat=23.09&product=astro&output=xml
https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/basic_type_example
https://www.typescriptlang.org/docs/handbook/basic-types.html#table-of-contents
https://blog.logrocket.com/types-vs-interfaces-in-typescript/
https://medium.com/@jeffbutsch/typescript-interface-functions-c691a108e3f1