diff --git a/docs/server-findings.md b/docs/server-findings.md index 9092735..e4b251b 100644 --- a/docs/server-findings.md +++ b/docs/server-findings.md @@ -14,3 +14,4 @@ the sample app and MOCK authentication. Each is a candidate issue for `QRun-IO/q | 7 | Process `init` on `clonePeople` without records answers `ERROR` with `No records were selected…` only after `init`; `getProcessMetaData` says `minInputRecords` 0. | `qqq process run clonePeople`. | Clients show the message. The metadata could carry the real minimum. | | 8 | `manageSession` has no documented username and password fields for `TABLE_BASED`, so a native client cannot sign in to such an app without the browser. | Spec `manageSession` request body. | `qqq login` refuses TABLE_BASED with a message. The design doc's nice-to-have "documented TABLE_BASED bearer recipe". | | 9 | `searchRecords` returned no results for `Avery` although `person` has search fields; unclear whether the sample app configures a search provider. | `qqq search Avery`. | None; needs a look at the sample's search setup. | +| 10 | The sample app configures no uploaded-file archive table (`QJavalinMetaData.uploadedFileArchiveTableName`), so every bulk-insert `upload` step and `POST /uploads` fail with `UploadFileArchiveTableName was not specified in javalinMetaData`. Bulk load cannot be exercised against the sample. | `qqq api initProcess --path processName=person.bulkInsert --form 'values={"tableName":"person"}'` then step `upload` with a file. | None in the client. The sample needs an archive table (memory or filesystem backend) and the javalin setting; the Next UI acceptance fixtures may already have one. | diff --git a/package.json b/package.json index 3c6f01e..22a0a64 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,9 @@ "generate": "npm run generate -w @qrun-io/qqq-ui-api-client && node scripts/gen-operations.mjs", "build": "npm run build -w @qrun-io/qqq-ui-api-client && npm run build -w @qrun-io/qqq-core && npm run build -w @qrun-io/qqq-ui-api-conformance && npm run build -w @qrun-io/qqq-cli", "test": "npm test --workspaces --if-present", - "mock": "prism mock --dynamic --port 4010 packages/ui-api-client/openapi/qqq-v1.json" + "mock": "prism mock --dynamic --port 4010 packages/ui-api-client/openapi/qqq-v1.json", + "prepublishOnly": "npm run build", + "lint": "node scripts/lint.mjs" }, "devDependencies": { "@stoplight/prism-cli": "5.16.0", diff --git a/scripts/lint.mjs b/scripts/lint.mjs new file mode 100644 index 0000000..35e3f95 --- /dev/null +++ b/scripts/lint.mjs @@ -0,0 +1,41 @@ +/* + * Copyright 2026 QRun.IO, Inc. + * Licensed under the Apache License, Version 2.0 (see LICENSE). + */ + +/** + * Repository lint: every TypeScript and script source carries the license header, and no file under + * packages/* /src imports from another package's src (only from its built entry point). + * + * Usage: node scripts/lint.mjs + */ + +import { readdirSync, readFileSync, statSync } from 'node:fs' +import { join, relative } from 'node:path' + +const HEADER = 'Copyright 2026 QRun.IO, Inc.' +const roots = ['packages/ui-api-client/src', 'packages/core/src', 'packages/conformance/src', 'packages/cli/src', 'scripts'] +const problems = [] + +function walk(dir) { + for (const name of readdirSync(dir)) { + const path = join(dir, name) + if (name === 'node_modules' || name === 'dist') continue + if (statSync(path).isDirectory()) walk(path) + else if (/\.(ts|tsx|mjs|js)$/.test(name) && !name.endsWith('.d.ts') && name !== 'schema.ts' && name !== 'operations.ts') check(path) + } +} + +function check(path) { + const text = readFileSync(path, 'utf8') + if (!text.slice(0, 400).includes(HEADER)) problems.push(`${relative('.', path)}: missing license header`) + const cross = text.match(/from '(\.\.\/)+(ui-api-client|core|conformance|cli)\/src\//) + if (cross) problems.push(`${relative('.', path)}: imports another package's src (${cross[0]}); import the package by name`) +} + +for (const root of roots) walk(root) +if (problems.length) { + console.error(problems.join('\n')) + process.exit(1) +} +console.log('lint: ok')