Skip to content

Commit

Permalink
chore(deps): upgrade eslint to v9
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra committed Apr 12, 2024
1 parent 9461a86 commit 40b5486
Show file tree
Hide file tree
Showing 9 changed files with 1,125 additions and 165 deletions.
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

17 changes: 0 additions & 17 deletions cfg/eslint.config.cjs

This file was deleted.

7 changes: 7 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
languageOptions: {
ecmaVersion: 2023,
sourceType: "module",
},
ignores: ['node_modules', 'cache', 'build', 'dist', 'out']
};
47 changes: 23 additions & 24 deletions lib/index.cjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
const { basename, resolve } = require("node:path");
const { version } = require("node:process");
const { mkdir, cp, rm, rename } = require("node:fs/promises");
const { readFileSync } = require("node:fs");
const fs = require("node:fs");
const path = require("node:path");
const process = require("node:process");

const _ = require("lodash");
const glob = require("simple-glob");
var _ = require("lodash");
var fs = require("graceful-fs-extra");
var path = require("path");
var thenify = require("thenify");
var rcedit = require("rcedit");
var winresourcer = thenify(require("winresourcer"));
var semver = require("semver");
var platformOverrides = require("./platformOverrides.cjs");
const fs = require("graceful-fs-extra");
const thenify = require("thenify");
const rcedit = require("rcedit");
const winresourcer = thenify(require("winresourcer"));
const semver = require("semver");
const platformOverrides = require("./platformOverrides.cjs");
const NwVersions = require("./versions.cjs");
const Utils = require("./utils.cjs");

const {
get,
Expand All @@ -23,8 +24,6 @@ const {
run,
validate,
} = require("../dist/index.cjs");
var NwVersions = require("./versions.cjs");
var Utils = require("./utils.cjs");

class NwBuilder {
constructor(options) {
Expand All @@ -49,8 +48,8 @@ class NwBuilder {
options = parse(options, manifest);

for (const file of glob(options.files)) {
if (basename(file) === "package.json" && manifest === undefined) {
manifest = JSON.parse(readFileSync(file));
if (path.basename(file) === "package.json" && manifest === undefined) {
manifest = JSON.parse(fs.readFileSync(file));
}
}

Expand Down Expand Up @@ -94,7 +93,7 @@ class NwBuilder {
if (options.quiet === "debug") {
log.debug(`Platform: ${platform}`);
log.debug(`Archicture: ${arch}`);
log.debug(`Node Version: ${version}`);
log.debug(`Node Version: ${process.version}`);
log.debug(`NW.js Version: ${options.version}\n`);
}
} catch (error) {
Expand Down Expand Up @@ -233,7 +232,7 @@ class NwBuilder {

built = await isCached(options.cacheDir);
if (built === false) {
await mkdir(options.cacheDir, { recursive: true });
await fs.promises.mkdir(options.cacheDir, { recursive: true });
}
for await (const os of options.platforms) {
const platform = os.slice(0, os.length - 2);
Expand Down Expand Up @@ -358,7 +357,7 @@ class NwBuilder {
const platform = os.slice(0, os.length - 2);
const arch = "x" + os.slice(os.length - 2);

await rm(resolve(this.options.buildDir, this.options.appName, os), {
await fs.promises.rm(resolve(this.options.buildDir, this.options.appName, os), {
recursive: true,
force: true,
});
Expand All @@ -370,14 +369,14 @@ class NwBuilder {
}-${platform}-${arch}`,
);

await cp(
await fs.promises.cp(
nwDir,
resolve(this.options.buildDir, this.options.appName, os),
{ recursive: true },
);

for (const file of glob(this.options.files)) {
await cp(
await fs.promises.cp(
file,
resolve(
this.options.buildDir,
Expand Down Expand Up @@ -577,7 +576,7 @@ class NwBuilder {

var executableName = self.getExecutableName(name);

await rename(
await fs.promises.rename(
resolve(platform.releasePath, "nw"),
resolve(platform.releasePath, executableName),
);
Expand All @@ -593,7 +592,7 @@ class NwBuilder {

var executableName = self.getExecutableName(name);

await rename(
await fs.promises.rename(
resolve(platform.releasePath, "nwjs.app"),
resolve(platform.releasePath, executableName),
);
Expand Down Expand Up @@ -689,7 +688,7 @@ class NwBuilder {
var executableName = self.getExecutableName(name);
var executablePath = path.resolve(platform.releasePath, executableName);

await rename(
await fs.promises.rename(
resolve(platform.releasePath, "nw.exe"),
resolve(platform.releasePath, executableName),
);
Expand Down
Loading

0 comments on commit 40b5486

Please sign in to comment.