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

Adding Format Script #115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: "18.18"
node-version: '18.18'
- run: corepack enable
- run: yarn install
- name: yarn start:docker
Expand Down Expand Up @@ -60,12 +60,12 @@ jobs:
with:
start: npx serve ui/dist -p 5173
command: yarn test:e2e
wait-on: "http://localhost:5173"
wait-on: 'http://localhost:5173'
wait-on-timeout: 120
browser: chrome
env:
DISPLAY: :0.0
SECRET_WORDS: "orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology"
SECRET_WORDS: 'orbit bench unit task food shock brand bracket domain regular warfare company announce wheel grape trust sphere boy doctor half guard ritual three ecology'

- name: Archive e2e artifacts
uses: actions/upload-artifact@v4
Expand Down
44 changes: 18 additions & 26 deletions contract/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": [
"ESNext",
"DOM"
],
"checkJs": true,
"strict": true,
"noImplicitAny": false,
"useUnknownInCatchVariables": false,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"outDir": "./dist"
},
"include": [
"src",
"test"
],
"exclude": [
"node_modules"
]
}
"compilerOptions": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a prettierignore that ignores all json files except package.json (see this for ref)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Do we have .prettierrc in any repo that we can copy?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we take a look at the one in agoric-sdk but its not applicable as is. We can use relevant portions though.

"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": ["ESNext", "DOM"],
"checkJs": true,
"strict": true,
"noImplicitAny": false,
"useUnknownInCatchVariables": false,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"outDir": "./dist"
},
"include": ["src", "test"],
"exclude": ["node_modules"]
}
15 changes: 14 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
"make:help": "make -C contract list",
"start:contract": "cd contract && yarn start",
"start:ui": "cd ui && yarn dev",
"lint": "yarn workspaces foreach --all run lint",
"format": "yarn prettier --write .github contract ui",
"lint:format": "yarn prettier --check .github contract ui",
"lint": "yarn lint:format && yarn workspaces foreach --all run lint",
"lint:fix": "yarn format && yarn workspaces foreach --all run lint:fix",
"test": "yarn workspaces foreach --all run test",
"test:e2e": "yarn workspace offer-up-ui test:e2e",
"build": "yarn workspaces foreach --all run build",
Expand All @@ -62,6 +65,16 @@
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-testing-library": "^6.2.0",
"eslint-plugin-ui-testing": "^2.0.1",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.5.11",
"serve": "^14.2.1"
},
"prettier": {
"trailingComma": "all",
"arrowParens": "avoid",
"singleQuote": true,
"plugins": [
"prettier-plugin-tailwindcss"
]
}
}
6 changes: 3 additions & 3 deletions ui/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ input {
}

.error {
background-color: #E11D48;
background-color: #e11d48;
color: #fff;
}

/* increment/decrement arrows always visible */
input[type=number]::-webkit-inner-spin-button {
opacity: 1
input[type='number']::-webkit-inner-spin-button {
opacity: 1;
}
2 changes: 1 addition & 1 deletion ui/test/e2e/synpress.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ module.exports = defineConfig({
specPattern: 'test/e2e/specs/**/*spec.{js,jsx,ts,tsx}',
supportFile: 'test/support.js',
screenshotsFolder: 'test/e2e/screenshots',
videosFolder: 'test/e2e/videos'
videosFolder: 'test/e2e/videos',
},
});
4 changes: 2 additions & 2 deletions ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"types": ["vitest/globals"],
"types": ["vitest/globals"]
},
"include": ["src", "test"],
"references": [{ "path": "./tsconfig.node.json" }],
"references": [{ "path": "./tsconfig.node.json" }]
}
66 changes: 66 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12760,6 +12760,8 @@ __metadata:
eslint-plugin-cypress: "npm:^2.15.1"
eslint-plugin-testing-library: "npm:^6.2.0"
eslint-plugin-ui-testing: "npm:^2.0.1"
prettier: "npm:^3.3.3"
prettier-plugin-tailwindcss: "npm:^0.5.11"
serve: "npm:^14.2.1"
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -13496,6 +13498,61 @@ __metadata:
languageName: node
linkType: hard

"prettier-plugin-tailwindcss@npm:^0.5.11":
version: 0.5.14
resolution: "prettier-plugin-tailwindcss@npm:0.5.14"
peerDependencies:
"@ianvs/prettier-plugin-sort-imports": "*"
"@prettier/plugin-pug": "*"
"@shopify/prettier-plugin-liquid": "*"
"@trivago/prettier-plugin-sort-imports": "*"
"@zackad/prettier-plugin-twig-melody": "*"
prettier: ^3.0
prettier-plugin-astro: "*"
prettier-plugin-css-order: "*"
prettier-plugin-import-sort: "*"
prettier-plugin-jsdoc: "*"
prettier-plugin-marko: "*"
prettier-plugin-organize-attributes: "*"
prettier-plugin-organize-imports: "*"
prettier-plugin-sort-imports: "*"
prettier-plugin-style-order: "*"
prettier-plugin-svelte: "*"
peerDependenciesMeta:
"@ianvs/prettier-plugin-sort-imports":
optional: true
"@prettier/plugin-pug":
optional: true
"@shopify/prettier-plugin-liquid":
optional: true
"@trivago/prettier-plugin-sort-imports":
optional: true
"@zackad/prettier-plugin-twig-melody":
optional: true
prettier-plugin-astro:
optional: true
prettier-plugin-css-order:
optional: true
prettier-plugin-import-sort:
optional: true
prettier-plugin-jsdoc:
optional: true
prettier-plugin-marko:
optional: true
prettier-plugin-organize-attributes:
optional: true
prettier-plugin-organize-imports:
optional: true
prettier-plugin-sort-imports:
optional: true
prettier-plugin-style-order:
optional: true
prettier-plugin-svelte:
optional: true
checksum: 10c0/9857873cb8cb0d9b7b895806e7f6265617a08805691125d282767dffb1cb3d2c4c662f2b9168ef391edc40dff1b81beb99eee488f96544e01b8924db694f2299
languageName: node
linkType: hard

"prettier@npm:^3.0.0, prettier@npm:^3.0.3, prettier@npm:^3.2.4":
version: 3.2.4
resolution: "prettier@npm:3.2.4"
Expand All @@ -13505,6 +13562,15 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:^3.3.3":
version: 3.4.2
resolution: "prettier@npm:3.4.2"
bin:
prettier: bin/prettier.cjs
checksum: 10c0/99e076a26ed0aba4ebc043880d0f08bbb8c59a4c6641cdee6cdadf2205bdd87aa1d7823f50c3aea41e015e99878d37c58d7b5f0e663bba0ef047f94e36b96446
languageName: node
linkType: hard

"pretty-bytes@npm:^5.6.0":
version: 5.6.0
resolution: "pretty-bytes@npm:5.6.0"
Expand Down
Loading