Skip to content

Commit 7c76239

Browse files
authored
Merge pull request #76 from sparksuite/fix-import-issue-in-published-package
Fix import issue in published package
2 parents 635fb48 + 7722a17 commit 7c76239

File tree

8 files changed

+40
-263
lines changed

8 files changed

+40
-263
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ coverage/
22
dist/
33
node_modules/
44
.DS_Store
5+
yarn-debug.log*
6+
yarn-error.log*

demo/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# testing
99
/coverage
10+
package-*.tgz
1011

1112
# production
1213
/build

demo/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
"@types/react-dom": "^16.9.0",
1313
"prettier": "^1.19.1",
1414
"react": "^16.12.0",
15+
"react-accessible-dropdown-menu-hook": "link:..",
1516
"react-dom": "^16.12.0",
1617
"react-scripts": "3.3.0",
1718
"typescript": "~3.7.2"
1819
},
1920
"scripts": {
20-
"postinstall": "yarn --cwd ../ link && yarn link react-accessible-dropdown-menu-hook",
2121
"start": "react-scripts start",
2222
"build": "react-scripts build",
23+
"pretest": "RANDOM_STRING=$(LC_ALL=C tr -dc 'A-Za-z0-9' </dev/urandom | head -c 32 ; echo) && yarn remove react-accessible-dropdown-menu-hook && yarn --cwd ../ pack --filename package-$RANDOM_STRING.tgz && yarn add file:./package-$RANDOM_STRING.tgz && rm package-$RANDOM_STRING.tgz",
24+
"test": "react-scripts test",
25+
"posttest": "yarn remove react-accessible-dropdown-menu-hook && yarn add link:../",
2326
"lint": "eslint --ext .ts,.js,.tsx . && prettier --check '**/*.{ts,js,tsx,css,html,json}'",
2427
"format": "eslint --fix --ext .ts,.js,.tsx . && prettier --write '**/*.{ts,js,tsx,css,html,json}'"
2528
},

demo/src/app.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Imports
2+
import React from 'react';
3+
import ReactDOM from 'react-dom';
4+
import App from './app';
5+
6+
// Tests
7+
it('renders', () => {
8+
const div = document.createElement('div');
9+
ReactDOM.render(<App />, div);
10+
});

demo/yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8252,6 +8252,10 @@ raw-body@2.4.0:
82528252
iconv-lite "0.4.24"
82538253
unpipe "1.0.0"
82548254

8255+
"react-accessible-dropdown-menu-hook@link:..":
8256+
version "0.0.0"
8257+
uid ""
8258+
82558259
react-app-polyfill@^1.0.5:
82568260
version "1.0.5"
82578261
resolved "https://registry.yarnpkg.com/react-app-polyfill/-/react-app-polyfill-1.0.5.tgz#59c7377a0b9ed25692eeaca7ad9b12ef2d064709"

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "react-accessible-dropdown-menu-hook",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A simple Hook for creating fully accessible dropdown menus in React",
55
"main": "dist/use-dropdown-menu.js",
66
"types": "dist/use-dropdown-menu.d.ts",
77
"files": [
88
"dist/"
99
],
1010
"scripts": {
11-
"dev": "yarn install --frozen-lockfile && yarn --cwd ./demo install --frozen-lockfile && yarn --cwd ./demo/node_modules/react link && yarn link react",
12-
"test": "yarn compile && yarn --cwd ./demo build && jest",
11+
"dev": "yarn --cwd ./demo install --frozen-lockfile && yarn install --frozen-lockfile",
12+
"test": "yarn compile && yarn --cwd ./demo build && yarn --cwd ./demo test --watchAll=false && jest",
1313
"lint": "eslint --ext .ts,.js,.tsx . && prettier --check '**/*.{ts,js,tsx,json}'",
1414
"format": "eslint --fix --ext .ts,.js,.tsx . && prettier --write '**/*.{ts,js,tsx,json}'",
1515
"clean": "rm -rf coverage/ dist/ node_modules/ demo/node_modules/",
@@ -65,6 +65,7 @@
6565
"jest-puppeteer": "^4.3.0",
6666
"prettier": "^1.19.1",
6767
"puppeteer": "^2.0.0",
68+
"react": "link:./demo/node_modules/react",
6869
"react-dom": "^16.12.0",
6970
"react-test-renderer": "^16.12.0",
7071
"typescript": "^3.7.3"

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"sourceMap": true,
1212
"strict": true,
1313
"strictNullChecks": true,
14-
"target": "es6"
14+
"target": "es5"
1515
},
1616
"include": ["src/**/*"]
1717
}

0 commit comments

Comments
 (0)