@backtickjs/builds 0.1.8 → 0.1.9
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 +2 -2
- package/dist/packages.d.ts +0 -14
- package/dist/packages.js +0 -34
- package/dist/packages.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backtickjs/builds",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Keeps a Backtick server drawing for every build of its app in users' hands: build ids, a registry of what each build carries, and a check for EAS builds",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"backtick",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@backtickjs/bundler": "^0.1.
|
|
43
|
+
"@backtickjs/bundler": "^0.1.9",
|
|
44
44
|
"typescript": "^6.0.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
package/dist/packages.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Packages } from "@backtickjs/bundler";
|
|
2
|
-
import { type Platform } from "./moduleMap.js";
|
|
3
|
-
/**
|
|
4
|
-
* The versions of the packages the module map for `platform` offers, as
|
|
5
|
-
* installed in the app at `projectRoot`: what a build made from it now
|
|
6
|
-
* carries there.
|
|
7
|
-
*/
|
|
8
|
-
export declare function installedPackages(projectRoot: string, platform: Platform): Packages;
|
|
9
|
-
/**
|
|
10
|
-
* The id of a build that carries `packages`: a hash of them, so two builds
|
|
11
|
-
* that carry the same share it, and a build always names exactly what it
|
|
12
|
-
* has.
|
|
13
|
-
*/
|
|
14
|
-
export declare function buildIdOf(packages: Packages): string;
|
package/dist/packages.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { packageOf } from "@backtickjs/bundler";
|
|
5
|
-
import { moduleMapFile, readModuleMap } from "./moduleMap.js";
|
|
6
|
-
/**
|
|
7
|
-
* The versions of the packages the module map for `platform` offers, as
|
|
8
|
-
* installed in the app at `projectRoot`: what a build made from it now
|
|
9
|
-
* carries there.
|
|
10
|
-
*/
|
|
11
|
-
export function installedPackages(projectRoot, platform) {
|
|
12
|
-
const specifiers = readModuleMap(moduleMapFile(projectRoot, platform));
|
|
13
|
-
const names = [...new Set(specifiers.map(packageOf))].sort();
|
|
14
|
-
return Object.fromEntries(names.map((name) => {
|
|
15
|
-
const file = join(projectRoot, "node_modules", name, "package.json");
|
|
16
|
-
const { version } = JSON.parse(readFileSync(file, "utf8"));
|
|
17
|
-
return [name, version];
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The id of a build that carries `packages`: a hash of them, so two builds
|
|
22
|
-
* that carry the same share it, and a build always names exactly what it
|
|
23
|
-
* has.
|
|
24
|
-
*/
|
|
25
|
-
export function buildIdOf(packages) {
|
|
26
|
-
const sorted = Object.keys(packages)
|
|
27
|
-
.sort()
|
|
28
|
-
.map((name) => [name, packages[name]]);
|
|
29
|
-
return createHash("sha256")
|
|
30
|
-
.update(JSON.stringify(sorted))
|
|
31
|
-
.digest("hex")
|
|
32
|
-
.slice(0, 16);
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=packages.js.map
|
package/dist/packages.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packages.js","sourceRoot":"","sources":["../src/packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAiB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC/D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