Hi, I'm @uppercod, creator of Atomico and I want to thank you for starting with Atomico.
If you need help you can find it at:
Now what you have installed is a quick start kit based on Vite, which you can scale for your project, now to continue you must execute the following commands:
npm installnpm start: Initialize the development servernpm build: Optional, Generate a build of your project from the html file index.html.
src
|- my-component
| |- my-component.{js,jsx,ts,tsx}
| |- my-component.test.js
| |- README.md
|- components.js # import all componentsThe
npm run createcommand, will create a webcomponent with the recommended structure, the template of this webcomponent can be edited intemplates/component.md.
Create a new webcomponent inside src, according to the recommended structure, the template of this webcomponent can be edited in templates/component.md.
initialize Vite server
package the app using de Vite
Run a test environment in watch mode, as configured in vite.config.js.
Run a test environment with coverage, as configured in vite.config.js.
Allows you to export your project to npm, this command executes changes in package.json before exporting and the changes will be reverted once exported.
temporary changes are:
- generation of the packages.json#exports
- generation of the pages.json#typesVersions
- Compilation of the files and generation of the types if the --types flag is used.
@atomico/vite, allows to preprocess the css template string through postcss, to use this feature add in vite.config.js the following options:
import atomico from "@atomico/vite";
import { defineConfig } from "vite";
export default defineConfig({
...
plugins: [
atomico({
cssLiterals: { postcss: true }, // 👈 CONFIGURATION TO ADD
}),
],
});To use postcss at least 1 plugin is required.
"postcss": {
"plugins": {
"postcss-import": {}
}
}Add to package.json#scripts.build:
--outDir docs # modify the destination directory
--base my-repo # github page folder