topic-carousel
v0.0.1-alpha
Published
Carousel with infinite scroll with the ability to filter items through topics
Downloads
2
Readme
TopicCarousel
Carousel with infinite scroll with the ability to filter items through topics.
Does not rely on any other dependency.
❗️ This package just started development, it isn't functional right now. Still, feel free to contribuite
▶️ Use
Install the package
npm i topic-carousel
or include the script directly in your html file with
<script src="https://unpkg.com/[email protected]/dist/bundle/topic-carousel.min.js"></script>
📖 Documentation
Check the complete documentation here.
💻 Development
If you want to improve the package or you are just curious on how it works, follow this section.
🗂 Folders structure
.
├── .github # github actions
├── .husky # git hooks
├── config # configuration files for rollup, lint-staged and playwright
├── dist # [AFTER npm run build] built package, to be used in the browser
├── docs # [AFTER npm run docs] documentation
├── lib # [AFTER npm run build] built package, to be used with node.js
├── public # base folder used by the dev web server
├── src # source code
├── tests # unit and end to end tests
└── README.md # THIS FILE
🧾 Requirements
- node.js 14.x
- npm (or similar package manager)
Notable dev-dependencies
- typescript to make programming decent
- rollup.js for building the package
- playwright for end to end tests
- mocha for unit tests
🔧 Setup
Install the dependencies with
npm install
🌐 Standalone web server
To play around and see for yourself any changes to the library, you can use the integrated web server. Just run
# Build the package locally and start the web server
npm run build:dev
npm run serve
# Allows live reload by refreshing the page
npm run serve:dev
🧱 Build
Make sure everything is clean by running
npm run clean
then all the versions of the package can be built with the command
npm run build
🧪 Tests
Unit
After having installed the dependencies, run
npm run test:unit
E2E
After having installed the dependencies, complete the setup required by playwright with
npx playwright install --with-deps
you can then run
npm run test:e2e
ℹ️ The e2e test configuration is located in config/playwright.config.ts. Right now, only chromium and firefox are tested, but it is possible to also include safari (see commented section).