* Ajout de storybook

Ajout d'un Switch oui/non

* Fix lint

* Add react-router and fix type

* Fix lint

* Resolution du conflit de version de prettier avec storybook

* Fix storybook

* Reduce Storybook bundle size
Refacto css in QuickLinks
Remove useless comment
Add default theme to CSS prop

* Déploiement de Storybook

* Fix déploiement

* Fix déploiement storybook url

* Fix Switch style

* Remplace les oui/non radio bouton par un Switch

* Filter aria props + react props in Storybook controls
Sort props in Storybook
Add global style in Storybook decorator

* Update Storybook packages

* Ajout d'un debounce dans OuiNonInput

* Fix du Switch

* Refacto des alias

* Fix lint error avec Storybook

* Fix eslint error

* Refacto deploy for Storybook

* Ajout de type pour les yaml d'economie collaborative
Ajout de type sur les fonction du locale storage
+ Autre fix de type

* Deploy storybook in dist dir in prod

* Fix focus on Switch

* Fix cy test

*  Remplace l'alias ~ par @

*  Refacto du Switch

* Remplace la checkbox par un Switch dans ChiffreAffairesActivitéMixte

* Ajout des stories RadioGroup et ToggleGroup

* Remplace le Switch oui/non par un ToggleGroup

* Ajout d'un label dans le Switch
Ajout du mode light sur le Switch

* Fix autofocus

* Fix cypress test

* 🐛 Ajout du polyfill replaceAll

* Test de deploiement

* Ajout d'une redirection pour Storybook

* Fix Storybook url

* Fix du deploiement de Storybook
pull/2011/head
Jérémy Rialland 2022-03-03 14:37:53 +01:00 committed by Johan Girod
parent 80be3f9229
commit 33199b79e0
22 changed files with 21094 additions and 14941 deletions

View File

@ -43,7 +43,7 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v2
- run: yarn install --frozen-lockfile
- run: yarn install --immutable
env:
# Secrets of all kinds for fetching stats & releases
GITHUB_API_SECRET: ${{ secrets.GITHUB_TOKEN }}
@ -243,17 +243,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
# Custom cache as we do not care about installing all the other dependancies
with:
path: |
~/.cache/Cypress
node_modules
key: cypress-cache-${{ runner.os }}-${{ hashFiles('package-lock.json', 'package.json') }}
- run: node site/scripts/get-cypress-packages.js | xargs npm i --legacy-peer-deps
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v2
- run: yarn install --immutable
- name: Test e2e mon-entreprise on preview (site=${{ matrix.site }}, browser=${{ matrix.browser}}, viewport=${{ matrix.viewport }})
uses: cypress-io/github-action@v2
with:
@ -309,17 +303,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
# Custom cache as we do not care about installing all the other dependancies
with:
path: |
~/.cache/Cypress
node_modules
key: cypress-cache-${{ runner.os }}-${{ hashFiles('package-lock.json', 'package.json') }}
- run: node site/scripts/get-cypress-packages.js | xargs npm i --legacy-peer-deps
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v2
- run: yarn install --immutable
- name: Test e2e mon-entreprise on production (site=${{ matrix.site }}, browser=${{ matrix.browser}}, viewport=${{ matrix.viewport }})
uses: cypress-io/github-action@v2
with:

View File

@ -21,7 +21,7 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v2
- run: yarn install --frozen-lockfile
- run: yarn install --immutable
env:
# Secrets of all kinds for fetching stats & releases
GITHUB_API_SECRET: ${{ secrets.GITHUB_TOKEN }}

View File

@ -13,7 +13,7 @@ jobs:
package: ['modele-social', 'exoneration-covid']
steps:
- uses: actions/checkout@v2
- run: yarn install --frozen-lockfile
- run: yarn install --immutable
- run: yarn workspace ${{ matrix.package }} run build
env:
NODE_ENV: production

View File

@ -10,7 +10,7 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v2
- run: yarn install --frozen-lockfile
- run: yarn install --immutable
- run: yarn lint
typecheck:
@ -21,7 +21,7 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v2
- run: yarn install --frozen-lockfile
- run: yarn install --immutable
env:
# Secrets of all kinds for fetching stats & releases
GITHUB_API_SECRET: ${{ secrets.GITHUB_TOKEN }}
@ -38,7 +38,7 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v2
- run: yarn install --frozen-lockfile
- run: yarn install --immutable
- run: yarn test
i18n:
@ -49,5 +49,5 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v2
- run: yarn install --frozen-lockfile
- run: yarn install --immutable
- run: yarn workspace site run i18n:check

9
.gitignore vendored
View File

@ -14,3 +14,12 @@ storybook-static/
# Webstorm (and other Jetbrains IDE)
.idea/
# Yarn https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

File diff suppressed because one or more lines are too long

785
.yarn/releases/yarn-3.2.0.cjs vendored Executable file

File diff suppressed because one or more lines are too long

7
.yarnrc.yml Normal file
View File

@ -0,0 +1,7 @@
nodeLinker: node-modules
enableMessageNames: false
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'
yarnPath: .yarn/releases/yarn-3.2.0.cjs

View File

@ -1,2 +0,0 @@
version-tag-prefix exoneration-covid -v
version-git-message "⬆ Mise à jour du paquet \"exoneration-covid \" vers %s"

View File

@ -0,0 +1 @@
nodeLinker: 'pnp'

View File

@ -17,6 +17,7 @@
"type": "module",
"devDependencies": {
"js-yaml": "^4.1.0",
"onchange": "^7.1.0",
"publicodes": "^1.0.0-beta.31"
},
"peerDependencies": {
@ -24,8 +25,9 @@
},
"scripts": {
"build": "node ../scripts/build-rules.js",
"start": "onchange 'règles/**/*.yaml' -- yarn run build",
"clean": "rimraf dist node_modules",
"prepare": "yarn run build",
"postinstall": "yarn run build",
"up": "yarn version --minor && echo \" N'oubliez pas de poussez le tag git\"",
"test": "node ../scripts/check-changelog.js"
}

View File

@ -1,2 +0,0 @@
version-tag-prefix modele-social-v
version-git-message "⬆ Mise à jour du paquet \"modele-social\" vers %s"

View File

@ -0,0 +1 @@
nodeLinker: 'pnp'

View File

@ -18,6 +18,7 @@
"type": "module",
"devDependencies": {
"js-yaml": "^4.1.0",
"onchange": "^7.1.0",
"publicodes": "^1.0.0-beta.30"
},
"peerDependencies": {
@ -25,8 +26,9 @@
},
"scripts": {
"build": "node ../scripts/build-rules.js",
"start": "onchange 'règles/**/*.yaml' -- yarn run build",
"clean": "rimraf dist node_modules",
"prepare": "yarn run build",
"postinstall": "yarn run build",
"up": "yarn version --minor && echo \" N'oubliez pas de poussez le tag git\"",
"test": "node ../scripts/check-changelog.js"
}

View File

@ -16,23 +16,28 @@
"type": "module",
"scripts": {
"lint:eslintrc": "npx eslint-config-prettier .eslintrc.cjs",
"lint:eslint": "export NODE_OPTIONS='--max-old-space-size=4096'; eslint .",
"lint:eslint": "NODE_OPTIONS='--max-old-space-size=4096' eslint .",
"lint:eslint:fix": "yarn lint:eslint --fix",
"lint:prettier": "yarn run prettier --check \"**/*.{js,jsx,ts,tsx,yaml,yml}\"",
"lint:prettier:fix": "yarn lint:prettier --write",
"lint:fix": "yarn lint:eslint:fix && yarn lint:prettier:fix",
"prepare": "if [ -z \"$NETLIFY\" ]; then yarn workspaces run prepare; fi",
"lint": "yarn lint:eslintrc && yarn lint:eslint && yarn lint:prettier",
"test": "yarn workspaces run test",
"test:type": "yarn workspaces run tsc --skipLibCheck --noEmit",
"clean": "yarn workspaces run clean && rimraf node_modules",
"start": "yarn workspace site start",
"moso:up": "yarn workspace modele-social run up && yarn workspace exoneration-covid run up && yarn workspace site upgrade modele-social",
"test": "yarn workspaces foreach run test",
"test:type": "yarn workspaces foreach -pi run tsc --skipLibCheck --noEmit",
"clean": "yarn workspaces foreach run clean && rimraf node_modules",
"start": "yarn workspaces foreach -pi run start",
"moso:up": "yarn workspace modele-social up && yarn workspace exoneration-covid up && yarn workspace site upgrade modele-social",
"i18n:check": "yarn workspace site i18n:check",
"i18n:translate": "yarn workspace site i18n:translate"
},
"resolutions": {
"prettier": "^2.5.1",
"@mui/styled-engine": "npm:@mui/styled-engine-sc@latest"
},
"packageManager": "yarn@3.2.0",
"devDependencies": {
"eslint": "^8.10.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.2"
}
}

View File

@ -41,8 +41,6 @@ function readRules() {
}, {})
}
// Note: we can't put the output file in the fs.watched directory
export default function writeJSFile() {
const rules = readRules()
const names = Object.keys(rules)

View File

@ -18,7 +18,7 @@
"not ie < 11"
],
"scripts": {
"prepare": "node scripts/prepare.js",
"postinstall": "node scripts/prepare.js",
"start": "vite dev",
"build": "vite build && yarn build:iframe-script",
"build:ssr": "vite build --ssr ./source/entry-server.tsx --outDir ./dist/server --emptyOutDir && echo '{\"module\": \"commonjs\"}' > dist/package.json",

View File

@ -1,12 +0,0 @@
import { readFileSync } from 'fs'
const packages = JSON.parse(
readFileSync(new URL('../package.json', import.meta.url).pathname)
)
console.log('cypress@' + packages.devDependencies.cypress)
for (const key of Object.keys(packages.devDependencies).filter(
(k) => k !== 'cypress' && k.startsWith('cypress')
)) {
console.log(key + '@' + packages.devDependencies[key])
}

View File

@ -215,7 +215,9 @@ export default function Select({
// Prevent input blur and focus elem selection
(e: React.MouseEvent) => e.preventDefault()
}
onClick={() => handleSubmit(result)}
onClick={() => {
handleSubmit(result)
}}
role="option"
focused={i === focusedElem}
data-role="commune-option"

View File

@ -63,7 +63,7 @@ export default function Popover(
const { dialogProps, titleProps } = useDialog(props, ref)
// Get props for the close button
const closeButtonRef = useRef(null)
const closeButtonRef = useRef<HTMLButtonElement>(null)
const { buttonProps: closeButtonProps } = useButton(
{
onPress: props.onClose,

View File

@ -91,7 +91,6 @@ export default defineConfig(({ command }) => ({
legacy({
targets: ['defaults', 'not IE 11'],
}),
monEntrepriseDevServer(),
],
}))
@ -183,14 +182,3 @@ function multipleSPA(options: MultipleSPAOptions): Plugin {
},
}
}
function monEntrepriseDevServer(): Plugin {
return {
name: 'mon-entreprise',
configureServer() {
// We could use native ViteJS watch API, but it would require changing
// more code and maybe the whole "modele-social" package build process.
// watchDottedNames()
},
}
}

35101
yarn.lock

File diff suppressed because it is too large Load Diff