Files
cunningham/packages/react/package.json
Nathan Vasse b5fcfdfeab (react) add support for CJS
At first we wanted to only support ESM. But as we want to share types
and export design tokens from the react package to the outside world
in order to allow local cunningham.ts files to import them, we are
forced to also build the library for CJS too. Why? Because local
cunningham.ts files are loaded as CJS, so they can only import CJS
module. Why loading cunningham.ts as CJS? Because the tokens package's
binary is built for CJS, then it's seamless to make it load CJS, where
making it load ESM was buggy. And why not migrate the tokens package to
ESM so? Because it implies to rewrite every imports with .js extensions,
makes us loose the possibility to use __dirname kind of variables. And
also Jest use for testing is not compliant at all when it comes to execute
ESM code. Well, the ecosystem is not ready for that at the moment, sadly.
2023-05-24 11:10:13 +02:00

105 lines
3.4 KiB
JSON

{
"name": "@openfun/cunningham-react",
"private": false,
"version": "0.6.2",
"publishConfig": {
"access": "public"
},
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"default": "./dist/index.mjs"
},
"./style": "./dist/style.css",
"./fonts": "./dist/fonts.css",
"./icons": "./dist/icons.css",
"./sass/fonts": "./dist/sass/fonts.scss",
"./sass/icons": "./dist/sass/icons.scss"
},
"files": [
"dist/"
],
"scripts": {
"lint": "eslint . 'src/**/*.{ts,tsx}'",
"dev": "yarn storybook & nodemon --watch src --ext '*' --ignore src/cunningham-tokens.ts --ignore src/cunningham-tokens.js --ignore src/cunningham-tokens.css --exec npm run build",
"build": "./build",
"build-fonts": "vite build -c vite.fonts.config.ts && rm -rf dist/fonts.js && mkdir -p dist/sass && cp src/fonts.scss dist/sass/",
"build-icons": "vite build -c vite.icons.config.ts && rm -rf dist/icons.js && mkdir -p dist/sass && cp src/icons.scss dist/sass/",
"build-theme": "cunningham -o src -g css,ts,js",
"preview": "vite preview",
"test": "FORCE_COLOR=1 vitest run",
"test-watch": "vitest",
"coverage": "vitest run --coverage",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"predeploy-storybook": "yarn build-storybook && touch ./storybook-static/.nojekyll",
"deploy-storybook": "storybook-to-ghpages --existing-output-dir ./storybook-static"
},
"dependencies": {
"@fontsource/material-icons": "4.5.4",
"@fontsource/roboto": "4.5.8",
"@openfun/cunningham-tokens": "*",
"@tanstack/react-table": "8.9.1",
"classnames": "2.3.2",
"downshift": "7.6.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"engines": {
"node": ">=16.0.0"
},
"devDependencies": {
"@babel/core": "7.21.8",
"@babel/plugin-proposal-decorators": "7.21.0",
"@babel/plugin-proposal-export-default-from": "7.18.10",
"@babel/preset-typescript": "7.21.5",
"@faker-js/faker": "8.0.0",
"@openfun/cunningham-tokens": "*",
"@openfun/typescript-configs": "*",
"@storybook/addon-a11y": "7.0.11",
"@storybook/addon-actions": "7.0.11",
"@storybook/addon-essentials": "7.0.11",
"@storybook/addon-interactions": "7.0.11",
"@storybook/addon-links": "7.0.11",
"@storybook/preset-scss": "1.0.3",
"@storybook/react": "7.0.11",
"@storybook/react-vite": "7.0.11",
"@storybook/storybook-deployer": "2.8.16",
"@storybook/testing-library": "0.1.0",
"@testing-library/dom": "9.2.0",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@types/jest": "29.5.1",
"@types/react": "18.2.6",
"@types/react-dom": "18.2.4",
"@vitejs/plugin-react": "4.0.0",
"@vitest/coverage-c8": "0.31.0",
"@vitest/ui": "0.31.0",
"babel-loader": "9.1.2",
"css-loader": "6.7.3",
"glob": "10.2.3",
"jsdom": "22.0.0",
"remark-gfm": "3.0.1",
"sass": "1.62.1",
"sass-loader": "13.2.2",
"storybook": "7.0.11",
"style-loader": "3.3.2",
"typescript": "5.0.4",
"vite": "4.3.5",
"vite-plugin-dts": "2.3.0",
"vite-tsconfig-paths": "4.2.0",
"vitest": "0.31.0",
"vitest-fetch-mock": "0.2.2"
},
"volta": {
"node": "18.16.0",
"yarn": "1.22.19"
}
}