Skip to content

Commit 116b79d

Browse files
authored
Merge pull request #7 from kingstinct/plugin
adding plugin
2 parents 8e4c7af + 2a061e0 commit 116b79d

8 files changed

Lines changed: 28 additions & 16 deletions

File tree

app.plugin.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
1-
const { createRunOncePlugin } = require("expo/config-plugins");
2-
3-
const withMotionActivityPermissions =
4-
require("./config-plugin/withMotionActivityPermissions").default;
5-
const pkg = require("./package.json");
6-
7-
module.exports = createRunOncePlugin(
8-
withMotionActivityPermissions,
9-
pkg.name,
10-
pkg.version,
11-
);
1+
module.exports = require("./plugin/build");

example/app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"web": {
2929
"favicon": "./assets/favicon.png"
30-
}
30+
},
31+
"plugins": ["../app.plugin.js"]
3132
}
3233
}

example/package-lock.json

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"dependencies": {
1212
"expo": "~51.0.28",
1313
"react": "18.2.0",
14-
"react-native": "0.74.5"
14+
"react-native": "0.74.5",
15+
"react-native-motion-activity-tracker": "^0.1.3"
1516
},
1617
"devDependencies": {
1718
"@babel/core": "^7.20.0",

config-plugin/withMotionActivityPermissions.ts renamed to plugin/src/index.ts

File renamed without changes.

plugin/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "expo-module-scripts/tsconfig.plugin",
3+
"compilerOptions": {
4+
"outDir": "build",
5+
"rootDir": "src"
6+
},
7+
"include": ["./src"],
8+
"exclude": ["**/__mocks__/*", "**/__tests__/*"]
9+
}

tests/withMotionActivityPermissions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { withInfoPlist, withAndroidManifest } from "@expo/config-plugins";
22
import type { ExpoConfig } from "@expo/config-types";
33

4-
import withMotionActivityPermissions from "../config-plugin/withMotionActivityPermissions";
4+
import withMotionActivityPermissions from "../plugin/src/index";
55

66
interface ExpoConfigWithModResults extends ExpoConfig {
77
modResults?: {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"compilerOptions": {
55
"outDir": "./build"
66
},
7-
"include": ["./src", "./tests"],
7+
"include": ["./src"],
88
"exclude": ["**/__mocks__/*", "**/__tests__/*"]
99
}

0 commit comments

Comments
 (0)