Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Release v0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hansonw committed Oct 25, 2017
1 parent 3359e73 commit 1f2677a
Show file tree
Hide file tree
Showing 277 changed files with 20,699 additions and 21,776 deletions.
Empty file removed DEVELOPMENT
Empty file.
134 changes: 65 additions & 69 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
'use strict';

var _fs = _interopRequireDefault(require('fs'));

var _path = _interopRequireDefault(require('path'));

var _UniversalDisposable;

function _load_UniversalDisposable() {
return _UniversalDisposable = _interopRequireDefault(require('nuclide-commons/UniversalDisposable'));
}

var _FeatureLoader;

function _load_FeatureLoader() {
return _FeatureLoader = _interopRequireDefault(require('nuclide-commons-atom/FeatureLoader'));
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
Expand All @@ -6,103 +26,79 @@
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
*
* @format
*/

/* eslint-disable rulesdir/no-commonjs */

import fs from 'fs';
const HIDE_WARNING_KEY = 'atom-ide-ui.hideNuclideWarning';
// eslint-disable-next-line rulesdir/prefer-nuclide-uri
import path from 'path';
import UniversalDisposable from 'nuclide-commons/UniversalDisposable';
import FeatureLoader from 'nuclide-commons-atom/FeatureLoader';

const HIDE_WARNING_KEY = 'atom-ide-ui.hideNuclideWarning';

function displayNuclideWarning() {
if (!atom.config.get(HIDE_WARNING_KEY)) {
const notification = atom.notifications.addInfo(
'Atom IDE UI is bundled with Nuclide',
{
description:
'`atom-ide-ui` will be deactivated in favor of Nuclide.<br>' +
'Please disable Nuclide if you only want to use `atom-ide-ui`.',
dismissable: true,
buttons: [
{
text: 'Disable Nuclide and reload',
onDidClick() {
atom.packages.disablePackage('nuclide');
atom.reload();
notification.dismiss();
},
},
{
text: "Don't warn me again",
onDidClick() {
atom.config.set(HIDE_WARNING_KEY, true);
notification.dismiss();
},
},
],
},
);
const notification = atom.notifications.addInfo('Atom IDE UI is bundled with Nuclide', {
description: '`atom-ide-ui` will be deactivated in favor of Nuclide.<br>' + 'Please disable Nuclide if you only want to use `atom-ide-ui`.',
dismissable: true,
buttons: [{
text: 'Disable Nuclide and reload',
onDidClick() {
atom.packages.disablePackage('nuclide');
atom.reload();
notification.dismiss();
}
}, {
text: "Don't warn me again",
onDidClick() {
atom.config.set(HIDE_WARNING_KEY, true);
notification.dismiss();
}
}]
});
}
}

if (
!atom.packages.isPackageDisabled('nuclide') &&
atom.packages.getAvailablePackageNames().includes('nuclide')
) {
if (!atom.packages.isPackageDisabled('nuclide') && atom.packages.getAvailablePackageNames().includes('nuclide')) {
displayNuclideWarning();
} else {
const featureDir = path.join(__dirname, 'modules/atom-ide-ui/pkg');
const features = fs
.readdirSync(featureDir)
.map(item => {
const dirname = path.join(featureDir, item);
try {
const pkgJson = fs.readFileSync(
path.join(dirname, 'package.json'),
'utf8',
);
return {
dirname,
pkg: JSON.parse(pkgJson),
};
} catch (err) {
if (err.code !== 'ENOENT') {
throw err;
}
const featureDir = _path.default.join(__dirname, 'modules/atom-ide-ui/pkg');
const features = _fs.default.readdirSync(featureDir).map(item => {
const dirname = _path.default.join(featureDir, item);
try {
const pkgJson = _fs.default.readFileSync(_path.default.join(dirname, 'package.json'), 'utf8');
return {
dirname,
pkg: JSON.parse(pkgJson)
};
} catch (err) {
if (err.code !== 'ENOENT') {
throw err;
}
})
.filter(Boolean);
}
}).filter(Boolean);

/**
* Use a unified package loader to load all the feature packages.
* See the following post for more context:
* https://nuclide.io/blog/2016/01/13/Nuclide-v0.111.0-The-Unified-Package/
*/
let disposables: ?UniversalDisposable;
const featureLoader = new FeatureLoader({
let disposables;
const featureLoader = new (_FeatureLoader || _load_FeatureLoader()).default({
pkgName: 'atom-ide-ui',
config: {},
features,
features
});
featureLoader.load();

module.exports = {
config: featureLoader.getConfig(),
activate() {
disposables = new UniversalDisposable(
require('nuclide-commons-ui'),
atom.packages.onDidActivatePackage(pkg => {
if (pkg.name === 'nuclide') {
displayNuclideWarning();
}
}),
);
disposables = new (_UniversalDisposable || _load_UniversalDisposable()).default(require('nuclide-commons-ui'), atom.packages.onDidActivatePackage(pkg => {
if (pkg.name === 'nuclide') {
displayNuclideWarning();
}
}));
featureLoader.activate();
},
deactivate() {
Expand All @@ -114,6 +110,6 @@ if (
},
serialize() {
featureLoader.serialize();
},
}
};
}
}
98 changes: 1 addition & 97 deletions modules/atom-ide-ui/index.js
Original file line number Diff line number Diff line change
@@ -1,97 +1 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
* @format
*/

export type {
BusySignalOptions,
BusySignalService,
} from './pkg/atom-ide-busy-signal/lib/types';

export type {
CodeAction,
CodeActionProvider,
} from './pkg/atom-ide-code-actions/lib/types';

export type {
CodeFormatProvider,
RangeCodeFormatProvider,
FileCodeFormatProvider,
OnTypeCodeFormatProvider,
OnSaveCodeFormatProvider,
} from './pkg/atom-ide-code-format/lib/types';

export type {
CodeHighlightProvider,
} from './pkg/atom-ide-code-highlight/lib/types';

export type {
Datatip,
DatatipProvider,
DatatipService,
MarkedString,
ModifierDatatipProvider,
ModifierKey,
} from './pkg/atom-ide-datatip/lib/types';

export type {
Definition,
DefinitionProvider,
DefinitionPreviewProvider,
DefinitionQueryResult,
} from './pkg/atom-ide-definitions/lib/types';

export type {
CallbackDiagnosticProvider,
DiagnosticFix,
DiagnosticInvalidationCallback,
DiagnosticInvalidationMessage,
DiagnosticMessage,
DiagnosticMessages,
DiagnosticMessageKind,
DiagnosticMessageType,
DiagnosticProvider,
DiagnosticProviderUpdate,
DiagnosticTrace,
DiagnosticUpdateCallback,
IndieLinterDelegate,
LinterMessage,
LinterMessageV1,
LinterMessageV2,
LinterProvider,
LinterTrace,
ObservableDiagnosticProvider,
RegisterIndieLinter,
} from './pkg/atom-ide-diagnostics/lib/types';

export type {
FindReferencesProvider,
FindReferencesReturn,
Reference,
} from './pkg/atom-ide-find-references/lib/types';

export type {
Outline,
OutlineProvider,
OutlineTree,
ResultsStreamProvider,
} from './pkg/atom-ide-outline-view/lib/types';

export type {
Signature,
SignatureHelp,
SignatureHelpProvider,
SignatureParameter,
} from './pkg/atom-ide-signature-help/lib/types';

export type {
HyperclickProvider,
HyperclickSuggestion,
} from './pkg/hyperclick/lib/types';
'use strict';
Loading

0 comments on commit 1f2677a

Please sign in to comment.