@meada/meada 0.0.0-stage → 0.1.0

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/binary.js ADDED
@@ -0,0 +1,124 @@
1
+ const { Package } = require("./binary-install");
2
+ const os = require("os");
3
+ const libc = require("detect-libc");
4
+
5
+ const error = (msg) => {
6
+ console.error(msg);
7
+ process.exit(1);
8
+ };
9
+
10
+ const {
11
+ name,
12
+ artifactDownloadUrls,
13
+ supportedPlatforms,
14
+ glibcMinimum,
15
+ } = require("./package.json");
16
+
17
+ // FIXME: implement NPM installer handling of fallback download URLs
18
+ const artifactDownloadUrl = artifactDownloadUrls[0];
19
+ const builderGlibcMajorVersion = glibcMinimum.major;
20
+ const builderGlibcMinorVersion = glibcMinimum.series;
21
+
22
+ const getPlatform = () => {
23
+ const rawOsType = os.type();
24
+ const rawArchitecture = os.arch();
25
+
26
+ // We want to use rust-style target triples as the canonical key
27
+ // for a platform, so translate the "os" library's concepts into rust ones
28
+ let osType = "";
29
+ switch (rawOsType) {
30
+ case "Windows_NT":
31
+ osType = "pc-windows-msvc";
32
+ break;
33
+ case "Darwin":
34
+ osType = "apple-darwin";
35
+ break;
36
+ case "Linux":
37
+ osType = "unknown-linux-gnu";
38
+ break;
39
+ }
40
+
41
+ let arch = "";
42
+ switch (rawArchitecture) {
43
+ case "x64":
44
+ arch = "x86_64";
45
+ break;
46
+ case "arm64":
47
+ arch = "aarch64";
48
+ break;
49
+ }
50
+
51
+ if (rawOsType === "Linux") {
52
+ if (libc.familySync() == "musl") {
53
+ osType = "unknown-linux-musl-dynamic";
54
+ } else if (libc.isNonGlibcLinuxSync()) {
55
+ console.warn(
56
+ "Your libc is neither glibc nor musl; trying static musl binary instead",
57
+ );
58
+ osType = "unknown-linux-musl-static";
59
+ } else {
60
+ let libcVersion = libc.versionSync();
61
+ let splitLibcVersion = libcVersion.split(".");
62
+ let libcMajorVersion = splitLibcVersion[0];
63
+ let libcMinorVersion = splitLibcVersion[1];
64
+ if (
65
+ libcMajorVersion != builderGlibcMajorVersion ||
66
+ libcMinorVersion < builderGlibcMinorVersion
67
+ ) {
68
+ // We can't run the glibc binaries, but we can run the static musl ones
69
+ // if they exist
70
+ console.warn(
71
+ "Your glibc isn't compatible; trying static musl binary instead",
72
+ );
73
+ osType = "unknown-linux-musl-static";
74
+ }
75
+ }
76
+ }
77
+
78
+ // Assume the above succeeded and build a target triple to look things up with.
79
+ // If any of it failed, this lookup will fail and we'll handle it like normal.
80
+ let targetTriple = `${arch}-${osType}`;
81
+ let platform = supportedPlatforms[targetTriple];
82
+
83
+ if (!platform) {
84
+ error(
85
+ `Platform with type "${rawOsType}" and architecture "${rawArchitecture}" is not supported by ${name}.\nYour system must be one of the following:\n\n${Object.keys(
86
+ supportedPlatforms,
87
+ ).join(",")}`,
88
+ );
89
+ }
90
+
91
+ return platform;
92
+ };
93
+
94
+ const getPackage = () => {
95
+ const platform = getPlatform();
96
+ const url = `${artifactDownloadUrl}/${platform.artifactName}`;
97
+ let filename = platform.artifactName;
98
+ let ext = platform.zipExt;
99
+ let binary = new Package(platform, name, url, filename, ext, platform.bins);
100
+
101
+ return binary;
102
+ };
103
+
104
+ const install = (suppressLogs) => {
105
+ if (!artifactDownloadUrl || artifactDownloadUrl.length === 0) {
106
+ console.warn("in demo mode, not installing binaries");
107
+ return;
108
+ }
109
+ const pkg = getPackage();
110
+
111
+ return pkg.install(suppressLogs);
112
+ };
113
+
114
+ const run = (binaryName) => {
115
+ const pkg = getPackage();
116
+
117
+ pkg.run(binaryName);
118
+ };
119
+
120
+ module.exports = {
121
+ install,
122
+ run,
123
+ getPackage,
124
+ };
package/install.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { install } = require("./binary");
4
+ install(false);
@@ -0,0 +1,52 @@
1
+ {
2
+ "lockfileVersion": 3,
3
+ "name": "@meada/meada",
4
+ "packages": {
5
+ "": {
6
+ "bin": {
7
+ "meada": "run-meada.js"
8
+ },
9
+ "dependencies": {
10
+ "detect-libc": "^2.1.2"
11
+ },
12
+ "devDependencies": {
13
+ "prettier": "^3.8.3"
14
+ },
15
+ "engines": {
16
+ "node": ">=14.14",
17
+ "npm": ">=6"
18
+ },
19
+ "hasInstallScript": true,
20
+ "license": "Apache-2.0",
21
+ "name": "@meada/meada",
22
+ "version": "0.1.0"
23
+ },
24
+ "node_modules/detect-libc": {
25
+ "engines": {
26
+ "node": ">=8"
27
+ },
28
+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
29
+ "license": "Apache-2.0",
30
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
31
+ "version": "2.1.2"
32
+ },
33
+ "node_modules/prettier": {
34
+ "bin": {
35
+ "prettier": "bin/prettier.cjs"
36
+ },
37
+ "dev": true,
38
+ "engines": {
39
+ "node": ">=14"
40
+ },
41
+ "funding": {
42
+ "url": "https://github.com/prettier/prettier?sponsor=1"
43
+ },
44
+ "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==",
45
+ "license": "MIT",
46
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz",
47
+ "version": "3.8.3"
48
+ }
49
+ },
50
+ "requires": true,
51
+ "version": "0.1.0"
52
+ }
package/package.json CHANGED
@@ -1,6 +1,97 @@
1
1
  {
2
+ "artifactDownloadUrls": [
3
+ "https://github.com/ClaudioMascaro/meada/releases/download/v0.1.0"
4
+ ],
5
+ "bin": {
6
+ "meada": "run-meada.js"
7
+ },
8
+ "dependencies": {
9
+ "detect-libc": "^2.1.2"
10
+ },
11
+ "description": "LLM-free code graph that links repositories through the contracts they share, served over MCP",
12
+ "devDependencies": {
13
+ "prettier": "^3.8.3"
14
+ },
15
+ "engines": {
16
+ "node": ">=14.14",
17
+ "npm": ">=6"
18
+ },
19
+ "glibcMinimum": {
20
+ "major": 2,
21
+ "series": 35
22
+ },
23
+ "keywords": [
24
+ "development-tools",
25
+ "command-line-utilities",
26
+ "code-graph",
27
+ "mcp",
28
+ "tree-sitter",
29
+ "cross-repo",
30
+ "code-intelligence"
31
+ ],
32
+ "license": "Apache-2.0",
2
33
  "name": "@meada/meada",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
34
+ "preferUnplugged": true,
35
+ "repository": "https://github.com/ClaudioMascaro/meada",
36
+ "scripts": {
37
+ "fmt": "prettier --write **/*.js",
38
+ "fmt:check": "prettier --check **/*.js",
39
+ "postinstall": "node ./install.js"
40
+ },
41
+ "supportedPlatforms": {
42
+ "aarch64-apple-darwin": {
43
+ "artifactName": "meada-aarch64-apple-darwin.tar.xz",
44
+ "bins": {
45
+ "meada": "meada"
46
+ },
47
+ "zipExt": ".tar.xz"
48
+ },
49
+ "aarch64-pc-windows-msvc": {
50
+ "artifactName": "meada-x86_64-pc-windows-msvc.zip",
51
+ "bins": {
52
+ "meada": "meada.exe"
53
+ },
54
+ "zipExt": ".zip"
55
+ },
56
+ "aarch64-unknown-linux-gnu": {
57
+ "artifactName": "meada-aarch64-unknown-linux-gnu.tar.xz",
58
+ "bins": {
59
+ "meada": "meada"
60
+ },
61
+ "zipExt": ".tar.xz"
62
+ },
63
+ "x86_64-apple-darwin": {
64
+ "artifactName": "meada-x86_64-apple-darwin.tar.xz",
65
+ "bins": {
66
+ "meada": "meada"
67
+ },
68
+ "zipExt": ".tar.xz"
69
+ },
70
+ "x86_64-pc-windows-gnu": {
71
+ "artifactName": "meada-x86_64-pc-windows-msvc.zip",
72
+ "bins": {
73
+ "meada": "meada.exe"
74
+ },
75
+ "zipExt": ".zip"
76
+ },
77
+ "x86_64-pc-windows-msvc": {
78
+ "artifactName": "meada-x86_64-pc-windows-msvc.zip",
79
+ "bins": {
80
+ "meada": "meada.exe"
81
+ },
82
+ "zipExt": ".zip"
83
+ },
84
+ "x86_64-unknown-linux-gnu": {
85
+ "artifactName": "meada-x86_64-unknown-linux-gnu.tar.xz",
86
+ "bins": {
87
+ "meada": "meada"
88
+ },
89
+ "zipExt": ".tar.xz"
90
+ }
91
+ },
92
+ "version": "0.1.0",
93
+ "volta": {
94
+ "node": "18.14.1",
95
+ "npm": "9.5.0"
96
+ }
6
97
  }
package/run-meada.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { run } = require("./binary");
4
+ run("meada");