瀏覽代碼

Remove dollar sign from settings schemas.

Afshin Darian 7 年之前
父節點
當前提交
048f9e7e0b
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 1 1
      jupyterlab/update-core.js
  2. 4 4
      packages/apputils-extension/src/index.ts

+ 1 - 1
jupyterlab/update-core.js

@@ -65,7 +65,7 @@ packages.forEach(function(packagePath) {
     var schemas = glob.sync(path.join(schemaDir, '*'));
     var prefix = data['name'].replace(/@/g, '').replace(/\//g, '-');
     schemas.forEach(function(schemaPath) {
-      var file = prefix + '$' + path.basename(schemaPath);
+      var file = prefix + '-' + path.basename(schemaPath);
       var to = path.join(basePath, 'jupyterlab', 'schemas', file);
       fs.copySync(schemaPath, to);
     });

+ 4 - 4
packages/apputils-extension/src/index.ts

@@ -74,10 +74,10 @@ function newConnector(manager: ServiceManager): IDataConnector<ISettingRegistry.
      */
     fetch(id: string): Promise<ISettingRegistry.IPlugin> {
       // Strip characters removed from the schema file name at build time.
-      const key = id.replace(/@/g, '').replace(/\//g, '-');
+      const key = id.replace(/@/g, '').replace(/\/|\:/g, '-');
 
       return manager.settings.fetch(key).catch(reason => {
-        throw apiError(id, (reason as ServerConnection.IError).xhr);
+        throw apiError(key, (reason as ServerConnection.IError).xhr);
       });
     },
 
@@ -95,10 +95,10 @@ function newConnector(manager: ServiceManager): IDataConnector<ISettingRegistry.
      */
     save(id: string, user: JSONObject): Promise<void> {
       // Strip characters removed from the schema file name at build time.
-      const key = id.replace(/@/g, '').replace(/\//g, '-');
+      const key = id.replace(/@/g, '').replace(/\/|\:/g, '-');
 
       return manager.settings.save(key, user).catch(reason => {
-        throw apiError(id, (reason as ServerConnection.IError).xhr);
+        throw apiError(key, (reason as ServerConnection.IError).xhr);
       });
     }
   };