Browse Source

@joystream/types: build in root folder to avoid need for /lib/ in import path

Mokhtar Naamani 4 years ago
parent
commit
40e490536f
4 changed files with 22 additions and 14 deletions
  1. 4 1
      types/.gitignore
  2. 2 0
      types/.npmignore
  3. 5 7
      types/package.json
  4. 11 6
      types/tsconfig.json

+ 4 - 1
types/.gitignore

@@ -1 +1,4 @@
-/lib/
+# Don't track build artifacts
+**/*.js
+**/*.d.ts
+hiring/schemas

+ 2 - 0
types/.npmignore

@@ -0,0 +1,2 @@
+# No need to include src in published package
+src/

+ 5 - 7
types/package.json

@@ -2,7 +2,8 @@
   "name": "@joystream/types",
   "version": "0.11.0",
   "description": "Types for Joystream Substrate Runtime - nicaea release",
-  "main": "lib/index.js",
+  "main": "index.js",
+  "types": "index.d.ts",
   "scripts": {
     "prepublish": "npm run build",
     "build": "tsc --build tsconfig.json"
@@ -15,9 +16,6 @@
     "ajv": "^6.11.0",
     "lodash": "^4.17.15"
   },
-  "directories": {
-    "lib": "lib"
-  },
   "devDependencies": {
     "typescript": "^3.6.4"
   },
@@ -30,7 +28,7 @@
   },
   "repository": {
     "type": "git",
-    "url": "git+https://github.com/Joystream/apps.git"
+    "url": "git+https://github.com/Joystream/joystream.git"
   },
   "keywords": [
     "substrate",
@@ -39,7 +37,7 @@
   ],
   "license": "Apache-2.0",
   "bugs": {
-    "url": "https://github.com/Joystream/apps/issues"
+    "url": "https://github.com/Joystream/joystream/issues"
   },
-  "homepage": "https://github.com/Joystream/packages/joy-types/README.md"
+  "homepage": "https://github.com/Joystream/joystream"
 }

+ 11 - 6
types/tsconfig.json

@@ -11,14 +11,19 @@
     "esModuleInterop": true,                  /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
     "experimentalDecorators": true,           /* Enables experimental support for ES7 decorators. */
     "declaration": true,
-    "outDir": "lib",
-	"resolveJsonModule": true,
-	"types" : [
-		"node"
-	]
-
+    "outDir": "./",
+    "resolveJsonModule": true,
+    "types" : [
+      "node"
+    ],
+    "forceConsistentCasingInFileNames": true
   },
   "include": [
     "src/**/*.ts"
   ],
+  "exclude": [
+    "node_modules",
+    "**/*.spec.ts",
+    "**/*.d.ts"
+  ]
 }