Skip to content

Commit

Permalink
Updated attribution files for ort-vv0.3.2 (#1196)
Browse files Browse the repository at this point in the history
* Updated attribution files

* Updated attribution files

---------

Co-authored-by: ort-bot <[email protected]>
  • Loading branch information
avifenesh and ort-bot committed Apr 1, 2024
1 parent 56276b8 commit 0d72713
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 47 deletions.
27 changes: 8 additions & 19 deletions node/npm/glide/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@ import { arch, platform } from "process";

let globalObject = global as unknown;

async function loadNativeBinding() {
function loadNativeBinding() {
let nativeBinding = null;
switch (platform) {
case "linux":
switch (arch) {
case "x64":
nativeBinding = await require(
"@scope/glide-for-redis-linux-x64"
);
nativeBinding = require("@scope/glide-for-redis-linux-x64");
break;
case "arm64":
nativeBinding = await require(
"@scope/glide-for-redis-linux-arm64"
);
nativeBinding = require("@scope/glide-for-redis-linux-arm64");
break;
default:
throw new Error(
Expand All @@ -32,14 +28,10 @@ async function loadNativeBinding() {
case "darwin":
switch (arch) {
case "x64":
nativeBinding = await require(
"@scope/glide-for-redis-darwin-x64"
);
nativeBinding = require("@scope/glide-for-redis-darwin-x64");
break;
case "arm64":
nativeBinding = await require(
"@scope/glide-for-redis-darwin-arm64"
);
nativeBinding = require("@scope/glide-for-redis-darwin-arm64");
break;
default:
throw new Error(
Expand All @@ -58,8 +50,8 @@ async function loadNativeBinding() {
return nativeBinding;
}

async function initialize() {
const nativeBinding = await loadNativeBinding();
function initialize() {
const nativeBinding = loadNativeBinding();
const {
RedisClient,
RedisClusterClient,
Expand Down Expand Up @@ -93,9 +85,6 @@ async function initialize() {
globalObject = Object.assign(global, nativeBinding);
}

initialize().catch((error) => {
console.error("Failed to initialize:", error);
process.exit(1);
});
initialize();

export default globalObject;
18 changes: 6 additions & 12 deletions node/npm/glide/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
{
"name": "${scope}${pkg_name}",
"types": "build-ts/mjs/index.d.ts",
"types": "build-ts/index.d.ts",
"version": "${package_version}",
"description": "An AWS-sponsored, open-source Redis client.",
"main": "build-ts/cjs/index.js",
"module": "build-ts/mjs/index.js",
"exports": {
".": {
"import": "./build-ts/mjs/index.js",
"require": "./build-ts/cjs/index.js",
"types": "./build-ts/mjs/index.d.ts"
}
},
"main": "build-ts/index.js",
"module": "build-ts/index.js",
"type": "commonjs",
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"clean": "rm -rf build-ts/",
"copy-declaration-files": "cp ../../build-ts/mjs/*.d.ts build-ts/mjs/ && cp ../../build-ts/cjs/*.d.ts build-ts/cjs/ && cp ../../build-ts/cjs/src/*.d.ts build-ts/cjs/src/ && cp ../../build-ts/mjs/src/*.d.ts build-ts/mjs/src/",
"build": "tsc -p tsconfig-mjs.json && tsc -p tsconfig-cjs.json && ./../../fixup_pj_files_for_build_type && mkdir -p build-ts/mjs/src && mkdir -p build-ts/cjs/src && npm run copy-declaration-files"
"copy-declaration-files": "cp ../../build-ts/*.d.ts build-ts/ && cp ../../build-ts/src/*.d.ts build-ts/src/",
"build": "tsc && mkdir -p build-ts/src && npm run copy-declaration-files"
},
"files": [
"/build-ts"
Expand Down
6 changes: 3 additions & 3 deletions node/npm/glide/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"target": "esnext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"target": "ESNext",
"module": "commonjs",
"allowJs": true,
"esModuleInterop": true,
"baseUrl": "./",
Expand All @@ -20,8 +21,7 @@
"traceResolution": false,
"types": ["node"],
/* The bellow parts are for developer extention usage and should be overriden in cjs and mjs tscofig's files */
"module": "ESNext" /* Specify what module code is generated. Ovrride in tsconfig-cjs/mjs */,
"outDir": "./build-ts/mjs" /* Specify an output folder for all emitted files. Ovrride in tsconfig-cjs */
"outDir": "./build-ts" /* Specify an output folder for all emitted files. Ovrride in tsconfig-cjs */
},
"include": ["./*.ts", "src/*.ts", "src/*.js"],
"exclude": [
Expand Down
18 changes: 6 additions & 12 deletions node/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
{
"name": "@aws/glide-for-redis",
"description": "An AWS-sponsored, open-source Redis client.",
"main": "build-ts/cjs/index.js",
"module": "build-ts/mjs/index.js",
"types": "./build-ts/mjs/index.d.ts",
"exports": {
".": {
"import": "./build-ts/mjs/index.js",
"require": "./build-ts/cjs/index.js",
"types": "./build-ts/mjs/index.d.ts"
}
},
"main": "build-ts/index.js",
"module": "build-ts/index.js",
"types": "./build-ts/index.d.ts",
"type": "commonjs",
"repository": {
"type": "git",
"url": "git+https://github.com/aws/glide-for-redis.git"
Expand All @@ -33,8 +27,8 @@
"build-internal": "cd rust-client && npm run build",
"build-internal:release": "cd rust-client && npm run build:release",
"build-internal:benchmark": "cd rust-client && npm run build:benchmark",
"build-external": "rm -rf build-ts && tsc -p tsconfig-mjs.json && tsc -p tsconfig-cjs.json && ./fixup_pj_files_for_build_type",
"build-external:release": "rm -rf build-ts && tsc -p tsconfig-mjs.json && tsc -p tsconfig-cjs.json && ./fixup_pj_files_for_build_type --stripInternal",
"build-external": "rm -rf build-ts && tsc",
"build-external:release": "rm -rf build-ts && tsc --stripInternal",
"build-protobuf": "npm run compile-protobuf-files && npm run fix-protobuf-file",
"compile-protobuf-files": "cd src && pbjs -t static-module -o ProtobufMessage.js ../../glide-core/src/protobuf/*.proto && pbts -o ProtobufMessage.d.ts ProtobufMessage.js",
"fix-protobuf-file": "replace 'this\\.encode\\(message, writer\\)\\.ldelim' 'this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim' src/ProtobufMessage.js",
Expand Down
3 changes: 2 additions & 1 deletion node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"target": "ES6" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"module": "CommonJS" /* Specify what module code is generated. */,
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
Expand All @@ -22,7 +23,7 @@
"lib": [
"esnext"
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
"outDir": "./build-ts/mjs" /* Specify an output folder for all emitted files. Ovrride in tsconfig-cjs */
"outDir": "./build-ts" /* Specify an output folder for all emitted files. Ovrride in tsconfig-cjs */
},
"compileOnSave": false,
"include": ["./*.ts", "src/*.ts", "src/*.js"],
Expand Down

0 comments on commit 0d72713

Please sign in to comment.