Skip to content

Commit

Permalink
Merge pull request #314 from EATSTEAK/dev
Browse files Browse the repository at this point in the history
0.11.1
  • Loading branch information
Twince authored Sep 14, 2022
2 parents 0b36ab7 + d112066 commit 37dec8b
Show file tree
Hide file tree
Showing 184 changed files with 9,126 additions and 9,151 deletions.
8 changes: 8 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -e

pnpm install --frozen-lockfile
pnpm -r prettier
pnpm -r lint
pnpm -r check
48 changes: 48 additions & 0 deletions .github/workflows/lint-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Check code

on:
pull_request:
types: [ opened, edited, reopened, synchronize ]
jobs:
check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: Setup pnpm cache
uses: actions/cache@v2
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Run prettier check
run: pnpm -r prettier
- name: Run eslint in server and types
run: pnpm -r --filter=!client lint
- name: Run eslint on changed files in client
uses: tj-actions/[email protected]
with:
path: "./packages/client"
file_extensions: |
**/*.ts
**/*.svelte
**/*.js
**/*.json
- name: Build client
run: pnpm -r --filter=client build
- name: Run svelte-check
run: pnpm -r check
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lockerweb",
"version": "0.11.0",
"version": "0.11.1",
"description": "SSU IT Collage Locker system.",
"private": true,
"scripts": {
Expand Down
74 changes: 47 additions & 27 deletions packages/client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:tailwindcss/recommended',
'eslint:recommended',
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended',
'prettier'
],
plugins: ['svelte3', '@typescript-eslint', 'tailwindcss'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
}
root: true,
extends: ['plugin:import/recommended', 'eslint:recommended'],
plugins: ['svelte3', '@typescript-eslint', 'tailwindcss'],
ignorePatterns: ['*.cjs'],
overrides: [
{
files: ['*.svelte'],
processor: 'svelte3/svelte3',
parser: '@typescript-eslint/parser',
extends: [
'plugin:import/typescript',
'airbnb-typescript/base',
'plugin:tailwindcss/recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
rules: {
'@typescript-eslint/indent': 'off',
},
},
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:import/typescript',
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended',
'prettier',
],
rules: {
'@typescript-eslint/indent': 'off',
},
},
],
settings: {
'svelte3/typescript': () => require('typescript'),
},
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
ecmaVersion: 2020,
},
env: {
browser: true,
es2017: true,
node: true,
},
};
8 changes: 4 additions & 4 deletions packages/client/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"bracketSameLine": true
}
9 changes: 5 additions & 4 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"name": "client",
"version": "0.11.0",
"version": "0.11.1",
"scripts": {
"dev": "cross-env VITE_BASE_URL=http://localhost:3000 vite dev --port 5002 --host 0.0.0.0",
"build": "vite build",
"package": "svelte-kit package",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check --plugin-search-dir=. . && eslint .",
"format": "prettier --write --plugin-search-dir=. .",
"prettier": "prettier --check --plugin-search-dir=. . ",
"lint": "eslint .",
"format": "eslint . --fix && prettier --write --plugin-search-dir=. .",
"delete": "node ./scripts/delete.js",
"deploy": "node ./scripts/deploy.js"
},
Expand All @@ -32,7 +33,7 @@
"postcss": "^8.4.14",
"postcss-load-config": "^4.0.1",
"prettier": "^2.6.2",
"prettier-plugin-svelte": "^2.7.0",
"prettier-plugin-tailwindcss": "^0.1.13",
"svelte": "^3.44.0",
"svelte-check": "^2.7.1",
"svelte-preprocess": "^4.10.7",
Expand Down
12 changes: 6 additions & 6 deletions packages/client/postcss.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ const tailwindcss = require('tailwindcss');
const autoprefixer = require('autoprefixer');

const config = {
plugins: [
//Some plugins, like tailwindcss/nesting, need to run before Tailwind,
tailwindcss(),
//But others, like autoprefixer, need to run after,
autoprefixer
]
plugins: [
//Some plugins, like tailwindcss/nesting, need to run before Tailwind,
tailwindcss(),
//But others, like autoprefixer, need to run after,
autoprefixer,
],
};

module.exports = config;
3 changes: 3 additions & 0 deletions packages/client/prettier.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: [require('prettier-plugin-tailwindcss')],
};
56 changes: 28 additions & 28 deletions packages/client/scripts/delete.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { exec } from 'child_process';

exec('aws cloudformation describe-stacks --stack-name ssu-it-locker', (err, stdout, stderr) => {
if (err) {
console.error(`Exception thrown: ${err.message}`);
return;
}
if (stderr) {
console.error(`Error occurred: ${stderr}`);
return;
}
const stackObj = JSON.parse(stdout);
const s3Name = stackObj?.['Stacks']?.[0]?.['Outputs']?.find(
(elem) => elem['OutputKey'] === 'FrontS3BucketName'
)?.['OutputValue'];
if (!s3Name) {
console.error('Cannot find s3 bucket. Please deploy lambda first.');
return;
}
console.log(`Found s3 bucket: ${s3Name}`);
exec(`aws s3 rm "s3://${s3Name}/" --recursive`, (err, stdout, stderr) => {
if (err) {
console.error(`Exception thrown: ${err.message}`);
return;
}
if (stderr) {
console.error(`Error occurred: ${stderr}`);
return;
}
console.log(`${stdout}`);
});
if (err) {
console.error(`Exception thrown: ${err.message}`);
return;
}
if (stderr) {
console.error(`Error occurred: ${stderr}`);
return;
}
const stackObj = JSON.parse(stdout);
const s3Name = stackObj?.['Stacks']?.[0]?.['Outputs']?.find(
(elem) => elem['OutputKey'] === 'FrontS3BucketName',
)?.['OutputValue'];
if (!s3Name) {
console.error('Cannot find s3 bucket. Please deploy lambda first.');
return;
}
console.log(`Found s3 bucket: ${s3Name}`);
exec(`aws s3 rm "s3://${s3Name}/" --recursive`, (err, stdout, stderr) => {
if (err) {
console.error(`Exception thrown: ${err.message}`);
return;
}
if (stderr) {
console.error(`Error occurred: ${stderr}`);
return;
}
console.log(`${stdout}`);
});
});
56 changes: 28 additions & 28 deletions packages/client/scripts/deploy.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { exec } from 'child_process';

exec('aws cloudformation describe-stacks --stack-name lockerweb', (err, stdout, stderr) => {
if (err) {
console.error(`Exception thrown: ${err.message}`);
return;
}
if (stderr) {
console.error(`Error occurred: ${stderr}`);
return;
}
const stackObj = JSON.parse(stdout);
const s3Name = stackObj?.['Stacks']?.[0]?.['Outputs']?.find(
(elem) => elem['OutputKey'] === 'FrontS3BucketName'
)?.['OutputValue'];
if (!s3Name) {
console.error('Cannot find s3 bucket. Please deploy lambda first.');
return;
}
console.log(`Found s3 bucket: ${s3Name}`);
exec(`aws s3 sync ./build "s3://${s3Name}/" --delete`, (err, stdout, stderr) => {
if (err) {
console.error(`Exception thrown: ${err.message}`);
return;
}
if (stderr) {
console.error(`Error occurred: ${stderr}`);
return;
}
console.log(`${stdout}`);
});
if (err) {
console.error(`Exception thrown: ${err.message}`);
return;
}
if (stderr) {
console.error(`Error occurred: ${stderr}`);
return;
}
const stackObj = JSON.parse(stdout);
const s3Name = stackObj?.['Stacks']?.[0]?.['Outputs']?.find(
(elem) => elem['OutputKey'] === 'FrontS3BucketName',
)?.['OutputValue'];
if (!s3Name) {
console.error('Cannot find s3 bucket. Please deploy lambda first.');
return;
}
console.log(`Found s3 bucket: ${s3Name}`);
exec(`aws s3 sync ./build "s3://${s3Name}/" --delete`, (err, stdout, stderr) => {
if (err) {
console.error(`Exception thrown: ${err.message}`);
return;
}
if (stderr) {
console.error(`Error occurred: ${stderr}`);
return;
}
console.log(`${stdout}`);
});
});
23 changes: 12 additions & 11 deletions packages/client/src/app.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Write your global styles here, in PostCSS syntax */
/*noinspection CssUnknownTarget*/
@import url('https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/variable/pretendardvariable.css');

@import 'css/normalize.css';
Expand All @@ -8,15 +9,15 @@
@tailwind utilities;

html {
font-size: 1em;
line-height: 1.4;
font-size: 1em;
line-height: 1.4;
}

:root {
font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic',
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
@apply text-gray-700;
@apply text-gray-700;
}

h1,
Expand All @@ -25,29 +26,29 @@ h3,
h4,
h5,
h6 {
@apply font-bold;
@apply font-bold;
}

h1 {
@apply text-6xl;
@apply text-6xl;
}

h2 {
@apply text-5xl;
@apply text-5xl;
}

h3 {
@apply text-4xl;
@apply text-4xl;
}

h4 {
@apply text-2xl;
@apply text-2xl;
}

h5 {
@apply text-xl;
@apply text-xl;
}

h6 {
@apply text-lg;
@apply text-lg;
}
Loading

0 comments on commit 37dec8b

Please sign in to comment.