CPNT 201
Assignment 4 - Vite Project with a Pull Request
Weight: 20%
Due:
Late Penalty: 10% deduction for each day late. Submissions will not be accepted more than three days late.
Instructions
- Create a new Vanilla Vite project.
- Modify
package.jsonaccording to the requirements listed in the Marking Criteria. - Modify the project structure according to the requirements listed in the Marking Criteria.
- Initialize project as a Git repository and make your changes in a branch called
201-a4 - Install a date library as an ESM module and demonstrate its use on the default Vanilla Vite home page.
- Install a second
npmpackage of your choice and demonstrate its use. - Add your changes to
mainbranch as a Pull Request. - Deploy your project to a free host that supports Vite.
Marking Criteria
Each of the following requirements will be worth 4 points for a total of 20 points.
1. npm project setup
Initialize an npm project that has properly formatted package.json and .gitignore files:
- Project
nameset to201-a4 - Project
descriptionset to an a description of the assignment - Project
typeset tomodule - Project
mainscript set to the name of the entry page of your project - Project
authorset to your name - Project
licenseset toMIT -
.gitignorefile present that excludesnode_modulesdirectory, along with common Mac and Windows files/extensions- This file will be set up for you when you initialize a project with Vite
2. Vite Project Improvements
Make the following improvements to Vite’s default vanilla project setup:
- Move
.jsfiles to a dedicatedjsdirectory - Move
.cssfiles to a dedicatedcssdirectory - Move images (such as
.png,.svg, etc) to a dedicatedimagesdirectory- This includes the
vite.svgimage located in thepublicdirectory
- This includes the
3. Date Library
Install a date library such as DayJS, luxon or date-fns:
- Library listed as a local dependency in
package.json - Library imported into a Node or Vite project using ES Module
importsyntax - Project installs fresh dependencies properly when
npm installis entered from the command line - Main script runs when
npm run devis entered from the command line - Using your chosen date library, output:
- the current date to the vanilla Vite home page in the following format: “Today’s date: Oct 30, 2023”;
- The number of days since this program started on Sept 5, 2023.
4. Above and Beyond
Install a second npm package of your choice and demonstrate its use in your project.
- Library listed as a local dependency in
package.json - Library imported into a Node or Vite project using ES Module
importsyntax - Project installs fresh dependencies properly when
npm installis entered from the command line - Main script runs when
npm run devis entered from the command line - Package either makes a visual change to the Vite project output or improves the project in some non-trivial way
- Include link to your chosen package in your
README
5. Pull Request and Deployment
Demonstrate your knowledge of GitHub Pull Requests by adding your work from a PR created from a branch called 201-a4.
- Push
201-a4branch to GitHub - Merge your changes into
mainfrom a Pull Request created from your pushed branch - Deploy your project to a free host that supports Vite, such as Vercel or Netlify
Submission Requirements
- Add a
README.mdfile to the root of your project that contains:- your name
- course and assignment number
- link to deployed github page
- link to github repo
- attributions to assets
- ZIP all files required for the site to operate and submit to Brightspace;
- Include links to the following as a comment in your Brightspace submission:
- GH repo
- Direct link to your
201-a4Pull Request - Deployed site link