@vscode/test-web 0.0.12 → 0.0.16

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.
@@ -0,0 +1,597 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ var __webpack_modules__ = ([
3
+ /* 0 */,
4
+ /* 1 */
5
+ /***/ ((__unused_webpack_module, exports) => {
6
+
7
+ (()=>{"use strict";var e={};(()=>{var r=e;Object.defineProperty(r,"__esModule",{value:!0}),r.getErrorStatusDescription=r.xhr=r.configure=void 0,r.configure=(e,r)=>{},r.xhr=async e=>{const r=new Headers;if(e.headers)for(const t in e.headers){const s=e.headers[t];Array.isArray(s)?s.forEach((e=>r.set(t,e))):r.set(t,s)}e.user&&e.password&&r.set("Authorization","Basic "+btoa(e.user+":"+e.password));const t={method:e.type,redirect:e.followRedirects>0?"follow":"manual",mode:"cors",headers:r};e.data&&(t.body=e.data);const s=new Request(e.url,t),o=await fetch(s),a={};o.headers.forEach(((e,r)=>{a[r]=e}));const n=await o.arrayBuffer();return new class{constructor(){this.status=o.status,this.headers=a}get responseText(){return(new TextDecoder).decode(n)}get body(){return new Uint8Array(n)}}},r.getErrorStatusDescription=function(e){return String(e)}})();var r=exports;for(var t in e)r[t]=e[t];e.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
8
+
9
+ /***/ }),
10
+ /* 2 */
11
+ /***/ ((module) => {
12
+
13
+ "use strict";
14
+ module.exports = require("vscode");;
15
+
16
+ /***/ }),
17
+ /* 3 */
18
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
19
+
20
+ "use strict";
21
+
22
+ /*---------------------------------------------------------------------------------------------
23
+ * Copyright (c) Microsoft Corporation. All rights reserved.
24
+ * Licensed under the MIT License. See License.txt in the project root for license information.
25
+ *--------------------------------------------------------------------------------------------*/
26
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
27
+ exports.MemFileSystemProvider = void 0;
28
+ const vscode_1 = __webpack_require__(2);
29
+ const vscode_uri_1 = __webpack_require__(4);
30
+ function newFileStat(type, size) {
31
+ return Promise.resolve({ type, ctime: Date.now(), mtime: Date.now(), size });
32
+ }
33
+ function modifiedFileStat(stats, size) {
34
+ return Promise.resolve({ type: stats.type, ctime: stats.ctime, mtime: Date.now(), size: size !== null && size !== void 0 ? size : stats.size });
35
+ }
36
+ class MemFileSystemProvider {
37
+ constructor(scheme, root) {
38
+ this.scheme = scheme;
39
+ this.root = root;
40
+ // --- manage file events
41
+ this._onDidChangeFile = new vscode_1.EventEmitter();
42
+ this.onDidChangeFile = this._onDidChangeFile.event;
43
+ this._bufferedChanges = [];
44
+ }
45
+ // --- manage file metadata
46
+ async stat(resource) {
47
+ const entry = await this._lookup(resource, false);
48
+ return entry.stats;
49
+ }
50
+ async readDirectory(resource) {
51
+ const entry = await this._lookupAsDirectory(resource, false);
52
+ const entries = await entry.entries;
53
+ const result = [];
54
+ entries.forEach((child, name) => result.push([name, child.type]));
55
+ return result;
56
+ }
57
+ // --- manage file contents
58
+ async readFile(resource) {
59
+ const entry = await this._lookupAsFile(resource, false);
60
+ return entry.content;
61
+ }
62
+ async writeFile(uri, content, opts) {
63
+ const basename = vscode_uri_1.Utils.basename(uri);
64
+ const parent = await this._lookupParentDirectory(uri);
65
+ const entries = await parent.entries;
66
+ let entry = entries.get(basename);
67
+ if (entry && entry.type === vscode_1.FileType.Directory) {
68
+ throw vscode_1.FileSystemError.FileIsADirectory(uri);
69
+ }
70
+ if (!entry && !opts.create) {
71
+ throw vscode_1.FileSystemError.FileNotFound(uri);
72
+ }
73
+ if (entry && opts.create && !opts.overwrite) {
74
+ throw vscode_1.FileSystemError.FileExists(uri);
75
+ }
76
+ const stats = newFileStat(vscode_1.FileType.File, content.byteLength);
77
+ if (!entry) {
78
+ entry = { type: vscode_1.FileType.File, name: basename, stats, content: Promise.resolve(content) };
79
+ entries.set(basename, entry);
80
+ this._fireSoon({ type: vscode_1.FileChangeType.Created, uri });
81
+ }
82
+ else {
83
+ entry.stats = stats;
84
+ entry.content = Promise.resolve(content);
85
+ }
86
+ this._fireSoon({ type: vscode_1.FileChangeType.Changed, uri });
87
+ }
88
+ // --- manage files/folders
89
+ async rename(from, to, opts) {
90
+ if (!opts.overwrite && await this._lookup(to, true)) {
91
+ throw vscode_1.FileSystemError.FileExists(to);
92
+ }
93
+ const entry = await this._lookup(from, false);
94
+ const oldParent = await this._lookupParentDirectory(from);
95
+ const newParent = await this._lookupParentDirectory(to);
96
+ const newName = vscode_uri_1.Utils.basename(to);
97
+ const oldParentEntries = await oldParent.entries;
98
+ oldParentEntries.delete(entry.name);
99
+ entry.name = newName;
100
+ const newParentEntries = await newParent.entries;
101
+ newParentEntries.set(newName, entry);
102
+ this._fireSoon({ type: vscode_1.FileChangeType.Deleted, uri: from }, { type: vscode_1.FileChangeType.Created, uri: to });
103
+ }
104
+ async delete(uri, opts) {
105
+ const dirname = vscode_uri_1.Utils.dirname(uri);
106
+ const basename = vscode_uri_1.Utils.basename(uri);
107
+ const parent = await this._lookupAsDirectory(dirname, false);
108
+ const parentEntries = await parent.entries;
109
+ if (parentEntries.has(basename)) {
110
+ parentEntries.delete(basename);
111
+ parent.stats = newFileStat(parent.type, -1);
112
+ this._fireSoon({ type: vscode_1.FileChangeType.Changed, uri: dirname }, { uri, type: vscode_1.FileChangeType.Deleted });
113
+ }
114
+ }
115
+ async createDirectory(uri) {
116
+ const basename = vscode_uri_1.Utils.basename(uri);
117
+ const dirname = vscode_uri_1.Utils.dirname(uri);
118
+ const parent = await this._lookupAsDirectory(dirname, false);
119
+ const parentEntries = await parent.entries;
120
+ const entry = { type: vscode_1.FileType.Directory, name: basename, stats: newFileStat(vscode_1.FileType.Directory, 0), entries: Promise.resolve(new Map()) };
121
+ parentEntries.set(entry.name, entry);
122
+ const stats = await parent.stats;
123
+ parent.stats = modifiedFileStat(stats, stats.size + 1);
124
+ this._fireSoon({ type: vscode_1.FileChangeType.Changed, uri: dirname }, { type: vscode_1.FileChangeType.Created, uri });
125
+ }
126
+ async _lookup(uri, silent) {
127
+ if (uri.scheme !== this.scheme) {
128
+ if (!silent) {
129
+ throw vscode_1.FileSystemError.FileNotFound(uri);
130
+ }
131
+ else {
132
+ return undefined;
133
+ }
134
+ }
135
+ let entry = this.root;
136
+ const parts = uri.path.split('/');
137
+ for (const part of parts) {
138
+ if (!part) {
139
+ continue;
140
+ }
141
+ let child;
142
+ if (entry.type === vscode_1.FileType.Directory) {
143
+ child = (await entry.entries).get(part);
144
+ }
145
+ if (!child) {
146
+ if (!silent) {
147
+ throw vscode_1.FileSystemError.FileNotFound(uri);
148
+ }
149
+ else {
150
+ return undefined;
151
+ }
152
+ }
153
+ entry = child;
154
+ }
155
+ return entry;
156
+ }
157
+ async _lookupAsDirectory(uri, silent) {
158
+ const entry = await this._lookup(uri, silent);
159
+ if ((entry === null || entry === void 0 ? void 0 : entry.type) === vscode_1.FileType.Directory) {
160
+ return entry;
161
+ }
162
+ throw vscode_1.FileSystemError.FileNotADirectory(uri);
163
+ }
164
+ async _lookupAsFile(uri, silent) {
165
+ const entry = await this._lookup(uri, silent);
166
+ if (!entry) {
167
+ throw vscode_1.FileSystemError.FileNotFound(uri);
168
+ }
169
+ if (entry.type === vscode_1.FileType.File) {
170
+ return entry;
171
+ }
172
+ throw vscode_1.FileSystemError.FileIsADirectory(uri);
173
+ }
174
+ _lookupParentDirectory(uri) {
175
+ const dirname = vscode_uri_1.Utils.dirname(uri);
176
+ return this._lookupAsDirectory(dirname, false);
177
+ }
178
+ watch(resource, opts) {
179
+ // ignore, fires for all changes...
180
+ return vscode_1.Disposable.from();
181
+ }
182
+ _fireSoon(...changes) {
183
+ this._bufferedChanges.push(...changes);
184
+ if (this._fireSoonHandle) {
185
+ clearTimeout(this._fireSoonHandle);
186
+ }
187
+ this._fireSoonHandle = setTimeout(() => {
188
+ this._onDidChangeFile.fire(this._bufferedChanges);
189
+ this._bufferedChanges.length = 0;
190
+ }, 5);
191
+ }
192
+ dispose() {
193
+ this._onDidChangeFile.dispose();
194
+ }
195
+ }
196
+ exports.MemFileSystemProvider = MemFileSystemProvider;
197
+
198
+
199
+ /***/ }),
200
+ /* 4 */
201
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
202
+
203
+ "use strict";
204
+ __webpack_require__.r(__webpack_exports__);
205
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
206
+ /* harmony export */ "URI": () => (/* binding */ URI),
207
+ /* harmony export */ "Utils": () => (/* binding */ Utils)
208
+ /* harmony export */ });
209
+ /* provided dependency */ var process = __webpack_require__(5);
210
+ var LIB;LIB=(()=>{"use strict";var t={470:t=>{function e(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function r(t,e){for(var r,n="",o=0,i=-1,a=0,h=0;h<=t.length;++h){if(h<t.length)r=t.charCodeAt(h);else{if(47===r)break;r=47}if(47===r){if(i===h-1||1===a);else if(i!==h-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var s=n.lastIndexOf("/");if(s!==n.length-1){-1===s?(n="",o=0):o=(n=n.slice(0,s)).length-1-n.lastIndexOf("/"),i=h,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=h,a=0;continue}e&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+t.slice(i+1,h):n=t.slice(i+1,h),o=h-i-1;i=h,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var t,n="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a;i>=0?a=arguments[i]:(void 0===t&&(t=process.cwd()),a=t),e(a),0!==a.length&&(n=a+"/"+n,o=47===a.charCodeAt(0))}return n=r(n,!o),o?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(t){if(e(t),0===t.length)return".";var n=47===t.charCodeAt(0),o=47===t.charCodeAt(t.length-1);return 0!==(t=r(t,!n)).length||n||(t="."),t.length>0&&o&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return e(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,r=0;r<arguments.length;++r){var o=arguments[r];e(o),o.length>0&&(void 0===t?t=o:t+="/"+o)}return void 0===t?".":n.normalize(t)},relative:function(t,r){if(e(t),e(r),t===r)return"";if((t=n.resolve(t))===(r=n.resolve(r)))return"";for(var o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var i=t.length,a=i-o,h=1;h<r.length&&47===r.charCodeAt(h);++h);for(var s=r.length-h,f=a<s?a:s,u=-1,c=0;c<=f;++c){if(c===f){if(s>f){if(47===r.charCodeAt(h+c))return r.slice(h+c+1);if(0===c)return r.slice(h+c)}else a>f&&(47===t.charCodeAt(o+c)?u=c:0===c&&(u=0));break}var l=t.charCodeAt(o+c);if(l!==r.charCodeAt(h+c))break;47===l&&(u=c)}var p="";for(c=o+u+1;c<=i;++c)c!==i&&47!==t.charCodeAt(c)||(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(h+u):(h+=u,47===r.charCodeAt(h)&&++h,r.slice(h))},_makeLong:function(t){return t},dirname:function(t){if(e(t),0===t.length)return".";for(var r=t.charCodeAt(0),n=47===r,o=-1,i=!0,a=t.length-1;a>=1;--a)if(47===(r=t.charCodeAt(a))){if(!i){o=a;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":t.slice(0,o)},basename:function(t,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');e(t);var n,o=0,i=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var h=r.length-1,s=-1;for(n=t.length-1;n>=0;--n){var f=t.charCodeAt(n);if(47===f){if(!a){o=n+1;break}}else-1===s&&(a=!1,s=n+1),h>=0&&(f===r.charCodeAt(h)?-1==--h&&(i=n):(h=-1,i=s))}return o===i?i=s:-1===i&&(i=t.length),t.slice(o,i)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!a){o=n+1;break}}else-1===i&&(a=!1,i=n+1);return-1===i?"":t.slice(o,i)},extname:function(t){e(t);for(var r=-1,n=0,o=-1,i=!0,a=0,h=t.length-1;h>=0;--h){var s=t.charCodeAt(h);if(47!==s)-1===o&&(i=!1,o=h+1),46===s?-1===r?r=h:1!==a&&(a=1):-1!==r&&(a=-1);else if(!i){n=h+1;break}}return-1===r||-1===o||0===a||1===a&&r===o-1&&r===n+1?"":t.slice(r,o)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+"/"+n:n}(0,t)},parse:function(t){e(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return r;var n,o=t.charCodeAt(0),i=47===o;i?(r.root="/",n=1):n=0;for(var a=-1,h=0,s=-1,f=!0,u=t.length-1,c=0;u>=n;--u)if(47!==(o=t.charCodeAt(u)))-1===s&&(f=!1,s=u+1),46===o?-1===a?a=u:1!==c&&(c=1):-1!==a&&(c=-1);else if(!f){h=u+1;break}return-1===a||-1===s||0===c||1===c&&a===s-1&&a===h+1?-1!==s&&(r.base=r.name=0===h&&i?t.slice(1,s):t.slice(h,s)):(0===h&&i?(r.name=t.slice(1,a),r.base=t.slice(1,s)):(r.name=t.slice(h,a),r.base=t.slice(h,s)),r.ext=t.slice(a,s)),h>0?r.dir=t.slice(0,h-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,t.exports=n},447:(t,e,r)=>{var n;if(r.r(e),r.d(e,{URI:()=>g,Utils:()=>O}),"object"==typeof process)n="win32"===process.platform;else if("object"==typeof navigator){var o=navigator.userAgent;n=o.indexOf("Windows")>=0}var i,a,h=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=/^\w[\w\d+.-]*$/,f=/^\//,u=/^\/\//,c="",l="/",p=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,g=function(){function t(t,e,r,n,o,i){void 0===i&&(i=!1),"object"==typeof t?(this.scheme=t.scheme||c,this.authority=t.authority||c,this.path=t.path||c,this.query=t.query||c,this.fragment=t.fragment||c):(this.scheme=function(t,e){return t||e?t:"file"}(t,i),this.authority=e||c,this.path=function(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==l&&(e=l+e):e=l}return e}(this.scheme,r||c),this.query=n||c,this.fragment=o||c,function(t,e){if(!t.scheme&&e)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+t.authority+'", path: "'+t.path+'", query: "'+t.query+'", fragment: "'+t.fragment+'"}');if(t.scheme&&!s.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path)if(t.authority){if(!f.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,i))}return t.isUri=function(e){return e instanceof t||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"function"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString},Object.defineProperty(t.prototype,"fsPath",{get:function(){return C(this,!1)},enumerable:!1,configurable:!0}),t.prototype.with=function(t){if(!t)return this;var e=t.scheme,r=t.authority,n=t.path,o=t.query,i=t.fragment;return void 0===e?e=this.scheme:null===e&&(e=c),void 0===r?r=this.authority:null===r&&(r=c),void 0===n?n=this.path:null===n&&(n=c),void 0===o?o=this.query:null===o&&(o=c),void 0===i?i=this.fragment:null===i&&(i=c),e===this.scheme&&r===this.authority&&n===this.path&&o===this.query&&i===this.fragment?this:new v(e,r,n,o,i)},t.parse=function(t,e){void 0===e&&(e=!1);var r=p.exec(t);return r?new v(r[2]||c,x(r[4]||c),x(r[5]||c),x(r[7]||c),x(r[9]||c),e):new v(c,c,c,c,c)},t.file=function(t){var e=c;if(n&&(t=t.replace(/\\/g,l)),t[0]===l&&t[1]===l){var r=t.indexOf(l,2);-1===r?(e=t.substring(2),t=l):(e=t.substring(2,r),t=t.substring(r)||l)}return new v("file",e,t,c,c)},t.from=function(t){return new v(t.scheme,t.authority,t.path,t.query,t.fragment)},t.prototype.toString=function(t){return void 0===t&&(t=!1),A(this,t)},t.prototype.toJSON=function(){return this},t.revive=function(e){if(e){if(e instanceof t)return e;var r=new v(e);return r._formatted=e.external,r._fsPath=e._sep===d?e.fsPath:null,r}return e},t}(),d=n?1:void 0,v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._formatted=null,e._fsPath=null,e}return h(e,t),Object.defineProperty(e.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=C(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),e.prototype.toString=function(t){return void 0===t&&(t=!1),t?A(this,!0):(this._formatted||(this._formatted=A(this,!1)),this._formatted)},e.prototype.toJSON=function(){var t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=d),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t},e}(g),m=((a={})[58]="%3A",a[47]="%2F",a[63]="%3F",a[35]="%23",a[91]="%5B",a[93]="%5D",a[64]="%40",a[33]="%21",a[36]="%24",a[38]="%26",a[39]="%27",a[40]="%28",a[41]="%29",a[42]="%2A",a[43]="%2B",a[44]="%2C",a[59]="%3B",a[61]="%3D",a[32]="%20",a);function y(t,e){for(var r=void 0,n=-1,o=0;o<t.length;o++){var i=t.charCodeAt(o);if(i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57||45===i||46===i||95===i||126===i||e&&47===i)-1!==n&&(r+=encodeURIComponent(t.substring(n,o)),n=-1),void 0!==r&&(r+=t.charAt(o));else{void 0===r&&(r=t.substr(0,o));var a=m[i];void 0!==a?(-1!==n&&(r+=encodeURIComponent(t.substring(n,o)),n=-1),r+=a):-1===n&&(n=o)}}return-1!==n&&(r+=encodeURIComponent(t.substring(n))),void 0!==r?r:t}function b(t){for(var e=void 0,r=0;r<t.length;r++){var n=t.charCodeAt(r);35===n||63===n?(void 0===e&&(e=t.substr(0,r)),e+=m[n]):void 0!==e&&(e+=t[r])}return void 0!==e?e:t}function C(t,e){var r;return r=t.authority&&t.path.length>1&&"file"===t.scheme?"//"+t.authority+t.path:47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?e?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,n&&(r=r.replace(/\//g,"\\")),r}function A(t,e){var r=e?b:y,n="",o=t.scheme,i=t.authority,a=t.path,h=t.query,s=t.fragment;if(o&&(n+=o,n+=":"),(i||"file"===o)&&(n+=l,n+=l),i){var f=i.indexOf("@");if(-1!==f){var u=i.substr(0,f);i=i.substr(f+1),-1===(f=u.indexOf(":"))?n+=r(u,!1):(n+=r(u.substr(0,f),!1),n+=":",n+=r(u.substr(f+1),!1)),n+="@"}-1===(f=(i=i.toLowerCase()).indexOf(":"))?n+=r(i,!1):(n+=r(i.substr(0,f),!1),n+=i.substr(f))}if(a){if(a.length>=3&&47===a.charCodeAt(0)&&58===a.charCodeAt(2))(c=a.charCodeAt(1))>=65&&c<=90&&(a="/"+String.fromCharCode(c+32)+":"+a.substr(3));else if(a.length>=2&&58===a.charCodeAt(1)){var c;(c=a.charCodeAt(0))>=65&&c<=90&&(a=String.fromCharCode(c+32)+":"+a.substr(2))}n+=r(a,!0)}return h&&(n+="?",n+=r(h,!1)),s&&(n+="#",n+=e?s:y(s,!1)),n}function w(t){try{return decodeURIComponent(t)}catch(e){return t.length>3?t.substr(0,3)+w(t.substr(3)):t}}var _=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function x(t){return t.match(_)?t.replace(_,(function(t){return w(t)})):t}var O,P=r(470),j=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,h=i.length;a<h;a++,o++)n[o]=i[a];return n},U=P.posix||P;!function(t){t.joinPath=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return t.with({path:U.join.apply(U,j([t.path],e))})},t.resolvePath=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=t.path||"/";return t.with({path:U.resolve.apply(U,j([n],e))})},t.dirname=function(t){var e=U.dirname(t.path);return 1===e.length&&46===e.charCodeAt(0)?t:t.with({path:e})},t.basename=function(t){return U.basename(t.path)},t.extname=function(t){return U.extname(t.path)}}(O||(O={}))}},e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(447)})();const{URI,Utils}=LIB;
211
+ //# sourceMappingURL=index.js.map
212
+
213
+ /***/ }),
214
+ /* 5 */
215
+ /***/ ((module) => {
216
+
217
+ // shim for using process in browser
218
+ var process = module.exports = {};
219
+
220
+ // cached from whatever global is present so that test runners that stub it
221
+ // don't break things. But we need to wrap it in a try catch in case it is
222
+ // wrapped in strict mode code which doesn't define any globals. It's inside a
223
+ // function because try/catches deoptimize in certain engines.
224
+
225
+ var cachedSetTimeout;
226
+ var cachedClearTimeout;
227
+
228
+ function defaultSetTimout() {
229
+ throw new Error('setTimeout has not been defined');
230
+ }
231
+ function defaultClearTimeout () {
232
+ throw new Error('clearTimeout has not been defined');
233
+ }
234
+ (function () {
235
+ try {
236
+ if (typeof setTimeout === 'function') {
237
+ cachedSetTimeout = setTimeout;
238
+ } else {
239
+ cachedSetTimeout = defaultSetTimout;
240
+ }
241
+ } catch (e) {
242
+ cachedSetTimeout = defaultSetTimout;
243
+ }
244
+ try {
245
+ if (typeof clearTimeout === 'function') {
246
+ cachedClearTimeout = clearTimeout;
247
+ } else {
248
+ cachedClearTimeout = defaultClearTimeout;
249
+ }
250
+ } catch (e) {
251
+ cachedClearTimeout = defaultClearTimeout;
252
+ }
253
+ } ())
254
+ function runTimeout(fun) {
255
+ if (cachedSetTimeout === setTimeout) {
256
+ //normal enviroments in sane situations
257
+ return setTimeout(fun, 0);
258
+ }
259
+ // if setTimeout wasn't available but was latter defined
260
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
261
+ cachedSetTimeout = setTimeout;
262
+ return setTimeout(fun, 0);
263
+ }
264
+ try {
265
+ // when when somebody has screwed with setTimeout but no I.E. maddness
266
+ return cachedSetTimeout(fun, 0);
267
+ } catch(e){
268
+ try {
269
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
270
+ return cachedSetTimeout.call(null, fun, 0);
271
+ } catch(e){
272
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
273
+ return cachedSetTimeout.call(this, fun, 0);
274
+ }
275
+ }
276
+
277
+
278
+ }
279
+ function runClearTimeout(marker) {
280
+ if (cachedClearTimeout === clearTimeout) {
281
+ //normal enviroments in sane situations
282
+ return clearTimeout(marker);
283
+ }
284
+ // if clearTimeout wasn't available but was latter defined
285
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
286
+ cachedClearTimeout = clearTimeout;
287
+ return clearTimeout(marker);
288
+ }
289
+ try {
290
+ // when when somebody has screwed with setTimeout but no I.E. maddness
291
+ return cachedClearTimeout(marker);
292
+ } catch (e){
293
+ try {
294
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
295
+ return cachedClearTimeout.call(null, marker);
296
+ } catch (e){
297
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
298
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
299
+ return cachedClearTimeout.call(this, marker);
300
+ }
301
+ }
302
+
303
+
304
+
305
+ }
306
+ var queue = [];
307
+ var draining = false;
308
+ var currentQueue;
309
+ var queueIndex = -1;
310
+
311
+ function cleanUpNextTick() {
312
+ if (!draining || !currentQueue) {
313
+ return;
314
+ }
315
+ draining = false;
316
+ if (currentQueue.length) {
317
+ queue = currentQueue.concat(queue);
318
+ } else {
319
+ queueIndex = -1;
320
+ }
321
+ if (queue.length) {
322
+ drainQueue();
323
+ }
324
+ }
325
+
326
+ function drainQueue() {
327
+ if (draining) {
328
+ return;
329
+ }
330
+ var timeout = runTimeout(cleanUpNextTick);
331
+ draining = true;
332
+
333
+ var len = queue.length;
334
+ while(len) {
335
+ currentQueue = queue;
336
+ queue = [];
337
+ while (++queueIndex < len) {
338
+ if (currentQueue) {
339
+ currentQueue[queueIndex].run();
340
+ }
341
+ }
342
+ queueIndex = -1;
343
+ len = queue.length;
344
+ }
345
+ currentQueue = null;
346
+ draining = false;
347
+ runClearTimeout(timeout);
348
+ }
349
+
350
+ process.nextTick = function (fun) {
351
+ var args = new Array(arguments.length - 1);
352
+ if (arguments.length > 1) {
353
+ for (var i = 1; i < arguments.length; i++) {
354
+ args[i - 1] = arguments[i];
355
+ }
356
+ }
357
+ queue.push(new Item(fun, args));
358
+ if (queue.length === 1 && !draining) {
359
+ runTimeout(drainQueue);
360
+ }
361
+ };
362
+
363
+ // v8 likes predictible objects
364
+ function Item(fun, array) {
365
+ this.fun = fun;
366
+ this.array = array;
367
+ }
368
+ Item.prototype.run = function () {
369
+ this.fun.apply(null, this.array);
370
+ };
371
+ process.title = 'browser';
372
+ process.browser = true;
373
+ process.env = {};
374
+ process.argv = [];
375
+ process.version = ''; // empty string to avoid regexp issues
376
+ process.versions = {};
377
+
378
+ function noop() {}
379
+
380
+ process.on = noop;
381
+ process.addListener = noop;
382
+ process.once = noop;
383
+ process.off = noop;
384
+ process.removeListener = noop;
385
+ process.removeAllListeners = noop;
386
+ process.emit = noop;
387
+ process.prependListener = noop;
388
+ process.prependOnceListener = noop;
389
+
390
+ process.listeners = function (name) { return [] }
391
+
392
+ process.binding = function (name) {
393
+ throw new Error('process.binding is not supported');
394
+ };
395
+
396
+ process.cwd = function () { return '/' };
397
+ process.chdir = function (dir) {
398
+ throw new Error('process.chdir is not supported');
399
+ };
400
+ process.umask = function() { return 0; };
401
+
402
+
403
+ /***/ })
404
+ /******/ ]);
405
+ /************************************************************************/
406
+ /******/ // The module cache
407
+ /******/ var __webpack_module_cache__ = {};
408
+ /******/
409
+ /******/ // The require function
410
+ /******/ function __webpack_require__(moduleId) {
411
+ /******/ // Check if module is in cache
412
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
413
+ /******/ if (cachedModule !== undefined) {
414
+ /******/ return cachedModule.exports;
415
+ /******/ }
416
+ /******/ // Create a new module (and put it into the cache)
417
+ /******/ var module = __webpack_module_cache__[moduleId] = {
418
+ /******/ // no module.id needed
419
+ /******/ // no module.loaded needed
420
+ /******/ exports: {}
421
+ /******/ };
422
+ /******/
423
+ /******/ // Execute the module function
424
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
425
+ /******/
426
+ /******/ // Return the exports of the module
427
+ /******/ return module.exports;
428
+ /******/ }
429
+ /******/
430
+ /************************************************************************/
431
+ /******/ /* webpack/runtime/define property getters */
432
+ /******/ (() => {
433
+ /******/ // define getter functions for harmony exports
434
+ /******/ __webpack_require__.d = (exports, definition) => {
435
+ /******/ for(var key in definition) {
436
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
437
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
438
+ /******/ }
439
+ /******/ }
440
+ /******/ };
441
+ /******/ })();
442
+ /******/
443
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
444
+ /******/ (() => {
445
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
446
+ /******/ })();
447
+ /******/
448
+ /******/ /* webpack/runtime/make namespace object */
449
+ /******/ (() => {
450
+ /******/ // define __esModule on exports
451
+ /******/ __webpack_require__.r = (exports) => {
452
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
453
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
454
+ /******/ }
455
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
456
+ /******/ };
457
+ /******/ })();
458
+ /******/
459
+ /************************************************************************/
460
+ var __webpack_exports__ = {};
461
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
462
+ (() => {
463
+ "use strict";
464
+ var exports = __webpack_exports__;
465
+
466
+ /*---------------------------------------------------------------------------------------------
467
+ * Copyright (c) Microsoft Corporation. All rights reserved.
468
+ * Licensed under the MIT License. See License.txt in the project root for license information.
469
+ *--------------------------------------------------------------------------------------------*/
470
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
471
+ exports.activate = void 0;
472
+ const request_light_1 = __webpack_require__(1);
473
+ const vscode_1 = __webpack_require__(2);
474
+ const fsProvider_1 = __webpack_require__(3);
475
+ const SCHEME = 'vscode-test-web';
476
+ function activate(context) {
477
+ const serverUri = context.extensionUri.with({ path: '/static/mount', query: undefined });
478
+ const serverBackedRootDirectory = new ServerBackedDirectory(serverUri, '');
479
+ const disposable = vscode_1.workspace.registerFileSystemProvider(SCHEME, new fsProvider_1.MemFileSystemProvider(SCHEME, serverBackedRootDirectory));
480
+ context.subscriptions.push(disposable);
481
+ console.log(`vscode-test-web-support fs provider registers for ${SCHEME}, initial content from ${serverUri.toString()}`);
482
+ }
483
+ exports.activate = activate;
484
+ class ServerBackedFile {
485
+ constructor(_serverUri, name) {
486
+ this._serverUri = _serverUri;
487
+ this.name = name;
488
+ this.type = vscode_1.FileType.File;
489
+ }
490
+ get stats() {
491
+ if (this._stats === undefined) {
492
+ this._stats = getStats(this._serverUri);
493
+ }
494
+ return this._stats;
495
+ }
496
+ set stats(stats) {
497
+ this._stats = stats;
498
+ }
499
+ get content() {
500
+ if (this._content === undefined) {
501
+ this._content = getContent(this._serverUri);
502
+ }
503
+ return this._content;
504
+ }
505
+ set content(content) {
506
+ this._content = content;
507
+ }
508
+ }
509
+ class ServerBackedDirectory {
510
+ constructor(_serverUri, name) {
511
+ this._serverUri = _serverUri;
512
+ this.name = name;
513
+ this.type = vscode_1.FileType.Directory;
514
+ }
515
+ get stats() {
516
+ if (this._stats === undefined) {
517
+ this._stats = getStats(this._serverUri);
518
+ }
519
+ return this._stats;
520
+ }
521
+ set stats(stats) {
522
+ this._stats = stats;
523
+ }
524
+ get entries() {
525
+ if (this._entries === undefined) {
526
+ this._entries = getEntries(this._serverUri);
527
+ }
528
+ return this._entries;
529
+ }
530
+ set entries(entries) {
531
+ this._entries = entries;
532
+ }
533
+ }
534
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
535
+ function isEntry(e) {
536
+ return e && (e.type === vscode_1.FileType.Directory || e.type === vscode_1.FileType.File) && typeof e.name === 'string' && e.name.length > 0;
537
+ }
538
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
539
+ function isStat(e) {
540
+ return e && (e.type === vscode_1.FileType.Directory || e.type === vscode_1.FileType.File) && typeof e.ctime === 'number' && typeof e.mtime === 'number' && typeof e.size === 'number';
541
+ }
542
+ async function getEntries(serverUri) {
543
+ const url = serverUri.with({ query: 'readdir' }).toString();
544
+ const response = await request_light_1.xhr({ url });
545
+ if (response.status === 200 && response.status <= 204) {
546
+ try {
547
+ const res = JSON.parse(response.responseText);
548
+ if (Array.isArray(res)) {
549
+ const entries = new Map();
550
+ for (const r of res) {
551
+ if (isEntry(r)) {
552
+ const childPath = vscode_1.Uri.joinPath(serverUri, r.name);
553
+ const newEntry = r.type === vscode_1.FileType.Directory ? new ServerBackedDirectory(childPath, r.name) : new ServerBackedFile(childPath, r.name);
554
+ entries.set(newEntry.name, newEntry);
555
+ }
556
+ }
557
+ return entries;
558
+ }
559
+ }
560
+ catch {
561
+ // ignore
562
+ }
563
+ console.log(`Invalid server response format for ${url.toString()}.`);
564
+ }
565
+ else {
566
+ console.log(`Invalid server response for ${url.toString()}. Status ${response.status}`);
567
+ }
568
+ return new Map();
569
+ }
570
+ async function getStats(serverUri) {
571
+ const url = serverUri.with({ query: 'stat' }).toString();
572
+ const response = await request_light_1.xhr({ url });
573
+ if (response.status === 200 && response.status <= 204) {
574
+ const res = JSON.parse(response.responseText);
575
+ if (isStat(res)) {
576
+ return res;
577
+ }
578
+ throw vscode_1.FileSystemError.FileNotFound(`Invalid server response for ${serverUri.toString()}.`);
579
+ }
580
+ throw vscode_1.FileSystemError.FileNotFound(`Invalid server response for ${serverUri.toString()}. Status ${response.status}.`);
581
+ }
582
+ async function getContent(serverUri) {
583
+ const response = await request_light_1.xhr({ url: serverUri.toString() });
584
+ if (response.status >= 200 && response.status <= 204) {
585
+ return response.body;
586
+ }
587
+ throw vscode_1.FileSystemError.FileNotFound(`Invalid server response for ${serverUri.toString()}. Status ${response.status}.`);
588
+ }
589
+
590
+ })();
591
+
592
+ var __webpack_export_target__ = exports;
593
+ for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
594
+ if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
595
+ /******/ })()
596
+ ;
597
+ //# sourceMappingURL=fsExtensionMain.js.map
@@ -15,7 +15,7 @@
15
15
  "activationEvents": [
16
16
  "onFileSystem:vscode-test-web"
17
17
  ],
18
- "browser": "./dist/extension-web.js",
18
+ "browser": "./dist/fsExtensionMain.js",
19
19
  "scripts": {
20
20
  "vscode:prepublish": "npm run package-web",
21
21
  "compile-web": "webpack",
@@ -24,10 +24,10 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/vscode": "^1.55.0",
27
- "@types/webpack-env": "^1.16.0",
28
- "ts-loader": "^9.2.3",
29
- "webpack": "^5.40.0",
30
- "webpack-cli": "^4.7.2",
27
+ "@types/webpack-env": "^1.16.2",
28
+ "ts-loader": "^9.2.6",
29
+ "webpack": "^5.55.0",
30
+ "webpack-cli": "^4.8.0",
31
31
  "process": "^0.11.10",
32
32
  "path-browserify": "^1.0.1",
33
33
  "request-light": "^0.5.3",