Skip to content

Commit 342cf21

Browse files
authored
chore: move source files to 'src' directory (#92)
Prevents unrelated files from being unintentionally published to the npm package, and fixes jest tests not being executed, which was introduced by #91.
1 parent 842e6be commit 342cf21

15 files changed

+15
-14
lines changed

cli/commands/initCommand/test/initAndroid.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from "fs";
22
import path from "path";
3-
import { initAndroid, modifyMainApplicationKt } from "../initAndroid.js";
3+
import { initAndroid, modifyMainApplicationKt } from "../initAndroid.ts";
44
import { jest, expect, describe, it } from "@jest/globals";
55

66
const tempDir = path.join(__dirname, 'temp');

cli/commands/initCommand/test/initIos.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { modifyObjectiveCAppDelegate, modifySwiftAppDelegate } from "../initIos.js";
1+
import { modifyObjectiveCAppDelegate, modifySwiftAppDelegate } from "../initIos.ts";
22
import { expect, describe, it} from "@jest/globals";
33

44
// https://github.com/react-native-community/template/blob/0.80.2/template/ios/HelloWorld/AppDelegate.swift

cli/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"esModuleInterop": true,
1313
"skipLibCheck": true,
1414
"strict": true,
15-
"forceConsistentCasingInFileNames": true
15+
"forceConsistentCasingInFileNames": true,
16+
"allowImportingTsExtensions": true
1617
},
1718
"include": ["./**/*.ts"],
1819
"exclude": [

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "@bravemobile/react-native-code-push",
33
"version": "12.0.2",
44
"description": "React Native plugin for the CodePush service",
5-
"main": "CodePush.js",
6-
"react-native": "CodePush.js",
7-
"source": "CodePush.js",
5+
"main": "src/CodePush.js",
6+
"react-native": "src/CodePush.js",
7+
"source": "src/CodePush.js",
88
"types": "typings/react-native-code-push.d.ts",
99
"homepage": "https://microsoft.github.io/code-push",
1010
"keywords": [
@@ -25,17 +25,17 @@
2525
"code-push": "bin/code-push.js"
2626
},
2727
"files": [
28+
"src",
29+
"bin/code-push.js",
2830
"android",
2931
"ios",
3032
"cli/dist",
3133
"cli/**/*.ts",
3234
"!cli/node_modules",
3335
"expo",
3436
"typings",
35-
"versioning",
3637
"*.podspec",
3738
"react-native.config.js",
38-
"./*.js",
3939
"package.json",
4040
"package-lock.json",
4141
"!ios/build",
@@ -69,7 +69,7 @@
6969
"prepack": "npm run build:cli",
7070
"publish": "npm publish --access=public",
7171
"eslint": "eslint --quiet .",
72-
"jest": "jest versioning/*"
72+
"jest": "jest src/versioning/* cli/*"
7373
},
7474
"repository": {
7575
"type": "git",

AlertAdapter.js renamed to src/AlertAdapter.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ let { Alert } = React;
33

44
if (Platform.OS === "android") {
55
const { NativeModules: { CodePushDialog } } = React;
6-
6+
77
Alert = {
88
alert(title, message, buttons) {
99
if (buttons.length > 2) {
1010
throw "Can only show 2 buttons for Android dialog.";
1111
}
12-
12+
1313
const button1Text = buttons[0] ? buttons[0].text : null,
1414
button2Text = buttons[1] ? buttons[1].text : null;
15-
15+
1616
CodePushDialog.showDialog(
1717
title, message, button1Text, button2Text,
18-
(buttonId) => { buttons[buttonId].onPress && buttons[buttonId].onPress(); },
18+
(buttonId) => { buttons[buttonId].onPress && buttons[buttonId].onPress(); },
1919
(error) => { throw error; });
2020
}
2121
};
2222
}
2323

24-
module.exports = { Alert };
24+
module.exports = { Alert };
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)