diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c4092a..46cf3be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,8 +3,7 @@ name: build on: push: branches: [ $default-branch ] - pull_request: - branches: [ $default-branch ] + pull_request: {} jobs: build: @@ -40,6 +39,7 @@ jobs: - uses: actions/checkout@v2 - uses: gerred/actions/current-time@master - run: npm ci + - run: npm run build - name: Install dependencies and verify Cypress uses: cypress-io/github-action@v2 with: diff --git a/lib/file/getFileMimeType.js b/lib/file/getFileMimeType.js index 444a0cd..e322a1b 100644 --- a/lib/file/getFileMimeType.js +++ b/lib/file/getFileMimeType.js @@ -1,4 +1,6 @@ import { extname } from 'path'; + +// eslint-disable-next-line import/no-extraneous-dependencies import { getType } from 'mime'; export default function getFileMimeType(filePath) { diff --git a/package-lock.json b/package-lock.json index 2dcebad..e5c7658 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4359,7 +4359,8 @@ "mime": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.0.tgz", - "integrity": "sha512-ft3WayFSFUVBuJj7BMLKAQcSlItKtfjsKDDsii3rqFDAZ7t11zRe8ASw/GlmivGwVUYtwkQrxiGGpL6gFvB0ag==" + "integrity": "sha512-ft3WayFSFUVBuJj7BMLKAQcSlItKtfjsKDDsii3rqFDAZ7t11zRe8ASw/GlmivGwVUYtwkQrxiGGpL6gFvB0ag==", + "dev": true }, "mimic-fn": { "version": "2.1.0", diff --git a/package.json b/package.json index 13bb4b7..30a122c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "node": ">=8.2.1" }, "scripts": { - "build": "microbundle build -i src/index.js -f cjs --no-generate-types", + "build": "microbundle build -i src/index.js -f cjs --target node --strict --no-compress --no-generate-types", "lint": "eslint . --ext=js", "test": "echo \"Error: no test specified\" && exit 0" }, @@ -43,12 +43,11 @@ "husky": "^4.3.8", "lint-staged": "^10.5.3", "microbundle": "^0.13.0", + "mime": "^2.5.0", "prettier": "^2.2.1" }, "peerDependencies": { "cypress": ">3.0.0" }, - "dependencies": { - "mime": "^2.5.0" - } + "dependencies": {} } diff --git a/recipes/angularjs-ng-file-upload/cypress/support/commands.js b/recipes/angularjs-ng-file-upload/cypress/support/commands.js index f04cdd3..61c14c9 100644 --- a/recipes/angularjs-ng-file-upload/cypress/support/commands.js +++ b/recipes/angularjs-ng-file-upload/cypress/support/commands.js @@ -24,7 +24,7 @@ // -- This is will overwrite an existing command -- // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) -import '../../../../src/index'; +import '../../../../dist/bundle'; // In your app, use: // import 'cypress-file-upload'; diff --git a/recipes/react-dropzone/cypress/support/commands.js b/recipes/react-dropzone/cypress/support/commands.js index f04cdd3..61c14c9 100644 --- a/recipes/react-dropzone/cypress/support/commands.js +++ b/recipes/react-dropzone/cypress/support/commands.js @@ -24,7 +24,7 @@ // -- This is will overwrite an existing command -- // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) -import '../../../../src/index'; +import '../../../../dist/bundle'; // In your app, use: // import 'cypress-file-upload'; diff --git a/recipes/react-html5-input/cypress/support/commands.js b/recipes/react-html5-input/cypress/support/commands.js index f04cdd3..61c14c9 100644 --- a/recipes/react-html5-input/cypress/support/commands.js +++ b/recipes/react-html5-input/cypress/support/commands.js @@ -24,7 +24,7 @@ // -- This is will overwrite an existing command -- // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) -import '../../../../src/index'; +import '../../../../dist/bundle'; // In your app, use: // import 'cypress-file-upload'; diff --git a/recipes/shadow-dom-native/cypress/support/commands.js b/recipes/shadow-dom-native/cypress/support/commands.js index 68918f0..c343e2e 100644 --- a/recipes/shadow-dom-native/cypress/support/commands.js +++ b/recipes/shadow-dom-native/cypress/support/commands.js @@ -26,7 +26,7 @@ import 'cypress-shadow-dom'; -import '../../../../src/index'; +import '../../../../dist/bundle'; // In your app, use: // import 'cypress-file-upload';