react-native-ios-widget 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugin/build/index.d.ts +2 -8
- package/plugin/build/index.js +14 -16
- package/plugin/build/types.d.ts +9 -0
- package/plugin/build/types.js +2 -0
- package/plugin/build/withConfig.d.ts +2 -6
- package/plugin/build/withConfig.js +1 -1
- package/plugin/build/withPodfile.d.ts +2 -5
- package/plugin/build/withPodfile.js +1 -1
- package/plugin/build/withWidgetExtensionEntitlements.d.ts +2 -7
- package/plugin/build/withXcode.d.ts +2 -7
- package/plugin/build/withXcode.js +9 -15
- package/plugin/src/index.ts +18 -24
- package/plugin/src/types.ts +9 -0
- package/plugin/src/withConfig.ts +5 -6
- package/plugin/src/withPodfile.ts +5 -5
- package/plugin/src/withWidgetExtensionEntitlements.ts +4 -7
- package/plugin/src/withXcode.ts +12 -28
package/package.json
CHANGED
package/plugin/build/index.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { ConfigPlugin } from "expo/config-plugins";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
widgetsFolder?: string;
|
|
5
|
-
deploymentTarget?: string;
|
|
6
|
-
groupIdentifier?: string;
|
|
7
|
-
pods?: string[];
|
|
8
|
-
widgetName: string;
|
|
9
|
-
}>;
|
|
2
|
+
import { WidgetPluginProps } from "./types";
|
|
3
|
+
declare const withWidget: ConfigPlugin<WidgetPluginProps>;
|
|
10
4
|
export default withWidget;
|
package/plugin/build/index.js
CHANGED
|
@@ -5,23 +5,21 @@ const withXcode_1 = require("./withXcode");
|
|
|
5
5
|
const withWidgetExtensionEntitlements_1 = require("./withWidgetExtensionEntitlements");
|
|
6
6
|
const withPodfile_1 = require("./withPodfile");
|
|
7
7
|
const withConfig_1 = require("./withConfig");
|
|
8
|
-
const withWidget = (config, { enabled = true, deploymentTarget = "14.0", widgetsFolder = "widgets", groupIdentifier, pods, }) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
8
|
+
const withWidget = (config, { enabled = true, deploymentTarget = "14.0", widgetsFolder = "widgets", groupIdentifier, pods = [], targetName = "WidgetsExtension", bundleIdentifier = `${config.ios?.bundleIdentifier}.Widgets`, }) => {
|
|
9
|
+
const props = {
|
|
10
|
+
enabled,
|
|
11
|
+
deploymentTarget,
|
|
12
|
+
widgetsFolder,
|
|
13
|
+
groupIdentifier,
|
|
14
|
+
pods,
|
|
15
|
+
targetName,
|
|
16
|
+
bundleIdentifier,
|
|
17
|
+
};
|
|
11
18
|
return (0, config_plugins_1.withPlugins)(config, [
|
|
12
|
-
[
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
targetName,
|
|
17
|
-
bundleIdentifier,
|
|
18
|
-
deploymentTarget,
|
|
19
|
-
widgetsFolder,
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
[withWidgetExtensionEntitlements_1.withWidgetExtensionEntitlements, { enabled, targetName, groupIdentifier }],
|
|
23
|
-
[withPodfile_1.withPodfile, { enabled, targetName, pods }],
|
|
24
|
-
[withConfig_1.withConfig, { enabled, targetName, bundleIdentifier, groupIdentifier }],
|
|
19
|
+
[withXcode_1.withXcode, props],
|
|
20
|
+
[withWidgetExtensionEntitlements_1.withWidgetExtensionEntitlements, props],
|
|
21
|
+
[withPodfile_1.withPodfile, props],
|
|
22
|
+
[withConfig_1.withConfig, props],
|
|
25
23
|
]);
|
|
26
24
|
};
|
|
27
25
|
exports.default = withWidget;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import { ConfigPlugin } from "expo/config-plugins";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
bundleIdentifier: string;
|
|
5
|
-
targetName: string;
|
|
6
|
-
groupIdentifier?: string;
|
|
7
|
-
}>;
|
|
2
|
+
import { WidgetPluginProps } from "./types";
|
|
3
|
+
export declare const withConfig: ConfigPlugin<Required<WidgetPluginProps>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withConfig = void 0;
|
|
4
4
|
const getWidgetExtensionEntitlements_1 = require("./lib/getWidgetExtensionEntitlements");
|
|
5
|
-
const withConfig = (config, { enabled,
|
|
5
|
+
const withConfig = (config, { enabled, groupIdentifier, targetName, bundleIdentifier }) => {
|
|
6
6
|
if (!enabled) {
|
|
7
7
|
return config;
|
|
8
8
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { ConfigPlugin } from "expo/config-plugins";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
targetName: string;
|
|
5
|
-
pods?: string[];
|
|
6
|
-
}>;
|
|
2
|
+
import { WidgetPluginProps } from "./types";
|
|
3
|
+
export declare const withPodfile: ConfigPlugin<Required<WidgetPluginProps>>;
|
|
@@ -28,7 +28,7 @@ const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
|
28
28
|
const config_plugins_1 = require("expo/config-plugins");
|
|
29
29
|
const fs = __importStar(require("fs"));
|
|
30
30
|
const path = __importStar(require("path"));
|
|
31
|
-
const withPodfile = (config, { enabled, targetName, pods
|
|
31
|
+
const withPodfile = (config, { enabled, targetName, pods }) => {
|
|
32
32
|
if (!enabled) {
|
|
33
33
|
return config;
|
|
34
34
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { ConfigPlugin } from "expo/config-plugins";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
targetName: string;
|
|
5
|
-
targetPath: string;
|
|
6
|
-
groupIdentifier: string;
|
|
7
|
-
appleSignin: boolean;
|
|
8
|
-
}>;
|
|
2
|
+
import { WidgetPluginProps } from "./types";
|
|
3
|
+
export declare const withWidgetExtensionEntitlements: ConfigPlugin<Required<WidgetPluginProps>>;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { ConfigPlugin } from "expo/config-plugins";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
targetName: string;
|
|
5
|
-
bundleIdentifier: string;
|
|
6
|
-
deploymentTarget: string;
|
|
7
|
-
widgetsFolder: string;
|
|
8
|
-
}>;
|
|
2
|
+
import { WidgetPluginProps } from "./types";
|
|
3
|
+
export declare const withXcode: ConfigPlugin<Required<WidgetPluginProps>>;
|
|
@@ -35,24 +35,16 @@ const addPbxGroup_1 = require("./xcode/addPbxGroup");
|
|
|
35
35
|
const addBuildPhases_1 = require("./xcode/addBuildPhases");
|
|
36
36
|
const getWidgetFiles_1 = require("./lib/getWidgetFiles");
|
|
37
37
|
const withXcode = (config, { enabled, targetName, bundleIdentifier, deploymentTarget, widgetsFolder }) => {
|
|
38
|
-
if (!enabled) {
|
|
39
|
-
return (0, config_plugins_1.withXcodeProject)(config, (config) => {
|
|
40
|
-
const widgetsPath = path.join(config.modRequest.projectRoot, widgetsFolder);
|
|
41
|
-
const { platformProjectRoot } = config.modRequest;
|
|
42
|
-
const targetPath = path.join(platformProjectRoot, targetName);
|
|
43
|
-
(0, getWidgetFiles_1.getWidgetFiles)(widgetsPath, targetPath);
|
|
44
|
-
return config;
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
38
|
return (0, config_plugins_1.withXcodeProject)(config, (config) => {
|
|
48
|
-
const
|
|
49
|
-
const widgetsPath = path.join(
|
|
50
|
-
const targetUuid = xcodeProject.generateUuid();
|
|
51
|
-
const groupName = "Embed Foundation Extensions";
|
|
52
|
-
const { platformProjectRoot } = config.modRequest;
|
|
53
|
-
const marketingVersion = config.version;
|
|
39
|
+
const { platformProjectRoot, projectRoot } = config.modRequest;
|
|
40
|
+
const widgetsPath = path.join(projectRoot, widgetsFolder);
|
|
54
41
|
const targetPath = path.join(platformProjectRoot, targetName);
|
|
55
42
|
const widgetFiles = (0, getWidgetFiles_1.getWidgetFiles)(widgetsPath, targetPath);
|
|
43
|
+
if (!enabled) {
|
|
44
|
+
return config;
|
|
45
|
+
}
|
|
46
|
+
const xcodeProject = config.modResults;
|
|
47
|
+
const marketingVersion = config.version;
|
|
56
48
|
const xCConfigurationList = (0, addXCConfigurationList_1.addXCConfigurationList)(xcodeProject, {
|
|
57
49
|
targetName,
|
|
58
50
|
currentProjectVersion: config.ios.buildNumber || "1",
|
|
@@ -60,10 +52,12 @@ const withXcode = (config, { enabled, targetName, bundleIdentifier, deploymentTa
|
|
|
60
52
|
deploymentTarget,
|
|
61
53
|
marketingVersion,
|
|
62
54
|
});
|
|
55
|
+
const groupName = "Embed Foundation Extensions";
|
|
63
56
|
const productFile = (0, addProductFile_1.addProductFile)(xcodeProject, {
|
|
64
57
|
targetName,
|
|
65
58
|
groupName,
|
|
66
59
|
});
|
|
60
|
+
const targetUuid = xcodeProject.generateUuid();
|
|
67
61
|
const target = (0, addToPbxNativeTargetSection_1.addToPbxNativeTargetSection)(xcodeProject, {
|
|
68
62
|
targetName,
|
|
69
63
|
targetUuid,
|
package/plugin/src/index.ts
CHANGED
|
@@ -3,41 +3,35 @@ import { withXcode } from "./withXcode";
|
|
|
3
3
|
import { withWidgetExtensionEntitlements } from "./withWidgetExtensionEntitlements";
|
|
4
4
|
import { withPodfile } from "./withPodfile";
|
|
5
5
|
import { withConfig } from "./withConfig";
|
|
6
|
+
import { WidgetPluginProps } from "./types";
|
|
6
7
|
|
|
7
|
-
const withWidget: ConfigPlugin<
|
|
8
|
-
enabled?: boolean;
|
|
9
|
-
widgetsFolder?: string;
|
|
10
|
-
deploymentTarget?: string;
|
|
11
|
-
groupIdentifier?: string;
|
|
12
|
-
pods?: string[];
|
|
13
|
-
widgetName: string;
|
|
14
|
-
}> = (
|
|
8
|
+
const withWidget: ConfigPlugin<WidgetPluginProps> = (
|
|
15
9
|
config,
|
|
16
10
|
{
|
|
17
11
|
enabled = true,
|
|
18
12
|
deploymentTarget = "14.0",
|
|
19
13
|
widgetsFolder = "widgets",
|
|
20
14
|
groupIdentifier,
|
|
21
|
-
pods,
|
|
15
|
+
pods = [],
|
|
16
|
+
targetName = "WidgetsExtension",
|
|
17
|
+
bundleIdentifier = `${config.ios?.bundleIdentifier}.Widgets`,
|
|
22
18
|
}
|
|
23
19
|
) => {
|
|
24
|
-
const
|
|
25
|
-
|
|
20
|
+
const props: WidgetPluginProps = {
|
|
21
|
+
enabled,
|
|
22
|
+
deploymentTarget,
|
|
23
|
+
widgetsFolder,
|
|
24
|
+
groupIdentifier,
|
|
25
|
+
pods,
|
|
26
|
+
targetName,
|
|
27
|
+
bundleIdentifier,
|
|
28
|
+
};
|
|
26
29
|
|
|
27
30
|
return withPlugins(config, [
|
|
28
|
-
[
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
targetName,
|
|
33
|
-
bundleIdentifier,
|
|
34
|
-
deploymentTarget,
|
|
35
|
-
widgetsFolder,
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
[withWidgetExtensionEntitlements, { enabled, targetName, groupIdentifier }],
|
|
39
|
-
[withPodfile, { enabled, targetName, pods }],
|
|
40
|
-
[withConfig, { enabled, targetName, bundleIdentifier, groupIdentifier }],
|
|
31
|
+
[withXcode, props],
|
|
32
|
+
[withWidgetExtensionEntitlements, props],
|
|
33
|
+
[withPodfile, props],
|
|
34
|
+
[withConfig, props],
|
|
41
35
|
]);
|
|
42
36
|
};
|
|
43
37
|
|
package/plugin/src/withConfig.ts
CHANGED
|
@@ -3,13 +3,12 @@ import {
|
|
|
3
3
|
addApplicationGroupsEntitlement,
|
|
4
4
|
getWidgetExtensionEntitlements,
|
|
5
5
|
} from "./lib/getWidgetExtensionEntitlements";
|
|
6
|
+
import { WidgetPluginProps } from "./types";
|
|
6
7
|
|
|
7
|
-
export const withConfig: ConfigPlugin<
|
|
8
|
-
|
|
9
|
-
bundleIdentifier
|
|
10
|
-
|
|
11
|
-
groupIdentifier?: string;
|
|
12
|
-
}> = (config, { enabled, bundleIdentifier, targetName, groupIdentifier }) => {
|
|
8
|
+
export const withConfig: ConfigPlugin<Required<WidgetPluginProps>> = (
|
|
9
|
+
config,
|
|
10
|
+
{ enabled, groupIdentifier, targetName, bundleIdentifier }
|
|
11
|
+
) => {
|
|
13
12
|
if (!enabled) {
|
|
14
13
|
return config;
|
|
15
14
|
}
|
|
@@ -2,12 +2,12 @@ import { mergeContents } from "@expo/config-plugins/build/utils/generateCode";
|
|
|
2
2
|
import { ConfigPlugin, withDangerousMod } from "expo/config-plugins";
|
|
3
3
|
import * as fs from "fs";
|
|
4
4
|
import * as path from "path";
|
|
5
|
+
import { WidgetPluginProps } from "./types";
|
|
5
6
|
|
|
6
|
-
export const withPodfile: ConfigPlugin<
|
|
7
|
-
|
|
8
|
-
targetName
|
|
9
|
-
|
|
10
|
-
}> = (config, { enabled, targetName, pods = [] }) => {
|
|
7
|
+
export const withPodfile: ConfigPlugin<Required<WidgetPluginProps>> = (
|
|
8
|
+
config,
|
|
9
|
+
{ enabled, targetName, pods }
|
|
10
|
+
) => {
|
|
11
11
|
if (!enabled) {
|
|
12
12
|
return config;
|
|
13
13
|
}
|
|
@@ -4,14 +4,11 @@ import * as fs from "fs";
|
|
|
4
4
|
import * as path from "path";
|
|
5
5
|
|
|
6
6
|
import { getWidgetExtensionEntitlements } from "./lib/getWidgetExtensionEntitlements";
|
|
7
|
+
import { WidgetPluginProps } from "./types";
|
|
7
8
|
|
|
8
|
-
export const withWidgetExtensionEntitlements: ConfigPlugin<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
targetPath: string;
|
|
12
|
-
groupIdentifier: string;
|
|
13
|
-
appleSignin: boolean;
|
|
14
|
-
}> = (config, { enabled, targetName, groupIdentifier }) => {
|
|
9
|
+
export const withWidgetExtensionEntitlements: ConfigPlugin<
|
|
10
|
+
Required<WidgetPluginProps>
|
|
11
|
+
> = (config, { enabled, targetName, groupIdentifier }) => {
|
|
15
12
|
if (!enabled) {
|
|
16
13
|
return config;
|
|
17
14
|
}
|
package/plugin/src/withXcode.ts
CHANGED
|
@@ -9,43 +9,25 @@ import { addTargetDependency } from "./xcode/addTargetDependency";
|
|
|
9
9
|
import { addPbxGroup } from "./xcode/addPbxGroup";
|
|
10
10
|
import { addBuildPhases } from "./xcode/addBuildPhases";
|
|
11
11
|
import { getWidgetFiles } from "./lib/getWidgetFiles";
|
|
12
|
+
import { WidgetPluginProps } from "./types";
|
|
12
13
|
|
|
13
|
-
export const withXcode: ConfigPlugin<
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
targetName: string;
|
|
16
|
-
bundleIdentifier: string;
|
|
17
|
-
deploymentTarget: string;
|
|
18
|
-
widgetsFolder: string;
|
|
19
|
-
}> = (
|
|
14
|
+
export const withXcode: ConfigPlugin<Required<WidgetPluginProps>> = (
|
|
20
15
|
config,
|
|
21
16
|
{ enabled, targetName, bundleIdentifier, deploymentTarget, widgetsFolder }
|
|
22
17
|
) => {
|
|
23
|
-
if (!enabled) {
|
|
24
|
-
return withXcodeProject(config, (config) => {
|
|
25
|
-
const widgetsPath = path.join(
|
|
26
|
-
config.modRequest.projectRoot,
|
|
27
|
-
widgetsFolder
|
|
28
|
-
);
|
|
29
|
-
const { platformProjectRoot } = config.modRequest;
|
|
30
|
-
const targetPath = path.join(platformProjectRoot, targetName);
|
|
31
|
-
getWidgetFiles(widgetsPath, targetPath);
|
|
32
|
-
return config;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
18
|
return withXcodeProject(config, (config) => {
|
|
37
|
-
const
|
|
38
|
-
const widgetsPath = path.join(config.modRequest.projectRoot, widgetsFolder);
|
|
39
|
-
|
|
40
|
-
const targetUuid = xcodeProject.generateUuid();
|
|
41
|
-
const groupName = "Embed Foundation Extensions";
|
|
42
|
-
const { platformProjectRoot } = config.modRequest;
|
|
43
|
-
const marketingVersion = config.version;
|
|
19
|
+
const { platformProjectRoot, projectRoot } = config.modRequest;
|
|
44
20
|
|
|
21
|
+
const widgetsPath = path.join(projectRoot, widgetsFolder);
|
|
45
22
|
const targetPath = path.join(platformProjectRoot, targetName);
|
|
46
|
-
|
|
47
23
|
const widgetFiles = getWidgetFiles(widgetsPath, targetPath);
|
|
48
24
|
|
|
25
|
+
if (!enabled) {
|
|
26
|
+
return config;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const xcodeProject = config.modResults;
|
|
30
|
+
const marketingVersion = config.version;
|
|
49
31
|
const xCConfigurationList = addXCConfigurationList(xcodeProject, {
|
|
50
32
|
targetName,
|
|
51
33
|
currentProjectVersion: config.ios!.buildNumber || "1",
|
|
@@ -54,11 +36,13 @@ export const withXcode: ConfigPlugin<{
|
|
|
54
36
|
marketingVersion,
|
|
55
37
|
});
|
|
56
38
|
|
|
39
|
+
const groupName = "Embed Foundation Extensions";
|
|
57
40
|
const productFile = addProductFile(xcodeProject, {
|
|
58
41
|
targetName,
|
|
59
42
|
groupName,
|
|
60
43
|
});
|
|
61
44
|
|
|
45
|
+
const targetUuid = xcodeProject.generateUuid();
|
|
62
46
|
const target = addToPbxNativeTargetSection(xcodeProject, {
|
|
63
47
|
targetName,
|
|
64
48
|
targetUuid,
|