This project focuses on creating a design system for the Amelia WordPress booking plugin using Vue.js. Our goal is to enhance the user interface and experience consistency throughout the plugin.
Before contributing to this project, please ensure you have the following tools installed:
- Node.js
- NVM (Node Version Manager)
- pnpm (Performant npm)
To maintain consistency across different development environments, we use NVM (Node Version Manager) for managing Node.js versions.
If NVM is not already installed on your machine, you can follow the installation instructions on the NVM GitHub page.
We recommend using the Latest LTS (Long-Term Support) version of Node.js for this project. To install and use the latest LTS version, execute the following commands:
nvm install --lts
nvm use --lts
To set up your development environment and start contributing to the design system, follow these steps:
-
Clone the project repository and navigate to the project directory:
git clone git@bitbucket.org:tmsplugins/amelia-design-system.git cd amelia-design-system
-
Install the project dependencies using pnpm:
pnpm install
To ensure code quality and consistency, we use ESLint for linting and Prettier for formatting. Here are the commands to run these tools:
Lint with ESLint
To identify and report on patterns found in ECMAScript/JavaScript code, we use ESLint. It helps in finding problematic patterns or code that doesn't adhere to certain style guidelines.
To run ESLint, use the following command:
pnpm lint
This command will check your code for any linting errors based on the project's ESLint configuration.
Format with Prettier
Prettier is an opinionated code formatter that supports many languages and integrates with most editors. It removes all original styling and ensures that all outputted code conforms to a consistent style.
To format your code using Prettier, use the following command:
pnpm format
This command will automatically format your code files according to the project's Prettier configuration, ensuring consistency across your codebase.
When working on the project, you might want to see your changes reflected immediately. For this purpose, you can use the following command to compile your project and set up hot-reloading:
pnpm dev
To compile and minify your project for production use, execute the following command:
pnpm build
This will generate a dist
directory with the compiled assets, ready for production deployment.
Follow these instructions to add a new component to the project. The new component should be placed in the src/components
directory, and its name should start with Am
.
- Navigate to the
src/components
directory in your project. - Create a new file for your component. The filename should start with
Am
and follow the PascalCase convention. For example,AmButtonAction.vue
for a button component. - Inside the new file, define your Vue component. Here's a basic template you can start with:
<template>
<div>
<!-- Your component HTML goes here -->
</div>
</template>
<script setup>
// Component logic using Composition API goes here
</script>
<style scoped lang="scss">
/* Your component SCSS goes here */
</style>
To make the component available for import, you need to export it from the src/components/index.ts
file.
- Open
src/index.ts
file. - Add an export statement for your new component.
After the component is exported in the index.ts
file, you can import and use it in other parts of your application like this:
import { AmButtonAction } from '@/components'
Now you're ready to use AmButtonAction
in your application.
Remember to follow these steps each time you add a new component to ensure consistency and maintainability in your project.
This document outlines the steps needed to deploy your package to the npm registry. Ensure you follow each step carefully to successfully publish your package.
Before deploying, you need to update the version of your package in package.json
. This version number should adhere to semantic versioning (semver) standards. Update the version field to reflect the new version of your package.
Example:
"version": "1.0.1"
Run the build command to generate the latest distribution of your package. This step is crucial to ensure that the latest code changes are compiled and ready for publication.
pnpm run build
Before publishing, you need to be logged in to npm. Use the following command to log in. If you're already logged in, you can skip this step.
pnpm login
Follow the prompts to enter your npm account credentials.
Once you're logged in and have your package ready, use the following command to publish it to npm:
pnpm publish