@expo/inline-modules 0.0.12 → 0.1.0-canary-20260624-9d83b81
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/build/index.js +12 -5
- package/build/index.js.map +1 -1
- package/build/xcodeProjectUpdates.js +68 -39
- package/build/xcodeProjectUpdates.js.map +1 -1
- package/package.json +10 -7
package/build/index.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "updateXcodeProject", {
|
|
6
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "updateXcodeProject", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _xcodeProjectUpdates.updateXcodeProject;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _xcodeProjectUpdates = require("./xcodeProjectUpdates");
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":[null],"names":["updateXcodeProject"],"mappings":";;;;+BAASA;;;eAAAA,uCAAkB;;;qCAAuC"}
|
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "updateXcodeProject", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return updateXcodeProject;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function _configplugins() {
|
|
12
|
+
const data = require("@expo/config-plugins");
|
|
13
|
+
_configplugins = function() {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
function _fs() {
|
|
19
|
+
const data = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
20
|
+
_fs = function() {
|
|
21
|
+
return data;
|
|
22
|
+
};
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
function _path() {
|
|
26
|
+
const data = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
27
|
+
_path = function() {
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
function _interop_require_default(obj) {
|
|
33
|
+
return obj && obj.__esModule ? obj : {
|
|
34
|
+
default: obj
|
|
35
|
+
};
|
|
36
|
+
}
|
|
10
37
|
function escapeXMLCharacters(original) {
|
|
11
38
|
const noAmps = original.replace('&', '&');
|
|
12
39
|
const noLt = noAmps.replace('<', '<');
|
|
@@ -19,16 +46,16 @@ function escapeXMLCharacters(original) {
|
|
|
19
46
|
function getMainTargetName(config) {
|
|
20
47
|
const name = config.name;
|
|
21
48
|
const safeName = escapeXMLCharacters(name);
|
|
22
|
-
return
|
|
49
|
+
return _configplugins().IOSConfig.XcodeUtils.sanitizedName(safeName);
|
|
23
50
|
}
|
|
24
51
|
function getNativeTargetSynchronizedGroupsMap(pbxProject) {
|
|
25
52
|
const objects = pbxProject.hash.project.objects;
|
|
26
53
|
const nativeTargetSynchronizedGroups = new Map();
|
|
27
|
-
for (const target of pbxProject.getFirstProject().firstProject.targets)
|
|
54
|
+
for (const target of pbxProject.getFirstProject().firstProject.targets){
|
|
28
55
|
const nativeTargetGroup = objects.PBXNativeTarget[target.value];
|
|
29
56
|
const synchronizedGroups = new Set();
|
|
30
|
-
if (nativeTargetGroup
|
|
31
|
-
for (const synchronizedGroup of nativeTargetGroup.fileSystemSynchronizedGroups)
|
|
57
|
+
if (nativeTargetGroup?.fileSystemSynchronizedGroups) {
|
|
58
|
+
for (const synchronizedGroup of nativeTargetGroup.fileSystemSynchronizedGroups){
|
|
32
59
|
synchronizedGroups.add(synchronizedGroup.value);
|
|
33
60
|
}
|
|
34
61
|
}
|
|
@@ -40,38 +67,34 @@ function prepareSynchronizedRootGroups(pbxProject) {
|
|
|
40
67
|
const objects = pbxProject.hash.project.objects;
|
|
41
68
|
const fsSynchronizedRootGroups = new Map();
|
|
42
69
|
if (objects.PBXFileSystemSynchronizedRootGroup) {
|
|
43
|
-
for (const key of Object.keys(objects.PBXFileSystemSynchronizedRootGroup))
|
|
70
|
+
for (const key of Object.keys(objects.PBXFileSystemSynchronizedRootGroup)){
|
|
44
71
|
if (key.endsWith('_comment')) {
|
|
45
72
|
continue;
|
|
46
73
|
}
|
|
47
74
|
const groupObject = objects.PBXFileSystemSynchronizedRootGroup[key];
|
|
48
75
|
fsSynchronizedRootGroups.set(groupObject.path, key);
|
|
49
76
|
}
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
77
|
+
} else {
|
|
52
78
|
objects.PBXFileSystemSynchronizedRootGroup = {};
|
|
53
79
|
}
|
|
54
|
-
return {
|
|
80
|
+
return {
|
|
81
|
+
fsSynchronizedRootGroups
|
|
82
|
+
};
|
|
55
83
|
}
|
|
56
|
-
/**
|
|
57
|
-
* Add watched directories as PBXFileSystemSynchronizedRootGroups to pbxproj file in the project and save the changes.
|
|
58
|
-
*/
|
|
59
84
|
async function updateXcodeProject(projectRoot, inlineModulesXcodeParams) {
|
|
60
85
|
const swiftWatchedDirectories = inlineModulesXcodeParams.watchedDirectories;
|
|
61
|
-
const xcodeProjectTargets = inlineModulesXcodeParams.xcodeProjectTargets
|
|
62
|
-
? new Set(inlineModulesXcodeParams.xcodeProjectTargets)
|
|
63
|
-
: undefined;
|
|
86
|
+
const xcodeProjectTargets = inlineModulesXcodeParams.xcodeProjectTargets ? new Set(inlineModulesXcodeParams.xcodeProjectTargets) : undefined;
|
|
64
87
|
// Only perform changes to pbxproj if necessary
|
|
65
88
|
if (swiftWatchedDirectories.length === 0) {
|
|
66
89
|
return;
|
|
67
90
|
}
|
|
68
|
-
const pbxProject =
|
|
91
|
+
const pbxProject = _configplugins().IOSConfig.XcodeUtils.getPbxproj(projectRoot);
|
|
69
92
|
const mainGroupUUID = pbxProject.getFirstProject().firstProject.mainGroup;
|
|
70
93
|
const objects = pbxProject.hash.project.objects;
|
|
71
94
|
const projectRootRelativeToIos = '..';
|
|
72
95
|
const pbxNativeTarget = pbxProject.hash.project.objects.PBXNativeTarget;
|
|
73
96
|
const nativeTargetSynchronizedGroups = getNativeTargetSynchronizedGroupsMap(pbxProject);
|
|
74
|
-
const addWatchedDirectoryToTarget = (targetUUID, nativeTargetGroup, dir, dirUUID)
|
|
97
|
+
const addWatchedDirectoryToTarget = (targetUUID, nativeTargetGroup, dir, dirUUID)=>{
|
|
75
98
|
if (!nativeTargetSynchronizedGroups.has(targetUUID)) {
|
|
76
99
|
nativeTargetSynchronizedGroups.set(targetUUID, new Set());
|
|
77
100
|
}
|
|
@@ -82,19 +105,23 @@ async function updateXcodeProject(projectRoot, inlineModulesXcodeParams) {
|
|
|
82
105
|
if (!nativeTargetGroup.fileSystemSynchronizedGroups) {
|
|
83
106
|
nativeTargetGroup.fileSystemSynchronizedGroups = [];
|
|
84
107
|
}
|
|
85
|
-
nativeTargetGroup.fileSystemSynchronizedGroups.push({
|
|
108
|
+
nativeTargetGroup.fileSystemSynchronizedGroups.push({
|
|
109
|
+
value: dirUUID,
|
|
110
|
+
comment: dir
|
|
111
|
+
});
|
|
86
112
|
targetSynchronizedGroups.add(dirUUID);
|
|
87
113
|
};
|
|
88
114
|
const { fsSynchronizedRootGroups } = prepareSynchronizedRootGroups(pbxProject);
|
|
89
|
-
const getOrCreateWatchedDirectoryUUID = (dir)
|
|
90
|
-
const dirRelativeToIos =
|
|
91
|
-
|
|
92
|
-
|
|
115
|
+
const getOrCreateWatchedDirectoryUUID = (dir)=>{
|
|
116
|
+
const dirRelativeToIos = _path().default.join(projectRootRelativeToIos, dir);
|
|
117
|
+
const existingUUID = fsSynchronizedRootGroups.get(dirRelativeToIos);
|
|
118
|
+
if (existingUUID !== undefined) {
|
|
119
|
+
return existingUUID;
|
|
93
120
|
}
|
|
94
121
|
const newUUID = pbxProject.generateUuid();
|
|
95
122
|
objects.PBXGroup[mainGroupUUID].children.push({
|
|
96
123
|
value: newUUID,
|
|
97
|
-
comment: dir
|
|
124
|
+
comment: dir
|
|
98
125
|
});
|
|
99
126
|
objects.PBXFileSystemSynchronizedRootGroup[newUUID] = {
|
|
100
127
|
isa: 'PBXFileSystemSynchronizedRootGroup',
|
|
@@ -102,28 +129,30 @@ async function updateXcodeProject(projectRoot, inlineModulesXcodeParams) {
|
|
|
102
129
|
explicitFolders: [],
|
|
103
130
|
name: dir,
|
|
104
131
|
path: dirRelativeToIos,
|
|
105
|
-
sourceTree: 'SOURCE_ROOT'
|
|
132
|
+
sourceTree: 'SOURCE_ROOT'
|
|
106
133
|
};
|
|
107
134
|
return newUUID;
|
|
108
135
|
};
|
|
109
|
-
const targetsToUpdate = pbxProject
|
|
110
|
-
.getFirstProject()
|
|
111
|
-
.firstProject.targets.filter((target) => {
|
|
136
|
+
const targetsToUpdate = pbxProject.getFirstProject().firstProject.targets.filter((target)=>{
|
|
112
137
|
const targetUuid = target.value;
|
|
113
|
-
const targetName = pbxNativeTarget[targetUuid]
|
|
138
|
+
const targetName = pbxNativeTarget[targetUuid]?.name;
|
|
139
|
+
if (targetName === undefined) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
114
142
|
if (!xcodeProjectTargets) {
|
|
115
143
|
// If the xcodeProjectTargets are not provided, default to the main target
|
|
116
144
|
return targetName === getMainTargetName(inlineModulesXcodeParams);
|
|
117
145
|
}
|
|
118
146
|
return xcodeProjectTargets.has(targetName);
|
|
119
147
|
});
|
|
120
|
-
for (const watchedDirectory of swiftWatchedDirectories)
|
|
148
|
+
for (const watchedDirectory of swiftWatchedDirectories){
|
|
121
149
|
const dirUUID = getOrCreateWatchedDirectoryUUID(watchedDirectory);
|
|
122
|
-
for (const target of targetsToUpdate)
|
|
150
|
+
for (const target of targetsToUpdate){
|
|
123
151
|
const nativeTargetGroup = objects.PBXNativeTarget[target.value];
|
|
124
152
|
addWatchedDirectoryToTarget(target.value, nativeTargetGroup, watchedDirectory, dirUUID);
|
|
125
153
|
}
|
|
126
154
|
}
|
|
127
|
-
await
|
|
155
|
+
await _fs().default.promises.writeFile(pbxProject.filepath, pbxProject.writeSync());
|
|
128
156
|
}
|
|
129
|
-
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=xcodeProjectUpdates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["xcodeProjectUpdates.ts"],"sourcesContent":[null],"names":["updateXcodeProject","escapeXMLCharacters","original","noAmps","replace","noLt","noGt","noApos","getMainTargetName","config","name","safeName","IOSConfig","XcodeUtils","sanitizedName","getNativeTargetSynchronizedGroupsMap","pbxProject","objects","hash","project","nativeTargetSynchronizedGroups","Map","target","getFirstProject","firstProject","targets","nativeTargetGroup","PBXNativeTarget","value","synchronizedGroups","Set","fileSystemSynchronizedGroups","synchronizedGroup","add","set","prepareSynchronizedRootGroups","fsSynchronizedRootGroups","PBXFileSystemSynchronizedRootGroup","key","Object","keys","endsWith","groupObject","path","projectRoot","inlineModulesXcodeParams","swiftWatchedDirectories","watchedDirectories","xcodeProjectTargets","undefined","length","getPbxproj","mainGroupUUID","mainGroup","projectRootRelativeToIos","pbxNativeTarget","addWatchedDirectoryToTarget","targetUUID","dir","dirUUID","has","targetSynchronizedGroups","get","push","comment","getOrCreateWatchedDirectoryUUID","dirRelativeToIos","join","existingUUID","newUUID","generateUuid","PBXGroup","children","isa","explicitFileTypes","explicitFolders","sourceTree","targetsToUpdate","filter","targetUuid","targetName","watchedDirectory","fs","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Q,CAACC,SAAS,CAACpE,WAAWqE,QAAQ,EAAErE,WAAWsE,SAAS;AACvE"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/inline-modules",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0-canary-20260624-9d83b81",
|
|
4
4
|
"description": "The Expo inline modules",
|
|
5
5
|
"main": "build/index.js",
|
|
6
|
+
"types": "build/index.d.ts",
|
|
6
7
|
"files": [
|
|
7
8
|
"build"
|
|
8
9
|
],
|
|
@@ -22,19 +23,21 @@
|
|
|
22
23
|
"url": "https://github.com/expo/expo/issues"
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@expo/config-plugins": "
|
|
26
|
+
"@expo/config-plugins": "56.0.9-canary-20260624-9d83b81"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@types/jest": "^29.2.1",
|
|
29
30
|
"@types/node": "^22.14.0",
|
|
30
|
-
"expo-module-scripts": "56.0.
|
|
31
|
+
"expo-module-scripts": "56.0.2"
|
|
31
32
|
},
|
|
32
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "9d83b8168716512cb0a2c380ed4c9c057c1321e5",
|
|
33
34
|
"scripts": {
|
|
34
|
-
"build": "expo-
|
|
35
|
+
"build": "expo-build cjs:src",
|
|
35
36
|
"clean": "expo-module clean",
|
|
36
37
|
"lint": "expo-module lint",
|
|
37
|
-
"test": "
|
|
38
|
-
"expo-module": "expo-module"
|
|
38
|
+
"test": "jest",
|
|
39
|
+
"expo-module": "expo-module",
|
|
40
|
+
"depscheck": "expo-module depscheck",
|
|
41
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
39
42
|
}
|
|
40
43
|
}
|