Skip to content

Commit 4bc697e

Browse files
committed
refactor(root): remove fs-extra
1 parent fd05c64 commit 4bc697e

File tree

3 files changed

+7
-50
lines changed

3 files changed

+7
-50
lines changed

configureStyles.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const fs = require("fs-extra");
1+
const fs = require("node:fs");
22
const yargs = require("yargs");
33
const path = require("path");
44

@@ -12,18 +12,18 @@ const args = yargs(process.argv)
1212

1313
// Function to copy CSS and generate shared-styles.html
1414
async function copyAndGenerateSharedStyles(sourceCss, mainCss) {
15-
await fs.copy(sourceCss, path.join("css", "currentStyle.css"));
15+
await fs.promises.cp(sourceCss, path.join("css", "currentStyle.css"));
1616

1717
// Read the main CSS file
18-
const mainCssContent = await fs.readFile(mainCss, "utf8");
18+
const mainCssContent = await fs.promises.readFile(mainCss, "utf8");
1919

2020
// Generate shared-styles.html content
2121
const sharedStylesContent = `<dom-module id="shared-styles"><template><style>${mainCssContent}</style></template></dom-module>`;
2222

2323
// Write shared-styles.html
24-
await fs.writeFile(
24+
await fs.promises.writeFile(
2525
path.join("polymer-v2.0.0-non-keyed", "src", "shared-styles.html"),
26-
sharedStylesContent
26+
sharedStylesContent,
2727
);
2828
}
2929

@@ -39,12 +39,12 @@ async function configureStyles() {
3939
if (args.bootstrap) {
4040
await copyAndGenerateSharedStyles(
4141
path.join("css", "useOriginalBootstrap.css"),
42-
path.join("css", "bootstrap", "dist", "css", "bootstrap.min.css")
42+
path.join("css", "bootstrap", "dist", "css", "bootstrap.min.css"),
4343
);
4444
} else {
4545
await copyAndGenerateSharedStyles(
4646
path.join("css", "useMinimalCss.css"),
47-
path.join("css", "useMinimalCss.css")
47+
path.join("css", "useMinimalCss.css"),
4848
);
4949
}
5050
} catch (error) {

package-lock.json

Lines changed: 0 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"dependencies": {
5252
"adm-zip": "^0.5.9",
5353
"cross-env": "^7.0.2",
54-
"fs-extra": "9.0.0",
5554
"json5": "^2.2.0",
5655
"local-web-server": "4.1.0",
5756
"lodash": "^4.17.15",

0 commit comments

Comments
 (0)