Skip to content

Commit

Permalink
apply format to all js files
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Tilsch committed Mar 29, 2024
1 parent 4e1c4ac commit 936ba8c
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 96 deletions.
26 changes: 12 additions & 14 deletions apps/exhibition-live/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import theme from "../components/theme/berry-theme";
import {CssBaseline, ThemeProvider} from "@mui/material";
import {QueryClient, QueryClientProvider} from "@tanstack/react-query";
import { CssBaseline, ThemeProvider } from "@mui/material";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
Expand All @@ -10,19 +10,17 @@ export const parameters = {
date: /Date$/,
},
},
}
};

const finalTheme = theme(
{
isOpen: [], // for active default menu
defaultId: "default",
fontFamily: "'Roboto', sans-serif",
borderRadius: 12,
opened: true,
navType: "light",
}
)
const queryClient = new QueryClient();
const finalTheme = theme({
isOpen: [], // for active default menu
defaultId: "default",
fontFamily: "'Roboto', sans-serif",
borderRadius: 12,
opened: true,
navType: "light",
});
const queryClient = new QueryClient();
export const withMuiTheme = (Story) => (
<ThemeProvider theme={finalTheme}>
<QueryClientProvider client={queryClient}>
Expand Down
17 changes: 10 additions & 7 deletions apps/exhibition-live/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest/presets/default-esm',
extensionsToTreatAsEsm: ['.ts'],
testEnvironment: 'node',
preset: "ts-jest/presets/default-esm",
extensionsToTreatAsEsm: [".ts"],
testEnvironment: "node",
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', {
useESM: true,
}],
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
useESM: true,
},
],
},
}
};
3 changes: 1 addition & 2 deletions apps/exhibition-live/next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ module.exports = {
defaultNS: "translation",
},
react: { useSuspense: false },
reloadOnPrerender: process.env.NODE_ENV === 'development',
reloadOnPrerender: process.env.NODE_ENV === "development",
};

16 changes: 9 additions & 7 deletions apps/exhibition-live/next.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: 'export',
output: "export",
images: {
unoptimized: true,
},
basePath: process.env.NEXT_PUBLIC_BASE_PATH || '/exhibition-live',
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/exhibition-live",
publicRuntimeConfig: {
NEXT_PUBLIC_GAPI_OAUTH_CLIENT_ID: process.env.NEXT_PUBLIC_GAPI_OAUTH_CLIENT_ID,
NEXT_PUBLIC_BASE_PATH: process.env.NEXT_PUBLIC_BASE_PATH || '/exhibition-live',
}
}
NEXT_PUBLIC_GAPI_OAUTH_CLIENT_ID:
process.env.NEXT_PUBLIC_GAPI_OAUTH_CLIENT_ID,
NEXT_PUBLIC_BASE_PATH:
process.env.NEXT_PUBLIC_BASE_PATH || "/exhibition-live",
},
};

module.exports = nextConfig
module.exports = nextConfig;
11 changes: 6 additions & 5 deletions apps/exhibition-live/next.config.standalone.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: 'standalone',
output: "standalone",
images: {
unoptimized: true,
},
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
publicRuntimeConfig: {
NEXT_PUBLIC_GAPI_OAUTH_CLIENT_ID: process.env.NEXT_PUBLIC_GAPI_OAUTH_CLIENT_ID,
NEXT_PUBLIC_GAPI_OAUTH_CLIENT_ID:
process.env.NEXT_PUBLIC_GAPI_OAUTH_CLIENT_ID,
NEXT_PUBLIC_BASE_PATH: process.env.NEXT_PUBLIC_BASE_PATH,
}
}
},
};

module.exports = nextConfig
module.exports = nextConfig;
75 changes: 39 additions & 36 deletions packages/build-helper/make-package-json.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
const fs = require('fs');
const path = require('path');
const fs = require("fs");
const path = require("path");

//get path of current directory
const currentDirectory = process.cwd();
console.log('currentDirectory', currentDirectory);
console.log("currentDirectory", currentDirectory);
// Load the original package.json
const originalPackageJson = require(`${currentDirectory}/package.json`);

// Define the fields to keep for the distribution package.json
const fieldsToKeep = [
'name',
'description',
'keywords',
'author',
'license',
'repository',
'bugs',
'homepage',
'version',
'main',
'module',
'exports',
'types',
'dependencies',
'peerDependencies',
'engines'
"name",
"description",
"keywords",
"author",
"license",
"repository",
"bugs",
"homepage",
"version",
"main",
"module",
"exports",
"types",
"dependencies",
"peerDependencies",
"engines",
];

// Construct the distribution package.json object
let distPackageJson = {};
fieldsToKeep.forEach(field => {
fieldsToKeep.forEach((field) => {
if (originalPackageJson[field]) {
distPackageJson[field] = originalPackageJson[field];
}
Expand All @@ -38,30 +38,33 @@ const name = distPackageJson.name;

distPackageJson = {
...distPackageJson,
name: name.replace('_src', ''),
"type": "module", // Enable ESM
"main": "./index.cjs",
"module": "./index.js",
"types": "./index.d.ts", // Fallback TypeScript declaration file
"exports": {
name: name.replace("_src", ""),
type: "module", // Enable ESM
main: "./index.cjs",
module: "./index.js",
types: "./index.d.ts", // Fallback TypeScript declaration file
exports: {
".": {
"import": "./index.js",
"require": "./index.cjs",
"default": "./index.js",
"types": "./index.d.ts" // TypeScript declaration for ESM
}
}
}
import: "./index.js",
require: "./index.cjs",
default: "./index.js",
types: "./index.d.ts", // TypeScript declaration for ESM
},
},
};

// Path to the distribution directory
const distPath = path.join(currentDirectory, 'dist');
const distPath = path.join(currentDirectory, "dist");

// Ensure the distribution directory exists
if (!fs.existsSync(distPath)) {
fs.mkdirSync(distPath);
}

// Write the distribution package.json
fs.writeFileSync(path.join(distPath, 'package.json'), JSON.stringify(distPackageJson, null, 2));
fs.writeFileSync(
path.join(distPath, "package.json"),
JSON.stringify(distPackageJson, null, 2),
);

console.log('Distribution package.json has been generated.');
console.log("Distribution package.json has been generated.");
4 changes: 2 additions & 2 deletions packages/core-utils/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
useESM: true,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-edb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module.exports = {
rules: {
"@next/next/no-html-link-for-pages": "off",
"turbo/no-undeclared-env-vars": "off",
}
}
},
};
18 changes: 9 additions & 9 deletions packages/graph-traversal/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: 'ts-jest/presets/default-esm',
extensionsToTreatAsEsm: ['.ts'],
testEnvironment: 'node',
preset: "ts-jest/presets/default-esm",
extensionsToTreatAsEsm: [".ts"],
testEnvironment: "node",
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
useESM: true,
}
]
}
}
},
],
},
};
6 changes: 3 additions & 3 deletions packages/json-schema-utils/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default {
testEnvironment: 'node',
testEnvironment: "node",
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
useESM: true,
},
Expand Down
6 changes: 3 additions & 3 deletions packages/remote-query/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default {
testEnvironment: 'node',
testEnvironment: "node",
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
useESM: true,
},
Expand Down
6 changes: 3 additions & 3 deletions packages/sparql-schema/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default {
testEnvironment: 'node',
testEnvironment: "node",
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
useESM: true,
},
Expand Down
6 changes: 3 additions & 3 deletions packages/tsup-config/tsup.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineConfig } from 'tsup';
import { defineConfig } from "tsup";

export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
entry: ["src/index.ts"],
format: ["cjs", "esm"],
splitting: false, // Set to true if you want code splitting in your ESM bundle
sourcemap: true, // Generates source maps
clean: true, // Cleans the outDir before building
Expand Down

0 comments on commit 936ba8c

Please sign in to comment.