@wized/embed v2.0.13
Wized Embed
This repsotory contains the client embed code for Wized 2.0.
File overview
src/index.ts
- the entry point of the to-be-embedded script.
How to run this project
- Make sure you have
pnpm
installed in your machine. Runnpm i -g pnpm
to install it globally. - Run
pnpm install
. - Run
pnpm dev
.
Linting
To lint the project, run pnpm lint
.
To fix all the auto-fixable linting issues, run pnpm lint:fix
.
CD
The Wized Embed is continuously deployed to npm
via Changesets.
Changesets does the following automatically for us:
- Generates a changelog that documents all the deployed updates.
- Manages the package's SemVer.
- Publishes new versions to
npm
.
New versions of the package are defined via:
pnpm changeset
This command will trigger a CLI questionnaire asking for the type of changes and a summary describing them.
Once you're done, it will create a Changeset file in the .changesets/
folder.
What's most important is the next step. The Changesets workflow is triggered when pushing a commit to the main
or staging
branches.
- Committing a changeset to the
staging
branch will trigger abeta
release workflow. - Committing a changeset to the
main
branch will trigger aproduction
release workflow.
Once the workflow starts, Changesets will scan the project for all changeset files and automatically open a new Pull Request that:
- Bumps the package version number based on the type of changes.
- Updates the
CHANGELOG.md
file with the changeset info. - Removes the previously generated changeset files.
Merging this Pull Request will finalize the workflow by deploying the new version to npm
.
Importing the Wized Embed via jsDelivr
Staging
For beta
releases, the Wized Embed can be imported either with a version range like:
https://cdn.jsdelivr.net/npm/@wized/embed@beta/embed.js
Or with a specific version like:
https://cdn.jsdelivr.net/npm/@wized/embed@1.1.0-beta-20230227192721/embed.js
Production
For production
releases, the Wized Embed can be imported either with a version range like:
https://cdn.jsdelivr.net/npm/@wized/embed@1/embed.js
Or with a specific version like:
https://cdn.jsdelivr.net/npm/@wized/embed@1.1.0/embed.js
Purging CDN cache
Version range URLs have a 7 day
maxAge cache.
Meaning that imports like https://cdn.jsdelivr.net/npm/@wized/embed@beta/embed.js
will display the same content for 7 days before the cache is invalidated.
If you need to manually purge the cache you just have to visit the same URL but replacing the subdomain for purge
:
https://purge.jsdelivr.net/npm/@wized/embed@beta/embed.js