Skip to content

Commit 22a0d05

Browse files
committed
chore: format some files
1 parent 490ac35 commit 22a0d05

File tree

10 files changed

+41
-39
lines changed

10 files changed

+41
-39
lines changed

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"trailingComma": "all",
3+
"singleQuote": false,
4+
"printWidth": 100,
5+
"semi": true,
6+
"arrowParens": "always",
7+
"bracketSpacing": true,
8+
"bracketSameLine": false,
9+
"useTabs": false,
10+
"tabWidth": 2,
11+
"objectWrap": "collapse"
12+
}

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The exports can be accessed as follows:
1515
### From the primary entry-point `@org/service-client`:
1616

1717
- The `customInstance` used to make calls is exported in the case where the exported API doesn't allow certain features.
18-
- *All* the exported types are only exported from here (limited by the output of orval but you should import types separately with `import type {} from ''` regardless).
18+
- _All_ the exported types are only exported from here (limited by the output of orval but you should import types separately with `import type {} from ''` regardless).
1919

2020
### From the sub-entry points, the `react-query` exports can be imported.
2121

@@ -39,4 +39,3 @@ A GitHub action is provided that can be triggered with a `repository_dispatch`.
3939

4040
- [Data Manager Client](https://github.com/InformaticsMatters/data-manager-npm-client)
4141
- [Account Server Client](https://github.com/InformaticsMatters/account-server-js-client)
42-

morph-query-keys.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { Project, SyntaxKind } from 'ts-morph';
1+
import { Project, SyntaxKind } from "ts-morph";
22

3-
const NO_CHECK_COMMENT = '// @ts-nocheck';
3+
const NO_CHECK_COMMENT = "// @ts-nocheck";
44

55
const project = new Project({
6-
tsConfigFilePath: './tsconfig.json',
6+
tsConfigFilePath: "./tsconfig.json",
77
skipAddingFilesFromTsConfig: true,
88
});
99

1010
// Add all .ts files inside ./src (this includes index.ts, custom-instance.ts etc.)
11-
project.addSourceFilesAtPaths(['./src/**/*.ts', '!./src/index.ts', '!./src/custom-instance.ts']);
11+
project.addSourceFilesAtPaths(["./src/**/*.ts", "!./src/index.ts", "!./src/custom-instance.ts"]);
1212

1313
// We will filter out all of the extra ones (index.ts, custom-instance.ts etc.) by the number of "/"
1414
// in the full file path. I.e. the ones we wan't to keep have one extra "/"
15-
const getNumberOfParts = (apiFile) => apiFile.getFilePath().split('/').length; // ! Requires Windows?
15+
const getNumberOfParts = (apiFile) => apiFile.getFilePath().split("/").length; // ! Requires Windows?
1616
const maxParts = Math.max(...project.getSourceFiles().map(getNumberOfParts));
1717

1818
const apiName = process.argv.at(-1); // ! probably requires a recent NodeJS version
@@ -29,7 +29,7 @@ for (const apiFile of project.getSourceFiles()) {
2929
// get their declaration, multiple declarations are never used so [0] is ok
3030
const declaration = variable.getDeclarations()[0]; // 257 (SyntaxKind.VariableDeclaration)
3131
// locate QueryKey function
32-
if (declaration.getName().endsWith('QueryKey')) {
32+
if (declaration.getName().endsWith("QueryKey")) {
3333
// console.log(declaration);
3434
const arrow = declaration.getLastChildByKind(SyntaxKind.ArrowFunction);
3535
// need to get the array expression from inside the `[] as const` expression

package.release.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@
44
"types": "./index.d.ts",
55
"sideEffects": false,
66
"private": false,
7-
"publishConfig": {
8-
"access": "public"
9-
}
7+
"publishConfig": { "access": "public" }
108
}

renovate.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
":disableRateLimiting",
5-
"config:js-app",
6-
":semanticCommitTypeAll(chore)"
7-
],
8-
"labels": [
9-
"dependencies"
10-
]
3+
"extends": [":disableRateLimiting", "config:js-app", ":semanticCommitTypeAll(chore)"],
4+
"labels": ["dependencies"]
115
}

setup-entrypoints.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
'use strict';
1+
"use strict";
22

3-
import fs from 'fs';
4-
import yaml from 'js-yaml';
3+
import fs from "fs";
4+
import yaml from "js-yaml";
55

6-
const doc = yaml.load(fs.readFileSync('./openapi.yaml', 'utf8'));
6+
const doc = yaml.load(fs.readFileSync("./openapi.yaml", "utf8"));
77
const tags = doc.tags.map((tag) => tag.name);
88

9+
console.log("Tags found in the OpenAPI document:");
910
console.log(tags);
1011

1112
tags.forEach((tag) => {

setup-typedoc.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
'use strict';
1+
"use strict";
22

3-
import fs from 'fs';
4-
import yaml from 'js-yaml';
3+
import fs from "fs";
4+
import yaml from "js-yaml";
55

66
try {
7-
const doc = yaml.load(fs.readFileSync('./openapi.yaml', 'utf8'));
7+
const doc = yaml.load(fs.readFileSync("./openapi.yaml", "utf8"));
88
const tags = doc.tags.map((tag) => tag.name);
99

1010
const additionalEntryPoints = tags.map((tag) => `./src/${tag}/${tag}.ts`);
11-
const entryPoints = ['./src/index.ts', ...additionalEntryPoints];
11+
const entryPoints = ["./src/index.ts", ...additionalEntryPoints];
1212

1313
const typeDocJSON = { entryPoints };
1414

15-
fs.writeFileSync('typedoc.json', JSON.stringify(typeDocJSON), (err) => {
15+
fs.writeFileSync("typedoc.json", JSON.stringify(typeDocJSON), (err) => {
1616
throw err;
1717
});
1818
} catch (e) {

src/custom-instance.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ export const setBaseUrl = (baseUrl: string) => {
3131

3232
export const customInstance = <TReturn>(
3333
config: AxiosRequestConfig,
34-
options?: AxiosRequestConfig
34+
options?: AxiosRequestConfig,
3535
): Promise<TReturn> => {
3636
const source = Axios.CancelToken.source();
3737

38-
const promise = AXIOS_INSTANCE({
39-
...config,
40-
...options,
41-
cancelToken: source.token,
42-
}).then(({ data }) => data);
38+
const promise = AXIOS_INSTANCE({ ...config, ...options, cancelToken: source.token }).then(
39+
({ data }) => data,
40+
);
4341

4442
// @ts-expect-error need to add a cancel method to the promise
4543
promise.cancel = () => {

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Generated by orval
22
// API_TARGET_NAME Is replaced with the api name
3-
export * from './API_TARGET_NAME.schemas';
3+
export * from "./API_TARGET_NAME.schemas";
44

55
// Request instance and methods to change the baseUrl and auth token
6-
export * from './custom-instance';
6+
export * from "./custom-instance";

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
"noEmit": true,
2525

2626
/* If your code runs in the DOM: */
27-
"lib": ["es2022", "dom", "dom.iterable"],
27+
"lib": ["es2022", "dom", "dom.iterable"]
2828
}
29-
}
29+
}

0 commit comments

Comments
 (0)