refactor: prefix node:* (#1769)

* refactor: prefix node:* to path
* refactor: prefix node:* to os
* refactor: prefix node:* to fs
* refactor: prefix node:* to util
This commit is contained in:
エリス 2025-01-28 12:13:36 +09:00 committed by GitHub
parent 92116dee48
commit 9f5518000f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
30 changed files with 40 additions and 40 deletions

View File

@ -17,7 +17,7 @@
under the License. under the License.
*/ */
const os = require('os'); const os = require('node:os');
const execa = require('execa'); const execa = require('execa');
const events = require('cordova-common').events; const events = require('cordova-common').events;
const CordovaError = require('cordova-common').CordovaError; const CordovaError = require('cordova-common').CordovaError;

View File

@ -17,7 +17,7 @@
under the License. under the License.
*/ */
const fs = require('fs'); const fs = require('node:fs');
const xml = require('cordova-common').xmlHelpers; const xml = require('cordova-common').xmlHelpers;
const DEFAULT_ORIENTATION = 'default'; const DEFAULT_ORIENTATION = 'default';

View File

@ -17,8 +17,8 @@
under the License. under the License.
*/ */
const fs = require('fs'); const fs = require('node:fs');
const path = require('path'); const path = require('node:path');
const properties_parser = require('properties-parser'); const properties_parser = require('properties-parser');
const pluginHandlers = require('./pluginHandlers'); const pluginHandlers = require('./pluginHandlers');
const CordovaGradleConfigParserFactory = require('./config/CordovaGradleConfigParserFactory'); const CordovaGradleConfigParserFactory = require('./config/CordovaGradleConfigParserFactory');

View File

@ -17,7 +17,7 @@
under the License. under the License.
*/ */
const path = require('path'); const path = require('node:path');
const AndroidProject = require('./AndroidProject'); const AndroidProject = require('./AndroidProject');
const PluginManager = require('cordova-common').PluginManager; const PluginManager = require('cordova-common').PluginManager;

View File

@ -17,8 +17,8 @@
under the License. under the License.
*/ */
const path = require('path'); const path = require('node:path');
const fs = require('fs'); const fs = require('node:fs');
const nopt = require('nopt'); const nopt = require('nopt');
const untildify = require('untildify'); const untildify = require('untildify');
const { parseArgsStringToArgv } = require('string-argv'); const { parseArgsStringToArgv } = require('string-argv');

View File

@ -18,7 +18,7 @@
*/ */
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('node:path');
const execa = require('execa'); const execa = require('execa');
const glob = require('fast-glob'); const glob = require('fast-glob');
const events = require('cordova-common').events; const events = require('cordova-common').events;

View File

@ -18,7 +18,7 @@
*/ */
const execa = require('execa'); const execa = require('execa');
const path = require('path'); const path = require('node:path');
const fs = require('fs-extra'); const fs = require('fs-extra');
const { forgivingWhichSync, isWindows, isDarwin } = require('./utils'); const { forgivingWhichSync, isWindows, isDarwin } = require('./utils');
const java = require('./env/java'); const java = require('./env/java');

View File

@ -18,7 +18,7 @@
*/ */
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('node:path');
const events = require('cordova-common').events; const events = require('cordova-common').events;
class CordovaGradleConfigParser { class CordovaGradleConfigParser {

View File

@ -17,8 +17,8 @@
under the License. under the License.
*/ */
const fs = require('fs'); const fs = require('node:fs');
const path = require('path'); const path = require('node:path');
const propertiesParser = require('properties-parser'); const propertiesParser = require('properties-parser');
const events = require('cordova-common').events; const events = require('cordova-common').events;

View File

@ -17,7 +17,7 @@
under the License. under the License.
*/ */
const path = require('path'); const path = require('node:path');
const fs = require('fs-extra'); const fs = require('fs-extra');
const utils = require('./utils'); const utils = require('./utils');
const check_reqs = require('./check_reqs'); const check_reqs = require('./check_reqs');

View File

@ -20,7 +20,7 @@
const execa = require('execa'); const execa = require('execa');
const fs = require('fs-extra'); const fs = require('fs-extra');
const android_versions = require('android-versions'); const android_versions = require('android-versions');
const path = require('path'); const path = require('node:path');
const Adb = require('./Adb'); const Adb = require('./Adb');
const events = require('cordova-common').events; const events = require('cordova-common').events;
const CordovaError = require('cordova-common').CordovaError; const CordovaError = require('cordova-common').CordovaError;

2
lib/env/java.js vendored
View File

@ -19,7 +19,7 @@
const execa = require('execa'); const execa = require('execa');
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('node:path');
const glob = require('fast-glob'); const glob = require('fast-glob');
const { CordovaError, events } = require('cordova-common'); const { CordovaError, events } = require('cordova-common');
const utils = require('../utils'); const utils = require('../utils');

View File

@ -15,7 +15,7 @@
*/ */
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('node:path');
const isPathInside = require('is-path-inside'); const isPathInside = require('is-path-inside');
const events = require('cordova-common').events; const events = require('cordova-common').events;
const CordovaError = require('cordova-common').CordovaError; const CordovaError = require('cordova-common').CordovaError;

View File

@ -18,7 +18,7 @@
*/ */
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('node:path');
const nopt = require('nopt'); const nopt = require('nopt');
const glob = require('fast-glob'); const glob = require('fast-glob');
const dedent = require('dedent'); const dedent = require('dedent');

View File

@ -17,7 +17,7 @@
under the License. under the License.
*/ */
const { inspect } = require('util'); const { inspect } = require('node:util');
const execa = require('execa'); const execa = require('execa');
const Adb = require('./Adb'); const Adb = require('./Adb');
const build = require('./build'); const build = require('./build');

View File

@ -25,7 +25,7 @@
const fs = require('fs-extra'); const fs = require('fs-extra');
const which = require('which'); 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. * Reads, searches, and replaces the found occurences with replacementString and then writes the file back out.

View File

@ -17,9 +17,9 @@
under the License. under the License.
*/ */
const os = require('os'); const os = require('node:os');
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('node:path');
const { EventEmitter } = require('events'); const { EventEmitter } = require('events');
const { ConfigParser, PluginInfoProvider } = require('cordova-common'); const { ConfigParser, PluginInfoProvider } = require('cordova-common');
const Api = require('../../lib/Api'); const Api = require('../../lib/Api');

View File

@ -17,9 +17,9 @@
under the License. under the License.
*/ */
const fs = require('fs'); const fs = require('node:fs');
const os = require('os'); const os = require('node:os');
const path = require('path'); const path = require('node:path');
const rewire = require('rewire'); const rewire = require('rewire');
describe('AndroidManifest', () => { describe('AndroidManifest', () => {

View File

@ -17,7 +17,7 @@
under the License. under the License.
*/ */
const path = require('path'); const path = require('node:path');
const rewire = require('rewire'); const rewire = require('rewire');
const MockCordovaGradleConfigParser = require('./mocks/config/MockCordovaGradleConfigParser'); const MockCordovaGradleConfigParser = require('./mocks/config/MockCordovaGradleConfigParser');
const CordovaGradleConfigParserFactory = require('../../lib/config/CordovaGradleConfigParserFactory'); const CordovaGradleConfigParserFactory = require('../../lib/config/CordovaGradleConfigParserFactory');

View File

@ -17,8 +17,8 @@
under the License. under the License.
*/ */
const os = require('os'); const os = require('node:os');
const path = require('path'); const path = require('node:path');
const common = require('cordova-common'); const common = require('cordova-common');
const EventEmitter = require('events'); const EventEmitter = require('events');

View File

@ -17,8 +17,8 @@
under the License. under the License.
*/ */
const fs = require('fs'); const fs = require('node:fs');
const path = require('path'); const path = require('node:path');
const rewire = require('rewire'); const rewire = require('rewire');
describe('android_sdk', () => { describe('android_sdk', () => {

View File

@ -18,7 +18,7 @@
*/ */
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('node:path');
const rewire = require('rewire'); const rewire = require('rewire');
const { isWindows } = require('../../../lib/utils'); const { isWindows } = require('../../../lib/utils');

View File

@ -20,7 +20,7 @@
const rewire = require('rewire'); const rewire = require('rewire');
const android_sdk = require('../../lib/android_sdk'); const android_sdk = require('../../lib/android_sdk');
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('node:path');
const events = require('cordova-common').events; const events = require('cordova-common').events;
const which = require('which'); const which = require('which');

View File

@ -22,7 +22,7 @@ const utils = require('../../lib/utils');
const create = rewire('../../lib/create'); const create = rewire('../../lib/create');
const check_reqs = require('../../lib/check_reqs'); const check_reqs = require('../../lib/check_reqs');
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('node:path');
const MockCordovaGradleConfigParser = require('./mocks/config/MockCordovaGradleConfigParser'); const MockCordovaGradleConfigParser = require('./mocks/config/MockCordovaGradleConfigParser');
const CordovaGradleConfigParserFactory = require('../../lib/config/CordovaGradleConfigParserFactory'); const CordovaGradleConfigParserFactory = require('../../lib/config/CordovaGradleConfigParserFactory');

View File

@ -18,7 +18,7 @@
*/ */
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('node:path');
const rewire = require('rewire'); const rewire = require('rewire');
const which = require('which'); const which = require('which');

View File

@ -17,7 +17,7 @@
under the License. under the License.
*/ */
const path = require('path'); const path = require('node:path');
const rewire = require('rewire'); const rewire = require('rewire');
const { CordovaError } = require('cordova-common'); const { CordovaError } = require('cordova-common');
const utils = require('../../lib/utils'); const utils = require('../../lib/utils');

View File

@ -18,9 +18,9 @@
const rewire = require('rewire'); const rewire = require('rewire');
const common = rewire('../../../lib/pluginHandlers'); const common = rewire('../../../lib/pluginHandlers');
const path = require('path'); const path = require('node:path');
const fs = require('fs-extra'); const fs = require('fs-extra');
const osenv = require('os'); const osenv = require('node:os');
const test_dir = path.join(osenv.tmpdir(), 'test_plugman'); const test_dir = path.join(osenv.tmpdir(), 'test_plugman');
const project_dir = path.join(test_dir, 'project'); const project_dir = path.join(test_dir, 'project');

View File

@ -20,9 +20,9 @@
const rewire = require('rewire'); const rewire = require('rewire');
const common = rewire('../../../lib/pluginHandlers'); const common = rewire('../../../lib/pluginHandlers');
const android = common.__get__('handlers'); const android = common.__get__('handlers');
const path = require('path'); const path = require('node:path');
const fs = require('fs-extra'); const fs = require('fs-extra');
const os = require('os'); const os = require('node:os');
const temp = path.join(os.tmpdir(), 'plugman'); const temp = path.join(os.tmpdir(), 'plugman');
const plugins_dir = path.join(temp, 'cordova/plugins'); const plugins_dir = path.join(temp, 'cordova/plugins');
const dummyplugin = path.join(__dirname, '../../fixtures/org.test.plugins.dummyplugin'); const dummyplugin = path.join(__dirname, '../../fixtures/org.test.plugins.dummyplugin');

View File

@ -18,7 +18,7 @@
*/ */
const rewire = require('rewire'); const rewire = require('rewire');
const path = require('path'); const path = require('node:path');
const CordovaError = require('cordova-common').CordovaError; const CordovaError = require('cordova-common').CordovaError;
const GradlePropertiesParser = require('../../lib/config/GradlePropertiesParser'); const GradlePropertiesParser = require('../../lib/config/GradlePropertiesParser');
const utils = require('../../lib/utils'); const utils = require('../../lib/utils');

View File

@ -19,7 +19,7 @@
under the License. under the License.
*/ */
const path = require('path'); const path = require('node:path');
const execa = require('execa'); const execa = require('execa');
const fs = require('fs-extra'); const fs = require('fs-extra');
const ProjectBuilder = require('../lib/builders/ProjectBuilder'); const ProjectBuilder = require('../lib/builders/ProjectBuilder');