@popoverai/dotrequirements 0.11.1 → 0.12.1
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/dist/cli.js +9 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/pull.js +5 -2
- package/dist/mcp/index.js +9 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -10,6 +10,14 @@ import { mcpSetupCommand } from './commands/mcp-setup.js';
|
|
|
10
10
|
import { loginCommand } from './commands/login.js';
|
|
11
11
|
import { logoutCommand } from './commands/logout.js';
|
|
12
12
|
import { loadEnvFile } from './utils/env.js';
|
|
13
|
+
import { readFileSync } from 'fs';
|
|
14
|
+
import { fileURLToPath } from 'url';
|
|
15
|
+
import { dirname, join } from 'path';
|
|
16
|
+
// Read version from package.json
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
+
const __dirname = dirname(__filename);
|
|
19
|
+
const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
|
|
20
|
+
const VERSION = packageJson.version;
|
|
13
21
|
// Load environment variables from .env.local if it exists
|
|
14
22
|
loadEnvFile();
|
|
15
23
|
/**
|
|
@@ -36,7 +44,7 @@ const program = new Command();
|
|
|
36
44
|
program
|
|
37
45
|
.name('dotrequirements')
|
|
38
46
|
.description('Requirements tracking CLI with test harness and MCP server')
|
|
39
|
-
.version(
|
|
47
|
+
.version(VERSION);
|
|
40
48
|
program
|
|
41
49
|
.command('init')
|
|
42
50
|
.description('Initialize a new dotrequirements project')
|
package/dist/commands/init.js
CHANGED
|
@@ -48,6 +48,7 @@ export async function initCommand(options = {}) {
|
|
|
48
48
|
await connectExistingProjectFlow(cwd, envPath);
|
|
49
49
|
}
|
|
50
50
|
console.log('\nDocumentation: https://docs.dotrequirements.io/getting-started');
|
|
51
|
+
console.log('By using this service, you agree to our Terms: https://app.dotrequirements.io/terms');
|
|
51
52
|
}
|
|
52
53
|
catch (error) {
|
|
53
54
|
console.error(`\n✗ Error: ${error instanceof Error ? error.message : String(error)}`);
|
package/dist/commands/pull.js
CHANGED
|
@@ -151,14 +151,17 @@ function extractDocumentIdFromFile(filePath) {
|
|
|
151
151
|
const content = fs.readFileSync(filePath, 'utf-8');
|
|
152
152
|
// Match document.id in YAML frontmatter - handles both inline and nested formats
|
|
153
153
|
// Inline: document: { id: "abc123", ... }
|
|
154
|
-
// Nested:
|
|
154
|
+
// Nested (id: can appear at any position within the indented document block):
|
|
155
155
|
// document:
|
|
156
|
+
// title: Some Title
|
|
157
|
+
// defaultPrefix: REQ
|
|
156
158
|
// id: abc123
|
|
157
159
|
const inlineMatch = content.match(/document:\s*\{[^}]*id:\s*["']?([^"',}\s]+)/);
|
|
158
160
|
if (inlineMatch) {
|
|
159
161
|
return inlineMatch[1];
|
|
160
162
|
}
|
|
161
|
-
|
|
163
|
+
// Match id: anywhere within the document block (allows other properties before it)
|
|
164
|
+
const nestedMatch = content.match(/document:\s*\n(?:[ \t]+[^\n]*\n)*?[ \t]+id:\s*["']?([^"'\s\n]+)/);
|
|
162
165
|
if (nestedMatch) {
|
|
163
166
|
return nestedMatch[1];
|
|
164
167
|
}
|
package/dist/mcp/index.js
CHANGED
|
@@ -9,6 +9,14 @@ import { glob } from 'glob';
|
|
|
9
9
|
import { loadConvexConfig, getRequirementCoverage as queryRequirementCoverage, getProjectCoverage as queryProjectCoverage, } from './convexClient.js';
|
|
10
10
|
import { discoverProjects, resolveProject, } from '../utils/project-discovery.js';
|
|
11
11
|
import { isLocalOnlyProject, CLOUD_FEATURES_REQUIRE_AUTH_MESSAGE } from '../utils/local-project.js';
|
|
12
|
+
import { readFileSync } from 'fs';
|
|
13
|
+
import { fileURLToPath } from 'url';
|
|
14
|
+
import { dirname, join } from 'path';
|
|
15
|
+
// Read version from package.json
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = dirname(__filename);
|
|
18
|
+
const packageJson = JSON.parse(readFileSync(join(__dirname, '../../package.json'), 'utf-8'));
|
|
19
|
+
const VERSION = packageJson.version;
|
|
12
20
|
// Get project paths from environment variables
|
|
13
21
|
// Supports both PROJ_* pattern (Antigravity) and REQUIREMENTS_DIR fallback
|
|
14
22
|
function getProjectPathsFromEnv() {
|
|
@@ -331,7 +339,7 @@ const prompts = [
|
|
|
331
339
|
// Create server
|
|
332
340
|
const server = new Server({
|
|
333
341
|
name: 'dotrequirements',
|
|
334
|
-
version:
|
|
342
|
+
version: VERSION,
|
|
335
343
|
}, {
|
|
336
344
|
capabilities: {
|
|
337
345
|
tools: {},
|