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

Switch Storybook build to vite builder #745

Merged
merged 17 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b96e8ce
:arrow_up: [#724] First upgrade to latest SB patch release
sergei-maertens Nov 29, 2024
4a3ba3b
:technologist: [#724] Switch to react-vite builder
sergei-maertens Nov 29, 2024
6c847f0
:alien: [#724] JSX syntax requires .jsx extension
sergei-maertens Nov 29, 2024
cd24ada
:technologist: [#724] Handle env reading/processing in both Vite and …
sergei-maertens Nov 29, 2024
a378f60
:alien: [#724] Update react-intl addon init code to not use require
sergei-maertens Nov 29, 2024
f37a5bc
:art: Don't inline the EJS plugin
sergei-maertens Nov 30, 2024
1176d55
:alien: [#724] Fix token imports (CJS -> ESM)
sergei-maertens Nov 30, 2024
80df351
:wrench: [#724] Disable vite public dir and make base relative
sergei-maertens Dec 2, 2024
7cb848d
:adhesive_bandage: [#724] Symlink fonts to root of project for vite
sergei-maertens Dec 2, 2024
e7e3122
:art: [#724] Address @charset warning emitted by vite-css
sergei-maertens Dec 2, 2024
9d29713
:alien: [#724] Fix loading/resolving the font-awesome font files
sergei-maertens Dec 2, 2024
2ece29d
:heavy_minus_sign: [#724] Drop @storybook/react-webpack5 builder
sergei-maertens Dec 2, 2024
c48ad5a
:fire: [#724] Remove viewport support for @storybook/test-runner
sergei-maertens Dec 2, 2024
096fdb9
:alien: [#724] Ensure that a _ global exists
sergei-maertens Dec 2, 2024
d613ea7
:iphone: [#724] Disable mobile-viewport test
sergei-maertens Dec 3, 2024
c2da3e9
:alien: [#724] Use different Dutch-locale import for flatpickr
sergei-maertens Dec 7, 2024
f058d80
:alien: [#724] Map error classes rather than their constructor names
sergei-maertens Dec 8, 2024
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
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# ViteJS based
VITE_VERSION=latest
VITE_BASE_API_URL=http://localhost:8000/api/v2/
VITE_FORM_ID=93c09209-5fb9-4105-b6bb-9d9f0aa6782c
VITE_USE_HASH_ROUTING=false

# Legacy
REACT_APP_VERSION=latest
REACT_APP_BASE_API_URL=http://localhost:8000/api/v2/
REACT_APP_FORM_ID=93c09209-5fb9-4105-b6bb-9d9f0aa6782c
Expand Down
93 changes: 0 additions & 93 deletions .storybook/main.js

This file was deleted.

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

// https://github.com/storybookjs/storybook/issues/26291 vite-plugin-istanbul is
// still causing CommonJS warnings, which is because of @storybook/addon-coverage,
// see https://github.com/storybookjs/storybook/issues/26291#issuecomment-2378399131

const config: StorybookConfig = {
core: {
disableTelemetry: true,
},
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'storybook-addon-theme-provider',
'storybook-react-intl',
'storybook-addon-remix-react-router',
'@storybook/addon-coverage',
'@storybook/addon-webpack5-compiler-babel',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
staticDirs: ['../src/img/', '../public'],
docs: {},
};

export default config;
14 changes: 14 additions & 0 deletions .storybook/modes.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const allModes = {
smallMobile: {
viewport: 'smallMobile',
},
largeMobile: {
viewport: 'largeMobile',
},
tablet: {
viewport: 'tablet',
},
desktop: {
viewport: 'desktop',
},
};
10 changes: 7 additions & 3 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'design-token-editor/lib/css/dte.css';
import 'design-token-editor/lib/css/root.css';
import 'flatpickr';
import 'flatpickr/dist/l10n/nl.js';
import lodash from 'lodash';
import {fixIconUrls as fixLeafletIconUrls} from 'map';
import {initialize, mswLoader} from 'msw-storybook-addon';
import {Formio, Templates} from 'react-formio';
Expand All @@ -25,9 +26,12 @@ import {
withClearSessionStorage,
withClearSubmissionLocalStorage,
} from './decorators';
import {reactIntl} from './reactIntl.js';
import {allModes} from './modes.mjs';
import {reactIntl} from './reactIntl.mjs';
import ThemeProvider from './theme';

window._ = lodash;

initialize({
onUnhandledRequest: 'bypass',
serviceWorker: {
Expand Down Expand Up @@ -88,8 +92,8 @@ export default {
chromatic: {
// Here we specify the viewports of which we want snapshots in Chromatic
modes: {
mobile: {viewport: 'smallMobile'},
desktop: {viewport: 'desktop'},
mobile: allModes.smallMobile,
desktop: allModes.desktop,
},
},
},
Expand Down
15 changes: 0 additions & 15 deletions .storybook/reactIntl.js

This file was deleted.

17 changes: 17 additions & 0 deletions .storybook/reactIntl.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import enMessages from '../src/i18n/compiled/en.json';
import nlMessages from '../src/i18n/compiled/nl.json';

// Populate the messages object
const messages = {
nl: nlMessages,
en: enMessages,
};

const formats = {}; // optional, if you have any formats

export const reactIntl = {
defaultLocale: 'nl',
locales: Object.keys(messages),
messages,
formats,
};
27 changes: 0 additions & 27 deletions .storybook/test-runner.js

This file was deleted.

1 change: 1 addition & 0 deletions fonts
Loading
Loading