@teamscala/service-boot 0.23.534 → 0.23.536
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 +3 -4
- package/src/agreement-gate/signing-session.ts +1 -1
- package/src/attach-proposal-accept.ts +1 -1
- package/src/attach-proposal-magic.ts +1 -1
- package/src/build-client-assets/styles-build.ts +2 -2
- package/src/content-gate/config-types.ts +1 -1
- package/src/gpt-gate.ts +1 -1
- package/src/proposal-gate.ts +1 -1
- package/src/quiz-gate.ts +1 -1
- package/src/build-client-assets/source-candidates.test.ts +0 -60
- package/src/build-client-assets/source-candidates.ts +0 -76
package/package.json
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@orpc/openapi": "*",
|
|
9
9
|
"@orpc/server": "*",
|
|
10
|
-
"@
|
|
10
|
+
"@tailwindcss/oxide": "*",
|
|
11
11
|
"@teamscala/agreement-render": "*",
|
|
12
|
+
"@teamscala/agreement-signing": "*",
|
|
12
13
|
"@teamscala/auth": "*",
|
|
13
14
|
"@teamscala/auth-channel-setup": "*",
|
|
14
15
|
"@teamscala/auth-factory": "*",
|
|
@@ -108,8 +109,6 @@
|
|
|
108
109
|
"./build-client-assets/hydrate-bundle.ts": "./src/build-client-assets/hydrate-bundle.ts",
|
|
109
110
|
"./build-client-assets/manifest": "./src/build-client-assets/manifest.ts",
|
|
110
111
|
"./build-client-assets/manifest.ts": "./src/build-client-assets/manifest.ts",
|
|
111
|
-
"./build-client-assets/source-candidates": "./src/build-client-assets/source-candidates.ts",
|
|
112
|
-
"./build-client-assets/source-candidates.ts": "./src/build-client-assets/source-candidates.ts",
|
|
113
112
|
"./build-client-assets/sourcemaps-upload": "./src/build-client-assets/sourcemaps-upload.ts",
|
|
114
113
|
"./build-client-assets/sourcemaps-upload.ts": "./src/build-client-assets/sourcemaps-upload.ts",
|
|
115
114
|
"./build-client-assets/styles-build": "./src/build-client-assets/styles-build.ts",
|
|
@@ -302,5 +301,5 @@
|
|
|
302
301
|
"repository": "https://github.com/teamgbg/service-boot",
|
|
303
302
|
"sideEffects": false,
|
|
304
303
|
"type": "module",
|
|
305
|
-
"version": "0.23.
|
|
304
|
+
"version": "0.23.536"
|
|
306
305
|
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
buildCertificateData,
|
|
14
14
|
type CertificateData,
|
|
15
|
-
} from "@teamscala/agreement-
|
|
15
|
+
} from "@teamscala/agreement-signing/agreement-certificate";
|
|
16
16
|
import { collectBlocks, forEachContent, type PuckData } from "@teamscala/puck-tree/collect-blocks";
|
|
17
17
|
import { findFirstAgreement } from "./agreement-lookup.ts";
|
|
18
18
|
import { resolveAgreementViewerDirectory } from "./resolution-caches.ts";
|
|
@@ -7,7 +7,7 @@ import type { Hono } from "hono";
|
|
|
7
7
|
import { getAppLogger } from "@teamscala/logger/app-loggers";
|
|
8
8
|
import { signAgreementAccessToken } from "@teamscala/document-signing/agreement-access-token";
|
|
9
9
|
import { parseCookie } from "./content-gate/parse-cookie.ts";
|
|
10
|
-
import { verifyAccessToken } from "@teamscala/content-gate-token";
|
|
10
|
+
import { verifyAccessToken } from "@teamscala/content-gate-token/content-gate-token";
|
|
11
11
|
import { agTtlMs } from "./gate-ttls.ts";
|
|
12
12
|
import { createAgreementFromProposal } from "@teamscala/agreement-render/create-agreement-from-proposal";
|
|
13
13
|
import { getCookieDomain } from "@teamscala/db/registry/cookie-domain";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import type { Hono } from "hono";
|
|
7
7
|
import { getAppLogger } from "@teamscala/logger/app-loggers";
|
|
8
|
-
import { verifyAccessToken } from "@teamscala/content-gate-token";
|
|
8
|
+
import { verifyAccessToken } from "@teamscala/content-gate-token/content-gate-token";
|
|
9
9
|
import { propTtlMs } from "./gate-ttls.ts";
|
|
10
10
|
|
|
11
11
|
const PROP_COOKIE = "prop_token";
|
|
@@ -7,7 +7,7 @@ import { dirname, join, resolve } from "node:path";
|
|
|
7
7
|
import { getAppLogger } from "@teamscala/logger/app-loggers";
|
|
8
8
|
import { compile } from "tailwindcss";
|
|
9
9
|
import { fileHash, removeStaleHashedFiles } from "./hashed-output.ts";
|
|
10
|
-
import {
|
|
10
|
+
import { Scanner } from "@tailwindcss/oxide";
|
|
11
11
|
import { mkdir, rename } from "node:fs/promises";
|
|
12
12
|
|
|
13
13
|
const STYLES_BASE = "styles";
|
|
@@ -118,7 +118,7 @@ export async function buildTailwindCss(
|
|
|
118
118
|
},
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
-
const candidates =
|
|
121
|
+
const candidates = new Scanner({ sources: compiler.sources.map((source) => ({ ...source, negated: source.negated ?? false })) }).scan();
|
|
122
122
|
const cssOutput = stripRemoteImports(compiler.build(candidates));
|
|
123
123
|
log.info(
|
|
124
124
|
`[build-client-assets] tailwind: ${candidates.length} candidate(s) from ${compiler.sources.length} source(s)`,
|
package/src/gpt-gate.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { AccessConfig, ContentGateConfig } from "./content-gate/config-types.ts";
|
|
7
|
-
import { signAccessToken, verifyAccessTokenIdentity } from "@teamscala/content-gate-token";
|
|
7
|
+
import { signAccessToken, verifyAccessTokenIdentity } from "@teamscala/content-gate-token/content-gate-token";
|
|
8
8
|
import { gptTtlMs } from "./gate-ttls.ts";
|
|
9
9
|
|
|
10
10
|
const GPT_COOKIE = "gpt_token";
|
package/src/proposal-gate.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { AccessConfig, ContentGateConfig } from "./content-gate/config-types.ts";
|
|
7
|
-
import { signAccessToken, verifyAccessToken } from "@teamscala/content-gate-token";
|
|
7
|
+
import { signAccessToken, verifyAccessToken } from "@teamscala/content-gate-token/content-gate-token";
|
|
8
8
|
import { resolveProposalAuthorizedEmails } from "./proposal-authorized-emails.ts";
|
|
9
9
|
import { propTtlMs } from "./gate-ttls.ts";
|
|
10
10
|
import { getAppLogger } from "@teamscala/logger/app-loggers";
|
package/src/quiz-gate.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { AccessConfig, ContentGateConfig } from "./content-gate/config-types.ts";
|
|
7
|
-
import { signAccessToken, verifyAccessTokenIdentity } from "@teamscala/content-gate-token";
|
|
7
|
+
import { signAccessToken, verifyAccessTokenIdentity } from "@teamscala/content-gate-token/content-gate-token";
|
|
8
8
|
import { quizTtlMs } from "./gate-ttls.ts";
|
|
9
9
|
|
|
10
10
|
const QUIZ_COOKIE = "quiz_token";
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// @system codegen
|
|
2
|
-
// @status generated
|
|
3
|
-
// @edit change the suite in the owned-suites band, then re-run codegen. Hand-edits are overwritten.
|
|
4
|
-
//
|
|
5
|
-
// This suite's assertions are OWNED by the codegen band: the band module
|
|
6
|
-
// carries them verbatim, this file is the emission, and hand edits here are
|
|
7
|
-
// overwritten on the next run. The rationale each assertion carries moved
|
|
8
|
-
// with it into the band.
|
|
9
|
-
|
|
10
|
-
import { describe, expect, test } from "bun:test";
|
|
11
|
-
import { mkdir, rm } from "node:fs/promises";
|
|
12
|
-
import { join } from "node:path";
|
|
13
|
-
import { tmpdir } from "node:os";
|
|
14
|
-
import { scanSourceCandidates } from "./source-candidates.ts";
|
|
15
|
-
|
|
16
|
-
const noopLog = { warn: () => {}, info: () => {}, error: () => {} } as never;
|
|
17
|
-
|
|
18
|
-
async function makeSourceTree(tag: string, files: Record<string, string>) {
|
|
19
|
-
const root = join(tmpdir(), `source-candidates-${tag}-${process.pid}`);
|
|
20
|
-
await rm(root, { recursive: true, force: true });
|
|
21
|
-
for (const [rel, content] of Object.entries(files)) {
|
|
22
|
-
const p = join(root, rel);
|
|
23
|
-
await mkdir(p.slice(0, p.lastIndexOf("/")), { recursive: true });
|
|
24
|
-
await Bun.file(p).write(content);
|
|
25
|
-
}
|
|
26
|
-
return root;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
describe("scanSourceCandidates", () => {
|
|
30
|
-
test("scans a DIRECTORY source and extracts utility candidates", async () => {
|
|
31
|
-
const root = await makeSourceTree("dir-src", {
|
|
32
|
-
"src/Button.tsx": 'export const k = "h-12 px-6 text-base rounded-md";',
|
|
33
|
-
});
|
|
34
|
-
const candidates = await scanSourceCandidates(
|
|
35
|
-
[{ base: root, pattern: "src" }],
|
|
36
|
-
noopLog,
|
|
37
|
-
);
|
|
38
|
-
expect(candidates).toContain("h-12");
|
|
39
|
-
expect(candidates).toContain("px-6");
|
|
40
|
-
expect(candidates).toContain("text-base");
|
|
41
|
-
expect(candidates).toContain("rounded-md");
|
|
42
|
-
await rm(root, { recursive: true, force: true });
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test("skips an absent source silently instead of zeroing the scan", async () => {
|
|
46
|
-
const root = await makeSourceTree("absent-src", {
|
|
47
|
-
"src/Keep.tsx": "flex gap-2",
|
|
48
|
-
});
|
|
49
|
-
const candidates = await scanSourceCandidates(
|
|
50
|
-
[
|
|
51
|
-
{ base: root, pattern: "src" },
|
|
52
|
-
{ base: root, pattern: "does-not-exist" },
|
|
53
|
-
],
|
|
54
|
-
noopLog,
|
|
55
|
-
);
|
|
56
|
-
expect(candidates).toContain("flex");
|
|
57
|
-
expect(candidates).toContain("gap-2");
|
|
58
|
-
await rm(root, { recursive: true, force: true });
|
|
59
|
-
});
|
|
60
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @system service-boot
|
|
3
|
-
* @status handwritten
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { resolve } from "node:path";
|
|
7
|
-
import { stat } from "node:fs/promises";
|
|
8
|
-
import { getAppLogger } from "@teamscala/logger/app-loggers";
|
|
9
|
-
|
|
10
|
-
async function existsStat(path: string): Promise<boolean> {
|
|
11
|
-
try {
|
|
12
|
-
await stat(path);
|
|
13
|
-
return true;
|
|
14
|
-
} catch {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const SCAN_EXTS = new Set([
|
|
20
|
-
".ts",
|
|
21
|
-
".tsx",
|
|
22
|
-
".js",
|
|
23
|
-
".jsx",
|
|
24
|
-
".mjs",
|
|
25
|
-
".cjs",
|
|
26
|
-
".html",
|
|
27
|
-
".md",
|
|
28
|
-
".mdx",
|
|
29
|
-
]);
|
|
30
|
-
const CANDIDATE_RE = /[A-Za-z0-9_:/[\].%#!,&-]+/g;
|
|
31
|
-
|
|
32
|
-
export async function scanSourceCandidates(
|
|
33
|
-
sources: Array<{ base: string; pattern: string; negated?: boolean }>,
|
|
34
|
-
log: ReturnType<typeof getAppLogger>,
|
|
35
|
-
): Promise<string[]> {
|
|
36
|
-
const candidates = new Set<string>();
|
|
37
|
-
for (const src of sources) {
|
|
38
|
-
if (src.negated) continue;
|
|
39
|
-
let root: string;
|
|
40
|
-
try {
|
|
41
|
-
root = resolve(src.base, src.pattern);
|
|
42
|
-
} catch {
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
if (!await existsStat(root)) continue;
|
|
46
|
-
const rootInNodeModules = root.includes("/node_modules/");
|
|
47
|
-
try {
|
|
48
|
-
const glob = new Bun.Glob("**/*");
|
|
49
|
-
for await (const file of glob.scan({
|
|
50
|
-
cwd: root,
|
|
51
|
-
absolute: true,
|
|
52
|
-
onlyFiles: true,
|
|
53
|
-
})) {
|
|
54
|
-
if (!rootInNodeModules && file.includes("/node_modules/")) continue;
|
|
55
|
-
if (file.includes("/dist/") || file.endsWith(".d.ts")) continue;
|
|
56
|
-
const dot = file.lastIndexOf(".");
|
|
57
|
-
if (dot < 0 || !SCAN_EXTS.has(file.slice(dot))) continue;
|
|
58
|
-
let text: string;
|
|
59
|
-
try {
|
|
60
|
-
text = await Bun.file(file).text();
|
|
61
|
-
} catch {
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
const matched = text.match(CANDIDATE_RE);
|
|
65
|
-
if (matched) for (const t of matched) candidates.add(t);
|
|
66
|
-
}
|
|
67
|
-
} catch (err) {
|
|
68
|
-
log.warn(
|
|
69
|
-
`[build-client-assets] candidate scan skipped ${root}: ${
|
|
70
|
-
err instanceof Error ? err.message : String(err)
|
|
71
|
-
}`,
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return [...candidates];
|
|
76
|
-
}
|