@cubejs-backend/native 0.33.21 → 0.33.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubejs-backend/native",
3
- "version": "0.33.21",
3
+ "version": "0.33.22",
4
4
  "author": "Cube Dev, Inc.",
5
5
  "description": "Native module for Cube.js (binding to Rust codebase)",
6
6
  "main": "dist/js/index.js",
@@ -17,7 +17,7 @@
17
17
  "native:build-release": "npm run native:build -- --release",
18
18
  "native:build-debug-python": "npm run native:build -- --features python",
19
19
  "native:build-release-python": "npm run native:build -- --release --features python",
20
- "install": "node-pre-gyp install || echo 'Your system is not supported by @cubejs-backend/native, some feature will be unavailable.'",
20
+ "postinstall": "post-installer || echo 'Your system is not supported by @cubejs-backend/native, some feature will be unavailable.'",
21
21
  "upload-binary-cross": "mkdir -p native && cp index.node native/index.node && node-pre-gyp package --target_arch=$PACKAGE_TARGET_ARCH --target_platform=$PACKAGE_TARGET_PLATFORM --target_libc=$PACKAGE_TARGET_LIBC && node-pre-gyp-github publish",
22
22
  "upload-binary": "mkdir -p native && cp index.node native/index.node && node-pre-gyp package && node-pre-gyp-github publish",
23
23
  "test:server": "CUBEJS_NATIVE_INTERNAL_DEBUG=true CUBESQL_LOG_LEVEL=trace CUBESQL_PG_PORT=5555 node dist/test/server.js",
@@ -30,7 +30,6 @@
30
30
  "node": "^14.0.0 || ^16.0.0 || >=17.0.0"
31
31
  },
32
32
  "files": [
33
- "bin",
34
33
  "dist/js"
35
34
  ],
36
35
  "devDependencies": {
@@ -46,6 +45,7 @@
46
45
  "dependencies": {
47
46
  "@cubejs-backend/cubesql": "^0.33.11",
48
47
  "@cubejs-backend/shared": "^0.33.21",
48
+ "@cubejs-infra/post-installer": "^0.0.7",
49
49
  "@mapbox/node-pre-gyp": "^1"
50
50
  },
51
51
  "binary": {
@@ -100,5 +100,5 @@
100
100
  "publishConfig": {
101
101
  "access": "public"
102
102
  },
103
- "gitHead": "c20bb62bf3bd7708ffc99b937a8e13cc60a075e7"
103
+ "gitHead": "5c0d4f4855ace774d3493289a7f4e9e1f2bae546"
104
104
  }
package/bin/post-install DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- if (!fs.existsSync(path.join(__dirname, '..', 'dist', 'js', 'post-install.js')) && fs.existsSync(path.join(__dirname, '..', 'tsconfig.json'))) {
7
- console.log('Skipping post-install because it was not compiled');
8
- return;
9
- }
10
-
11
- require('../dist/js/post-install');
@@ -1,2 +0,0 @@
1
- import 'source-map-support/register';
2
- //# sourceMappingURL=post-install.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"post-install.d.ts","sourceRoot":"","sources":["../../js/post-install.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC"}
@@ -1,123 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- require("source-map-support/register");
27
- const shared_1 = require("@cubejs-backend/shared");
28
- const process = __importStar(require("process"));
29
- const pkg = require('../../package.json');
30
- function resolveConstraint(name, constraintDetails) {
31
- if (name === 'platform') {
32
- return constraintDetails.includes(process.platform);
33
- }
34
- if (name === 'arch') {
35
- return constraintDetails.includes(process.arch);
36
- }
37
- (0, shared_1.displayCLIWarning)(`Unknown constraint name: ${name}, pass: false`);
38
- return false;
39
- }
40
- function resolveVariableValue(value) {
41
- if (Array.isArray(value) && value.length == 2) {
42
- const [valueName, supportedVersions] = value;
43
- if (valueName === 'libpython') {
44
- for (const version of supportedVersions) {
45
- if ((0, shared_1.libraryExists)(`libpython${version}`) === shared_1.LibraryExistsResult.Exists) {
46
- return version;
47
- }
48
- }
49
- return false;
50
- }
51
- }
52
- if (value === 'libc') {
53
- return resolveLibc();
54
- }
55
- (0, shared_1.displayCLIWarning)(`Unable to resolve value, unknown value ${value}`);
56
- return false;
57
- }
58
- function resolveVars(variables) {
59
- const res = [];
60
- for (const [variableName, variable] of Object.entries(variables)) {
61
- let constraintPass = true;
62
- if (variable.constraints) {
63
- for (const [constraintName, constraintDetails] of Object.entries(variable.constraints)) {
64
- if (!resolveConstraint(constraintName, constraintDetails)) {
65
- constraintPass = false;
66
- break;
67
- }
68
- }
69
- }
70
- let value = variable['default'];
71
- if (constraintPass) {
72
- if (variable.value) {
73
- const resolvedValue = resolveVariableValue(variable.value);
74
- if (resolvedValue) {
75
- value = resolvedValue;
76
- }
77
- }
78
- }
79
- res.push({
80
- resolve(url) {
81
- url = url.replace('${' + variableName + '}', value);
82
- return url;
83
- }
84
- });
85
- }
86
- return res;
87
- }
88
- function resolveLibc() {
89
- if (process.platform === 'linux') {
90
- return (0, shared_1.detectLibc)() === 'gnu' ? 'glibc' : 'musl';
91
- }
92
- return 'unknown';
93
- }
94
- function resolvePath(path, variables) {
95
- path = path.replace('${version}', pkg.version);
96
- path = path.replace('${platform}', process.platform);
97
- path = path.replace('${arch}', process.arch);
98
- path = path.replace('${libc}', resolveLibc());
99
- for (const variable of variables) {
100
- path = variable.resolve(path);
101
- }
102
- return path;
103
- }
104
- (async () => {
105
- try {
106
- if (!pkg.resources) {
107
- throw new Error('Please defined resources section in package.json file in corresponding package');
108
- }
109
- const variables = resolveVars(pkg.resources.vars);
110
- for (const file of pkg.resources.files) {
111
- const url = resolvePath(file.host + file.path, variables);
112
- console.log(`Downloading: ${url}`);
113
- await (0, shared_1.downloadAndExtractFile)(url, {
114
- cwd: process.cwd(),
115
- showProgress: true
116
- });
117
- }
118
- }
119
- catch (e) {
120
- await (0, shared_1.displayCLIError)(e, 'Native Installer');
121
- }
122
- })();
123
- //# sourceMappingURL=post-install.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"post-install.js","sourceRoot":"","sources":["../../js/post-install.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAqC;AAErC,mDAOgC;AAChC,iDAAmC;AAEnC,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAM1C,SAAS,iBAAiB,CAAC,IAAY,EAAE,iBAAsB;IAC7D,IAAI,IAAI,KAAK,UAAU,EAAE;QACvB,OAAO,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;KACrD;IAED,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,OAAO,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACjD;IAED,IAAA,0BAAiB,EAAC,4BAA4B,IAAI,eAAe,CAAC,CAAC;IAEnE,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAU;IACtC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE;QAC7C,MAAM,CAAE,SAAS,EAAE,iBAAiB,CAAE,GAAG,KAAK,CAAC;QAC/C,IAAI,SAAS,KAAK,WAAW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