Skip to content

Commit

Permalink
Merge pull request #2678 from thematters/develop
Browse files Browse the repository at this point in the history
Release: v4.4.0
  • Loading branch information
robertu7 authored Aug 25, 2022
2 parents ae98ced + 5802c3d commit 6e58e5e
Show file tree
Hide file tree
Showing 225 changed files with 12,334 additions and 10,281 deletions.
2 changes: 1 addition & 1 deletion .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
NEXT_PUBLIC_RUNTIME_ENV=local
NEXT_PUBLIC_SITE_DOMAIN=web-develop.matters.news
NEXT_PUBLIC_ASSET_DOMAIN=assets-develop.matters.news
NEXT_PUBLIC_NEXT_ASSET_DOMAIN=assets-next-develop.matters.news
NEXT_PUBLIC_NEXT_ASSET_DOMAIN=
NEXT_PUBLIC_API_URL=https://server-develop.matters.news/graphql
NEXT_PUBLIC_OAUTH_URL=https://auth-server-develop.matters.news/oauth
NEXT_PUBLIC_OAUTH_API_URL=https://auth-server-develop.matters.news/graphql
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci
run: npm ci --legacy-peer-deps

- name: Generate Types (develop)
if: github.base_ref == 'develop'
Expand Down
28 changes: 20 additions & 8 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ module.exports = {
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-a11y',
'storybook-addon-next',
],
framework: '@storybook/react',
core: {
builder: 'webpack5',
},
/*
Next.js automatically supports the tsconfig.json "paths" and "baseUrl"
options but the webpack configuration of Storybook doesn't yet.
Expand All @@ -18,6 +23,11 @@ module.exports = {
config.module.rules = config.module.rules.filter(
(it) => it.test && it.test.toString() !== '/\\.css$/'
)

config.module.rules.push({
resolve: { fullySpecified: false },
})

const newConfig = mergeWithCustomize({
customizeArray(a, b, key) {
if (key === 'module.rules') {
Expand Down Expand Up @@ -74,19 +84,21 @@ module.exports = {
},
}
)

return newConfig
},
/*
make the components' PropTypes interface works for argTypes of storybook
*/
typescript: {
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
// @see https://github.com/storybookjs/storybook/issues/11019#issuecomment-656776919
shouldRemoveUndefinedFromOptional: true,
propFilter: (prop) =>
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
},
reactDocgen: false,
// reactDocgen: 'react-docgen-typescript',
// reactDocgenTypescriptOptions: {
// shouldExtractLiteralValuesFromEnum: true,
// // @see https://github.com/storybookjs/storybook/issues/11019#issuecomment-656776919
// shouldRemoveUndefinedFromOptional: true,
// propFilter: (prop) =>
// prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
// },
},
}
11 changes: 1 addition & 10 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'
import { RouterContext } from 'next/dist/next-server/lib/router-context'
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'

import { GlobalStyles } from '../src/components/GlobalStyles'
Expand All @@ -17,15 +16,7 @@ export const decorators = [
<>
<GlobalStyles />

<RouterContext.Provider
value={{
push: () => Promise.resolve(),
replace: () => Promise.resolve(),
prefetch: () => Promise.resolve(),
}}
>
<Story />
</RouterContext.Provider>
<Story />

<style jsx global>
{`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### Start local dev

- Install dependencies: `npm i`
- Install dependencies: `npm i --legacy-peer-deps`
- Environment variables: `cp .env.local.example .env.local`
- Run `npm run gen:type` or `npm run gen:watch`
- Run `npm run dev`, then go to `http://localhost:3000/`
Expand Down
7 changes: 1 addition & 6 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const withPlugins = require('next-compose-plugins')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

const withOffline = require('next-offline')

const packageJson = require('./package.json')
Expand All @@ -14,10 +15,6 @@ const isProd = process.env.NEXT_PUBLIC_RUNTIME_ENV === 'production'
const isStatic = process.env.NEXT_PUBLIC_BUILD_TYPE === 'static'
const nextAssetDomain = process.env.NEXT_PUBLIC_NEXT_ASSET_DOMAIN || ''

const URL_PUSH_SW = isProd
? './firebase-messaging-sw-production.js'
: './firebase-messaging-sw-develop.js'

const nextConfig = {
/**
* Build time configs
Expand Down Expand Up @@ -128,8 +125,6 @@ if (!isStatic) {
// FIXME: https://github.com/hanford/next-offline/issues/195
generateInDevMode: false,
workboxOpts: {
// https://github.com/hanford/next-offline/issues/35
importScripts: [URL_PUSH_SW],
swDest: '../public/service-worker.js',
runtimeCaching: [
{
Expand Down
Loading

0 comments on commit 6e58e5e

Please sign in to comment.