Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup repository structure #1

Merged
merged 21 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI
on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Build project
run: npm run build
- name: Build storybook
run: npm run build:storybook
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OS
.DS_Store

# NPM
node_modules

# Storybook
*storybook.log
storybook-static

# Build
dist
22 changes: 22 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { StorybookConfig } from "@storybook/web-components-vite";
import { NodePackageImporter } from "sass";

const config: StorybookConfig = {
framework: "@storybook/web-components-vite",
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: ["@storybook/addon-essentials"],
async viteFinal(config) {
const { mergeConfig } = await import("vite");
return mergeConfig(config, {
css: {
preprocessorOptions: {
scss: {
pkgImporter: new NodePackageImporter(),
},
},
},
});
},
};

export default config;
7 changes: 7 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Preview } from "@storybook/web-components";

import "../src/scss/iati.scss";

const preview: Preview = {};

export default preview;
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# design-system
# IATI Design System

## Usage

### NPM

```
npm install iati-design-system
```

### CDN

```
https://cdn.jsdelivr.net/npm/iati-design-system@[X.Y.Z]/dist/css/iati.css
```

## Development

Start storybook:

```
npm start
```

## Project Structure

Sass code roughly follows [The 7-1 Pattern](https://sass-guidelin.es/#the-7-1-pattern).

Storybook stories should be placed alongside their respective component.

## Production build

Build CSS:

```
npm run build
```

Build storybook:

```
npm run build:storybook
```
19 changes: 19 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import js from "@eslint/js";
import gitignore from "eslint-config-flat-gitignore";
import eslintConfigPrettier from "eslint-config-prettier";
import globals from "globals";
import tsEslint from "typescript-eslint";

export default [
gitignore(),
{
languageOptions: {
globals: {
...globals.node,
},
},
},
js.configs.recommended,
...tsEslint.configs.recommended,
eslintConfigPrettier,
];
Loading