Skip to content

Commit

Permalink
Merge pull request #1 from IATI/setup
Browse files Browse the repository at this point in the history
Setup repository structure
  • Loading branch information
tillywoodfield authored May 8, 2024
2 parents 6d56fa6 + d1a6060 commit d4cf256
Show file tree
Hide file tree
Showing 13 changed files with 11,638 additions and 1 deletion.
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

0 comments on commit d4cf256

Please sign in to comment.