UNPKG

2.59 kBJavaScriptView Raw
1"use strict";
2function __export(m) {
3 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4}
5Object.defineProperty(exports, "__esModule", { value: true });
6/*
7 * Copyright 2014-2019 Guy Bedford (http://guybedford.com)
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21exports.version = require('../package.json').version;
22const common_1 = require("./utils/common");
23const ui_1 = require("./utils/ui");
24__export(require("./project"));
25var map_1 = require("./map");
26exports.map = map_1.map;
27exports.filterMap = map_1.filterMap;
28exports.renormalizeMap = map_1.renormalizeMap;
29exports.trace = map_1.trace;
30const path = require("path");
31var build_1 = require("./build");
32exports.build = build_1.build;
33if (process.env.globalJspm !== undefined) {
34 process.once('unhandledRejection', err => {
35 ui_1.log('Internal Error: Unhandled promise rejection.', ui_1.LogType.err);
36 ui_1.logErr(err.stack || err);
37 process.exit(1);
38 });
39 process.once('SIGINT', () => {
40 ui_1.log('jspm process terminated.');
41 process.exit(1);
42 });
43 process.once('SIGTERM', () => {
44 ui_1.log('jspm process terminated.');
45 process.exit(1);
46 });
47}
48else {
49 process.on('unhandledRejection', err => {
50 console.error('Internal Error: Unhandled promise rejection.');
51 throw err;
52 });
53}
54async function resolve(name, parent, env, relativeFallback) {
55 const jspmResolve = require('@jspm/resolve');
56 return jspmResolve(name, parent, { env, relativeFallback });
57}
58exports.resolve = resolve;
59function resolveSync(name, parent, env, relativeFallback) {
60 const jspmResolve = require('@jspm/resolve');
61 return jspmResolve.sync(name, parent, { env, relativeFallback });
62}
63exports.resolveSync = resolveSync;
64exports.JSPM_GLOBAL_PATH = path.resolve(common_1.JSPM_CONFIG_DIR, 'global');
65exports.exec = function () {
66 return require('./exec').exec.apply(this, arguments);
67};
68exports.run = function () {
69 return require('./exec').run.apply(this, arguments);
70};
71//# sourceMappingURL=api.js.map
\No newline at end of file