Repository: playcanvas/engine
Pull request #4716 (2022-10-10 12:40:20)

Fix lint issues in types-fixup.mjs


Patch:
diff --git a/src/asset/asset.js b/src/asset/asset.js
index 1a256770b..b5c168be2 100644
--- a/src/asset/asset.js
+++ b/src/asset/asset.js
@@ -3,7 +3,7 @@ import { Tags } from '../core/tags.js';
 
 import { EventHandler } from '../core/event-handler.js';
 
-import { findAvailableLocale } from '../i18n/utils.js';
+import { findAvailableLocale } from '../framework/i18n/utils.js';
 
 import { ABSOLUTE_URL } from './constants.js';
 import { AssetFile } from './asset-file.js';
diff --git a/src/framework/app-base.js b/src/framework/app-base.js
index 9ca1e5f63..746d8bf47 100644
--- a/src/framework/app-base.js
+++ b/src/framework/app-base.js
@@ -48,7 +48,7 @@ import { BundleRegistry } from '../bundles/bundle-registry.js';
 
 import { ScriptRegistry } from './script/script-registry.js';
 
-import { I18n } from '../i18n/i18n.js';
+import { I18n } from '../framework/i18n/i18n.js';
 
 import { ComponentSystemRegistry } from './components/registry.js';
 import { script } from './script.js';
diff --git a/src/i18n/constants.js b/src/framework/i18n/constants.js
similarity index 100%
rename from src/i18n/constants.js
rename to src/framework/i18n/constants.js
diff --git a/src/i18n/i18n-parser.js b/src/framework/i18n/i18n-parser.js
similarity index 100%
rename from src/i18n/i18n-parser.js
rename to src/framework/i18n/i18n-parser.js
diff --git a/src/i18n/i18n.js b/src/framework/i18n/i18n.js
similarity index 98%
rename from src/i18n/i18n.js
rename to src/framework/i18n/i18n.js
index 10c7c0f57..c7b22e9c2 100644
--- a/src/i18n/i18n.js
+++ b/src/framework/i18n/i18n.js
@@ -1,10 +1,10 @@
-import { EventHandler } from '../core/event-handler.js';
+import { EventHandler } from '../../core/event-handler.js';
 
-import { Asset } from '../asset/asset.js';
+import { Asset } from '../../asset/asset.js';
 
 import { I18nParser } from './i18n-parser.js';
 
-/** @typedef {import('../framework/app-base.js').AppBase} AppBase */
+/** @typedef {import('../../framework/app-base.js').AppBase} AppBase */
 
 import {
     DEFAULT_LOCALE,
diff --git a/src/i18n/utils.js b/src/framework/i18n/utils.js
similarity index 100%
rename from src/i18n/utils.js
rename to src/framework/i18n/utils.js
diff --git a/src/index.js b/src/index.js
index ca950af3b..f3dc07815 100644
--- a/src/index.js
+++ b/src/index.js
@@ -199,7 +199,7 @@ export { ScriptRegistry } from './framework/script/script-registry.js';
 export { ScriptType } from './framework/script/script-type.js';
 
 // LOCALIZATION
-export { I18n } from './i18n/i18n.js';
+export { I18n } from './framework/i18n/i18n.js';
 
 // INPUT
 export * from './platform/input/constants.js';
diff --git a/src/resources/parser/scene.js b/src/resources/parser/scene.js
index 8d252ac63..9986ed55c 100644
--- a/src/resources/parser/scene.js
+++ b/src/resources/parser/scene.js
@@ -1,7 +1,7 @@
 import { Entity } from '../../framework/entity.js';
 
-import { CompressUtils } from '../../compress/compress-utils.js';
-import { Decompress } from '../../compress/decompress.js';
+import { CompressUtils } from '../../scene/compress/compress-utils.js';
+import { Decompress } from '../../scene/compress/decompress.js';
 
 class SceneParser {
     constructor(app, isTemplate) {
diff --git a/types-fixup.mjs b/types-fixup.mjs
index bf4c1475a..3c848dc1a 100644
--- a/types-fixup.mjs
+++ b/types-fixup.mjs
@@ -9,7 +9,7 @@ const paths = [
     './types/framework/script/script.d.ts'
 ];
 
-paths.forEach(path => {
+paths.forEach((path) => {
     let dts = fs.readFileSync(path, 'utf8');
     dts = dts.replace(regex, 'typeof ScriptType');
     fs.writeFileSync(path, dts);
@@ -28,7 +28,7 @@ const regexConstructor = /constructor\(([^)]+)\);/g;
 const getDeclarations = (properties) => {
     let declarations = '';
 
-    properties.forEach(prop => {
+    properties.forEach((prop) => {
         declarations += `
     set ${prop[0]}(arg: ${prop[1]});
     get ${prop[0]}(): ${prop[1]};
@@ -63,7 +63,7 @@ const buttonComponentProps = [
     ['pressedTint', 'Color'],
     ['transitionMode', 'number']
 ];
-   
+
 path = './types/framework/components/button/component.d.ts';
 dts = fs.readFileSync(path, 'utf8');
 dts = dts.replace(regexConstructor, '$&\n' + getDeclarations(buttonComponentProps));


Test patch:
diff --git a/src/compress/compress-utils.js b/src/scene/compress/compress-utils.js
similarity index 100%
rename from src/compress/compress-utils.js
rename to src/scene/compress/compress-utils.js
diff --git a/src/compress/decompress.js b/src/scene/compress/decompress.js
similarity index 100%
rename from src/compress/decompress.js
rename to src/scene/compress/decompress.js
diff --git a/test/framework/application.test.mjs b/test/framework/application.test.mjs
index df40edcac..faf61c784 100644
--- a/test/framework/application.test.mjs
+++ b/test/framework/application.test.mjs
@@ -5,7 +5,7 @@ import { BatchManager } from '../../src/scene/batching/batch-manager.js';
 import { ComponentSystemRegistry } from '../../src/framework/components/registry.js';
 import { Entity } from '../../src/framework/entity.js';
 import { GraphicsDevice } from '../../src/platform/graphics/graphics-device.js';
-import { I18n } from '../../src/i18n/i18n.js';
+import { I18n } from '../../src/framework/i18n/i18n.js';
 import { Lightmapper } from '../../src/scene/lightmapper/lightmapper.js';
 import { ResourceLoader } from '../../src/resources/loader.js';
 import { Scene } from '../../src/scene/scene.js';