diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..d251bc4 --- /dev/null +++ b/.npmignore @@ -0,0 +1,11 @@ +node_modules +.git +.vscode +dist +**/* +!dist/ +!dist/** +!src/styles/ +!.gitignore +.github +/.github diff --git a/README.md b/README.md index e69679c..027e88c 100644 --- a/README.md +++ b/README.md @@ -23,23 +23,23 @@ npm install git+https://git.maze.io/maze/cyberduck.git#main Note: when installing from a git repository, npm will clone the source. For consumers to get built artifacts (the `dist` bundle and compiled types) the repository must either include the `dist` output or provide a `prepare`/build step that runs on install. If you prefer not to publish, using `npm pack` from the repo owner (tarball) ensures the built `dist` is included. -## Including styles +## Including styles (optional) -CyberDuck emits a single bundled stylesheet. Preferred import options: +Styles are optional — CyberDuck does not automatically inject styles when you import components. Import styles only if you want the theme and utilities applied. -- Import the packaged CSS via the package export (recommended): +- Recommended (package export): ```ts import 'cyberduck/css' ``` -- Import the compiled CSS file directly (older setups): +- Direct CSS file (older setups): ```ts import 'cyberduck/dist/cyberduck.css' ``` -- If you want to include and compile the SCSS source in your app (allows customization), import the SCSS entry: +- Compile and include SCSS in your app (for customization): ```scss @use 'cyberduck/styles/cyberduck.scss' as *; diff --git a/package.json b/package.json index 1b4bd39..5547f58 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ }, "scripts": { "dev": "vite", - "build": "tsc -p tsconfig.build.json && vite build", + "build": "tsc -p tsconfig.build.json && npm run styles:build && vite build", "prepare": "npm run build", "lint": "eslint .", "lint:css": "stylelint \"src/**/*.{scss,css,sass}\"", diff --git a/src/index.ts b/src/index.ts index 60fefab..46c299e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,5 +4,6 @@ export { default as Footer } from './components/Layout/Footer' export { default as Layout } from './components/Layout/Layout' export { default as Split } from './components/Layout/Split' -// Export styles so consumers can import the theme -import './index.scss' +// Styles are optional — consumers can import the CSS or SCSS themselves: +// import 'cyberduck/css' +// import 'cyberduck/styles/cyberduck.scss' diff --git a/tsconfig.build.json b/tsconfig.build.json index 07570b2..350617e 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -6,5 +6,9 @@ "emitDeclarationOnly": true, "outDir": "dist/types" }, - "include": ["src"] + "include": [ + "src/components", + "src/index.ts", + "src/styles" + ] }