@theia/application-package 1.23.0-next.8 → 1.23.0

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.
Files changed (51) hide show
  1. package/lib/api.d.ts +0 -15
  2. package/lib/api.d.ts.map +1 -1
  3. package/lib/api.js +15 -15
  4. package/lib/api.js.map +1 -1
  5. package/lib/application-package.d.ts +0 -15
  6. package/lib/application-package.d.ts.map +1 -1
  7. package/lib/application-package.js +18 -18
  8. package/lib/application-package.js.map +1 -1
  9. package/lib/application-package.spec.d.ts +0 -15
  10. package/lib/application-package.spec.d.ts.map +1 -1
  11. package/lib/application-package.spec.js +15 -15
  12. package/lib/application-package.spec.js.map +1 -1
  13. package/lib/application-props.d.ts +0 -15
  14. package/lib/application-props.d.ts.map +1 -1
  15. package/lib/application-props.js +15 -15
  16. package/lib/application-props.js.map +1 -1
  17. package/lib/environment.d.ts +0 -15
  18. package/lib/environment.d.ts.map +1 -1
  19. package/lib/environment.js +15 -15
  20. package/lib/environment.js.map +1 -1
  21. package/lib/extension-package-collector.d.ts +0 -15
  22. package/lib/extension-package-collector.d.ts.map +1 -1
  23. package/lib/extension-package-collector.js +16 -16
  24. package/lib/extension-package-collector.js.map +1 -1
  25. package/lib/extension-package.d.ts +0 -15
  26. package/lib/extension-package.d.ts.map +1 -1
  27. package/lib/extension-package.js +15 -15
  28. package/lib/extension-package.js.map +1 -1
  29. package/lib/index.d.ts +0 -15
  30. package/lib/index.d.ts.map +1 -1
  31. package/lib/index.js +16 -16
  32. package/lib/index.js.map +1 -1
  33. package/lib/json-file.d.ts +0 -15
  34. package/lib/json-file.d.ts.map +1 -1
  35. package/lib/json-file.js +15 -15
  36. package/lib/json-file.js.map +1 -1
  37. package/lib/npm-registry.d.ts +2 -16
  38. package/lib/npm-registry.d.ts.map +1 -1
  39. package/lib/npm-registry.js +20 -22
  40. package/lib/npm-registry.js.map +1 -1
  41. package/package.json +4 -4
  42. package/src/api.ts +15 -15
  43. package/src/application-package.spec.ts +15 -15
  44. package/src/application-package.ts +15 -15
  45. package/src/application-props.ts +15 -15
  46. package/src/environment.ts +15 -15
  47. package/src/extension-package-collector.ts +15 -15
  48. package/src/extension-package.ts +15 -15
  49. package/src/index.ts +15 -15
  50. package/src/json-file.ts +15 -15
  51. package/src/npm-registry.ts +21 -23
@@ -1,22 +1,22 @@
1
- /********************************************************************************
2
- * Copyright (C) 2017 TypeFox and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- ********************************************************************************/
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
16
 
17
17
  /* eslint-disable @typescript-eslint/no-explicit-any */
18
18
  import * as request from 'request';
19
- const ChangesStream = require('changes-stream');
19
+ import * as nano from 'nano';
20
20
  import { NpmRegistryProps } from './application-props';
21
21
 
22
22
  export interface IChangeStream {
@@ -92,7 +92,7 @@ export class NpmRegistry {
92
92
  readonly props: NpmRegistryProps = { ...NpmRegistryProps.DEFAULT };
93
93
  protected readonly options: NpmRegistryOptions;
94
94
 
95
- protected changes: undefined | IChangeStream;
95
+ protected changes?: nano.ChangesReaderScope;
96
96
  protected readonly index = new Map<string, Promise<ViewResult>>();
97
97
 
98
98
  constructor(options?: Partial<NpmRegistryOptions>) {
@@ -115,13 +115,11 @@ export class NpmRegistry {
115
115
  this.index.clear();
116
116
  if (this.options.watchChanges && this.props.registry === NpmRegistryProps.DEFAULT.registry) {
117
117
  if (this.changes) {
118
- this.changes.destroy();
118
+ this.changes.stop();
119
119
  }
120
- // invalidate index with NPM registry web hooks
121
- // see: https://github.com/npm/registry-follower-tutorial
122
- const db = 'https://replicate.npmjs.com';
123
- this.changes = new ChangesStream({ db }) as IChangeStream;
124
- this.changes.on('data', change => this.invalidate(change.id));
120
+ // Invalidate index with NPM registry web hooks
121
+ this.changes = nano('https://replicate.npmjs.com').use('registry').changesReader;
122
+ this.changes.get({}).on('change', change => this.invalidate(change.id));
125
123
  }
126
124
  }
127
125
  protected invalidate(name: string): void {