Skip to content

Commit

Permalink
feat: support ESM artifacts in all packages (#752)
Browse files Browse the repository at this point in the history
Add ESM artifacts to all packages,
so that all packages support CommonJS and ESM
  • Loading branch information
AllanZhengYP authored Oct 12, 2023
1 parent 77bc5fb commit e930ffb
Show file tree
Hide file tree
Showing 45 changed files with 172 additions and 187 deletions.
7 changes: 4 additions & 3 deletions packages/crc32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"name": "@aws-crypto/crc32",
"version": "5.1.0",
"scripts": {
"prepublishOnly": "tsc",
"prepublishOnly": "tsc -p tsconfig.json && tsc -p tsconfig.module.json",
"pretest": "tsc -p tsconfig.test.json",
"test": "mocha --require ts-node/register test/**/*test.ts"
},
"main": "./build/index.js",
"types": "./build/index.d.ts",
"main": "./build/main/index.js",
"module": "./build/module/index.js",
"types": "./build/main/index.d.ts",
"repository": {
"type": "git",
"url": "[email protected]:aws/aws-sdk-js-crypto-helpers.git"
Expand Down
18 changes: 2 additions & 16 deletions packages/crc32/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": true,
"strict": true,
"sourceMap": true,
"downlevelIteration": true,
"importHelpers": true,
"noEmitHelpers": true,
"lib": [
"es5",
"es2015.promise",
"es2015.collection",
"es2015.iterable",
"es2015.symbol.wellknown"
],
"rootDir": "./src",
"outDir": "./build"
"outDir": "./build/main",
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"]
Expand Down
7 changes: 7 additions & 0 deletions packages/crc32/tsconfig.module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"outDir": "build/module",
"module": "esnext",
}
}
3 changes: 1 addition & 2 deletions packages/crc32/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"sourceMap": false,
"inlineSourceMap": true,
"inlineSources": true,
"rootDir": "./src",
"outDir": "./build"

}
}
7 changes: 4 additions & 3 deletions packages/crc32c/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"name": "@aws-crypto/crc32c",
"version": "5.1.0",
"scripts": {
"prepublishOnly": "tsc",
"prepublishOnly": "tsc -p tsconfig.json && tsc -p tsconfig.module.json",
"pretest": "tsc -p tsconfig.test.json",
"test": "mocha --require ts-node/register test/**/*test.ts"
},
"main": "./build/index.js",
"types": "./build/index.d.ts",
"main": "./build/main/index.js",
"module": "./build/module/index.js",
"types": "./build/main/index.d.ts",
"repository": {
"type": "git",
"url": "[email protected]:aws/aws-sdk-js-crypto-helpers.git"
Expand Down
18 changes: 2 additions & 16 deletions packages/crc32c/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": true,
"strict": true,
"sourceMap": true,
"downlevelIteration": true,
"importHelpers": true,
"noEmitHelpers": true,
"lib": [
"es5",
"es2015.promise",
"es2015.collection",
"es2015.iterable",
"es2015.symbol.wellknown"
],
"rootDir": "./src",
"outDir": "./build"
"outDir": "./build/main",
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"]
Expand Down
7 changes: 7 additions & 0 deletions packages/crc32c/tsconfig.module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"outDir": "build/module",
"module": "esnext",
}
}
3 changes: 1 addition & 2 deletions packages/crc32c/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"sourceMap": false,
"inlineSourceMap": true,
"inlineSources": true,
"rootDir": "./src",
"outDir": "./build"

}
}
7 changes: 4 additions & 3 deletions packages/random-source-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@aws-crypto/random-source-browser",
"version": "5.1.0",
"scripts": {
"prepublishOnly": "tsc",
"prepublishOnly": "tsc -p tsconfig.json && tsc -p tsconfig.module.json",
"pretest": "tsc -p tsconfig.test.json",
"test": "mocha --require ts-node/register test/**/*test.ts"
},
Expand All @@ -22,6 +22,7 @@
"@aws-sdk/util-locate-window": "^3.0.0",
"tslib": "^2.6.2"
},
"main": "./build/index.js",
"types": "./build/index.d.ts"
"main": "./build/main/index.js",
"module": "./build/module/index.js",
"types": "./build/main/index.d.ts"
}
12 changes: 3 additions & 9 deletions packages/random-source-browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"lib": ["dom", "es5", "es2015.promise", "es2015.collection"],
"declaration": true,
"sourceMap": true,
"strict": true,
"rootDir": "./src",
"outDir": "./build",
"importHelpers": true,
"noEmitHelpers": true
"outDir": "./build/main",
"lib": ["dom"],
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"]
Expand Down
7 changes: 7 additions & 0 deletions packages/random-source-browser/tsconfig.module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"outDir": "build/module",
"module": "esnext",
}
}
3 changes: 0 additions & 3 deletions packages/random-source-browser/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@
"sourceMap": false,
"inlineSourceMap": true,
"inlineSources": true,
"rootDir": "./src",
"outDir": "./build",
"types": ["node"]
}
}
6 changes: 4 additions & 2 deletions packages/random-source-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
"name": "@aws-crypto/random-source-node",
"version": "5.1.0",
"description": "A Node.JS implementation of the AWS SDK for JavaScript's `randomValues` interface",
"main": "./build/index.js",
"main": "./build/main/index.js",
"module": "./build/module/index.js",
"types": "./build/main/index.d.ts",
"scripts": {
"prepublishOnly": "tsc -p tsconfig.json && tsc -p tsconfig.module.json",
"pretest": "tsc -p tsconfig.test.json",
"test": "mocha --require ts-node/register test/**/*test.ts"
},
Expand All @@ -22,7 +25,6 @@
"@aws-sdk/types": "^3.222.0",
"tslib": "^2.6.2"
},
"types": "./build/index.d.ts",
"engines": {
"node": ">=16.0.0"
}
Expand Down
11 changes: 2 additions & 9 deletions packages/random-source-node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"lib": ["es5", "es2015.promise", "es2015.collection"],
"declaration": true,
"sourceMap": true,
"strict": true,
"rootDir": "./src",
"outDir": "./build",
"importHelpers": true,
"noEmitHelpers": true
"outDir": "./build/main",
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"]
Expand Down
7 changes: 7 additions & 0 deletions packages/random-source-node/tsconfig.module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"outDir": "build/module",
"module": "esnext",
}
}
3 changes: 1 addition & 2 deletions packages/random-source-node/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"sourceMap": false,
"inlineSourceMap": true,
"inlineSources": true,
"rootDir": "./src",
"outDir": "./build"

}
}
7 changes: 4 additions & 3 deletions packages/random-source-universal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@aws-crypto/random-source-universal",
"version": "5.1.0",
"scripts": {
"prepublishOnly": "tsc",
"prepublishOnly": "tsc -p tsconfig.json && tsc -p tsconfig.module.json",
"pretest": "tsc -p tsconfig.test.json",
"test": "mocha --require ts-node/register test/**/*test.ts"
},
Expand All @@ -26,8 +26,9 @@
"browser": {
"@aws/crypto-random-source-node": false
},
"main": "./build/index.js",
"types": "./build/index.d.ts",
"main": "./build/main/index.js",
"module": "./build/module/index.js",
"types": "./build/main/index.d.ts",
"engines": {
"node": ">=16.0.0"
}
Expand Down
12 changes: 3 additions & 9 deletions packages/random-source-universal/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"lib": ["dom", "es5", "es2015.promise", "es2015.collection"],
"declaration": true,
"sourceMap": true,
"strict": true,
"rootDir": "./src",
"outDir": "./build",
"importHelpers": true,
"noEmitHelpers": true
"outDir": "./build/main",
"lib": ["dom"],
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"]
Expand Down
7 changes: 7 additions & 0 deletions packages/random-source-universal/tsconfig.module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"outDir": "build/module",
"module": "esnext",
}
}
3 changes: 1 addition & 2 deletions packages/random-source-universal/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"sourceMap": false,
"inlineSourceMap": true,
"inlineSources": true,
"rootDir": "./src",
"outDir": "./build"

}
}
7 changes: 4 additions & 3 deletions packages/sha1-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@aws-crypto/sha1-browser",
"version": "5.1.0",
"scripts": {
"prepublishOnly": "tsc",
"prepublishOnly": "tsc -p tsconfig.json && tsc -p tsconfig.module.json",
"pretest": "tsc -p tsconfig.test.json",
"test": "mocha --require ts-node/register test/**/*test.ts"
},
Expand All @@ -25,8 +25,9 @@
"@smithy/util-utf8": "^2.0.0",
"tslib": "^2.6.2"
},
"main": "./build/index.js",
"types": "./build/index.d.ts",
"main": "./build/main/index.js",
"module": "./build/module/index.js",
"types": "./build/main/index.d.ts",
"publishConfig": {
"access": "public"
}
Expand Down
18 changes: 3 additions & 15 deletions packages/sha1-browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"lib": [
"dom",
"es5",
"es2015.promise",
"es2015.collection",
"es2015.iterable"
],
"declaration": true,
"sourceMap": true,
"strict": true,
"rootDir": "./src",
"outDir": "./build",
"importHelpers": true,
"noEmitHelpers": true
"outDir": "./build/main",
"lib": ["dom"],
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"]
Expand Down
7 changes: 7 additions & 0 deletions packages/sha1-browser/tsconfig.module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"outDir": "build/module",
"module": "esnext",
}
}
3 changes: 1 addition & 2 deletions packages/sha1-browser/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"sourceMap": false,
"inlineSourceMap": true,
"inlineSources": true,
"rootDir": "./src",
"outDir": "./build"

}
}
7 changes: 4 additions & 3 deletions packages/sha256-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@aws-crypto/sha256-browser",
"version": "5.1.0",
"scripts": {
"prepublishOnly": "tsc",
"prepublishOnly": "tsc -p tsconfig.json && tsc -p tsconfig.module.json",
"pretest": "tsc -p tsconfig.test.json",
"test": "mocha --require ts-node/register test/**/*test.ts"
},
Expand All @@ -26,6 +26,7 @@
"@smithy/util-utf8": "^2.0.0",
"tslib": "^2.6.2"
},
"main": "./build/index.js",
"types": "./build/index.d.ts"
"main": "./build/main/index.js",
"module": "./build/module/index.js",
"types": "./build/main/index.d.ts"
}
18 changes: 3 additions & 15 deletions packages/sha256-browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"lib": [
"dom",
"es5",
"es2015.promise",
"es2015.collection",
"es2015.iterable"
],
"declaration": true,
"sourceMap": true,
"strict": true,
"rootDir": "./src",
"outDir": "./build",
"importHelpers": true,
"noEmitHelpers": true
"outDir": "./build/main",
"lib": ["dom"],
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"]
Expand Down
Loading

0 comments on commit e930ffb

Please sign in to comment.