@vscode/test-web 0.0.39 → 0.0.40

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.
@@ -15,7 +15,7 @@ function asJSON(value) {
15
15
  return JSON.stringify(value).replace(/"/g, '"');
16
16
  }
17
17
  class Workbench {
18
- constructor(baseUrl, dev, esm, builtInExtensions = [], productOverrides = '') {
18
+ constructor(baseUrl, dev, esm, builtInExtensions = [], productOverrides) {
19
19
  this.baseUrl = baseUrl;
20
20
  this.dev = dev;
21
21
  this.esm = esm;
@@ -28,7 +28,7 @@ class Workbench {
28
28
  WORKBENCH_AUTH_SESSION: '',
29
29
  WORKBENCH_WEB_BASE_URL: this.baseUrl,
30
30
  WORKBENCH_BUILTIN_EXTENSIONS: asJSON(this.builtInExtensions),
31
- WORKBENCH_PRODUCT_OVERRIDES: this.productOverrides,
31
+ WORKBENCH_PRODUCT_OVERRIDES: this.productOverrides ? asJSON(this.productOverrides) : '',
32
32
  WORKBENCH_MAIN: this.getMain()
33
33
  };
34
34
  try {
@@ -108,7 +108,7 @@ function default_1(config) {
108
108
  router.use(async (ctx, next) => {
109
109
  if (config.build.type === 'sources') {
110
110
  const builtInExtensions = await (0, extensions_1.getScannedBuiltinExtensions)(config.build.location);
111
- const productOverrides = await getProductOverridesContent(config.build.location);
111
+ const productOverrides = await getProductOverrides(config.build.location);
112
112
  ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, config.esm, builtInExtensions, productOverrides);
113
113
  }
114
114
  else if (config.build.type === 'static') {
@@ -133,11 +133,11 @@ function default_1(config) {
133
133
  return router.routes();
134
134
  }
135
135
  exports.default = default_1;
136
- async function getProductOverridesContent(vsCodeDevLocation) {
136
+ async function getProductOverrides(vsCodeDevLocation) {
137
137
  try {
138
- return (await fs_1.promises.readFile(path.join(vsCodeDevLocation, 'product.overrides.json'))).toString();
138
+ return JSON.parse((await fs_1.promises.readFile(path.join(vsCodeDevLocation, 'product.overrides.json'))).toString());
139
139
  }
140
140
  catch (e) {
141
- return '';
141
+ return undefined;
142
142
  }
143
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode/test-web",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "scripts": {
5
5
  "install-extensions": "yarn --cwd=fs-provider && yarn --cwd=sample",
6
6
  "compile": "tsc -p ./ && yarn compile-fs-provider",