Skip to content

Commit f3e25b8

Browse files
[MOO-996]: Normalize JS actions line endings (#45)
2 parents b244af5 + b6990c4 commit f3e25b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+348
-97
lines changed

Diff for: .nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
18.15.0

Diff for: configs/jsactions/rollup.config.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export default async args => {
2222
const posixPath = join(cwd, "src", "**/*.ts").split(sep).join(posix.sep); // Always use forward slashes
2323
const files = await fg([posixPath]); // fast-glob only works with forward slashes
2424
const outDir = join(cwd, "dist");
25-
const isWeb = args.configEnv === "web";
2625

2726
const nodeResolvePlugin = nodeResolve({ preferBuiltins: false, mainFields: ["module", "browser", "main"] });
2827
const typescriptPlugin = typescript({
@@ -31,7 +30,10 @@ export default async args => {
3130
inlineSources: false,
3231
target: "es2019",
3332
types: ["mendix-client", "react-native"],
34-
allowSyntheticDefaultImports: true
33+
allowSyntheticDefaultImports: true,
34+
compilerOptions: {
35+
newLine: "CRLF"
36+
}
3537
});
3638

3739
const copyAsync = promisify(copy);
@@ -50,7 +52,7 @@ export default async args => {
5052
plugins: [
5153
i === 0 ? clear({ targets: [outDir] }) : null,
5254
collectDependencies({
53-
copyJsModules: !isWeb,
55+
copyJsModules: true,
5456
onlyNative: false,
5557
outputDir: outDir,
5658
widgetName: fileOutput,
@@ -76,24 +78,22 @@ export default async args => {
7678
? command([
7779
async () => copyLicenseFile(cwd, outDir),
7880
async () => {
79-
if (!isWeb) {
80-
if (args.configProject === "nativemobileresources") {
81-
// `fbjs/lib/invariant` is being used silently by @react-native-community/cameraroll; it is not listed as a dependency nor peerDependency.
82-
// https://github.dev/react-native-cameraroll/react-native-cameraroll/blob/7c269a837d095a2cb5f4ce13b54ab3060455b17f/js/CameraRoll.js#L14
83-
const path = join(outDir, "node_modules", "fbjs", "lib");
84-
mkdirSync(path, { recursive: true });
85-
await copyAsync(
86-
join(dirname(require.resolve("fbjs")), "lib", "invariant.js"),
87-
join(path, "invariant.js")
88-
);
89-
} else if (args.configProject === "nanoflowcommons") {
90-
// `invariant` is being used silently by @react-native-community/geolocation; it is not listed as a dependency nor peerDependency.
91-
// https://github.dev/react-native-geolocation/react-native-geolocation/blob/1786929f2be581da91082ff857c2393da5e597b3/js/implementation.native.js#L13
92-
await copyAsync(
93-
dirname(require.resolve("invariant")),
94-
join(outDir, "node_modules", "invariant")
95-
);
96-
}
81+
if (args.configProject === "nativemobileresources") {
82+
// `fbjs/lib/invariant` is being used silently by @react-native-community/cameraroll; it is not listed as a dependency nor peerDependency.
83+
// https://github.dev/react-native-cameraroll/react-native-cameraroll/blob/7c269a837d095a2cb5f4ce13b54ab3060455b17f/js/CameraRoll.js#L14
84+
const path = join(outDir, "node_modules", "fbjs", "lib");
85+
mkdirSync(path, { recursive: true });
86+
await copyAsync(
87+
join(dirname(require.resolve("fbjs")), "lib", "invariant.js"),
88+
join(path, "invariant.js")
89+
);
90+
} else if (args.configProject === "nanoflowcommons") {
91+
// `invariant` is being used silently by @react-native-community/geolocation; it is not listed as a dependency nor peerDependency.
92+
// https://github.dev/react-native-geolocation/react-native-geolocation/blob/1786929f2be581da91082ff857c2393da5e597b3/js/implementation.native.js#L13
93+
await copyAsync(
94+
dirname(require.resolve("invariant")),
95+
join(outDir, "node_modules", "invariant")
96+
);
9797
}
9898

9999
// this is helpful to copy the files and folders to a test project path for dev/testing purposes.

Diff for: packages/jsActions/mobile-resources-native/src/authentication/BiometricAuthentication.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import TouchID from "react-native-touch-id";
89

10+
// BEGIN EXTRA CODE
11+
// END EXTRA CODE
12+
913
/**
1014
* @param {string} reason - The reason for requesting authentication. If empty, the system default message is used.
1115
* @returns {Promise.<boolean>}

Diff for: packages/jsActions/mobile-resources-native/src/authentication/IsBiometricAuthenticationSupported.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import TouchID from "react-native-touch-id";
89

10+
// BEGIN EXTRA CODE
11+
// END EXTRA CODE
12+
913
/**
1014
* @returns {Promise.<boolean>}
1115
*/

Diff for: packages/jsActions/mobile-resources-native/src/camera/SaveToPictureLibrary.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
68
import { saveToCameraRoll } from "@react-native-community/cameraroll";
9+
10+
// BEGIN EXTRA CODE
11+
// END EXTRA CODE
12+
713
/**
814
* @param {MxObject} picture - This field is required.
915
* @returns {Promise.<string>}

Diff for: packages/jsActions/mobile-resources-native/src/camera/TakePicture.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { Big } from "big.js";
89
import { Alert, Linking, NativeModules, Platform } from "react-native";
910
import {
@@ -17,6 +18,9 @@ import {
1718
import { getLocales } from "react-native-localize";
1819
import { ImagePickerV2Options, ImagePickerV2Response, PictureQuality, PictureSource } from "../../typings/Camera";
1920

21+
// BEGIN EXTRA CODE
22+
// END EXTRA CODE
23+
2024
/**
2125
* Take a picture using the camera or import one from the photo library on the device.
2226
*

Diff for: packages/jsActions/mobile-resources-native/src/camera/TakePictureAdvanced.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { Big } from "big.js";
89
import { Alert, Linking, NativeModules, Platform } from "react-native";
910
import {
@@ -17,6 +18,9 @@ import {
1718
import { getLocales } from "react-native-localize";
1819
import { ImagePickerV2Options, ImagePickerV2Response, PictureQuality, PictureSource } from "../../typings/Camera";
1920

21+
// BEGIN EXTRA CODE
22+
// END EXTRA CODE
23+
2024
/**
2125
* Take a picture using the camera or import one from the image library on the device.
2226
*

Diff for: packages/jsActions/mobile-resources-native/src/clipboard/GetClipboardContent.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { Clipboard } from "react-native";
89

10+
// BEGIN EXTRA CODE
11+
// END EXTRA CODE
12+
913
/**
1014
* @returns {Promise.<string>}
1115
*/

Diff for: packages/jsActions/mobile-resources-native/src/clipboard/SetClipboardContent.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { Clipboard } from "react-native";
89

10+
// BEGIN EXTRA CODE
11+
// END EXTRA CODE
12+
913
/**
1014
* @param {string} content - This field is required.
1115
* @returns {Promise.<void>}

Diff for: packages/jsActions/mobile-resources-native/src/deeplink/RegisterDeepLink.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { Linking } from "react-native";
99

1010
type Nanoflow = (params: Record<string, any>) => Promise<void>;
11+
1112
// BEGIN EXTRA CODE
1213
// END EXTRA CODE
1314

Diff for: packages/jsActions/mobile-resources-native/src/network/IsCellularConnection.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { fetch } from "@react-native-community/netinfo";
89
import { NetInfoType } from "../../typings/NetInfo";
910

11+
// BEGIN EXTRA CODE
12+
// END EXTRA CODE
13+
1014
/**
1115
* @returns {Promise.<boolean>}
1216
*/

Diff for: packages/jsActions/mobile-resources-native/src/network/IsConnected.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { fetch } from "@react-native-community/netinfo";
89
import { NetInfoType } from "../../typings/NetInfo";
910

11+
// BEGIN EXTRA CODE
12+
// END EXTRA CODE
13+
1014
/**
1115
* @returns {Promise.<boolean>}
1216
*/

Diff for: packages/jsActions/mobile-resources-native/src/network/IsWifiConnection.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { fetch } from "@react-native-community/netinfo";
89
import { NetInfoType } from "../../typings/NetInfo";
910

11+
// BEGIN EXTRA CODE
12+
// END EXTRA CODE
13+
1014
/**
1115
* @returns {Promise.<boolean>}
1216
*/

Diff for: packages/jsActions/mobile-resources-native/src/notifications/CancelAllScheduledNotifications.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { NativeModules, Platform } from "react-native";
89
import PushNotification from "react-native-push-notification";
910

11+
// BEGIN EXTRA CODE
12+
// END EXTRA CODE
13+
1014
/**
1115
* Cancels all pending scheduled notifications.
1216
* @returns {Promise.<void>}

Diff for: packages/jsActions/mobile-resources-native/src/notifications/CancelScheduledNotification.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { NativeModules, Platform } from "react-native";
89
import PushNotification from "react-native-push-notification";
910

11+
// BEGIN EXTRA CODE
12+
// END EXTRA CODE
13+
1014
/**
1115
* @param {string} notificationId - This field is required.
1216
* @returns {Promise.<void>}

Diff for: packages/jsActions/mobile-resources-native/src/notifications/DisplayNotification.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { NativeModules, Platform } from "react-native";
89
import PushNotification, { PushNotificationObject } from "react-native-push-notification";
910

11+
// BEGIN EXTRA CODE
12+
// END EXTRA CODE
13+
1014
/**
1115
* Displays the specified notification straight away.
1216
*

Diff for: packages/jsActions/mobile-resources-native/src/notifications/GetPushNotificationToken.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { NativeModules } from "react-native";
89
import messaging from "@react-native-firebase/messaging";
910

11+
// BEGIN EXTRA CODE
12+
// END EXTRA CODE
13+
1014
/**
1115
* This generated registration token is used to identify the app instance and periodically sends data to the backend.
1216
* @returns {Promise.<string>}

Diff for: packages/jsActions/mobile-resources-native/src/notifications/HasNotificationPermission.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { NativeModules } from "react-native";
89

10+
// BEGIN EXTRA CODE
11+
// END EXTRA CODE
12+
913
/**
1014
* Checks if the user has granted the appropriate permissions to be able to send and receive messages.
1115
* Returns true if permission is granted, false otherwise.

Diff for: packages/jsActions/mobile-resources-native/src/notifications/RequestNotificationPermission.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// This file was generated by Mendix Modeler.
1+
// This file was generated by Mendix Studio Pro.
22
//
33
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
45
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
57
// Other code you write will be lost the next time you deploy the project.
6-
78
import { NativeModules, Platform } from "react-native";
89
import messaging from "@react-native-firebase/messaging";
910

11+
// BEGIN EXTRA CODE
12+
// END EXTRA CODE
13+
1014
/**
1115
* Notification permissions are required to send a user push messages. Calling this action displays the permission dialog to the user.
1216
* Returns true if permission is granted, otherwise it returns false.

0 commit comments

Comments
 (0)