@theia/userstorage 1.53.0-next.4 → 1.53.0-next.55

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)
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@theia/userstorage",
3
- "version": "1.53.0-next.4+9e9124118",
3
+ "version": "1.53.0-next.55+d1a989a68c",
4
4
  "description": "Theia - User Storage Extension",
5
5
  "dependencies": {
6
- "@theia/core": "1.53.0-next.4+9e9124118",
7
- "@theia/filesystem": "1.53.0-next.4+9e9124118",
6
+ "@theia/core": "1.53.0-next.55+d1a989a68c",
7
+ "@theia/filesystem": "1.53.0-next.55+d1a989a68c",
8
8
  "tslib": "^2.6.2"
9
9
  },
10
10
  "publishConfig": {
@@ -40,10 +40,10 @@
40
40
  "watch": "theiaext watch"
41
41
  },
42
42
  "devDependencies": {
43
- "@theia/ext-scripts": "1.52.0"
43
+ "@theia/ext-scripts": "1.53.0"
44
44
  },
45
45
  "nyc": {
46
46
  "extends": "../../configs/nyc.json"
47
47
  },
48
- "gitHead": "9e912411843f32b2a549ef6580b07872edd95e8b"
48
+ "gitHead": "d1a989a68c1b5ec1f9098e9126653c6346844769"
49
49
  }
@@ -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
+ });