Skip to content

Commit

Permalink
fix(package): export package internals with unsafe path prefix; (#5677)
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalBrainJS authored Apr 25, 2023
1 parent 59eb991 commit df38c94
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
"default": "./index.js"
}
},
"./unsafe/*": "./lib/*",
"./unsafe/core/settle.js": "./lib/core/settle.js",
"./unsafe/core/buildFullPath.js": "./lib/core/buildFullPath.js",
"./unsafe/helpers/isAbsoluteURL.js": "./lib/helpers/isAbsoluteURL.js",
"./unsafe/helpers/buildURL.js": "./lib/helpers/buildURL.js",
"./unsafe/helpers/combineURLs.js": "./lib/helpers/combineURLs.js",
"./unsafe/adapters/http.js": "./lib/adapters/http.js",
"./unsafe/adapters/xhr.js": "./lib/adapters/xhr.js",
"./unsafe/utils.js": "./lib/utils.js",
"./package.json": "./package.json"
},
"type": "module",
Expand All @@ -29,6 +38,7 @@
"test:mocha": "node bin/ssl_hotfix.js mocha test/unit/**/*.js --timeout 30000 --exit",
"test:exports": "node bin/ssl_hotfix.js mocha test/module/test.js --timeout 30000 --exit",
"test:karma": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: karma start karma.conf.cjs --single-run",
"test:karma:firefox": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: Browsers=Firefox karma start karma.conf.cjs --single-run",
"test:karma:server": "node bin/ssl_hotfix.js cross-env karma start karma.conf.cjs",
"test:build:version": "node ./bin/check-build-version.js",
"start": "node ./sandbox/server.js",
Expand Down Expand Up @@ -203,4 +213,4 @@
"@commitlint/config-conventional"
]
}
}
}
3 changes: 3 additions & 0 deletions test/module/esm/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import assert from 'assert';
import axios, {CanceledError, AxiosError, AxiosHeaders} from 'axios';
import settle from 'axios/unsafe/core/settle.js';

assert.strictEqual(typeof axios, 'function');
assert.strictEqual(typeof CanceledError, 'function');
Expand All @@ -10,4 +11,6 @@ assert.strictEqual(axios.CanceledError, CanceledError);
assert.strictEqual(axios.AxiosError, AxiosError);
assert.strictEqual(axios.AxiosHeaders, AxiosHeaders);

assert.strictEqual(typeof settle, 'function');

console.log('ESM importing test passed');

0 comments on commit df38c94

Please sign in to comment.