A component for displaying and editing reviews for items on the Internet Archive.
npm install @internetarchive/reviews
Note: 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 install
npm run test
npm run test:watch
To scan the project for linting errors, run
npm run lint
You can lint with ESLint and Prettier individually as well
npm run lint:eslint
npm run lint:prettier
To automatically fix many linting errors, run
npm run format
You can format using ESLint and Prettier individually as well
npm run format:eslint
npm 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 alpha
our 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 --tags
to fetch all git tagsnpm version X.X.X
to set the new tag WITH the commit git taggedgit push --tags
npm 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)