@theia/userstorage 1.45.0 → 1.46.0-next.72

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/README.md CHANGED
@@ -1,39 +1,39 @@
1
- <div align='center'>
2
-
3
- <br />
4
-
5
- <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
-
7
- <h2>ECLIPSE THEIA - USERSTORAGE EXTENSION</h2>
8
-
9
- <hr />
10
-
11
- </div>
12
-
13
- ## Description
14
-
15
- The `@theia/userstorage` extension provides an API for accessing user storage files, i.e preferences, custom keymaps and other user-specific files without having to know how it's implemented. User storage files can then be accessed with `userstorage` uri scheme like so `userstorage://settings.json` and the user storage service implementation will then fetch the appropriate file.
16
-
17
- ## Additional Information
18
-
19
- - [API documentation for `@theia/userstorage`](https://eclipse-theia.github.io/theia/docs/next/modules/userstorage.html)
20
- - [Theia - GitHub](https://github.com/eclipse-theia/theia)
21
- - [Theia - Website](https://theia-ide.org/)
22
-
23
- ## License
24
-
25
- - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
26
- - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
27
-
28
- ## Trademark
29
- "Theia" is a trademark of the Eclipse Foundation
30
- https://www.eclipse.org/theia
31
-
32
-
33
- # Theia - User Storage Extension
34
-
35
-
36
-
37
- ## License
38
- - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
39
- - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
1
+ <div align='center'>
2
+
3
+ <br />
4
+
5
+ <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
+
7
+ <h2>ECLIPSE THEIA - USERSTORAGE EXTENSION</h2>
8
+
9
+ <hr />
10
+
11
+ </div>
12
+
13
+ ## Description
14
+
15
+ The `@theia/userstorage` extension provides an API for accessing user storage files, i.e preferences, custom keymaps and other user-specific files without having to know how it's implemented. User storage files can then be accessed with `userstorage` uri scheme like so `userstorage://settings.json` and the user storage service implementation will then fetch the appropriate file.
16
+
17
+ ## Additional Information
18
+
19
+ - [API documentation for `@theia/userstorage`](https://eclipse-theia.github.io/theia/docs/next/modules/userstorage.html)
20
+ - [Theia - GitHub](https://github.com/eclipse-theia/theia)
21
+ - [Theia - Website](https://theia-ide.org/)
22
+
23
+ ## License
24
+
25
+ - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
26
+ - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
27
+
28
+ ## Trademark
29
+ "Theia" is a trademark of the Eclipse Foundation
30
+ https://www.eclipse.org/theia
31
+
32
+
33
+ # Theia - User Storage Extension
34
+
35
+
36
+
37
+ ## License
38
+ - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
39
+ - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
@@ -1,3 +1,3 @@
1
- export * from './user-storage-uri';
2
- export * from './user-storage-frontend-module';
1
+ export * from './user-storage-uri';
2
+ export * from './user-storage-frontend-module';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,30 +1,30 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2017 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- __exportStar(require("./user-storage-uri"), exports);
29
- __exportStar(require("./user-storage-frontend-module"), exports);
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ __exportStar(require("./user-storage-uri"), exports);
29
+ __exportStar(require("./user-storage-frontend-module"), exports);
30
30
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,9 @@
1
- import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
2
- import { FileSystemProvider } from '@theia/filesystem/lib/common/files';
3
- import { FileService, FileServiceContribution } from '@theia/filesystem/lib/browser/file-service';
4
- export declare class UserStorageContribution implements FileServiceContribution {
5
- protected readonly environments: EnvVariablesServer;
6
- registerFileSystemProviders(service: FileService): void;
7
- protected createProvider(service: FileService): Promise<FileSystemProvider>;
8
- }
1
+ import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
2
+ import { FileSystemProvider } from '@theia/filesystem/lib/common/files';
3
+ import { FileService, FileServiceContribution } from '@theia/filesystem/lib/browser/file-service';
4
+ export declare class UserStorageContribution implements FileServiceContribution {
5
+ protected readonly environments: EnvVariablesServer;
6
+ registerFileSystemProviders(service: FileService): void;
7
+ protected createProvider(service: FileService): Promise<FileSystemProvider>;
8
+ }
9
9
  //# sourceMappingURL=user-storage-contribution.d.ts.map
@@ -1,76 +1,76 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2020 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.UserStorageContribution = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const uri_1 = require("@theia/core/lib/common/uri");
30
- const disposable_1 = require("@theia/core/lib/common/disposable");
31
- const env_variables_1 = require("@theia/core/lib/common/env-variables");
32
- const delegating_file_system_provider_1 = require("@theia/filesystem/lib/common/delegating-file-system-provider");
33
- const user_storage_uri_1 = require("./user-storage-uri");
34
- let UserStorageContribution = class UserStorageContribution {
35
- registerFileSystemProviders(service) {
36
- service.onWillActivateFileSystemProvider(event => {
37
- if (event.scheme === user_storage_uri_1.UserStorageUri.scheme) {
38
- event.waitUntil((async () => {
39
- const provider = await this.createProvider(service);
40
- service.registerProvider(user_storage_uri_1.UserStorageUri.scheme, provider);
41
- })());
42
- }
43
- });
44
- }
45
- async createProvider(service) {
46
- const delegate = await service.activateProvider('file');
47
- const configDirUri = new uri_1.default(await this.environments.getConfigDirUri());
48
- return new delegating_file_system_provider_1.DelegatingFileSystemProvider(delegate, {
49
- uriConverter: {
50
- to: resource => {
51
- const relativePath = user_storage_uri_1.UserStorageUri.relative(resource);
52
- if (relativePath) {
53
- return configDirUri.resolve(relativePath).normalizePath();
54
- }
55
- return undefined;
56
- },
57
- from: resource => {
58
- const relativePath = configDirUri.relative(resource);
59
- if (relativePath) {
60
- return user_storage_uri_1.UserStorageUri.resolve(relativePath);
61
- }
62
- return undefined;
63
- }
64
- }
65
- }, new disposable_1.DisposableCollection(delegate.watch(configDirUri, { excludes: [], recursive: true })));
66
- }
67
- };
68
- __decorate([
69
- (0, inversify_1.inject)(env_variables_1.EnvVariablesServer),
70
- __metadata("design:type", Object)
71
- ], UserStorageContribution.prototype, "environments", void 0);
72
- UserStorageContribution = __decorate([
73
- (0, inversify_1.injectable)()
74
- ], UserStorageContribution);
75
- exports.UserStorageContribution = UserStorageContribution;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2020 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.UserStorageContribution = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const uri_1 = require("@theia/core/lib/common/uri");
30
+ const disposable_1 = require("@theia/core/lib/common/disposable");
31
+ const env_variables_1 = require("@theia/core/lib/common/env-variables");
32
+ const delegating_file_system_provider_1 = require("@theia/filesystem/lib/common/delegating-file-system-provider");
33
+ const user_storage_uri_1 = require("./user-storage-uri");
34
+ let UserStorageContribution = class UserStorageContribution {
35
+ registerFileSystemProviders(service) {
36
+ service.onWillActivateFileSystemProvider(event => {
37
+ if (event.scheme === user_storage_uri_1.UserStorageUri.scheme) {
38
+ event.waitUntil((async () => {
39
+ const provider = await this.createProvider(service);
40
+ service.registerProvider(user_storage_uri_1.UserStorageUri.scheme, provider);
41
+ })());
42
+ }
43
+ });
44
+ }
45
+ async createProvider(service) {
46
+ const delegate = await service.activateProvider('file');
47
+ const configDirUri = new uri_1.default(await this.environments.getConfigDirUri());
48
+ return new delegating_file_system_provider_1.DelegatingFileSystemProvider(delegate, {
49
+ uriConverter: {
50
+ to: resource => {
51
+ const relativePath = user_storage_uri_1.UserStorageUri.relative(resource);
52
+ if (relativePath) {
53
+ return configDirUri.resolve(relativePath).normalizePath();
54
+ }
55
+ return undefined;
56
+ },
57
+ from: resource => {
58
+ const relativePath = configDirUri.relative(resource);
59
+ if (relativePath) {
60
+ return user_storage_uri_1.UserStorageUri.resolve(relativePath);
61
+ }
62
+ return undefined;
63
+ }
64
+ }
65
+ }, new disposable_1.DisposableCollection(delegate.watch(configDirUri, { excludes: [], recursive: true })));
66
+ }
67
+ };
68
+ __decorate([
69
+ (0, inversify_1.inject)(env_variables_1.EnvVariablesServer),
70
+ __metadata("design:type", Object)
71
+ ], UserStorageContribution.prototype, "environments", void 0);
72
+ UserStorageContribution = __decorate([
73
+ (0, inversify_1.injectable)()
74
+ ], UserStorageContribution);
75
+ exports.UserStorageContribution = UserStorageContribution;
76
76
  //# sourceMappingURL=user-storage-contribution.js.map
@@ -1,4 +1,4 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- declare const _default: ContainerModule;
3
- export default _default;
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
4
  //# sourceMappingURL=user-storage-frontend-module.d.ts.map
@@ -1,25 +1,25 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2017 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const inversify_1 = require("@theia/core/shared/inversify");
19
- const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
20
- const user_storage_contribution_1 = require("./user-storage-contribution");
21
- exports.default = new inversify_1.ContainerModule(bind => {
22
- bind(user_storage_contribution_1.UserStorageContribution).toSelf().inSingletonScope();
23
- bind(file_service_1.FileServiceContribution).toService(user_storage_contribution_1.UserStorageContribution);
24
- });
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const inversify_1 = require("@theia/core/shared/inversify");
19
+ const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
20
+ const user_storage_contribution_1 = require("./user-storage-contribution");
21
+ exports.default = new inversify_1.ContainerModule(bind => {
22
+ bind(user_storage_contribution_1.UserStorageContribution).toSelf().inSingletonScope();
23
+ bind(file_service_1.FileServiceContribution).toService(user_storage_contribution_1.UserStorageContribution);
24
+ });
25
25
  //# sourceMappingURL=user-storage-frontend-module.js.map
@@ -1,3 +1,3 @@
1
- import URI from '@theia/core/lib/common/uri';
2
- export declare const UserStorageUri: URI;
1
+ import URI from '@theia/core/lib/common/uri';
2
+ export declare const UserStorageUri: URI;
3
3
  //# sourceMappingURL=user-storage-uri.d.ts.map
@@ -1,21 +1,21 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2017 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.UserStorageUri = void 0;
19
- const uri_1 = require("@theia/core/lib/common/uri");
20
- exports.UserStorageUri = new uri_1.default('user-storage:/user');
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.UserStorageUri = void 0;
19
+ const uri_1 = require("@theia/core/lib/common/uri");
20
+ exports.UserStorageUri = new uri_1.default('user-storage:/user');
21
21
  //# sourceMappingURL=user-storage-uri.js.map
@@ -1,26 +1,26 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 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-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
- /* note: this bogus test file is required so that
17
- we are able to run mocha unit tests on this
18
- package, without having any actual unit tests in it.
19
- This way a coverage report will be generated,
20
- showing 0% coverage, instead of no report.
21
- This file can be removed once we have real unit
22
- tests in place. */
23
- describe('userstorage package', () => {
24
- it('support code coverage statistics', () => true);
25
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 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-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+ /* note: this bogus test file is required so that
17
+ we are able to run mocha unit tests on this
18
+ package, without having any actual unit tests in it.
19
+ This way a coverage report will be generated,
20
+ showing 0% coverage, instead of no report.
21
+ This file can be removed once we have real unit
22
+ tests in place. */
23
+ describe('userstorage package', () => {
24
+ it('support code coverage statistics', () => true);
25
+ });
26
26
  //# sourceMappingURL=package.spec.js.map
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@theia/userstorage",
3
- "version": "1.45.0",
3
+ "version": "1.46.0-next.72+4a275b29d",
4
4
  "description": "Theia - User Storage Extension",
5
5
  "dependencies": {
6
- "@theia/core": "1.45.0",
7
- "@theia/filesystem": "1.45.0"
6
+ "@theia/core": "1.46.0-next.72+4a275b29d",
7
+ "@theia/filesystem": "1.46.0-next.72+4a275b29d"
8
8
  },
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -39,10 +39,10 @@
39
39
  "watch": "theiaext watch"
40
40
  },
41
41
  "devDependencies": {
42
- "@theia/ext-scripts": "1.45.0"
42
+ "@theia/ext-scripts": "1.46.0"
43
43
  },
44
44
  "nyc": {
45
45
  "extends": "../../configs/nyc.json"
46
46
  },
47
- "gitHead": "2b20a60a0f9b54b19838a0f71760989a19622495"
47
+ "gitHead": "4a275b29d0db6c81190488c7f76cb667da05ef19"
48
48
  }
@@ -1,18 +1,18 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2017 Ericsson 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-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- export * from './user-storage-uri';
18
- export * from './user-storage-frontend-module';
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 Ericsson 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-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ export * from './user-storage-uri';
18
+ export * from './user-storage-frontend-module';
@@ -1,68 +1,68 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 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-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { inject, injectable } from '@theia/core/shared/inversify';
18
- import URI from '@theia/core/lib/common/uri';
19
- import { DisposableCollection } from '@theia/core/lib/common/disposable';
20
- import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
21
- import { FileSystemProvider } from '@theia/filesystem/lib/common/files';
22
- import { FileService, FileServiceContribution } from '@theia/filesystem/lib/browser/file-service';
23
- import { DelegatingFileSystemProvider } from '@theia/filesystem/lib/common/delegating-file-system-provider';
24
- import { UserStorageUri } from './user-storage-uri';
25
-
26
- @injectable()
27
- export class UserStorageContribution implements FileServiceContribution {
28
-
29
- @inject(EnvVariablesServer)
30
- protected readonly environments: EnvVariablesServer;
31
-
32
- registerFileSystemProviders(service: FileService): void {
33
- service.onWillActivateFileSystemProvider(event => {
34
- if (event.scheme === UserStorageUri.scheme) {
35
- event.waitUntil((async () => {
36
- const provider = await this.createProvider(service);
37
- service.registerProvider(UserStorageUri.scheme, provider);
38
- })());
39
- }
40
- });
41
- }
42
-
43
- protected async createProvider(service: FileService): Promise<FileSystemProvider> {
44
- const delegate = await service.activateProvider('file');
45
- const configDirUri = new URI(await this.environments.getConfigDirUri());
46
- return new DelegatingFileSystemProvider(delegate, {
47
- uriConverter: {
48
- to: resource => {
49
- const relativePath = UserStorageUri.relative(resource);
50
- if (relativePath) {
51
- return configDirUri.resolve(relativePath).normalizePath();
52
- }
53
- return undefined;
54
- },
55
- from: resource => {
56
- const relativePath = configDirUri.relative(resource);
57
- if (relativePath) {
58
- return UserStorageUri.resolve(relativePath);
59
- }
60
- return undefined;
61
- }
62
- }
63
- }, new DisposableCollection(
64
- delegate.watch(configDirUri, { excludes: [], recursive: true })
65
- ));
66
- }
67
-
68
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 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-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { inject, injectable } from '@theia/core/shared/inversify';
18
+ import URI from '@theia/core/lib/common/uri';
19
+ import { DisposableCollection } from '@theia/core/lib/common/disposable';
20
+ import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
21
+ import { FileSystemProvider } from '@theia/filesystem/lib/common/files';
22
+ import { FileService, FileServiceContribution } from '@theia/filesystem/lib/browser/file-service';
23
+ import { DelegatingFileSystemProvider } from '@theia/filesystem/lib/common/delegating-file-system-provider';
24
+ import { UserStorageUri } from './user-storage-uri';
25
+
26
+ @injectable()
27
+ export class UserStorageContribution implements FileServiceContribution {
28
+
29
+ @inject(EnvVariablesServer)
30
+ protected readonly environments: EnvVariablesServer;
31
+
32
+ registerFileSystemProviders(service: FileService): void {
33
+ service.onWillActivateFileSystemProvider(event => {
34
+ if (event.scheme === UserStorageUri.scheme) {
35
+ event.waitUntil((async () => {
36
+ const provider = await this.createProvider(service);
37
+ service.registerProvider(UserStorageUri.scheme, provider);
38
+ })());
39
+ }
40
+ });
41
+ }
42
+
43
+ protected async createProvider(service: FileService): Promise<FileSystemProvider> {
44
+ const delegate = await service.activateProvider('file');
45
+ const configDirUri = new URI(await this.environments.getConfigDirUri());
46
+ return new DelegatingFileSystemProvider(delegate, {
47
+ uriConverter: {
48
+ to: resource => {
49
+ const relativePath = UserStorageUri.relative(resource);
50
+ if (relativePath) {
51
+ return configDirUri.resolve(relativePath).normalizePath();
52
+ }
53
+ return undefined;
54
+ },
55
+ from: resource => {
56
+ const relativePath = configDirUri.relative(resource);
57
+ if (relativePath) {
58
+ return UserStorageUri.resolve(relativePath);
59
+ }
60
+ return undefined;
61
+ }
62
+ }
63
+ }, new DisposableCollection(
64
+ delegate.watch(configDirUri, { excludes: [], recursive: true })
65
+ ));
66
+ }
67
+
68
+ }
@@ -1,24 +1,24 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2017 Ericsson 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-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { ContainerModule } from '@theia/core/shared/inversify';
18
- import { FileServiceContribution } from '@theia/filesystem/lib/browser/file-service';
19
- import { UserStorageContribution } from './user-storage-contribution';
20
-
21
- export default new ContainerModule(bind => {
22
- bind(UserStorageContribution).toSelf().inSingletonScope();
23
- bind(FileServiceContribution).toService(UserStorageContribution);
24
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 Ericsson 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-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { ContainerModule } from '@theia/core/shared/inversify';
18
+ import { FileServiceContribution } from '@theia/filesystem/lib/browser/file-service';
19
+ import { UserStorageContribution } from './user-storage-contribution';
20
+
21
+ export default new ContainerModule(bind => {
22
+ bind(UserStorageContribution).toSelf().inSingletonScope();
23
+ bind(FileServiceContribution).toService(UserStorageContribution);
24
+ });
@@ -1,19 +1,19 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2017 Ericsson 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-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import URI from '@theia/core/lib/common/uri';
18
-
19
- export const UserStorageUri = new URI('user-storage:/user');
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 Ericsson 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-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import URI from '@theia/core/lib/common/uri';
18
+
19
+ export const UserStorageUri = new URI('user-storage:/user');
@@ -1,29 +1,29 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 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-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- /* note: this bogus test file is required so that
18
- we are able to run mocha unit tests on this
19
- package, without having any actual unit tests in it.
20
- This way a coverage report will be generated,
21
- showing 0% coverage, instead of no report.
22
- This file can be removed once we have real unit
23
- tests in place. */
24
-
25
- describe('userstorage package', () => {
26
-
27
- it('support code coverage statistics', () => true);
28
-
29
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 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-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ /* note: this bogus test file is required so that
18
+ we are able to run mocha unit tests on this
19
+ package, without having any actual unit tests in it.
20
+ This way a coverage report will be generated,
21
+ showing 0% coverage, instead of no report.
22
+ This file can be removed once we have real unit
23
+ tests in place. */
24
+
25
+ describe('userstorage package', () => {
26
+
27
+ it('support code coverage statistics', () => true);
28
+
29
+ });