Skip to content

Commit

Permalink
fix: update cjs_module creation to include typings field
Browse files Browse the repository at this point in the history
Also update the create_cjs_modules script to not emit absolute file paths.
  • Loading branch information
darthtrevino committed Aug 6, 2019
1 parent 698ac4c commit 8ebdc2c
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 60 deletions.
11 changes: 6 additions & 5 deletions packages/alternative_builds/cjs/dnd-core/package.json
@@ -1,10 +1,10 @@
{
"name": "dnd-core-cjs",
"version": "9.3.5",
"debug_force": "1",
"version": "9.3.4",
"license": "MIT",
"description": "Drag and drop sans the GUI",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"clean": "../../../../scripts/clean_package.sh"
Expand All @@ -17,6 +17,7 @@
"redux": "^4.0.1"
},
"devDependencies": {
"dnd-core": "^9.3.4"
}
}
"dnd-core": "9.3.4"
},
"peerDependencies": {}
}
4 changes: 2 additions & 2 deletions packages/alternative_builds/cjs/dnd-core/tsconfig.json
Expand Up @@ -5,7 +5,7 @@
"module": "commonjs",
"outDir": "lib",
"esModuleInterop": true,
"baseUrl": "/Users/christrevino/Workspace/oss/react-dnd/packages/core/dnd-core/",
"baseUrl": "../../../dnd-core/",
"emitDeclarationOnly": false,
"paths": {
"dnd-core": [
Expand All @@ -26,6 +26,6 @@
}
},
"files": [
"/Users/christrevino/Workspace/oss/react-dnd/packages/core/dnd-core/src/index.ts"
"../../../core/dnd-core/src/index.ts"
]
}
15 changes: 8 additions & 7 deletions packages/alternative_builds/cjs/html5-backend/package.json
@@ -1,22 +1,23 @@
{
"name": "react-dnd-html5-backend-cjs",
"version": "9.3.5",
"debug_force": "1",
"version": "9.3.4",
"license": "MIT",
"description": "HTML5 backend for React DnD",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"clean": "../../../../scripts/clean_package.sh"
},
"dependencies": {
"dnd-core-cjs": "^9.3.5"
"dnd-core-cjs": "^9.3.4"
},
"devDependencies": {
"@types/react": "^16.8.23",
"react": "^16.8.6",
"react-dnd-html5-backend": "^9.3.4",
"react-dnd-test-backend": "^9.3.4",
"react-dom": "^16.8.6"
}
}
"react-dom": "^16.8.6",
"react-dnd-html5-backend": "9.3.4"
},
"peerDependencies": {}
}
4 changes: 2 additions & 2 deletions packages/alternative_builds/cjs/html5-backend/tsconfig.json
Expand Up @@ -5,7 +5,7 @@
"module": "commonjs",
"outDir": "lib",
"esModuleInterop": true,
"baseUrl": "/Users/christrevino/Workspace/oss/react-dnd/packages/core/html5-backend/",
"baseUrl": "../../../html5-backend/",
"emitDeclarationOnly": false,
"paths": {
"dnd-core": [
Expand All @@ -26,6 +26,6 @@
}
},
"files": [
"/Users/christrevino/Workspace/oss/react-dnd/packages/core/html5-backend/src/index.ts"
"../../../core/html5-backend/src/index.ts"
]
}
14 changes: 7 additions & 7 deletions packages/alternative_builds/cjs/react-dnd/package.json
@@ -1,30 +1,30 @@
{
"name": "react-dnd-cjs",
"version": "9.3.5",
"debug_force": "1",
"version": "9.3.4",
"license": "MIT",
"description": "Drag and Drop for React",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"clean": "../../../../scripts/clean_package.sh"
},
"dependencies": {
"@types/hoist-non-react-statics": "^3.3.1",
"@types/shallowequal": "^1.1.1",
"dnd-core-cjs": "^9.3.5",
"hoist-non-react-statics": "^3.3.0",
"shallowequal": "^1.1.0"
"shallowequal": "^1.1.0",
"dnd-core-cjs": "^9.3.4"
},
"devDependencies": {
"@types/react": "^16.8.23",
"@types/react-dom": "^16.8.4",
"react": "^16.8.6",
"react-dnd": "^9.3.4",
"react-dom": "^16.8.6"
"react-dom": "^16.8.6",
"react-dnd": "9.3.4"
},
"peerDependencies": {
"react": ">= 16.8",
"react-dom": ">= 16.8"
}
}
}
4 changes: 2 additions & 2 deletions packages/alternative_builds/cjs/react-dnd/tsconfig.json
Expand Up @@ -5,7 +5,7 @@
"module": "commonjs",
"outDir": "lib",
"esModuleInterop": true,
"baseUrl": "/Users/christrevino/Workspace/oss/react-dnd/packages/core/react-dnd/",
"baseUrl": "../../../react-dnd/",
"emitDeclarationOnly": false,
"paths": {
"dnd-core": [
Expand All @@ -26,6 +26,6 @@
}
},
"files": [
"/Users/christrevino/Workspace/oss/react-dnd/packages/core/react-dnd/src/index.ts"
"../../../core/react-dnd/src/index.ts"
]
}
13 changes: 7 additions & 6 deletions packages/alternative_builds/cjs/test-backend/package.json
@@ -1,18 +1,19 @@
{
"name": "react-dnd-test-backend-cjs",
"version": "9.3.5",
"debug_force": "1",
"version": "9.3.4",
"license": "MIT",
"description": "A mock backend for testing React DnD apps",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"clean": "../../../../scripts/clean_package.sh"
},
"dependencies": {
"dnd-core-cjs": "^9.3.5"
"dnd-core-cjs": "^9.3.4"
},
"devDependencies": {
"react-dnd-test-backend": "^9.3.4"
}
}
"react-dnd-test-backend": "9.3.4"
},
"peerDependencies": {}
}
4 changes: 2 additions & 2 deletions packages/alternative_builds/cjs/test-backend/tsconfig.json
Expand Up @@ -5,7 +5,7 @@
"module": "commonjs",
"outDir": "lib",
"esModuleInterop": true,
"baseUrl": "/Users/christrevino/Workspace/oss/react-dnd/packages/testing/test-backend/",
"baseUrl": "../../../test-backend/",
"emitDeclarationOnly": false,
"paths": {
"dnd-core": [
Expand All @@ -26,6 +26,6 @@
}
},
"files": [
"/Users/christrevino/Workspace/oss/react-dnd/packages/testing/test-backend/src/index.ts"
"../../../testing/test-backend/src/index.ts"
]
}
15 changes: 8 additions & 7 deletions packages/alternative_builds/cjs/test-utils/package.json
@@ -1,24 +1,25 @@
{
"name": "react-dnd-test-utils-cjs",
"version": "9.3.5",
"debug_force": "1",
"version": "9.3.4",
"license": "MIT",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"clean": "../../../../scripts/clean_package.sh"
},
"dependencies": {},
"devDependencies": {
"react": "^16.8.6",
"react-dnd": "^9.3.4",
"react-dnd-test-backend": "^9.3.4",
"react-dnd-test-utils": "^9.3.4",
"react-dom": "^16.8.6"
"react-dom": "^16.8.6",
"react-dnd-test-utils": "9.3.4"
},
"peerDependencies": {
"react": ">= 16.8.5",
"react-dom": ">= 16.8.5",
"react-dnd-cjs": "^7.3.2",
"react-dnd-test-backend-cjs": "^7.2.0",
"react-dom": ">= 16.8.5"
"react-dnd-test-backend-cjs": "^7.2.0"
}
}
}
4 changes: 2 additions & 2 deletions packages/alternative_builds/cjs/test-utils/tsconfig.json
Expand Up @@ -5,7 +5,7 @@
"module": "commonjs",
"outDir": "lib",
"esModuleInterop": true,
"baseUrl": "/Users/christrevino/Workspace/oss/react-dnd/packages/testing/test-utils/",
"baseUrl": "../../../test-utils/",
"emitDeclarationOnly": false,
"paths": {
"dnd-core": [
Expand All @@ -26,6 +26,6 @@
}
},
"files": [
"/Users/christrevino/Workspace/oss/react-dnd/packages/testing/test-utils/src/index.ts"
"../../../testing/test-utils/src/index.ts"
]
}
15 changes: 8 additions & 7 deletions packages/alternative_builds/cjs/touch-backend/package.json
@@ -1,20 +1,21 @@
{
"name": "react-dnd-touch-backend-cjs",
"version": "9.3.5",
"debug_force": "1",
"version": "9.3.4",
"license": "MIT",
"description": "Touch backend for react-dnd",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"build": "tsc",
"clean": "../../../../scripts/clean_package.sh"
},
"dependencies": {
"@types/invariant": "^2.2.30",
"dnd-core-cjs": "^9.3.5",
"invariant": "^2.2.4"
"invariant": "^2.2.4",
"dnd-core-cjs": "^9.3.4"
},
"devDependencies": {
"react-dnd-touch-backend": "^9.3.4"
}
}
"react-dnd-touch-backend": "9.3.4"
},
"peerDependencies": {}
}
4 changes: 2 additions & 2 deletions packages/alternative_builds/cjs/touch-backend/tsconfig.json
Expand Up @@ -5,7 +5,7 @@
"module": "commonjs",
"outDir": "lib",
"esModuleInterop": true,
"baseUrl": "/Users/christrevino/Workspace/oss/react-dnd/packages/core/touch-backend/",
"baseUrl": "../../../touch-backend/",
"emitDeclarationOnly": false,
"paths": {
"dnd-core": [
Expand All @@ -26,6 +26,6 @@
}
},
"files": [
"/Users/christrevino/Workspace/oss/react-dnd/packages/core/touch-backend/src/index.ts"
"../../../core/touch-backend/src/index.ts"
]
}
16 changes: 7 additions & 9 deletions scripts/create_cjs_modules.js
Expand Up @@ -21,12 +21,10 @@ function deleteFolderRecursive(filePath) {

const cjsRoot = path.join(__dirname, '../packages/alternative_builds/cjs')

const coreRoots = [
path.join(__dirname, '../packages/core'),
path.join(__dirname, '../packages/testing'),
]
const coreRoots = ['core', 'testing']
coreRoots.forEach(coreRoot => {
const corePackages = fs.readdirSync(coreRoot)
const absCoreRoot = path.join(__dirname, '../packages/', coreRoot)
const corePackages = fs.readdirSync(absCoreRoot)
corePackages.forEach(corePackage => {
const cjsPackageRoot = path.join(cjsRoot, corePackage)
if (fs.existsSync(cjsPackageRoot)) {
Expand All @@ -44,7 +42,7 @@ coreRoots.forEach(coreRoot => {
description,
devDependencies = {},
peerDependencies = {},
} = require(`${coreRoot}/${corePackage}/package.json`)
} = require(`${absCoreRoot}/${corePackage}/package.json`)

esmLibs.forEach(lib => {
if (dependencies[lib]) {
Expand All @@ -63,7 +61,7 @@ coreRoots.forEach(coreRoot => {
license,
description,
main: 'lib/index.js',
typings,
typings: 'lib/index.d.ts',
scripts: {
build: 'tsc',
clean: '../../../../scripts/clean_package.sh',
Expand All @@ -90,7 +88,7 @@ coreRoots.forEach(coreRoot => {
module: 'commonjs',
outDir: 'lib',
esModuleInterop: true,
baseUrl: `${coreRoot}/${corePackage}/`,
baseUrl: `../../../${corePackage}/`,
emitDeclarationOnly: false,
paths: {
'dnd-core': ['../../core/dnd-core/lib/index.d.ts'],
Expand All @@ -104,7 +102,7 @@ coreRoots.forEach(coreRoot => {
'react-dnd-test-utils': ['../../testing/test-utils/lib/index.d.ts'],
},
},
files: [`${coreRoot}/${corePackage}/src/index.ts`],
files: [`../../../${coreRoot}/${corePackage}/src/index.ts`],
}

console.log(`write ${name} tsconfig.json`)
Expand Down

0 comments on commit 8ebdc2c

Please sign in to comment.