Skip to content

Commit

Permalink
chore: setup repo wide prettier format (#322)
Browse files Browse the repository at this point in the history
Co-authored-by: salihuDickson <salihudickson@gmail.com>
Co-authored-by: Anurag Gupta <me@anuragxd.com>
  • Loading branch information
3 people authored Jun 24, 2024
1 parent bbe64c6 commit ae87802
Show file tree
Hide file tree
Showing 33 changed files with 367 additions and 327 deletions.
40 changes: 40 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,50 @@
**/.svn
**/.hg
**/node_modules
**/*.hbs
**/dist
**/.next
**/.turbo
**/.vercel

/.github/*
CONTRIBUTING.md
LICENSE
README.md
CONTRIBUTORS.md
CODE_OF_CONDUCT.md

/dist
/www
/build
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

## editors
/.idea
/.vscode

## system files
.DS_Store

## npm
/node_modules/
/npm-debug.log

## testing
/coverage/

## temp folders
/.tmp/

## build
/_site/
/out-tsc/
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.


3 changes: 3 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
## Description

<!-- Please include a summary of the change and the relevant issue(s) it resolves, if any (otherwise delete that line). -->

Fixes #(issue)

## Checklist

<!-- Please go through the following checklist to ensure that your change is ready for review. -->

- [ ] My code follows the [contributing guidelines][contributing] of this project.
Expand All @@ -16,6 +18,7 @@ Fixes #(issue)
- [ ] I have not reduced the existing code coverage.

## Comments

<!-- If there are unchecked boxes in the list above, but you would still like your PR to be reviewed or considered for merging, please describe here why boxes were not checked. -->

[contributing]: CONTRIBUTING.md
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@custom-elements-manifest/analyzer": "^0.9.0",
"@elixir-cloud/eslint-config": "*",
"@lit/react": "^1.0.2",
"@open-wc/eslint-config": "^12.0.3",
"@open-wc/testing": "^4.0.0",
"@turbo/gen": "^1.9.8",
"@web/dev-server": "^0.4.1",
"concurrently": "^8.2.2",
"eslint": "^7.32.0",
"@elixir-cloud/eslint-config": "*",
"fast-glob": "^3.3.2",
"husky": "^8.0.0",
"prettier": "^2.8.8",
"prettier": "2.8.8",
"turbo": "^1.13.0",
"typescript": "^5.3.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ecc-client-elixir-trs-filer/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
}
8 changes: 4 additions & 4 deletions packages/ecc-client-elixir-trs-filer/fast.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rootDir": "./src",
"componentPath": "./components",
"componentPrefix": "fast"
}
"rootDir": "./src",
"componentPath": "./components",
"componentPrefix": "fast"
}
8 changes: 4 additions & 4 deletions packages/ecc-client-elixir-trs-filer/server.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ var PORT = 3000;

app.use(express.static(path.join(__dirname, "www")));

app.listen(PORT, err => {
if (err) {
throw err;
}
app.listen(PORT, (err) => {
if (err) {
throw err;
}
});
58 changes: 28 additions & 30 deletions packages/ecc-client-elixir-trs-filer/webpack.common.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,34 @@ const appDir = path.resolve(__dirname, "./src");
const outDir = path.resolve(__dirname, "./www");

module.exports = {
name: "root",
entry: {
main: path.resolve(appDir, "index.ts"),
},
resolve: {
extensions: [".ts", ".js"],
plugins: [
new ResolveTypeScriptPlugin()
]
},
output: {
path: outDir,
publicPath: "/",
},
module: {
rules: [
{
test: /.ts$/,
use: [
{
loader: "ts-loader",
},
],
},
name: "root",
entry: {
main: path.resolve(appDir, "index.ts"),
},
resolve: {
extensions: [".ts", ".js"],
plugins: [new ResolveTypeScriptPlugin()],
},
output: {
path: outDir,
publicPath: "/",
},
module: {
rules: [
{
test: /.ts$/,
use: [
{
loader: "ts-loader",
},
],
},
plugins: [
new HtmlWebpackPlugin({
title: "ecc-client-elixir-trs-filer",
template: path.resolve(appDir, "index.html"),
}),
},
],
},
plugins: [
new HtmlWebpackPlugin({
title: "ecc-client-elixir-trs-filer",
template: path.resolve(appDir, "index.html"),
}),
],
};
16 changes: 8 additions & 8 deletions packages/ecc-client-elixir-trs-filer/webpack.dev.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ const merge = require("webpack-merge");
const baseConfig = require("./webpack.common.cjs");

module.exports = merge(baseConfig, {
devServer: {
open: true,
port: 8004,
},
mode: "development",
output: {
filename: "[name].js",
},
devServer: {
open: true,
port: 8004,
},
mode: "development",
output: {
filename: "[name].js",
},
});
40 changes: 20 additions & 20 deletions packages/ecc-client-elixir-trs-filer/webpack.prod.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ const merge = require("webpack-merge");
const baseConfig = require("./webpack.common.cjs");

module.exports = merge(baseConfig, {
mode: "production",
optimization: {
splitChunks: {
chunks: "all",
maxInitialRequests: 100,
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: module => {
const packageName = module.context.match(
/[\\/]node_modules[\\/](.*?)([\\/]|$)/
)[1];
// npm package names are URL-safe, but some servers don't like @ symbols
return `npm.${packageName.replace("@", "")}`;
},
},
},
mode: "production",
optimization: {
splitChunks: {
chunks: "all",
maxInitialRequests: 100,
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: (module) => {
const packageName = module.context.match(
/[\\/]node_modules[\\/](.*?)([\\/]|$)/
)[1];
// npm package names are URL-safe, but some servers don't like @ symbols
return `npm.${packageName.replace("@", "")}`;
},
},
},
},
output: {
filename: "bundle/[name].[contenthash].js",
},
},
output: {
filename: "bundle/[name].[contenthash].js",
},
});
16 changes: 8 additions & 8 deletions packages/ecc-client-ga4gh-tes/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": ["@open-wc", "@elixir-cloud", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"class-methods-use-this": "warn",
"lit/no-classfield-shadowing": "warn",
"no-console": ["error", { "allow": ["warn", "error"] }]
}
"extends": ["@open-wc", "@elixir-cloud", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"class-methods-use-this": "warn",
"lit/no-classfield-shadowing": "warn",
"no-console": ["error", { "allow": ["warn", "error"] }]
}
}
44 changes: 22 additions & 22 deletions packages/ecc-client-ga4gh-tes/demo/create-run/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8" />
<style>
body {
background: #fafafa;
}
</style>
</head>
<title>ecc-client-ga4gh-wes-runs</title>
<body>
<div id="demo"></div>
<head>
<meta charset="utf-8" />
<style>
body {
background: #fafafa;
}
</style>
</head>
<title>ecc-client-ga4gh-wes-runs</title>
<body>
<div id="demo"></div>

<script type="module">
import { html, render } from "lit";
import "../../dist/components/create-run/index.js";
<script type="module">
import { html, render } from "lit";
import "../../dist/components/create-run/index.js";

render(
html`<ecc-client-ga4gh-tes-create-run
baseURL="http://localhost:8080/ga4gh/tes/v1"
/>`,
document.querySelector("#demo")
);
</script>
</body>
render(
html`<ecc-client-ga4gh-tes-create-run
baseURL="http://localhost:8080/ga4gh/tes/v1"
/>`,
document.querySelector("#demo")
);
</script>
</body>
</html>
34 changes: 17 additions & 17 deletions packages/ecc-client-ga4gh-tes/demo/index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8" />
<style>
body {
background: #f5f5f5;
}
</style>
<title>ecc-client-ga4gh-tes</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<div class="p-10">
<a href="./runs" class="text-blue-500">Runs component</a>
<br />
<a href="./create-run" class="text-blue-500">Create runs component</a>
</div>
</body>
<head>
<meta charset="utf-8" />
<style>
body {
background: #f5f5f5;
}
</style>
<title>ecc-client-ga4gh-tes</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<div class="p-10">
<a href="./runs" class="text-blue-500">Runs component</a>
<br />
<a href="./create-run" class="text-blue-500">Create runs component</a>
</div>
</body>
</html>
6 changes: 3 additions & 3 deletions packages/ecc-client-ga4gh-tes/web-dev-server.config.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';

/** Use Hot Module replacement by adding --hmr to the start command */
const hmr = process.argv.includes('--hmr');
const hmr = process.argv.includes("--hmr");

export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
open: '/demo/',
open: "/demo/",
/** Use regular watch mode if HMR is not enabled. */
watch: !hmr,
/** Resolve bare module imports */
nodeResolve: {
exportConditions: ['browser', 'development'],
exportConditions: ["browser", "development"],
},

/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
Expand Down
Loading

0 comments on commit ae87802

Please sign in to comment.