Skip to content

Commit

Permalink
refactor: prefix node:* (#1769)
Browse files Browse the repository at this point in the history
* refactor: prefix node:* to path
* refactor: prefix node:* to os
* refactor: prefix node:* to fs
* refactor: prefix node:* to util
  • Loading branch information
erisu authored Jan 28, 2025
1 parent 92116de commit 9f55180
Show file tree
Hide file tree
Showing 30 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion lib/Adb.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
*/

const os = require('os');
const os = require('node:os');
const execa = require('execa');
const events = require('cordova-common').events;
const CordovaError = require('cordova-common').CordovaError;
Expand Down
2 changes: 1 addition & 1 deletion lib/AndroidManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
*/

const fs = require('fs');
const fs = require('node:fs');
const xml = require('cordova-common').xmlHelpers;

const DEFAULT_ORIENTATION = 'default';
Expand Down
4 changes: 2 additions & 2 deletions lib/AndroidProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
under the License.
*/

const fs = require('fs');
const path = require('path');
const fs = require('node:fs');
const path = require('node:path');
const properties_parser = require('properties-parser');
const pluginHandlers = require('./pluginHandlers');
const CordovaGradleConfigParserFactory = require('./config/CordovaGradleConfigParserFactory');
Expand Down
2 changes: 1 addition & 1 deletion lib/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
*/

const path = require('path');
const path = require('node:path');

const AndroidProject = require('./AndroidProject');
const PluginManager = require('cordova-common').PluginManager;
Expand Down
4 changes: 2 additions & 2 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
under the License.
*/

const path = require('path');
const fs = require('fs');
const path = require('node:path');
const fs = require('node:fs');
const nopt = require('nopt');
const untildify = require('untildify');
const { parseArgsStringToArgv } = require('string-argv');
Expand Down
2 changes: 1 addition & 1 deletion lib/builders/ProjectBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const execa = require('execa');
const glob = require('fast-glob');
const events = require('cordova-common').events;
Expand Down
2 changes: 1 addition & 1 deletion lib/check_reqs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

const execa = require('execa');
const path = require('path');
const path = require('node:path');
const fs = require('fs-extra');
const { forgivingWhichSync, isWindows, isDarwin } = require('./utils');
const java = require('./env/java');
Expand Down
2 changes: 1 addition & 1 deletion lib/config/CordovaGradleConfigParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const events = require('cordova-common').events;

class CordovaGradleConfigParser {
Expand Down
4 changes: 2 additions & 2 deletions lib/config/GradlePropertiesParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
under the License.
*/

const fs = require('fs');
const path = require('path');
const fs = require('node:fs');
const path = require('node:path');
const propertiesParser = require('properties-parser');
const events = require('cordova-common').events;

Expand Down
2 changes: 1 addition & 1 deletion lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
*/

const path = require('path');
const path = require('node:path');
const fs = require('fs-extra');
const utils = require('./utils');
const check_reqs = require('./check_reqs');
Expand Down
2 changes: 1 addition & 1 deletion lib/emulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const execa = require('execa');
const fs = require('fs-extra');
const android_versions = require('android-versions');
const path = require('path');
const path = require('node:path');
const Adb = require('./Adb');
const events = require('cordova-common').events;
const CordovaError = require('cordova-common').CordovaError;
Expand Down
2 changes: 1 addition & 1 deletion lib/env/java.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

const execa = require('execa');
const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const glob = require('fast-glob');
const { CordovaError, events } = require('cordova-common');
const utils = require('../utils');
Expand Down
2 changes: 1 addition & 1 deletion lib/pluginHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const isPathInside = require('is-path-inside');
const events = require('cordova-common').events;
const CordovaError = require('cordova-common').CordovaError;
Expand Down
2 changes: 1 addition & 1 deletion lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const nopt = require('nopt');
const glob = require('fast-glob');
const dedent = require('dedent');
Expand Down
2 changes: 1 addition & 1 deletion lib/target.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
*/

const { inspect } = require('util');
const { inspect } = require('node:util');
const execa = require('execa');
const Adb = require('./Adb');
const build = require('./build');
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

const fs = require('fs-extra');
const which = require('which');
const os = require('os');
const os = require('node:os');

/**
* Reads, searches, and replaces the found occurences with replacementString and then writes the file back out.
Expand Down
4 changes: 2 additions & 2 deletions spec/e2e/e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
under the License.
*/

const os = require('os');
const os = require('node:os');
const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const { EventEmitter } = require('events');
const { ConfigParser, PluginInfoProvider } = require('cordova-common');
const Api = require('../../lib/Api');
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/AndroidManifest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
under the License.
*/

const fs = require('fs');
const os = require('os');
const path = require('path');
const fs = require('node:fs');
const os = require('node:os');
const path = require('node:path');
const rewire = require('rewire');

describe('AndroidManifest', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/AndroidProject.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
*/

const path = require('path');
const path = require('node:path');
const rewire = require('rewire');
const MockCordovaGradleConfigParser = require('./mocks/config/MockCordovaGradleConfigParser');
const CordovaGradleConfigParserFactory = require('../../lib/config/CordovaGradleConfigParserFactory');
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/Api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
under the License.
*/

const os = require('os');
const path = require('path');
const os = require('node:os');
const path = require('node:path');
const common = require('cordova-common');
const EventEmitter = require('events');

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/android_sdk.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
under the License.
*/

const fs = require('fs');
const path = require('path');
const fs = require('node:fs');
const path = require('node:path');
const rewire = require('rewire');

describe('android_sdk', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/builders/ProjectBuilder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const rewire = require('rewire');
const { isWindows } = require('../../../lib/utils');

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/check_reqs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const rewire = require('rewire');
const android_sdk = require('../../lib/android_sdk');
const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const events = require('cordova-common').events;
const which = require('which');

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/create.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const utils = require('../../lib/utils');
const create = rewire('../../lib/create');
const check_reqs = require('../../lib/check_reqs');
const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const MockCordovaGradleConfigParser = require('./mocks/config/MockCordovaGradleConfigParser');
const CordovaGradleConfigParserFactory = require('../../lib/config/CordovaGradleConfigParserFactory');

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/emulator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

const fs = require('fs-extra');
const path = require('path');
const path = require('node:path');
const rewire = require('rewire');
const which = require('which');

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/java.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
*/

const path = require('path');
const path = require('node:path');
const rewire = require('rewire');
const { CordovaError } = require('cordova-common');
const utils = require('../../lib/utils');
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/pluginHandlers/common.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

const rewire = require('rewire');
const common = rewire('../../../lib/pluginHandlers');
const path = require('path');
const path = require('node:path');
const fs = require('fs-extra');
const osenv = require('os');
const osenv = require('node:os');

const test_dir = path.join(osenv.tmpdir(), 'test_plugman');
const project_dir = path.join(test_dir, 'project');
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/pluginHandlers/handlers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
const rewire = require('rewire');
const common = rewire('../../../lib/pluginHandlers');
const android = common.__get__('handlers');
const path = require('path');
const path = require('node:path');
const fs = require('fs-extra');
const os = require('os');
const os = require('node:os');
const temp = path.join(os.tmpdir(), 'plugman');
const plugins_dir = path.join(temp, 'cordova/plugins');
const dummyplugin = path.join(__dirname, '../../fixtures/org.test.plugins.dummyplugin');
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/prepare.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

const rewire = require('rewire');
const path = require('path');
const path = require('node:path');
const CordovaError = require('cordova-common').CordovaError;
const GradlePropertiesParser = require('../../lib/config/GradlePropertiesParser');
const utils = require('../../lib/utils');
Expand Down
2 changes: 1 addition & 1 deletion test/run_java_unit_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
under the License.
*/

const path = require('path');
const path = require('node:path');
const execa = require('execa');
const fs = require('fs-extra');
const ProjectBuilder = require('../lib/builders/ProjectBuilder');
Expand Down

0 comments on commit 9f55180

Please sign in to comment.