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

Upgrade all dependencies #20

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
"prettier",
"plugin:storybook/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {}
"rules": {},
"ignorePatterns": ["node_modules/", "dist/", "**/_*"]
}
19 changes: 19 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check

on:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'

jobs:
job:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install packages
run: yarn install --frozen-lockfile
- name: Check
run: yarn test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
dist
dist-ssr
*.local
.eslintcache
.eslintcache
yarn-error.log
10 changes: 9 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"singleQuote": true
"printWidth": 120,
"tabWidth": 2,
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"quoteProps": "as-needed",
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf"
}
18 changes: 0 additions & 18 deletions .storybook/main.js

This file was deleted.

27 changes: 27 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { StorybookConfig } from '@storybook/react-vite';
import { mergeConfig } from 'vite';

const config: StorybookConfig = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
core: {
builder: '@storybook/builder-vite', // 👈 The builder enabled here.
},
framework: {
name: '@storybook/react-vite',
options: {},
},
async viteFinal(config) {
// Merge custom configuration into the default config
return mergeConfig(config, {
// Set relative base path to support deployment on path like /storybook
base: './',
optimizeDeps: { include: ['react-is', '@base2/pretty-print-object'] },
});
},
docs: {
autodocs: true,
},
};

export default config;
2 changes: 1 addition & 1 deletion .storybook/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ module.exports = function (app) {
createProxyMiddleware({
target: `http://localhost:${PORT}`,
changeOrigin: true,
})
}),
);
};
1 change: 1 addition & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,700,800,900" />
8 changes: 6 additions & 2 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Preview } from '@storybook/react';
import React from 'react';
import { addDecorator } from '@storybook/react';
import { MemoryRouter } from 'react-router-dom';

import '../src/app/globals.css';
Expand All @@ -14,4 +14,8 @@ export const parameters = {
},
};

addDecorator((story) => <MemoryRouter>{story()}</MemoryRouter>);
const preview: Preview = {
decorators: [(story) => <MemoryRouter>{story()}</MemoryRouter>],
};

export default preview;
2 changes: 1 addition & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
"extends": ["stylelint-config-standard"],
"rules": {
"selector-class-pattern": null,
"keyframes-name-pattern": null
Expand Down
25 changes: 25 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"node_modules": true,
"dist": true
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.format": true,
"source.organizeImports": true,
// Sort package.json keys with https://marketplace.visualstudio.com/items?itemName=unional.vscode-sort-package-json
"source.sortPackageJson": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ First, [create a repository from this template](https://docs.github.com/en/githu
Now you are ready to go:

```shell
npm install
yarn
```

This will install the dependencies required to run the boilerplate.

```shell
npm run dev
yarn dev
```

Boom! These scripts run your server, client and storybook in development mode.
Expand All @@ -34,9 +34,9 @@ The default PORTS are:
If you don't like to call all scripts at once, you can also run:

```shell
npm run server:dev
npm run client:dev
npm run storybook
yarn run server:dev
yarn run client:dev
yarn run storybook
```

You can configure the server port by setting the `PORT` environment variable. Creating a `.env` file is supported. You can copy `.env.example` to `.env`.
Expand All @@ -50,13 +50,13 @@ You can configure the server port by setting the `PORT` environment variable. Cr
To build the project, run:

```shell
npm run build
yarn build
```

This will build the client, server and storybook.

```shell
npm start
yarn start
```

In production, you have a single server serving everything.
Expand Down
9 changes: 9 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
http-equiv="Content-Security-Policy"
content="
default-src 'self' ;
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com/css ;
font-src 'self' 'unsafe-inline' https://fonts.gstatic.com/ ;
"
/>
<link rel="icon" type="image/svg+xml" href="/src/app/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,700,800,900" />
<title>Vite App</title>
</head>
<body>
Expand Down
Loading