From 146562f060e6e1bd53c5ad365fd2cecb92b4d867 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sun, 5 Jan 2025 11:34:04 +0000 Subject: [PATCH 1/2] convert to import statement to follow esm module Signed-off-by: Shivam Gupta --- .github/build/features-to-json.js | 4 ++-- gatsby-node.js | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/build/features-to-json.js b/.github/build/features-to-json.js index b4667d5979b9..edfec44344ef 100755 --- a/.github/build/features-to-json.js +++ b/.github/build/features-to-json.js @@ -1,7 +1,7 @@ #!/usr/bin/env node -const fs = require("fs").promises; // Use fs.promises -const csv = require("csvtojson"); +import { promises as fs } from "fs"; // Use fs.promises +import csv from "csvtojson"; const [major, minor, patch] = process.versions.node.split(".").map(Number); console.log(`Using Node.js version: ${major}.${minor}.${patch}`); diff --git a/gatsby-node.js b/gatsby-node.js index 7f8a6cb95605..8e5d0e03fabb 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -5,15 +5,13 @@ * See: https://www.gatsbyjs.org/docs/node-apis/ */ -const path = require("path"); -const slugify = require("./src/utils/slugify"); -const { paginate } = require("gatsby-awesome-pagination"); -const { createFilePath } = require("gatsby-source-filesystem"); -const FilterWarningsPlugin = require("webpack-filter-warnings-plugin"); -const config = require("./gatsby-config"); -const { - componentsData, -} = require("./src/sections/Projects/Sistent/components/content"); +import path from "path"; +import slugify from "./src/utils/slugify.js"; +import { paginate } from "gatsby-awesome-pagination"; +import { createFilePath } from "gatsby-source-filesystem"; +import FilterWarningsPlugin from "webpack-filter-warnings-plugin"; +import config from "./gatsby-config.js"; +import { componentsData } from "./src/sections/Projects/Sistent/components/content.js"; if (process.env.CI === "true") { // All process.env.CI conditionals in this file are in place for GitHub Pages, if webhost changes in the future, code may need to be modified or removed. From 8d983386329c1b9b508b9a8448c679081ad61a13 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sun, 5 Jan 2025 11:39:24 +0000 Subject: [PATCH 2/2] make feature file to follow esm modules Signed-off-by: Shivam Gupta --- gatsby-node.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 8e5d0e03fabb..7f8a6cb95605 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -5,13 +5,15 @@ * See: https://www.gatsbyjs.org/docs/node-apis/ */ -import path from "path"; -import slugify from "./src/utils/slugify.js"; -import { paginate } from "gatsby-awesome-pagination"; -import { createFilePath } from "gatsby-source-filesystem"; -import FilterWarningsPlugin from "webpack-filter-warnings-plugin"; -import config from "./gatsby-config.js"; -import { componentsData } from "./src/sections/Projects/Sistent/components/content.js"; +const path = require("path"); +const slugify = require("./src/utils/slugify"); +const { paginate } = require("gatsby-awesome-pagination"); +const { createFilePath } = require("gatsby-source-filesystem"); +const FilterWarningsPlugin = require("webpack-filter-warnings-plugin"); +const config = require("./gatsby-config"); +const { + componentsData, +} = require("./src/sections/Projects/Sistent/components/content"); if (process.env.CI === "true") { // All process.env.CI conditionals in this file are in place for GitHub Pages, if webhost changes in the future, code may need to be modified or removed.