Skip to content

Commit

Permalink
Revert "build: switch from CommonJS to ESM (#290)"
Browse files Browse the repository at this point in the history
This reverts commit c11d5e1.
  • Loading branch information
alasdairwilson authored Jan 14, 2025
1 parent 89a618f commit 74447ac
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 326 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG MATERIAL_METHOD=copy

# Define the Python version to use
ARG PYTHON_VERSION=3.12.3-slim
ARG NODE_VERSION=20-alpine
ARG NODE_VERSION=20.9-alpine

####
# MATERIAL OPTION: PULL
Expand Down
8 changes: 3 additions & 5 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { defineConfig } from "cypress"
import path from "path"

const __dirname = import.meta.dirname
const { default: installLogsPrinter } = await import("cypress-terminal-report/src/installLogsPrinter")

export default defineConfig({
env: {
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
Expand All @@ -12,7 +9,7 @@ export default defineConfig({
viewportHeight: 1080,
e2e: {
setupNodeEvents(on, config) {
installLogsPrinter(on)
require("cypress-terminal-report/src/installLogsPrinter")(on)

// implement node event listeners here
on("before:browser:launch", (browser, launchOptions) => {
Expand Down Expand Up @@ -47,7 +44,8 @@ export default defineConfig({
},
component: {
setupNodeEvents(on, config) {
installLogsPrinter(on, { printLogsToConsole: "onFail" })
const termReportConfig = { printLogsToConsole: "onFail" }
require("cypress-terminal-report/src/installLogsPrinter")(on, termReportConfig)
},
devServer: {
framework: "next",
Expand Down
7 changes: 3 additions & 4 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/** @type {import('next').NextConfig} */
import bundleAnalyzer from "@next/bundle-analyzer"
const withBundleAnalyzer = bundleAnalyzer({
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
})
import { withPlausibleProxy } from "next-plausible"
const { withPlausibleProxy } = require("next-plausible")

const nextConfig = {
reactStrictMode: true,
Expand Down Expand Up @@ -41,4 +40,4 @@ const nextConfig = {
},
}

export default withPlausibleProxy()(withBundleAnalyzer(nextConfig))
module.exports = withPlausibleProxy()(withBundleAnalyzer(nextConfig))
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "gutenberg",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"format": "prettier --write \"**/*.{ts,tsx,js,md,mdx,css,yaml}\"",
"format:check": "prettier --check \"**/*.{ts,tsx,js,md,mdx,css,yaml}\"",
Expand All @@ -14,12 +13,12 @@
"e2e": "start-server-and-test 'yarn dev' http://127.0.0.1:3000 \"dotenv -e .env.local -e .env cypress run --e2e\"",
"ci:e2e": "start-server-and-test 'yarn start' http://127.0.0.1:3000 \"cypress run --e2e\"",
"component": "cypress run --component",
"table": "NEXT_PUBLIC_BASEPATH='' MATERIAL_DIR=.material tsx scripts/table.ts",
"cron": "dotenv -e .env.local -e .env -- tsx scripts/cronScripts.ts",
"pullmat": "dotenv -e .env -e .env.local -- tsx scripts/pullMaterial.ts"
"table": "NEXT_PUBLIC_BASEPATH='' MATERIAL_DIR=.material ts-node --skip-project --compiler-options '{\"module\":\"CommonJS\"}' scripts/table.ts",
"cron": "dotenv -e .env.local -e .env -- ts-node --skip-project --compiler-options '{\"module\":\"CommonJS\"}' scripts/cronScripts.ts",
"pullmat": "dotenv -e .env -e .env.local -- ts-node --skip-project --transpile-only --compiler-options '{\"module\":\"CommonJS\"}' scripts/pullMaterial.ts"
},
"prisma": {
"seed": "tsx prisma/seed.ts"
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
},
"dependencies": {
"@dnd-kit/core": "^3.0.0",
Expand Down Expand Up @@ -92,7 +91,7 @@
"devDependencies": {
"@panva/hkdf": "^1.1.1",
"@testing-library/cypress": "^10.0.0",
"@types/node": "^20.11.0",
"@types/node": "^20.4.0",
"@types/react": "^18.0.21",
"@types/react-dom": "18.0.6",
"@types/react-syntax-highlighter": "^15.5.6",
Expand All @@ -103,7 +102,7 @@
"jose": "^4.15.5",
"prisma": "^4.11.0",
"start-server-and-test": "^2.0.0",
"tsx": "^4.19.2",
"ts-node": "^10.9.1",
"typescript": "5.6.2"
},
"packageManager": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "esnext",
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": false,
"skipLibCheck": true,
Expand Down
Loading

0 comments on commit 74447ac

Please sign in to comment.