Browse Source

fix up ensure package and repo

Steven Silvester 4 years ago
parent
commit
12914baf82

+ 11 - 1
buildutils/src/ensure-package.ts

@@ -140,7 +140,10 @@ export async function ensurePackage(
   });
 
   // Make sure we are not importing CSS in a core package.
-  if (data.name.indexOf('example') === -1) {
+  if (
+    data.name.indexOf('example') === -1 &&
+    data.name !== '@jupyterlab/codemirror'
+  ) {
     imports.forEach(importStr => {
       if (importStr.indexOf('.css') !== -1) {
         messages.push('CSS imports are not allowed source files');
@@ -154,6 +157,9 @@ export async function ensurePackage(
     if (name.indexOf('@') === 0) {
       return parts[0] + '/' + parts[1];
     }
+    if (parts[0].indexOf('!') !== -1) {
+      parts[0] = parts[0].slice(parts[0].lastIndexOf('!') + 1);
+    }
     return parts[0];
   });
 
@@ -257,6 +263,10 @@ export async function ensurePackage(
   // Inherit from the base tsconfig.
   if (fs.existsSync(tsConfigPath)) {
     const tsConfigData = utils.readJSONFile(tsConfigPath);
+    tsConfigData.references = [];
+    Object.keys(references).forEach(name => {
+      tsConfigData.references.push({ path: references[name] });
+    });
     let prefix = '';
     let dirName = pkgPath;
     while (!fs.existsSync(path.join(dirName, 'tsconfigbase.json'))) {

+ 2 - 1
buildutils/template/tsconfig.json

@@ -4,5 +4,6 @@
     "outDir": "lib",
     "rootDir": "src"
   },
-  "include": ["src/*"]
+  "include": ["src/*"],
+  "references": []
 }

+ 2 - 1
buildutils/tsconfig.json

@@ -5,5 +5,6 @@
     "rootDir": "src",
     "module": "commonjs"
   },
-  "include": ["src/*"]
+  "include": ["src/*"],
+  "references": []
 }

+ 0 - 1
packages/celltags-extension/tsconfig.json

@@ -1,7 +1,6 @@
 {
   "compilerOptions": {
     "strict": true,
-
     "outDir": "lib",
     "rootDir": "src"
   },

+ 0 - 1
packages/celltags/tsconfig.json

@@ -1,7 +1,6 @@
 {
   "compilerOptions": {
     "strict": true,
-
     "outDir": "lib",
     "rootDir": "src"
   },

+ 5 - 0
packages/codemirror/style/index.css

@@ -8,3 +8,8 @@
 @import url('~@jupyterlab/apputils/style/index.css');
 @import url('~@jupyterlab/codeeditor/style/index.css');
 @import url('~@jupyterlab/statusbar/style/index.css');
+@import url('~codemirror/lib/codemirror.css');
+@import url('~codemirror/addon/dialog/dialog.css');
+@import url('~codemirror/addon/fold/foldgutter.css');
+
+@import url('./base.css');

+ 2 - 1
packages/coreutils/tsconfig.json

@@ -5,5 +5,6 @@
     "rootDir": "src",
     "module": "commonjs"
   },
-  "include": ["src/*"]
+  "include": ["src/*"],
+  "references": []
 }

+ 2 - 1
packages/nbformat/tsconfig.json

@@ -4,5 +4,6 @@
     "outDir": "lib",
     "rootDir": "src"
   },
-  "include": ["src/*"]
+  "include": ["src/*"],
+  "references": []
 }

+ 2 - 1
packages/observables/tsconfig.json

@@ -4,5 +4,6 @@
     "outDir": "lib",
     "rootDir": "src"
   },
-  "include": ["src/*"]
+  "include": ["src/*"],
+  "references": []
 }

+ 1 - 5
packages/rendermime-interfaces/tsconfig.json

@@ -5,9 +5,5 @@
     "rootDir": "src"
   },
   "include": ["src/*"],
-  "references": [
-    {
-      "path": "../ui-components"
-    }
-  ]
+  "references": []
 }

+ 1 - 4
packages/services/examples/browser/tsconfig.json

@@ -10,10 +10,7 @@
   "include": ["src/**/*"],
   "references": [
     {
-      "path": "../../../outputarea"
-    },
-    {
-      "path": "../../../rendermime"
+      "path": "../../../coreutils"
     },
     {
       "path": "../.."

+ 3 - 0
packages/services/examples/typescript-browser-with-output/tsconfig.json

@@ -9,6 +9,9 @@
   },
   "include": ["src/**/*"],
   "references": [
+    {
+      "path": "../../../coreutils"
+    },
     {
       "path": "../../../outputarea"
     },

+ 2 - 1
packages/statedb/tsconfig.json

@@ -6,5 +6,6 @@
     "module": "commonjs",
     "types": ["node"]
   },
-  "include": ["src/*"]
+  "include": ["src/*"],
+  "references": []
 }