A component for displaying and editing reviews for items on the Internet Archive.
npm install @internetarchive/reviewsNote: The release currently only includes the web component for rendering the review edit form, and the form will trigger the spam detector unless a valid token is passed in.
Default review form:
<ia-review-form .identifier=${'foo'}></ia-review-form>Form with prefilled previous review:
const myReview = new Review({
stars: 3,
reviewtitle: 'What a cool book!',
reviewbody: 'I loved it.',
})
<ia-review-form .identifier=${'foo'} .oldReview=${myReview}></ia-review-form>Submittable form with token:
import { VALID_TOKEN } from './constants.ts'
<ia-review-form .identifier=${'foo'} .token=${VALID_TOKEN}></ia-review-form>npm installnpm run testnpm run startNote: If you'd like ReCaptcha to work in your dev environment, you'll want to temporarily replace the defaultSiteKey in app-root.ts with the current IA site key. If you don't know what that is, ask in the UX team channel.
npm run test:watchTo scan the project for linting errors, run
npm run lintYou can lint with ESLint and Prettier individually as well
npm run lint:eslintnpm run lint:prettierTo automatically fix many linting errors, run
npm run formatYou can format using ESLint and Prettier individually as well
npm run format:eslintnpm run format:prettier- Use your Jira ticket to create your namespace. This will prevent collision as many people can be simultaneously working in the same repository.
- run:
npm version prerelease --preid=wedev-1234- this command will help auto-increment your alpha package tags inside your jira ticket namespace. refer to npm versioning docs & [guides for more info on command options](- this command will help auto-increment your alpha package tags inside your jira ticket namespace)
- run:
npm publish --tag alphaour most used development tags are: alpha, canary
- run:
We like to create a pull request specifically after the expected changes are merged into the main branch. Steps:
- create PR with version number as branch name. Ex, if the next version is 3.2.1, your git command will be:
git checkout -b v3.2.1- in the new branch, run the following:
git pull --tagsto fetch all git tagsnpm version X.X.Xto set the new tag WITH the commit git taggedgit push --tagsnpm publish
- in the new branch, run the following:
- Note: version numbers must start at minimum, with 1 (1.x.x) in order for consumers to automatically receive patch updates (no tags starting with 0, like 0.x.x)