lula2 0.7.3-nightly.5 → 0.7.5

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 CHANGED
@@ -1,128 +1,129 @@
1
1
  {
2
- "name": "lula2",
3
- "version": "0.7.3-nightly.5",
4
- "description": "A tool for managing compliance as code in your GitHub repositories.",
5
- "bin": {
6
- "lula2": "./dist/lula2"
7
- },
8
- "main": "dist/index.js",
9
- "types": "dist/index.d.ts",
10
- "type": "module",
11
- "engines": {
12
- "node": ">=22.20.0"
13
- },
14
- "repository": {
15
- "type": "git",
16
- "url": "git+https://github.com/defenseunicorns/lula.git"
17
- },
18
- "keywords": [
19
- "compliance",
20
- "devops",
21
- "devsecops"
22
- ],
23
- "author": "Defense Unicorns",
24
- "license": "Apache-2.0",
25
- "bugs": {
26
- "url": "https://github.com/defenseunicorns/lula/issues"
27
- },
28
- "homepage": "https://github.com/defenseunicorns/lula#readme",
29
- "files": [
30
- "/src",
31
- "/dist",
32
- "!src/**/*.test.ts",
33
- "!dist/**/*.test.js*",
34
- "!dist/**/*.test.d.ts*"
35
- ],
36
- "dependencies": {
37
- "@octokit/rest": "22.0.1",
38
- "@types/ws": "8.18.1",
39
- "commander": "14.0.2",
40
- "cors": "2.8.5",
41
- "csv-parse": "6.1.0",
42
- "express": "5.2.1",
43
- "express-rate-limit": "8.2.1",
44
- "flowbite": "4.0.1",
45
- "glob": "13.0.0",
46
- "isomorphic-git": "1.35.1",
47
- "js-yaml": "4.1.1",
48
- "multer": "2.0.2",
49
- "open": "11.0.0",
50
- "undici": "7.16.0",
51
- "ws": "8.18.3",
52
- "xlsx-republish": "0.20.3",
53
- "yaml": "2.8.2"
54
- },
55
- "devDependencies": {
56
- "@commitlint/cli": "^20.0.0",
57
- "@commitlint/config-conventional": "^20.0.0",
58
- "@defenseunicorns/eslint-config": "^1.1.2",
59
- "@eslint/compat": "^2.0.0",
60
- "@eslint/eslintrc": "^3.3.1",
61
- "@eslint/js": "^9.35.0",
62
- "@playwright/test": "^1.55.0",
63
- "@sveltejs/adapter-static": "^3.0.9",
64
- "@sveltejs/kit": "^2.37.1",
65
- "@sveltejs/vite-plugin-svelte": "^6.1.4",
66
- "@tailwindcss/vite": "^4.1.13",
67
- "@types/cors": "^2.8.19",
68
- "@types/express": "^5.0.3",
69
- "@types/js-yaml": "^4.0.9",
70
- "@types/jsdom": "^27.0.0",
71
- "@types/multer": "^2.0.0",
72
- "@types/node": "^24.4.0",
73
- "@typescript-eslint/eslint-plugin": "^8.42.0",
74
- "@typescript-eslint/parser": "^8.42.0",
75
- "@vitest/browser": "^4.0.1",
76
- "@vitest/coverage-v8": "^4.0.1",
77
- "carbon-icons-svelte": "^13.5.0",
78
- "carbon-preprocess-svelte": "^0.11.11",
79
- "concurrently": "^9.2.1",
80
- "esbuild": "^0.27.0",
81
- "eslint": "^9.35.0",
82
- "eslint-config-prettier": "^10.1.8",
83
- "eslint-plugin-jsdoc": "^61.0.0",
84
- "eslint-plugin-svelte": "^3.12.2",
85
- "globals": "^16.3.0",
86
- "husky": "^9.1.7",
87
- "jsdom": "^27.0.0",
88
- "playwright": "^1.55.0",
89
- "prettier": "3.7.4",
90
- "prettier-plugin-svelte": "^3.4.0",
91
- "semantic-release": "^25.0.1",
92
- "shellcheck": "^4.1.0",
93
- "svelte": "^5.38.7",
94
- "svelte-check": "^4.3.1",
95
- "tailwind-merge": "^3.3.1",
96
- "tailwindcss": "^4.1.13",
97
- "tsx": "^4.20.5",
98
- "typescript": "5.9.3",
99
- "typescript-eslint": "^8.42.0",
100
- "vite": "^7.1.4",
101
- "vitest": "^4.0.1",
102
- "vitest-browser-svelte": "^2.0.0"
103
- },
104
- "release": {
105
- "branches": [
106
- "main",
107
- "next"
108
- ]
109
- },
110
- "scripts": {
111
- "dev": "vite dev --port 5173",
112
- "dev:api": "tsx --watch index.ts --debug ui --port 3000 --no-open-browser",
113
- "dev:full": "concurrently \"npm run dev:api\" \"npm run dev\"",
114
- "build": "npm run build:svelte && npm run build:cli && npm run postbuild:cli",
115
- "build:svelte": "vite build",
116
- "build:cli": "esbuild index.ts cli/**/*.ts --bundle --platform=node --target=node22 --format=esm --outdir=dist --external:express --external:commander --external:js-yaml --external:yaml --external:isomorphic-git --external:glob --external:open --external:ws --external:cors --external:multer --external:@octokit/rest --external:undici --external:xlsx-republish --external:csv-parse",
117
- "postbuild:cli": "cp cli-wrapper.mjs dist/lula2 && chmod +x dist/lula2",
118
- "preview": "vite preview",
119
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json && tsc --noEmit",
120
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
121
- "format": "prettier --write 'src/**/*.{ts,js,svelte}' 'cli/**/*.ts' 'index.ts' 'tests/**/*.ts'",
122
- "format:check": "prettier --check 'src/**/*.{ts,js,svelte}' 'cli/**/*.ts' 'index.ts' 'tests/**/*.ts'",
123
- "lint": "prettier --check 'src/**/*.{ts,js,svelte}' 'cli/**/*.ts' 'index.ts' 'tests/**/*.ts' && eslint src cli",
124
- "test": "npm run test:unit -- --run --coverage",
125
- "test:integration": "vitest --config integration/vitest.config.integration.ts",
126
- "test:unit": "vitest"
127
- }
128
- }
2
+ "name": "lula2",
3
+ "version": "0.7.5",
4
+ "description": "A tool for managing compliance as code in your GitHub repositories.",
5
+ "bin": {
6
+ "lula2": "./dist/lula2"
7
+ },
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "type": "module",
11
+ "engines": {
12
+ "node": ">=22.20.0"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/defenseunicorns/lula.git"
17
+ },
18
+ "keywords": [
19
+ "compliance",
20
+ "devops",
21
+ "devsecops"
22
+ ],
23
+ "author": "Defense Unicorns",
24
+ "license": "Apache-2.0",
25
+ "bugs": {
26
+ "url": "https://github.com/defenseunicorns/lula/issues"
27
+ },
28
+ "homepage": "https://github.com/defenseunicorns/lula#readme",
29
+ "files": [
30
+ "/src",
31
+ "/dist",
32
+ "!src/**/*.test.ts",
33
+ "!dist/**/*.test.js*",
34
+ "!dist/**/*.test.d.ts*"
35
+ ],
36
+ "scripts": {
37
+ "dev": "vite dev --port 5173",
38
+ "dev:api": "tsx --watch index.ts --debug ui --port 3000 --no-open-browser",
39
+ "dev:full": "concurrently \"npm run dev:api\" \"npm run dev\"",
40
+ "build": "npm run build:svelte && npm run build:cli && npm run postbuild:cli",
41
+ "build:svelte": "vite build",
42
+ "build:cli": "esbuild index.ts cli/**/*.ts --bundle --platform=node --target=node22 --format=esm --outdir=dist --external:express --external:commander --external:js-yaml --external:yaml --external:isomorphic-git --external:glob --external:open --external:ws --external:cors --external:multer --external:@octokit/rest --external:undici --external:xlsx-republish --external:csv-parse",
43
+ "postbuild:cli": "cp cli-wrapper.mjs dist/lula2 && chmod +x dist/lula2",
44
+ "preview": "vite preview",
45
+ "prepare": "svelte-kit sync || echo ''",
46
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json && tsc --noEmit",
47
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
48
+ "format": "prettier --write 'src/**/*.{ts,js,svelte}' 'cli/**/*.ts' 'index.ts' 'tests/**/*.ts'",
49
+ "format:check": "prettier --check 'src/**/*.{ts,js,svelte}' 'cli/**/*.ts' 'index.ts' 'tests/**/*.ts'",
50
+ "lint": "prettier --check 'src/**/*.{ts,js,svelte}' 'cli/**/*.ts' 'index.ts' 'tests/**/*.ts' && eslint src cli",
51
+ "test": "npm run test:unit -- --run --coverage",
52
+ "test:integration": "vitest --config integration/vitest.config.integration.ts",
53
+ "test:unit": "vitest"
54
+ },
55
+ "dependencies": {
56
+ "@octokit/rest": "22.0.1",
57
+ "@types/ws": "8.18.1",
58
+ "commander": "14.0.2",
59
+ "cors": "2.8.5",
60
+ "csv-parse": "6.1.0",
61
+ "express": "5.2.1",
62
+ "express-rate-limit": "8.2.1",
63
+ "flowbite": "4.0.1",
64
+ "glob": "13.0.0",
65
+ "isomorphic-git": "1.36.0",
66
+ "js-yaml": "4.1.1",
67
+ "multer": "2.0.2",
68
+ "open": "11.0.0",
69
+ "undici": "7.16.0",
70
+ "ws": "8.18.3",
71
+ "xlsx-republish": "0.20.3",
72
+ "yaml": "2.8.2"
73
+ },
74
+ "devDependencies": {
75
+ "@commitlint/cli": "^20.0.0",
76
+ "@commitlint/config-conventional": "^20.0.0",
77
+ "@defenseunicorns/eslint-config": "^1.1.2",
78
+ "@eslint/compat": "^2.0.0",
79
+ "@eslint/eslintrc": "^3.3.1",
80
+ "@eslint/js": "^9.35.0",
81
+ "@playwright/test": "^1.55.0",
82
+ "@sveltejs/adapter-static": "^3.0.9",
83
+ "@sveltejs/kit": "^2.37.1",
84
+ "@sveltejs/vite-plugin-svelte": "^6.1.4",
85
+ "@tailwindcss/vite": "^4.1.13",
86
+ "@types/cors": "^2.8.19",
87
+ "@types/express": "^5.0.3",
88
+ "@types/js-yaml": "^4.0.9",
89
+ "@types/jsdom": "^27.0.0",
90
+ "@types/multer": "^2.0.0",
91
+ "@types/node": "^24.4.0",
92
+ "@typescript-eslint/eslint-plugin": "^8.42.0",
93
+ "@typescript-eslint/parser": "^8.42.0",
94
+ "@vitest/browser": "^4.0.1",
95
+ "@vitest/coverage-v8": "^4.0.1",
96
+ "carbon-icons-svelte": "^13.5.0",
97
+ "carbon-preprocess-svelte": "^0.11.11",
98
+ "concurrently": "^9.2.1",
99
+ "esbuild": "^0.27.0",
100
+ "eslint": "^9.35.0",
101
+ "eslint-config-prettier": "^10.1.8",
102
+ "eslint-plugin-jsdoc": "^61.0.0",
103
+ "eslint-plugin-svelte": "^3.12.2",
104
+ "globals": "^16.3.0",
105
+ "husky": "^9.1.7",
106
+ "jsdom": "^27.0.0",
107
+ "playwright": "^1.55.0",
108
+ "prettier": "3.7.4",
109
+ "prettier-plugin-svelte": "^3.4.0",
110
+ "semantic-release": "^25.0.1",
111
+ "shellcheck": "^4.1.0",
112
+ "svelte": "^5.38.7",
113
+ "svelte-check": "^4.3.1",
114
+ "tailwind-merge": "^3.3.1",
115
+ "tailwindcss": "^4.1.13",
116
+ "tsx": "^4.20.5",
117
+ "typescript": "5.9.3",
118
+ "typescript-eslint": "^8.42.0",
119
+ "vite": "^7.1.4",
120
+ "vitest": "^4.0.1",
121
+ "vitest-browser-svelte": "^2.0.0"
122
+ },
123
+ "release": {
124
+ "branches": [
125
+ "main",
126
+ "next"
127
+ ]
128
+ }
129
+ }
@@ -8,7 +8,7 @@
8
8
  interface Props {
9
9
  mapping: Mapping;
10
10
  onEdit?: (mapping: Mapping) => void;
11
- onDelete?: (uuid: string) => void;
11
+ onDelete?: (hash: string) => void;
12
12
  showActions?: boolean;
13
13
  }
14
14
 
@@ -23,8 +23,8 @@
23
23
  }
24
24
 
25
25
  function handleDelete() {
26
- if (confirm('Are you sure you want to delete this mapping?')) {
27
- onDelete?.(mapping.uuid);
26
+ if (confirm('Are you sure you want to delete this mapping? '+ mapping.uuid)) {
27
+ onDelete?.(mapping.hash!);
28
28
  }
29
29
  }
30
30
  </script>
@@ -35,8 +35,17 @@
35
35
  justification: data.justification,
36
36
  status: data.status,
37
37
  source_entries: data.source_entries,
38
- uuid: data.uuid || '' // Use the UUID from form or empty for auto-generation
38
+ uuid: data.uuid || '', // Use the UUID from form or empty for auto-generation,
39
+ hash: ''
39
40
  };
41
+ const hash = await fetch('/hash', {
42
+ method: 'POST',
43
+ headers: {
44
+ 'Content-Type': 'application/json'
45
+ },
46
+ body: JSON.stringify(mappingData)
47
+ });
48
+ mappingData.hash = (await hash.json()).hash;
40
49
 
41
50
  await wsClient.createMapping(mappingData);
42
51
  resetMappingForm();
@@ -80,18 +89,12 @@
80
89
  uuid: data.uuid || editingMapping.uuid, // Use form UUID or fallback to original
81
90
  justification: data.justification,
82
91
  status: data.status,
83
- source_entries: data.source_entries
92
+ source_entries: data.source_entries,
84
93
  };
85
-
86
- const uuidChanged = updatedMapping.uuid !== editingMapping.uuid;
87
-
88
- if (uuidChanged) {
89
- const compositeId = `${control.id}:${editingMapping.uuid}`;
90
- await wsClient.deleteMapping(compositeId);
91
- await wsClient.createMapping(updatedMapping);
92
- } else {
93
- await wsClient.updateMapping(updatedMapping);
94
- }
94
+ // hashes change every time so we just delete an create
95
+ await wsClient.deleteMapping(`${editingMapping.control_id}:${editingMapping.hash!}`);
96
+ delete updatedMapping.hash;
97
+ await wsClient.createMapping(updatedMapping);
95
98
 
96
99
  resetMappingForm();
97
100
  } catch (error) {
@@ -99,10 +102,17 @@
99
102
  }
100
103
  }
101
104
 
102
- async function handleDeleteMapping(uuid: string) {
105
+ async function handleDeleteMapping(hash: string) {
106
+ // Find the mapping by hash to get the UUID for backend deletion
107
+ const mappingToDelete = mappings.find(m => (m.hash === hash));
108
+ if (!mappingToDelete) {
109
+ console.error('Mapping not found for deletion');
110
+ return;
111
+ }
112
+
103
113
  try {
104
- const compositeId = `${control.id}:${uuid}`;
105
- await wsClient.deleteMapping(compositeId);
114
+ // Backend expects UUID for file operations
115
+ await wsClient.deleteMapping(`${mappingToDelete.control_id}:${mappingToDelete.hash!}`);
106
116
  } catch (error) {
107
117
  console.error('Failed to delete mapping:', error);
108
118
  }
@@ -113,8 +123,8 @@
113
123
  <!-- Existing Mappings -->
114
124
  {#if mappings.length > 0}
115
125
  <div class="space-y-4">
116
- {#each mappings as mapping (mapping.uuid)}
117
- {#if editingMapping && editingMapping.uuid === mapping.uuid}
126
+ {#each mappings as mapping (mapping.hash)}
127
+ {#if editingMapping && editingMapping.hash === mapping.hash}
118
128
  <!-- Edit Form in place of the mapping being edited -->
119
129
  <div
120
130
  class="bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm"
package/src/lib/types.ts CHANGED
@@ -36,6 +36,8 @@ export interface Mapping {
36
36
  justification: string;
37
37
  source_entries: SourceEntry[];
38
38
  status: 'planned' | 'implemented' | 'verified';
39
+ cci?: string;
40
+ hash?: string;
39
41
  created_by?: string;
40
42
  }
41
43
 
@@ -355,12 +355,8 @@ class WebSocketClient {
355
355
  return this.sendCommand('create-mapping', mapping);
356
356
  }
357
357
 
358
- async updateMapping(mapping: Mapping) {
359
- return this.sendCommand('update-mapping', mapping);
360
- }
361
-
362
- async deleteMapping(uuid: string) {
363
- return this.sendCommand('delete-mapping', { uuid });
358
+ async deleteMapping(composite_key: string) {
359
+ return this.sendCommand('delete-mapping', { composite_key });
364
360
  }
365
361
 
366
362
  async switchControlSet(path: string) {
@@ -1 +0,0 @@
1
- import{l as o,a as r}from"../chunks/CgqRWI7t.js";export{o as load_css,r as start};