78 lines
2.0 KiB
JavaScript
78 lines
2.0 KiB
JavaScript
|
'use strict';
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", {
|
||
|
value: true
|
||
|
});
|
||
|
|
||
|
var _StandaloneBuildFlags;
|
||
|
|
||
|
function _load_StandaloneBuildFlags() {
|
||
|
return _StandaloneBuildFlags = _interopRequireDefault(require('./StandaloneBuildFlags'));
|
||
|
}
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
/**
|
||
|
* A user context is used when we are configuring a standalone app locally on a user's machine,
|
||
|
* such as during `exp detach`.
|
||
|
*/
|
||
|
|
||
|
|
||
|
/**
|
||
|
* A service context is used when we are generating a standalone app remotely on an Expo
|
||
|
* service machine, such as during `exp build`.
|
||
|
*/
|
||
|
class StandaloneContext {
|
||
|
constructor() {
|
||
|
this.isAnonymous = () => {
|
||
|
return this.type === 'service' && !this.config;
|
||
|
};
|
||
|
} // same as underlying app.json or manifest
|
||
|
|
||
|
|
||
|
/**
|
||
|
* On iOS we begin configuring standalone apps before we have any information about the
|
||
|
* project's manifest.
|
||
|
*/
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
StandaloneContext.createUserContext = (projectPath, exp, publishedUrl) => {
|
||
|
let context = new StandaloneContext();
|
||
|
context.type = 'user';
|
||
|
context.data = {
|
||
|
projectPath,
|
||
|
exp
|
||
|
};
|
||
|
context.config = exp;
|
||
|
context.published = {
|
||
|
url: publishedUrl,
|
||
|
releaseChannel: 'default'
|
||
|
};
|
||
|
// we never expect to handle the build step for user contexts right now
|
||
|
context.build = (_StandaloneBuildFlags || _load_StandaloneBuildFlags()).default.createEmpty();
|
||
|
return context;
|
||
|
};
|
||
|
|
||
|
StandaloneContext.createServiceContext = (expoSourcePath, archivePath, manifest, privateConfig, build, publishedUrl, releaseChannel) => {
|
||
|
let context = new StandaloneContext();
|
||
|
context.type = 'service';
|
||
|
context.data = {
|
||
|
expoSourcePath,
|
||
|
archivePath,
|
||
|
manifest,
|
||
|
privateConfig
|
||
|
};
|
||
|
context.config = manifest;
|
||
|
context.build = build;
|
||
|
context.published = {
|
||
|
url: publishedUrl,
|
||
|
releaseChannel: releaseChannel ? releaseChannel : 'default'
|
||
|
};
|
||
|
return context;
|
||
|
};
|
||
|
|
||
|
exports.default = StandaloneContext;
|
||
|
//# sourceMappingURL=../__sourcemaps__/detach/StandaloneContext.js.map
|