Skip to content

Commit

Permalink
feat: components
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasm91 committed Nov 12, 2024
1 parent 1c87d9b commit 46b0073
Show file tree
Hide file tree
Showing 49 changed files with 6,802 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
changelog:
categories:
- title: 🚨 Breaking Changes
labels:
- changelog:breaking-change

- title: 🫥 Deprecated Changes
labels:
- changelog:deprecated

- title: 🔒 Security
labels:
- changelog:security

- title: 🚀 Features
labels:
- changelog:feature

- title: 🌟 Enhancements
labels:
- changelog:enhancement

- title: 🐛 Bug fixes
labels:
- changelog:bugfix

- title: 📚 Documentation
labels:
- changelog:documentation
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Run npm install
run: npm ci

- name: Run build
run: npm run build
67 changes: 67 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Prepare release

on:
workflow_dispatch:
inputs:
releaseType:
description: 'Type of release'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-root
cancel-in-progress: true

jobs:
bump_version:
runs-on: ubuntu-latest

outputs:
ref: ${{ steps.push-tag.outputs.commit_long_sha }}

steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }}
private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}

- name: Bump version
run: misc/release/pump-version.sh "${{ inputs.releaseType }}"

- name: Commit and tag
id: push-tag
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'chore: version ${{ env.IMMICH_VERSION }}'
tag: ${{ env.IMMICH_VERSION }}
push: true

prepare_release:
runs-on: ubuntu-latest
needs: bump_version

steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.ORG_RELEASE_TOKEN }}

- name: Create draft release
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: ${{ env.IMMICH_VERSION }}
generate_release_notes: true
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish

on:
release:
types: [published]

permissions:
packages: write

jobs:
publish:
name: Publish
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install
run: npm ci

- name: Build
run: npm run build

- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test
on:
workflow_dispatch:
pull_request:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Run npm install
run: npm ci

- name: Run linter
run: npm run lint
if: ${{ !cancelled() }}

- name: Run formatter
run: npm run format
if: ${{ !cancelled() }}

- name: Run check
run: npm run check
if: ${{ !cancelled() }}

# - name: Run unit tests
# run: npm test
# if: ${{ !cancelled() }}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
test-results
node_modules

# Output
.output
.vercel
/.svelte-kit
/build
/dist

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

*storybook.log
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.18
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock
15 changes: 15 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# create-svelte

Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).

Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```bash
# create a new project in the current directory
npx sv create

# create a new project in my-app
npx sv create my-app
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.

## Building

To build your library:

```bash
npm run package
```

To create a production version of your showcase app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
## Publishing

Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).

To publish your library to [npm](https://www.npmjs.com):

```bash
npm publish
```
33 changes: 33 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import prettier from 'eslint-config-prettier';
import js from '@eslint/js';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import ts from 'typescript-eslint';

export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],

languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
);
25 changes: 25 additions & 0 deletions misc/release/pump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# usage: './misc/release/pump-version.sh <major|minor|patch>


TYPE=$1

if [[ $TYPE == "major" ]]; then
echo 'Pumping a major version'
elif [[ $TYPE == "minor" ]]; then
echo 'Pumping a minor version'
elif [[ $TYPE == "patch" ]]; then
echo 'Pumping a patch version'
else
echo 'Expected <major|minor|patch>'
exit 1
fi

VERSION_BEFORE=v$(jq -r '.version' package.json)

npm version $TYPE

VERSION_AFTER=v$(jq -r '.version' package.json)

echo "Pumped @immich/ui from $VERSION_BEFORE to $VERSION_AFTER"
echo "IMMICH_VERSION=$VERSION_AFTER" >>"$GITHUB_ENV"
Loading

0 comments on commit 46b0073

Please sign in to comment.