🔨(project) add json, cjs and js extensions to prettier config
Prettier had some missing extensions in the config, this commit added them, we then prettified the whole project. We ignore the `cunningham-tokens` files.
This commit is contained in:
committed by
Jean-Baptiste PENRATH
parent
b46aaa66ed
commit
6ea8544fed
@@ -1 +1,2 @@
|
|||||||
dist/
|
dist/
|
||||||
|
cunningham-tokens.*
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
<a href="https://openfun.github.io/cunningham"><b>📚 Documentation</b></a> •
|
<a href="https://openfun.github.io/cunningham"><b>📚 Documentation</b></a> •
|
||||||
<a href="https://www.figma.com/file/JbPT1R6YUFW4oH8jHvH960/DS-Cunningham---PUBLIC?type=design"><b>🖌️ Figma</b></a>
|
<a href="https://www.figma.com/file/JbPT1R6YUFW4oH8jHvH960/DS-Cunningham---PUBLIC?type=design"><b>🖌️ Figma</b></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
- **Atomic**: We follow [atomic design principles](https://bradfrost.com/blog/post/atomic-web-design/).
|
- **Atomic**: We follow [atomic design principles](https://bradfrost.com/blog/post/atomic-web-design/).
|
||||||
@@ -46,11 +47,12 @@ yarn add @openfun/cunningham-react
|
|||||||
```
|
```
|
||||||
|
|
||||||
➡️ Then, add this script to your `package.json` file
|
➡️ Then, add this script to your `package.json` file
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-theme": "cunningham -g css -o src"
|
"build-theme": "cunningham -g css -o src"
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -79,7 +81,6 @@ To ensure everything works well, let's test rendering a component, such as the [
|
|||||||
|
|
||||||
Now please see the [documentation](https://openfun.github.io/cunningham) 📚 to learn more about customization, typography, spacings and available components!
|
Now please see the [documentation](https://openfun.github.io/cunningham) 📚 to learn more about customization, typography, spacings and available components!
|
||||||
|
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
<a href="https://github.com/openfun/cunningham/graphs/contributors">
|
<a href="https://github.com/openfun/cunningham/graphs/contributors">
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
"extends": [
|
"extends": ["custom"],
|
||||||
"custom"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"project": "./tsconfig.eslint.json"
|
"project": "./tsconfig.eslint.json"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"exclude": [],
|
"exclude": [],
|
||||||
"include": [
|
"include": ["**/*.ts", "**/*.tsx"]
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"extends": "@openfun/typescript-configs/react.json",
|
"extends": "@openfun/typescript-configs/react.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"noEmit": true,
|
"noEmit": true
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"exclude": ["node_modules","dist"],
|
"exclude": ["node_modules", "dist"],
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
"references": [{ "path": "./tsconfig.node.json" }]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,5 @@
|
|||||||
"moduleResolution": "Node",
|
"moduleResolution": "Node",
|
||||||
"allowSyntheticDefaultImports": true
|
"allowSyntheticDefaultImports": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["vite.config.ts"]
|
||||||
"vite.config.ts"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
"test-ci": "turbo run test-ci",
|
"test-ci": "turbo run test-ci",
|
||||||
"lint": "turbo run lint",
|
"lint": "turbo run lint",
|
||||||
"deploy": "turbo run deploy",
|
"deploy": "turbo run deploy",
|
||||||
"format": "prettier --write \"**/*.{ts,tsx,md}\""
|
"format": "prettier --write \"**/*.{ts,tsx,md,json,cjs,js}\""
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
|
|||||||
@@ -29,7 +29,10 @@
|
|||||||
"plugins": ["formatjs", "@typescript-eslint", "import"],
|
"plugins": ["formatjs", "@typescript-eslint", "import"],
|
||||||
/* Disable some rules to be iso with tslint which was previously used */
|
/* Disable some rules to be iso with tslint which was previously used */
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }],
|
"@typescript-eslint/explicit-member-accessibility": [
|
||||||
|
"error",
|
||||||
|
{ "accessibility": "no-public" }
|
||||||
|
],
|
||||||
"@typescript-eslint/lines-between-class-members": "off",
|
"@typescript-eslint/lines-between-class-members": "off",
|
||||||
"@typescript-eslint/no-use-before-define": "off",
|
"@typescript-eslint/no-use-before-define": "off",
|
||||||
"arrow-parens": "error",
|
"arrow-parens": "error",
|
||||||
@@ -45,7 +48,14 @@
|
|||||||
"import/order": [
|
"import/order": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
|
"groups": [
|
||||||
|
"builtin",
|
||||||
|
"external",
|
||||||
|
"internal",
|
||||||
|
"parent",
|
||||||
|
"sibling",
|
||||||
|
"index"
|
||||||
|
],
|
||||||
"alphabetize": { "order": "ignore" }
|
"alphabetize": { "order": "ignore" }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -70,7 +80,10 @@
|
|||||||
"react/destructuring-assignment": "off",
|
"react/destructuring-assignment": "off",
|
||||||
"react/function-component-definition": [
|
"react/function-component-definition": [
|
||||||
"error",
|
"error",
|
||||||
{ "namedComponents": "arrow-function", "unnamedComponents": "arrow-function" }
|
{
|
||||||
|
"namedComponents": "arrow-function",
|
||||||
|
"unnamedComponents": "arrow-function"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"react/jsx-boolean-value": "off",
|
"react/jsx-boolean-value": "off",
|
||||||
"react/jsx-fragments": "off",
|
"react/jsx-fragments": "off",
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
import { addons } from '@storybook/manager-api';
|
import { addons } from "@storybook/manager-api";
|
||||||
import { create } from '@storybook/theming';
|
import { create } from "@storybook/theming";
|
||||||
import { defaultTokens } from '@openfun/cunningham-tokens';
|
import { defaultTokens } from "@openfun/cunningham-tokens";
|
||||||
|
|
||||||
const COLORS = defaultTokens.theme.colors;
|
const COLORS = defaultTokens.theme.colors;
|
||||||
|
|
||||||
const theme = create({
|
const theme = create({
|
||||||
base: 'light',
|
base: "light",
|
||||||
brandUrl: 'https://github.com/openfun/cunningham',
|
brandUrl: "https://github.com/openfun/cunningham",
|
||||||
brandImage: 'logo-cunningham.svg',
|
brandImage: "logo-cunningham.svg",
|
||||||
brandTitle: 'Cunningham',
|
brandTitle: "Cunningham",
|
||||||
brandTarget: '_self',
|
brandTarget: "_self",
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
colorPrimary: COLORS["primary-400"],
|
colorPrimary: COLORS["primary-400"],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"empty": "This table is empty",
|
"empty": "This table is empty",
|
||||||
"empty_alt": "Illustration of an empty table",
|
"empty_alt": "Illustration of an empty table",
|
||||||
"loader_aria": "Loading data",
|
"loader_aria": "Loading data",
|
||||||
"rows_selection_aria":"All rows selection",
|
"rows_selection_aria": "All rows selection",
|
||||||
"row_selection_aria": "Row selection"
|
"row_selection_aria": "Row selection"
|
||||||
},
|
},
|
||||||
"provider": {
|
"provider": {
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"exclude": [],
|
"exclude": [],
|
||||||
"include": [
|
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs"]
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
".eslintrc.cjs"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,6 @@
|
|||||||
"types": ["vitest/globals", "vite/client"]
|
"types": ["vitest/globals", "vite/client"]
|
||||||
},
|
},
|
||||||
"include": ["src", "cunningham.ts"],
|
"include": ["src", "cunningham.ts"],
|
||||||
"exclude": ["node_modules","dist", "**/tokens.ts", "**/*.stories.tsx"],
|
"exclude": ["node_modules", "dist", "**/tokens.ts", "**/*.stories.tsx"],
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
"references": [{ "path": "./tsconfig.node.json" }]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"exclude": [
|
"exclude": ["./__mocks__", "./tests", "**/*.spec.ts"]
|
||||||
"./__mocks__",
|
|
||||||
"./tests",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "@openfun/typescript-configs/node.json",
|
"extends": "@openfun/typescript-configs/node.json",
|
||||||
"include": [
|
"include": ["**/*"],
|
||||||
"**/*"
|
|
||||||
],
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"paths": {
|
"paths": {
|
||||||
@@ -10,5 +8,5 @@
|
|||||||
},
|
},
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"outDir": "../../dist/bin"
|
"outDir": "../../dist/bin"
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": "@openfun/typescript-configs/node.json",
|
"extends": "@openfun/typescript-configs/node.json",
|
||||||
"include": [
|
"include": ["./*"],
|
||||||
"./*"
|
|
||||||
],
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"outDir": "../../dist/lib",
|
"outDir": "../../dist/lib",
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
{
|
{
|
||||||
"include": [
|
"include": ["**/*.ts", "**/*.js", ".eslintrc.cjs"]
|
||||||
"**/*.ts",
|
|
||||||
"**/*.js",
|
|
||||||
".eslintrc.cjs"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
{
|
{
|
||||||
"include": [
|
"include": ["./jest.config.ts"]
|
||||||
"./jest.config.ts"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": [
|
"extends": ["github>openfun/renovate-configuration"],
|
||||||
"github>openfun/renovate-configuration"
|
"ignoreDeps": ["chalk", "@storybook/builder-vite"],
|
||||||
],
|
"ignorePaths": ["**/node_modules/**"]
|
||||||
"ignoreDeps": [
|
|
||||||
"chalk", "@storybook/builder-vite"
|
|
||||||
],
|
|
||||||
"ignorePaths": [
|
|
||||||
"**/node_modules/**"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
32
turbo.json
32
turbo.json
@@ -2,46 +2,26 @@
|
|||||||
"$schema": "https://turbo.build/schema.json",
|
"$schema": "https://turbo.build/schema.json",
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"build": {
|
"build": {
|
||||||
"dependsOn": [
|
"dependsOn": ["^build"],
|
||||||
"^build"
|
"outputs": ["dist/**"]
|
||||||
],
|
|
||||||
"outputs": [
|
|
||||||
"dist/**"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"outputs": []
|
"outputs": []
|
||||||
},
|
},
|
||||||
"dev": {
|
"dev": {
|
||||||
"cache": false,
|
"cache": false,
|
||||||
"dependsOn": [
|
"dependsOn": ["^dev"]
|
||||||
"^dev"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"inputs": [
|
"inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts", "test/**/*.tsx"]
|
||||||
"src/**/*.tsx",
|
|
||||||
"src/**/*.ts",
|
|
||||||
"test/**/*.ts",
|
|
||||||
"test/**/*.tsx"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"test-ci": {
|
"test-ci": {
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"inputs": [
|
"inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts", "test/**/*.tsx"]
|
||||||
"src/**/*.tsx",
|
|
||||||
"src/**/*.ts",
|
|
||||||
"test/**/*.ts",
|
|
||||||
"test/**/*.tsx"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"deploy": {
|
"deploy": {
|
||||||
"dependsOn": [
|
"dependsOn": ["build", "test", "lint"],
|
||||||
"build",
|
|
||||||
"test",
|
|
||||||
"lint"
|
|
||||||
],
|
|
||||||
"outputs": []
|
"outputs": []
|
||||||
},
|
},
|
||||||
"@openfun/cunningham-tokens#test": {
|
"@openfun/cunningham-tokens#test": {
|
||||||
|
|||||||
Reference in New Issue
Block a user