-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(external): add new package for external dependencies #5923
Draft
kuhe
wants to merge
1
commit into
aws:main
Choose a base branch
from
kuhe:chore/external
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# @aws-sdk/external | ||
|
||
This is an _internal_ package used by other `@aws-sdk/...` packages. | ||
|
||
It acts as a centralized importer and re-exporter for external packages. | ||
It applies build transforms on those packages as needed on a case-by-case basis. | ||
|
||
You should _not_ use this package directly in your application code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "../../api-extractor.packages.json", | ||
"mainEntryPointFilePath": "./dist-types/index.d.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const base = require("../../jest.config.base.js"); | ||
|
||
module.exports = { | ||
...base, | ||
testPathIgnorePatterns: ["/node_modules/"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"name": "@aws-sdk/external", | ||
"version": "3.0.0", | ||
"description": "Centralized provider and transformer for external packages", | ||
"scripts": { | ||
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'", | ||
"build:cjs": "node ./scripts/esbuild.js", | ||
"build:es": "yarn tsc -p tsconfig.es.json", | ||
"build:types": "yarn tsc -p tsconfig.types.json", | ||
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", | ||
"stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz", | ||
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0", | ||
"lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"", | ||
"format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"", | ||
"extract:docs": "api-extractor run --local", | ||
"test": "yarn jest --passWithNoTests" | ||
}, | ||
"main": "./dist-cjs/index.js", | ||
"module": "./dist-es/index.js", | ||
"types": "./dist-types/index.d.ts", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
"./fast-xml-parser": { | ||
"types": "./dist-types/packages/fast-xml-parser/index.d.ts", | ||
"require": "./dist-cjs/packages/fast-xml-parser/index.js", | ||
"node": "./dist-cjs/packages/fast-xml-parser/index.js", | ||
"default": "./dist-es/packages/fast-xml-parser/index.js" | ||
} | ||
}, | ||
"sideEffects": false, | ||
"author": { | ||
"name": "AWS SDK for JavaScript Team", | ||
"url": "https://aws.amazon.com/javascript/" | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"fast-xml-parser": "4.2.5", | ||
"tslib": "^2.6.2" | ||
}, | ||
"devDependencies": { | ||
"@tsconfig/recommended": "1.0.1", | ||
"concurrently": "7.0.0", | ||
"downlevel-dts": "0.10.1", | ||
"rimraf": "3.0.2", | ||
"typescript": "~4.9.5" | ||
}, | ||
"engines": { | ||
"node": ">=14.0.0" | ||
}, | ||
"typesVersions": { | ||
"<4.0": { | ||
"dist-types/*": [ | ||
"dist-types/ts3.4/*" | ||
] | ||
} | ||
}, | ||
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/master/packages/external", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/aws/aws-sdk-js-v3.git", | ||
"directory": "packages/external" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const esbuild = require("esbuild"); | ||
|
||
(async () => { | ||
const packages = fs.readdirSync(path.join(__dirname, "..", "src", "packages")); | ||
|
||
for (const pkg of packages) { | ||
await esbuild.build({ | ||
platform: "node", | ||
target: ["node14"], | ||
bundle: true, | ||
format: "cjs", | ||
mainFields: ["module", "main"], | ||
allowOverwrite: true, | ||
entryPoints: [path.join(__dirname, "..", "src", "packages", pkg, "index.ts")], | ||
supported: { | ||
"dynamic-import": false, | ||
}, | ||
outfile: path.join(__dirname, "..", "dist-cjs", "packages", pkg, "index.js"), | ||
keepNames: true, | ||
external: [], | ||
}); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export {}; | ||
|
||
throw new Error( | ||
"Index export of @aws-sdk/external is not available. See https://github.com/aws/aws-sdk-js-v3/tree/main/packages/external for usage." | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { XMLParser } from "fast-xml-parser"; | ||
|
||
export { XMLParser }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist-cjs", | ||
"baseUrl": "." | ||
}, | ||
"extends": "../../tsconfig.cjs.json", | ||
"include": ["src/"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist-es", | ||
"baseUrl": "." | ||
}, | ||
"extends": "../../tsconfig.es.json", | ||
"include": ["src/"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"declarationDir": "dist-types", | ||
"rootDir": "src" | ||
}, | ||
"extends": "../../tsconfig.types.json", | ||
"include": ["src/"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ const node_libraries = [ | |
"http", | ||
"http2", | ||
"https", | ||
"net", | ||
"os", | ||
"path", | ||
"path/posix", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not yet signal dropping Node.js 14, which is scheduled in #5416.
This is needed for the TypeScript compiler to understand the
exports
block of the@aws-sdk/external
package. In Node.js this was added in v12 already.I will test to confirm this behavior.