Skip to content

Commit

Permalink
server: Prettier Formatting (#14402)
Browse files Browse the repository at this point in the history
## Description

Run pnpm run format in Gitrest, Historian, and Routerlicious codebases

Prompted by auto-formatting headache in #14401
  • Loading branch information
znewton authored Mar 9, 2023
1 parent d27bfae commit 38e1d64
Show file tree
Hide file tree
Showing 469 changed files with 43,792 additions and 39,179 deletions.
47 changes: 47 additions & 0 deletions server/gitrest/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Generated by npm / Lerna
**/package-lock.json
**/lerna-package-lock.json
**/pnpm-lock.yaml
**/pnpm-workspace.yaml

# Boilerplate files
CODE_OF_CONDUCT.md
PACKAGES.md
SECURITY.md

# Build output
**/dist/**/*
**/lib/**/*
**/src/**/test/types/*
**/src/packageVersion.ts

# Dependencies
**/node_modules/*

# Pipeline definitions are in YAML and can be broken by autoformatting
tools/pipelines/

# Used by API-Extractor
**/_api-extractor-temp/*
**/api-report/*
**/*.api.md

# Generated type-tests
**/*.generated.ts

# Generated bundle analysis files
**/bundleAnalysis/**

# Generated oclif manifest files
**/oclif.manifest.json

# Test coverage reports
**/coverage/*
**/nyc/*

# Git configuration file
.git-blame-ignore-revs

# Server Files
LICENSE.txt
nginx.conf
5 changes: 4 additions & 1 deletion server/gitrest/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# gitrest


Provides a REST API to a GitHub repository. It's API is based off of GitHub's REST APIs.

## Building and running
Expand Down Expand Up @@ -71,11 +70,13 @@ There is a PR out to nodegit. Once they merge it in and publish a new version we
## Example REST API usage

Create the repo

```
curl -H "Content-Type: application/json" -X POST -d '{"name": "test"}' --verbose localhost:3000/prague/repos
```

Create a first commit and update main ref

```
curl -H "Content-Type: application/json" -X POST -d '{"content": "Hello, World!", "encoding": "utf-8"}' --verbose localhost:3000/repos/prague/test/git/blobs
curl -H "Content-Type: application/json" -X POST -d '{"tree": [{"path": "file.txt", "mode": "100644", "type": "blob", "sha": "b45ef6fec89518d314f546fd6c3025367b721684"}]}' --verbose localhost:3000/repos/prague/test/git/trees
Expand All @@ -87,6 +88,7 @@ curl --verbose http://localhost:3000/repos/prague/test/git/refs
```

Submodule example

```
curl -H "Content-Type: application/json" -X POST -d '{"content": "[submodule \"module\"]\n\tpath = module\n\turl = ssh://git@localhost:3022/home/git/prague/test", "encoding": "utf-8"}' --verbose localhost:3000/repos/prague/test/git/blobs
curl -H "Content-Type: application/json" -X POST -d '{"tree": [{"path": ".gitmodules", "mode": "100644", "type": "blob", "sha": "54a2d1738d0c62529ada54d32c5d05e1d1ea0fae"},{"path": "file.txt", "mode": "100644", "type": "blob", "sha": "b45ef6fec89518d314f546fd6c3025367b721684"},{"path": "module", "mode": "160000", "type": "commit", "sha": "38421e18f9cf4ec024ae98f687e79c0bdf8f3f18"}]}' --verbose localhost:3000/repos/prague/test/git/trees
Expand All @@ -95,6 +97,7 @@ curl -H "Content-Type: application/json" -X POST -d '{"ref": "refs/heads/modules
```

Reference deletion and tags

```
curl -X DELETE --verbose http://localhost:3000/repos/prague/test/git/refs/heads/main
curl -H "Content-Type: application/json" -X POST -d '{"ref": "refs/heads/main", "sha": "38421e18f9cf4ec024ae98f687e79c0bdf8f3f18"}' --verbose localhost:3000/repos/prague/test/git/refs
Expand Down
8 changes: 4 additions & 4 deletions server/gitrest/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: '3'
version: "3"
services:
gitrest:
volumes:
- .:/home/node/server
- /home/node/server/node_modules
networks:
default:
external:
name: routerlicious_default
default:
external:
name: routerlicious_default
10 changes: 5 additions & 5 deletions server/gitrest/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: '3'
version: "3"
services:
gitrest:
build:
context: .
target: runner
context: .
target: runner
ports:
- "3000:3000"
volumes:
Expand All @@ -17,5 +17,5 @@ services:
- git:/home/git
restart: always
volumes:
git:
driver: local
git:
driver: local
6 changes: 3 additions & 3 deletions server/gitrest/lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.0",
"npmClient": "pnpm",
"useWorkspaces": true
"version": "0.1.0",
"npmClient": "pnpm",
"useWorkspaces": true
}
4 changes: 4 additions & 0 deletions server/gitrest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"lint:fix": "lerna run lint:fix --no-sort --stream",
"policy-check": "fluid-repo-policy-check",
"policy-check:fix": "fluid-repo-policy-check -r",
"prettier": "npm run prettier:root && lerna run prettier --no-sort --stream",
"prettier:fix": "npm run prettier:root:fix && lerna run prettier:fix --no-sort --stream",
"prettier:root": "prettier --check ./*.* --ignore-path ./.prettierignore",
"prettier:root:fix": "prettier --write ./*.* --ignore-path ./.prettierignore",
"start": "node packages/gitrest/dist/www.js",
"start:dev": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml up",
"test": "lerna run test --stream --no-bail --no-sort",
Expand Down
21 changes: 9 additions & 12 deletions server/gitrest/packages/gitrest-base/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
*/

module.exports = {
"extends": [
require.resolve("@fluidframework/eslint-config-fluid/minimal"),
"prettier"
],
"parserOptions": {
"project": ["./tsconfig.json", "./src/test/tsconfig.json"]
},
"rules": {
"@typescript-eslint/strict-boolean-expressions": "off", // requires strictNullChecks=true in tsconfig
"import/no-nodejs-modules": "off",
}
}
extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
parserOptions: {
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
},
rules: {
"@typescript-eslint/strict-boolean-expressions": "off", // requires strictNullChecks=true in tsconfig
"import/no-nodejs-modules": "off",
},
};
172 changes: 86 additions & 86 deletions server/gitrest/packages/gitrest-base/package.json
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
{
"name": "@fluidframework/gitrest-base",
"version": "0.1.0",
"description": "Git REST API base components",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "server/gitrest/packages/gitrest-base"
},
"license": "MIT",
"author": "Microsoft and contributors",
"main": "dist/index.js",
"scripts": {
"build": "npm run build:genver && concurrently npm:build:compile npm:lint",
"build:commonjs": "npm run tsc && npm run build:test",
"build:compile": "npm run build:commonjs",
"build:genver": "gen-version",
"build:test": "tsc --project ./src/test/tsconfig.json",
"clean": "rimraf dist *.tsbuildinfo *.build.log",
"eslint": "eslint --format stylish src",
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
"format": "npm run prettier:fix",
"lint": "npm run eslint",
"lint:fix": "npm run eslint:fix",
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
"start": "node dist/www.js",
"test": "nyc --all -x dist/test/**/* mocha dist/test",
"tsc": "tsc"
},
"dependencies": {
"@fluidframework/common-utils": "^1.1.1",
"@fluidframework/gitresources": "^0.1038.3000-117199",
"@fluidframework/protocol-base": "^0.1038.3000-117199",
"@fluidframework/protocol-definitions": "^1.1.0",
"@fluidframework/server-services-client": "^0.1038.3000-117199",
"@fluidframework/server-services-core": "^0.1038.3000-117199",
"@fluidframework/server-services-shared": "^0.1038.3000-117199",
"@fluidframework/server-services-telemetry": "^0.1038.3000-117199",
"@fluidframework/server-services-utils": "^0.1038.3000-117199",
"async-mutex": "^0.3.2",
"axios": "^0.26.0",
"body-parser": "^1.17.2",
"compression": "^1.7.3",
"cors": "^2.8.5",
"debug": "^4.1.1",
"express": "^4.17.3",
"isomorphic-git": "^1.14.0",
"json-stringify-safe": "^5.0.1",
"memfs": "^3.4.12",
"nconf": "^0.11.4",
"nodegit": "^0.27.0",
"prettier": "~2.6.2",
"split": "^1.0.0",
"uuid": "^3.3.2",
"winston": "^3.6.0"
},
"devDependencies": {
"@fluidframework/build-common": "^1.1.0",
"@fluidframework/eslint-config-fluid": "^2.0.0",
"@rushstack/eslint-config": "^2.6.1",
"@types/async": "^3.2.9",
"@types/cors": "^2.8.4",
"@types/debug": "^4.1.5",
"@types/express": "^4.11.0",
"@types/express-serve-static-core": "^4.17.32",
"@types/lorem-ipsum": "^1.0.2",
"@types/mocha": "^10.0.0",
"@types/nconf": "^0.10.0",
"@types/node": "^14.18.12",
"@types/nodegit": "^0.27.3",
"@types/rimraf": "^3.0.2",
"@types/supertest": "^2.0.7",
"@types/uuid": "^3.4.4",
"@types/winston": "^2.4.4",
"async": "^3.2.2",
"concurrently": "^7.5.0",
"eslint": "~8.27.0",
"lorem-ipsum": "^1.0.6",
"mocha": "^10.1.0",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"sillyname": "^0.1.0",
"supertest": "^3.4.2",
"typescript": "~4.5.5"
}
"name": "@fluidframework/gitrest-base",
"version": "0.1.0",
"description": "Git REST API base components",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "server/gitrest/packages/gitrest-base"
},
"license": "MIT",
"author": "Microsoft and contributors",
"main": "dist/index.js",
"scripts": {
"build": "npm run build:genver && concurrently npm:build:compile npm:lint",
"build:commonjs": "npm run tsc && npm run build:test",
"build:compile": "npm run build:commonjs",
"build:genver": "gen-version",
"build:test": "tsc --project ./src/test/tsconfig.json",
"clean": "rimraf dist *.tsbuildinfo *.build.log",
"eslint": "eslint --format stylish src",
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
"format": "npm run prettier:fix",
"lint": "npm run eslint",
"lint:fix": "npm run eslint:fix",
"prettier": "prettier --check . --ignore-path ../../.prettierignore",
"prettier:fix": "prettier --write . --ignore-path ../../.prettierignore",
"start": "node dist/www.js",
"test": "nyc --all -x dist/test/**/* mocha dist/test",
"tsc": "tsc"
},
"dependencies": {
"@fluidframework/common-utils": "^1.1.1",
"@fluidframework/gitresources": "^0.1038.3000-117199",
"@fluidframework/protocol-base": "^0.1038.3000-117199",
"@fluidframework/protocol-definitions": "^1.1.0",
"@fluidframework/server-services-client": "^0.1038.3000-117199",
"@fluidframework/server-services-core": "^0.1038.3000-117199",
"@fluidframework/server-services-shared": "^0.1038.3000-117199",
"@fluidframework/server-services-telemetry": "^0.1038.3000-117199",
"@fluidframework/server-services-utils": "^0.1038.3000-117199",
"async-mutex": "^0.3.2",
"axios": "^0.26.0",
"body-parser": "^1.17.2",
"compression": "^1.7.3",
"cors": "^2.8.5",
"debug": "^4.1.1",
"express": "^4.17.3",
"isomorphic-git": "^1.14.0",
"json-stringify-safe": "^5.0.1",
"memfs": "^3.4.12",
"nconf": "^0.11.4",
"nodegit": "^0.27.0",
"prettier": "~2.6.2",
"split": "^1.0.0",
"uuid": "^3.3.2",
"winston": "^3.6.0"
},
"devDependencies": {
"@fluidframework/build-common": "^1.1.0",
"@fluidframework/eslint-config-fluid": "^2.0.0",
"@rushstack/eslint-config": "^2.6.1",
"@types/async": "^3.2.9",
"@types/cors": "^2.8.4",
"@types/debug": "^4.1.5",
"@types/express": "^4.11.0",
"@types/express-serve-static-core": "^4.17.32",
"@types/lorem-ipsum": "^1.0.2",
"@types/mocha": "^10.0.0",
"@types/nconf": "^0.10.0",
"@types/node": "^14.18.12",
"@types/nodegit": "^0.27.3",
"@types/rimraf": "^3.0.2",
"@types/supertest": "^2.0.7",
"@types/uuid": "^3.4.4",
"@types/winston": "^2.4.4",
"async": "^3.2.2",
"concurrently": "^7.5.0",
"eslint": "~8.27.0",
"lorem-ipsum": "^1.0.6",
"mocha": "^10.1.0",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"sillyname": "^0.1.0",
"supertest": "^3.4.2",
"typescript": "~4.5.5"
}
}
Loading

0 comments on commit 38e1d64

Please sign in to comment.