Browse Source

display readme by default

display commit history
main
Silberengel 4 weeks ago
parent
commit
b3493e371c
  1. 272
      package-lock.json
  2. 3
      package.json
  3. 58
      src/lib/components/CodeEditor.svelte
  4. 4
      src/lib/services/git/repo-manager.ts
  5. 2
      src/lib/services/messaging/event-forwarder.ts
  6. 4
      src/lib/services/messaging/preferences-storage.server.ts
  7. 2
      src/lib/services/nostr/repo-polling.ts
  8. 85
      src/routes/repos/[npub]/[repo]/+page.svelte

272
package-lock.json generated

@ -8,9 +8,12 @@
"name": "gitrepublic-web", "name": "gitrepublic-web",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@codemirror/autocomplete": "^6.20.0",
"@codemirror/basic-setup": "^0.20.0", "@codemirror/basic-setup": "^0.20.0",
"@codemirror/commands": "^6.10.1",
"@codemirror/lang-markdown": "^6.5.0", "@codemirror/lang-markdown": "^6.5.0",
"@codemirror/language": "^6.12.1", "@codemirror/language": "^6.12.1",
"@codemirror/search": "^6.6.0",
"@codemirror/state": "^6.5.4", "@codemirror/state": "^6.5.4",
"@codemirror/view": "^6.39.14", "@codemirror/view": "^6.39.14",
"@sveltejs/kit": "^2.0.0", "@sveltejs/kit": "^2.0.0",
@ -170,66 +173,23 @@
} }
}, },
"node_modules/@codemirror/autocomplete": { "node_modules/@codemirror/autocomplete": {
"version": "0.20.3", "version": "6.20.0",
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-0.20.3.tgz", "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.0.tgz",
"integrity": "sha512-lYB+NPGP+LEzAudkWhLfMxhTrxtLILGl938w+RcFrGdrIc54A+UgmCoz+McE3IYRFp4xyQcL4uFJwo+93YdgHw==", "integrity": "sha512-bOwvTOIJcG5FVo5gUUupiwYh8MioPLQ4UcqbcRf7UQ98X90tCa9E1kZ3Z7tqwpZxYyOvh1YTYbmZE9RTfTp5hg==",
"license": "MIT",
"dependencies": {
"@codemirror/language": "^0.20.0",
"@codemirror/state": "^0.20.0",
"@codemirror/view": "^0.20.0",
"@lezer/common": "^0.16.0"
}
},
"node_modules/@codemirror/autocomplete/node_modules/@codemirror/language": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-0.20.2.tgz",
"integrity": "sha512-WB3Bnuusw0xhVvhBocieYKwJm04SOk5bPoOEYksVHKHcGHFOaYaw+eZVxR4gIqMMcGzOIUil0FsCmFk8yrhHpw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@codemirror/state": "^0.20.0", "@codemirror/language": "^6.0.0",
"@codemirror/view": "^0.20.0", "@codemirror/state": "^6.0.0",
"@lezer/common": "^0.16.0", "@codemirror/view": "^6.17.0",
"@lezer/highlight": "^0.16.0", "@lezer/common": "^1.0.0"
"@lezer/lr": "^0.16.0",
"style-mod": "^4.0.0"
} }
}, },
"node_modules/@codemirror/autocomplete/node_modules/@codemirror/state": { "node_modules/@codemirror/autocomplete/node_modules/@lezer/common": {
"version": "0.20.1", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/@codemirror/state/-/state-0.20.1.tgz", "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz",
"integrity": "sha512-ms0tlV5A02OK0pFvTtSUGMLkoarzh1F8mr6jy1cD7ucSC2X/VLHtQCxfhdSEGqTYlQF2hoZtmLv+amqhdgbwjQ==", "integrity": "sha512-6YRVG9vBkaY7p1IVxL4s44n5nUnaNnGM2/AckNgYOnxTG2kWh1vR8BMxPseWPjRNpb5VtXnMpeYAEAADoRV1Iw==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@codemirror/autocomplete/node_modules/@codemirror/view": {
"version": "0.20.7",
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-0.20.7.tgz",
"integrity": "sha512-pqEPCb9QFTOtHgAH5XU/oVy9UR/Anj6r+tG5CRmkNVcqSKEPmBU05WtN/jxJCFZBXf6HumzWC9ydE4qstO3TxQ==",
"license": "MIT",
"dependencies": {
"@codemirror/state": "^0.20.0",
"style-mod": "^4.0.0",
"w3c-keyname": "^2.2.4"
}
},
"node_modules/@codemirror/autocomplete/node_modules/@lezer/highlight": {
"version": "0.16.0",
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-0.16.0.tgz",
"integrity": "sha512-iE5f4flHlJ1g1clOStvXNLbORJoiW4Kytso6ubfYzHnaNo/eo5SKhxs4wv/rtvwZQeZrK3we8S9SyA7OGOoRKQ==",
"license": "MIT",
"dependencies": {
"@lezer/common": "^0.16.0"
}
},
"node_modules/@codemirror/autocomplete/node_modules/@lezer/lr": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-0.16.3.tgz",
"integrity": "sha512-pau7um4eAw94BEuuShUIeQDTf3k4Wt6oIUOYxMmkZgDHdqtIcxWND4LRxi8nI9KuT4I1bXQv67BCapkxt7Ywqw==",
"license": "MIT",
"dependencies": {
"@lezer/common": "^0.16.0"
}
},
"node_modules/@codemirror/basic-setup": { "node_modules/@codemirror/basic-setup": {
"version": "0.20.0", "version": "0.20.0",
"resolved": "https://registry.npmjs.org/@codemirror/basic-setup/-/basic-setup-0.20.0.tgz", "resolved": "https://registry.npmjs.org/@codemirror/basic-setup/-/basic-setup-0.20.0.tgz",
@ -246,56 +206,19 @@
"@codemirror/view": "^0.20.0" "@codemirror/view": "^0.20.0"
} }
}, },
"node_modules/@codemirror/basic-setup/node_modules/@codemirror/language": { "node_modules/@codemirror/basic-setup/node_modules/@codemirror/autocomplete": {
"version": "0.20.2", "version": "0.20.3",
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-0.20.2.tgz", "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-0.20.3.tgz",
"integrity": "sha512-WB3Bnuusw0xhVvhBocieYKwJm04SOk5bPoOEYksVHKHcGHFOaYaw+eZVxR4gIqMMcGzOIUil0FsCmFk8yrhHpw==", "integrity": "sha512-lYB+NPGP+LEzAudkWhLfMxhTrxtLILGl938w+RcFrGdrIc54A+UgmCoz+McE3IYRFp4xyQcL4uFJwo+93YdgHw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@codemirror/language": "^0.20.0",
"@codemirror/state": "^0.20.0", "@codemirror/state": "^0.20.0",
"@codemirror/view": "^0.20.0", "@codemirror/view": "^0.20.0",
"@lezer/common": "^0.16.0",
"@lezer/highlight": "^0.16.0",
"@lezer/lr": "^0.16.0",
"style-mod": "^4.0.0"
}
},
"node_modules/@codemirror/basic-setup/node_modules/@codemirror/state": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@codemirror/state/-/state-0.20.1.tgz",
"integrity": "sha512-ms0tlV5A02OK0pFvTtSUGMLkoarzh1F8mr6jy1cD7ucSC2X/VLHtQCxfhdSEGqTYlQF2hoZtmLv+amqhdgbwjQ==",
"license": "MIT"
},
"node_modules/@codemirror/basic-setup/node_modules/@codemirror/view": {
"version": "0.20.7",
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-0.20.7.tgz",
"integrity": "sha512-pqEPCb9QFTOtHgAH5XU/oVy9UR/Anj6r+tG5CRmkNVcqSKEPmBU05WtN/jxJCFZBXf6HumzWC9ydE4qstO3TxQ==",
"license": "MIT",
"dependencies": {
"@codemirror/state": "^0.20.0",
"style-mod": "^4.0.0",
"w3c-keyname": "^2.2.4"
}
},
"node_modules/@codemirror/basic-setup/node_modules/@lezer/highlight": {
"version": "0.16.0",
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-0.16.0.tgz",
"integrity": "sha512-iE5f4flHlJ1g1clOStvXNLbORJoiW4Kytso6ubfYzHnaNo/eo5SKhxs4wv/rtvwZQeZrK3we8S9SyA7OGOoRKQ==",
"license": "MIT",
"dependencies": {
"@lezer/common": "^0.16.0" "@lezer/common": "^0.16.0"
} }
}, },
"node_modules/@codemirror/basic-setup/node_modules/@lezer/lr": { "node_modules/@codemirror/basic-setup/node_modules/@codemirror/commands": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-0.16.3.tgz",
"integrity": "sha512-pau7um4eAw94BEuuShUIeQDTf3k4Wt6oIUOYxMmkZgDHdqtIcxWND4LRxi8nI9KuT4I1bXQv67BCapkxt7Ywqw==",
"license": "MIT",
"dependencies": {
"@lezer/common": "^0.16.0"
}
},
"node_modules/@codemirror/commands": {
"version": "0.20.0", "version": "0.20.0",
"resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-0.20.0.tgz", "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-0.20.0.tgz",
"integrity": "sha512-v9L5NNVA+A9R6zaFvaTbxs30kc69F6BkOoiEbeFw4m4I0exmDEKBILN6mK+GksJtvTzGBxvhAPlVFTdQW8GB7Q==", "integrity": "sha512-v9L5NNVA+A9R6zaFvaTbxs30kc69F6BkOoiEbeFw4m4I0exmDEKBILN6mK+GksJtvTzGBxvhAPlVFTdQW8GB7Q==",
@ -307,7 +230,7 @@
"@lezer/common": "^0.16.0" "@lezer/common": "^0.16.0"
} }
}, },
"node_modules/@codemirror/commands/node_modules/@codemirror/language": { "node_modules/@codemirror/basic-setup/node_modules/@codemirror/language": {
"version": "0.20.2", "version": "0.20.2",
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-0.20.2.tgz", "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-0.20.2.tgz",
"integrity": "sha512-WB3Bnuusw0xhVvhBocieYKwJm04SOk5bPoOEYksVHKHcGHFOaYaw+eZVxR4gIqMMcGzOIUil0FsCmFk8yrhHpw==", "integrity": "sha512-WB3Bnuusw0xhVvhBocieYKwJm04SOk5bPoOEYksVHKHcGHFOaYaw+eZVxR4gIqMMcGzOIUil0FsCmFk8yrhHpw==",
@ -321,13 +244,24 @@
"style-mod": "^4.0.0" "style-mod": "^4.0.0"
} }
}, },
"node_modules/@codemirror/commands/node_modules/@codemirror/state": { "node_modules/@codemirror/basic-setup/node_modules/@codemirror/search": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@codemirror/search/-/search-0.20.1.tgz",
"integrity": "sha512-ROe6gRboQU5E4z6GAkNa2kxhXqsGNbeLEisbvzbOeB7nuDYXUZ70vGIgmqPu0tB+1M3F9yWk6W8k2vrFpJaD4Q==",
"license": "MIT",
"dependencies": {
"@codemirror/state": "^0.20.0",
"@codemirror/view": "^0.20.0",
"crelt": "^1.0.5"
}
},
"node_modules/@codemirror/basic-setup/node_modules/@codemirror/state": {
"version": "0.20.1", "version": "0.20.1",
"resolved": "https://registry.npmjs.org/@codemirror/state/-/state-0.20.1.tgz", "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-0.20.1.tgz",
"integrity": "sha512-ms0tlV5A02OK0pFvTtSUGMLkoarzh1F8mr6jy1cD7ucSC2X/VLHtQCxfhdSEGqTYlQF2hoZtmLv+amqhdgbwjQ==", "integrity": "sha512-ms0tlV5A02OK0pFvTtSUGMLkoarzh1F8mr6jy1cD7ucSC2X/VLHtQCxfhdSEGqTYlQF2hoZtmLv+amqhdgbwjQ==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@codemirror/commands/node_modules/@codemirror/view": { "node_modules/@codemirror/basic-setup/node_modules/@codemirror/view": {
"version": "0.20.7", "version": "0.20.7",
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-0.20.7.tgz", "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-0.20.7.tgz",
"integrity": "sha512-pqEPCb9QFTOtHgAH5XU/oVy9UR/Anj6r+tG5CRmkNVcqSKEPmBU05WtN/jxJCFZBXf6HumzWC9ydE4qstO3TxQ==", "integrity": "sha512-pqEPCb9QFTOtHgAH5XU/oVy9UR/Anj6r+tG5CRmkNVcqSKEPmBU05WtN/jxJCFZBXf6HumzWC9ydE4qstO3TxQ==",
@ -338,7 +272,7 @@
"w3c-keyname": "^2.2.4" "w3c-keyname": "^2.2.4"
} }
}, },
"node_modules/@codemirror/commands/node_modules/@lezer/highlight": { "node_modules/@codemirror/basic-setup/node_modules/@lezer/highlight": {
"version": "0.16.0", "version": "0.16.0",
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-0.16.0.tgz", "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-0.16.0.tgz",
"integrity": "sha512-iE5f4flHlJ1g1clOStvXNLbORJoiW4Kytso6ubfYzHnaNo/eo5SKhxs4wv/rtvwZQeZrK3we8S9SyA7OGOoRKQ==", "integrity": "sha512-iE5f4flHlJ1g1clOStvXNLbORJoiW4Kytso6ubfYzHnaNo/eo5SKhxs4wv/rtvwZQeZrK3we8S9SyA7OGOoRKQ==",
@ -347,7 +281,7 @@
"@lezer/common": "^0.16.0" "@lezer/common": "^0.16.0"
} }
}, },
"node_modules/@codemirror/commands/node_modules/@lezer/lr": { "node_modules/@codemirror/basic-setup/node_modules/@lezer/lr": {
"version": "0.16.3", "version": "0.16.3",
"resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-0.16.3.tgz", "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-0.16.3.tgz",
"integrity": "sha512-pau7um4eAw94BEuuShUIeQDTf3k4Wt6oIUOYxMmkZgDHdqtIcxWND4LRxi8nI9KuT4I1bXQv67BCapkxt7Ywqw==", "integrity": "sha512-pau7um4eAw94BEuuShUIeQDTf3k4Wt6oIUOYxMmkZgDHdqtIcxWND4LRxi8nI9KuT4I1bXQv67BCapkxt7Ywqw==",
@ -356,6 +290,24 @@
"@lezer/common": "^0.16.0" "@lezer/common": "^0.16.0"
} }
}, },
"node_modules/@codemirror/commands": {
"version": "6.10.2",
"resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.10.2.tgz",
"integrity": "sha512-vvX1fsih9HledO1c9zdotZYUZnE4xV0m6i3m25s5DIfXofuprk6cRcLUZvSk3CASUbwjQX21tOGbkY2BH8TpnQ==",
"license": "MIT",
"dependencies": {
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.4.0",
"@codemirror/view": "^6.27.0",
"@lezer/common": "^1.1.0"
}
},
"node_modules/@codemirror/commands/node_modules/@lezer/common": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz",
"integrity": "sha512-6YRVG9vBkaY7p1IVxL4s44n5nUnaNnGM2/AckNgYOnxTG2kWh1vR8BMxPseWPjRNpb5VtXnMpeYAEAADoRV1Iw==",
"license": "MIT"
},
"node_modules/@codemirror/lang-css": { "node_modules/@codemirror/lang-css": {
"version": "6.3.1", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.3.1.tgz", "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.3.1.tgz",
@ -369,18 +321,6 @@
"@lezer/css": "^1.1.7" "@lezer/css": "^1.1.7"
} }
}, },
"node_modules/@codemirror/lang-css/node_modules/@codemirror/autocomplete": {
"version": "6.20.0",
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.0.tgz",
"integrity": "sha512-bOwvTOIJcG5FVo5gUUupiwYh8MioPLQ4UcqbcRf7UQ98X90tCa9E1kZ3Z7tqwpZxYyOvh1YTYbmZE9RTfTp5hg==",
"license": "MIT",
"dependencies": {
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.0.0",
"@codemirror/view": "^6.17.0",
"@lezer/common": "^1.0.0"
}
},
"node_modules/@codemirror/lang-css/node_modules/@lezer/common": { "node_modules/@codemirror/lang-css/node_modules/@lezer/common": {
"version": "1.5.1", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz", "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz",
@ -404,18 +344,6 @@
"@lezer/html": "^1.3.12" "@lezer/html": "^1.3.12"
} }
}, },
"node_modules/@codemirror/lang-html/node_modules/@codemirror/autocomplete": {
"version": "6.20.0",
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.0.tgz",
"integrity": "sha512-bOwvTOIJcG5FVo5gUUupiwYh8MioPLQ4UcqbcRf7UQ98X90tCa9E1kZ3Z7tqwpZxYyOvh1YTYbmZE9RTfTp5hg==",
"license": "MIT",
"dependencies": {
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.0.0",
"@codemirror/view": "^6.17.0",
"@lezer/common": "^1.0.0"
}
},
"node_modules/@codemirror/lang-html/node_modules/@lezer/common": { "node_modules/@codemirror/lang-html/node_modules/@lezer/common": {
"version": "1.5.1", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz", "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz",
@ -437,18 +365,6 @@
"@lezer/javascript": "^1.0.0" "@lezer/javascript": "^1.0.0"
} }
}, },
"node_modules/@codemirror/lang-javascript/node_modules/@codemirror/autocomplete": {
"version": "6.20.0",
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.0.tgz",
"integrity": "sha512-bOwvTOIJcG5FVo5gUUupiwYh8MioPLQ4UcqbcRf7UQ98X90tCa9E1kZ3Z7tqwpZxYyOvh1YTYbmZE9RTfTp5hg==",
"license": "MIT",
"dependencies": {
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.0.0",
"@codemirror/view": "^6.17.0",
"@lezer/common": "^1.0.0"
}
},
"node_modules/@codemirror/lang-javascript/node_modules/@codemirror/lint": { "node_modules/@codemirror/lang-javascript/node_modules/@codemirror/lint": {
"version": "6.9.4", "version": "6.9.4",
"resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.9.4.tgz", "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.9.4.tgz",
@ -481,18 +397,6 @@
"@lezer/markdown": "^1.0.0" "@lezer/markdown": "^1.0.0"
} }
}, },
"node_modules/@codemirror/lang-markdown/node_modules/@codemirror/autocomplete": {
"version": "6.20.0",
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.0.tgz",
"integrity": "sha512-bOwvTOIJcG5FVo5gUUupiwYh8MioPLQ4UcqbcRf7UQ98X90tCa9E1kZ3Z7tqwpZxYyOvh1YTYbmZE9RTfTp5hg==",
"license": "MIT",
"dependencies": {
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.0.0",
"@codemirror/view": "^6.17.0",
"@lezer/common": "^1.0.0"
}
},
"node_modules/@codemirror/lang-markdown/node_modules/@lezer/common": { "node_modules/@codemirror/lang-markdown/node_modules/@lezer/common": {
"version": "1.5.1", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz", "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz",
@ -548,33 +452,16 @@
} }
}, },
"node_modules/@codemirror/search": { "node_modules/@codemirror/search": {
"version": "0.20.1", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/@codemirror/search/-/search-0.20.1.tgz", "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.6.0.tgz",
"integrity": "sha512-ROe6gRboQU5E4z6GAkNa2kxhXqsGNbeLEisbvzbOeB7nuDYXUZ70vGIgmqPu0tB+1M3F9yWk6W8k2vrFpJaD4Q==", "integrity": "sha512-koFuNXcDvyyotWcgOnZGmY7LZqEOXZaaxD/j6n18TCLx2/9HieZJ5H6hs1g8FiRxBD0DNfs0nXn17g872RmYdw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@codemirror/state": "^0.20.0", "@codemirror/state": "^6.0.0",
"@codemirror/view": "^0.20.0", "@codemirror/view": "^6.37.0",
"crelt": "^1.0.5" "crelt": "^1.0.5"
} }
}, },
"node_modules/@codemirror/search/node_modules/@codemirror/state": {
"version": "0.20.1",
"resolved": "https://registry.npmjs.org/@codemirror/state/-/state-0.20.1.tgz",
"integrity": "sha512-ms0tlV5A02OK0pFvTtSUGMLkoarzh1F8mr6jy1cD7ucSC2X/VLHtQCxfhdSEGqTYlQF2hoZtmLv+amqhdgbwjQ==",
"license": "MIT"
},
"node_modules/@codemirror/search/node_modules/@codemirror/view": {
"version": "0.20.7",
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-0.20.7.tgz",
"integrity": "sha512-pqEPCb9QFTOtHgAH5XU/oVy9UR/Anj6r+tG5CRmkNVcqSKEPmBU05WtN/jxJCFZBXf6HumzWC9ydE4qstO3TxQ==",
"license": "MIT",
"dependencies": {
"@codemirror/state": "^0.20.0",
"style-mod": "^4.0.0",
"w3c-keyname": "^2.2.4"
}
},
"node_modules/@codemirror/state": { "node_modules/@codemirror/state": {
"version": "6.5.4", "version": "6.5.4",
"resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.4.tgz", "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.4.tgz",
@ -2644,30 +2531,6 @@
"integrity": "sha512-h6Xhj+ZsWh/DTNE3xMfRv9edufchsVVwPED7wSGMeEdoYk/UtCZmwRGH0ZZQkr43aNVF3tWGLZJGT+cAeYgUIg==", "integrity": "sha512-h6Xhj+ZsWh/DTNE3xMfRv9edufchsVVwPED7wSGMeEdoYk/UtCZmwRGH0ZZQkr43aNVF3tWGLZJGT+cAeYgUIg==",
"license": "BSD" "license": "BSD"
}, },
"node_modules/codemirror/node_modules/@codemirror/autocomplete": {
"version": "6.20.0",
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.0.tgz",
"integrity": "sha512-bOwvTOIJcG5FVo5gUUupiwYh8MioPLQ4UcqbcRf7UQ98X90tCa9E1kZ3Z7tqwpZxYyOvh1YTYbmZE9RTfTp5hg==",
"license": "MIT",
"dependencies": {
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.0.0",
"@codemirror/view": "^6.17.0",
"@lezer/common": "^1.0.0"
}
},
"node_modules/codemirror/node_modules/@codemirror/commands": {
"version": "6.10.2",
"resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.10.2.tgz",
"integrity": "sha512-vvX1fsih9HledO1c9zdotZYUZnE4xV0m6i3m25s5DIfXofuprk6cRcLUZvSk3CASUbwjQX21tOGbkY2BH8TpnQ==",
"license": "MIT",
"dependencies": {
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.4.0",
"@codemirror/view": "^6.27.0",
"@lezer/common": "^1.1.0"
}
},
"node_modules/codemirror/node_modules/@codemirror/lint": { "node_modules/codemirror/node_modules/@codemirror/lint": {
"version": "6.9.4", "version": "6.9.4",
"resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.9.4.tgz", "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.9.4.tgz",
@ -2679,23 +2542,6 @@
"crelt": "^1.0.5" "crelt": "^1.0.5"
} }
}, },
"node_modules/codemirror/node_modules/@codemirror/search": {
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.6.0.tgz",
"integrity": "sha512-koFuNXcDvyyotWcgOnZGmY7LZqEOXZaaxD/j6n18TCLx2/9HieZJ5H6hs1g8FiRxBD0DNfs0nXn17g872RmYdw==",
"license": "MIT",
"dependencies": {
"@codemirror/state": "^6.0.0",
"@codemirror/view": "^6.37.0",
"crelt": "^1.0.5"
}
},
"node_modules/codemirror/node_modules/@lezer/common": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz",
"integrity": "sha512-6YRVG9vBkaY7p1IVxL4s44n5nUnaNnGM2/AckNgYOnxTG2kWh1vR8BMxPseWPjRNpb5VtXnMpeYAEAADoRV1Iw==",
"license": "MIT"
},
"node_modules/color-convert": { "node_modules/color-convert": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",

3
package.json

@ -12,9 +12,12 @@
"format": "prettier --write ." "format": "prettier --write ."
}, },
"dependencies": { "dependencies": {
"@codemirror/autocomplete": "^6.20.0",
"@codemirror/basic-setup": "^0.20.0", "@codemirror/basic-setup": "^0.20.0",
"@codemirror/commands": "^6.10.1",
"@codemirror/lang-markdown": "^6.5.0", "@codemirror/lang-markdown": "^6.5.0",
"@codemirror/language": "^6.12.1", "@codemirror/language": "^6.12.1",
"@codemirror/search": "^6.6.0",
"@codemirror/state": "^6.5.4", "@codemirror/state": "^6.5.4",
"@codemirror/view": "^6.39.14", "@codemirror/view": "^6.39.14",
"@sveltejs/kit": "^2.0.0", "@sveltejs/kit": "^2.0.0",

58
src/lib/components/CodeEditor.svelte

@ -1,8 +1,10 @@
<script lang="ts"> <script lang="ts">
import { onMount, onDestroy } from 'svelte'; import { onMount, onDestroy } from 'svelte';
import { EditorView } from '@codemirror/view'; import { EditorView, keymap } from '@codemirror/view';
import { EditorState, type Extension } from '@codemirror/state'; import { EditorState, type Extension, Compartment } from '@codemirror/state';
import { basicSetup } from '@codemirror/basic-setup'; import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
import { searchKeymap, highlightSelectionMatches } from '@codemirror/search';
import { closeBrackets, autocompletion, closeBracketsKeymap, completionKeymap } from '@codemirror/autocomplete';
import { markdown } from '@codemirror/lang-markdown'; import { markdown } from '@codemirror/lang-markdown';
import { StreamLanguage } from '@codemirror/language'; import { StreamLanguage } from '@codemirror/language';
import { asciidoc } from 'codemirror-asciidoc'; import { asciidoc } from 'codemirror-asciidoc';
@ -27,6 +29,7 @@
let editorView: EditorView | null = null; let editorView: EditorView | null = null;
let editorElement: HTMLDivElement; let editorElement: HTMLDivElement;
let languageCompartment = new Compartment();
function getLanguageExtension(): Extension[] { function getLanguageExtension(): Extension[] {
switch (language) { switch (language) {
@ -39,12 +42,22 @@
} }
} }
onMount(() => { function createExtensions(): Extension[] {
const state = EditorState.create({ const extensions: Extension[] = [
doc: content, history(),
extensions: [ closeBrackets(),
basicSetup, autocompletion(),
...getLanguageExtension(), highlightSelectionMatches(),
keymap.of([
...closeBracketsKeymap,
...defaultKeymap,
...searchKeymap,
...historyKeymap,
...completionKeymap
] as any),
// Add language extensions in a compartment for dynamic updates
languageCompartment.of(getLanguageExtension()),
// Add update listener
EditorView.updateListener.of((update) => { EditorView.updateListener.of((update) => {
if (update.docChanged) { if (update.docChanged) {
const newContent = update.state.doc.toString(); const newContent = update.state.doc.toString();
@ -69,8 +82,17 @@
} }
} }
}), }),
// Add editable state
EditorView.editable.of(!readOnly) EditorView.editable.of(!readOnly)
] ];
return extensions;
}
onMount(() => {
const state = EditorState.create({
doc: content,
extensions: createExtensions()
}); });
editorView = new EditorView({ editorView = new EditorView({
@ -103,20 +125,10 @@
// Update language when prop changes // Update language when prop changes
$effect(() => { $effect(() => {
if (editorView) { if (editorView) {
const state = EditorState.create({ // Update language extension using compartment
doc: editorView.state.doc.toString(), editorView.dispatch({
extensions: [ effects: languageCompartment.reconfigure(getLanguageExtension())
basicSetup,
...getLanguageExtension(),
EditorView.updateListener.of((update) => {
if (update.docChanged) {
const newContent = update.state.doc.toString();
onChange(newContent);
}
})
]
}); });
editorView.setState(state);
} }
}); });
</script> </script>

4
src/lib/services/git/repo-manager.ts

@ -124,7 +124,7 @@ export class RepoManager {
const isNewRepo = !repoExists; const isNewRepo = !repoExists;
if (isNewRepo && !isExistingRepo) { if (isNewRepo && !isExistingRepo) {
const { getCachedUserLevel } = await import('../security/user-level-cache.js'); const { getCachedUserLevel } = await import('../security/user-level-cache.js');
const { hasUnlimitedAccess } = await import('../utils/user-access.js'); const { hasUnlimitedAccess } = await import('../../utils/user-access.js');
const userLevel = getCachedUserLevel(event.pubkey); const userLevel = getCachedUserLevel(event.pubkey);
if (!hasUnlimitedAccess(userLevel?.level)) { if (!hasUnlimitedAccess(userLevel?.level)) {
throw new Error(`Repository creation requires unlimited access. User has level: ${userLevel?.level || 'none'}`); throw new Error(`Repository creation requires unlimited access. User has level: ${userLevel?.level || 'none'}`);
@ -533,7 +533,7 @@ export class RepoManager {
// For private repos, require owner to have unlimited access to prevent unauthorized creation // For private repos, require owner to have unlimited access to prevent unauthorized creation
if (!isPublic) { if (!isPublic) {
const { getCachedUserLevel } = await import('../security/user-level-cache.js'); const { getCachedUserLevel } = await import('../security/user-level-cache.js');
const { hasUnlimitedAccess } = await import('../utils/user-access.js'); const { hasUnlimitedAccess } = await import('../../utils/user-access.js');
const userLevel = getCachedUserLevel(announcementEvent.pubkey); const userLevel = getCachedUserLevel(announcementEvent.pubkey);
if (!hasUnlimitedAccess(userLevel?.level)) { if (!hasUnlimitedAccess(userLevel?.level)) {
logger.warn({ logger.warn({

2
src/lib/services/messaging/event-forwarder.ts

@ -621,7 +621,7 @@ export async function forwardEventIfEnabled(
try { try {
// Early returns for eligibility checks // Early returns for eligibility checks
const cached = getCachedUserLevel(userPubkeyHex); const cached = getCachedUserLevel(userPubkeyHex);
const { hasUnlimitedAccess } = await import('../utils/user-access.js'); const { hasUnlimitedAccess } = await import('../../utils/user-access.js');
if (!hasUnlimitedAccess(cached?.level)) { if (!hasUnlimitedAccess(cached?.level)) {
return; return;
} }

4
src/lib/services/messaging/preferences-storage.server.ts

@ -44,7 +44,7 @@ const LOOKUP_SECRET = process.env.MESSAGING_LOOKUP_SECRET;
const isMessagingConfigured = !!(ENCRYPTION_KEY && SALT_ENCRYPTION_KEY && LOOKUP_SECRET); const isMessagingConfigured = !!(ENCRYPTION_KEY && SALT_ENCRYPTION_KEY && LOOKUP_SECRET);
if (!isMessagingConfigured) { if (!isMessagingConfigured) {
logger.warn('Messaging preferences storage is not configured. Missing environment variables: MESSAGING_PREFS_ENCRYPTION_KEY, MESSAGING_SALT_ENCRYPTION_KEY, MESSAGING_LOOKUP_SECRET'); logger.info('Messaging preferences storage is disabled (optional feature). To enable, set environment variables: MESSAGING_PREFS_ENCRYPTION_KEY, MESSAGING_SALT_ENCRYPTION_KEY, MESSAGING_LOOKUP_SECRET');
} }
interface StoredPreferences { interface StoredPreferences {
@ -213,7 +213,7 @@ export async function storePreferences(
// Verify user has unlimited access // Verify user has unlimited access
const cached = getCachedUserLevel(userPubkeyHex); const cached = getCachedUserLevel(userPubkeyHex);
const { hasUnlimitedAccess } = await import('../utils/user-access.js'); const { hasUnlimitedAccess } = await import('../../utils/user-access.js');
if (!hasUnlimitedAccess(cached?.level)) { if (!hasUnlimitedAccess(cached?.level)) {
throw new Error('Messaging forwarding requires unlimited access'); throw new Error('Messaging forwarding requires unlimited access');
} }

2
src/lib/services/nostr/repo-polling.ts

@ -167,7 +167,7 @@ export class RepoPollingService {
// This prevents spam and abuse // This prevents spam and abuse
if (!isExistingRepo) { if (!isExistingRepo) {
const userLevel = getCachedUserLevel(event.pubkey); const userLevel = getCachedUserLevel(event.pubkey);
const { hasUnlimitedAccess } = await import('../utils/user-access.js'); const { hasUnlimitedAccess } = await import('../../utils/user-access.js');
if (!hasUnlimitedAccess(userLevel?.level)) { if (!hasUnlimitedAccess(userLevel?.level)) {
logger.warn({ logger.warn({
eventId: event.id, eventId: event.id,

85
src/routes/repos/[npub]/[repo]/+page.svelte

@ -1595,6 +1595,17 @@
files = await response.json(); files = await response.json();
currentPath = path; currentPath = path;
// Auto-load README if we're in the root directory and no file is currently selected
if (path === '' && !currentFile) {
const readmeFile = findReadmeFile(files);
if (readmeFile) {
// Small delay to ensure UI is ready
setTimeout(() => {
loadFile(readmeFile.path);
}, 100);
}
}
} catch (err) { } catch (err) {
error = err instanceof Error ? err.message : 'Failed to load files'; error = err instanceof Error ? err.message : 'Failed to load files';
console.error('Error loading files:', err); console.error('Error loading files:', err);
@ -1603,6 +1614,43 @@
} }
} }
// Helper function to find README file in file list
function findReadmeFile(fileList: Array<{ name: string; path: string; type: 'file' | 'directory' }>): { name: string; path: string; type: 'file' | 'directory' } | null {
// Priority order for README files (most common first)
const readmeExtensions = ['md', 'markdown', 'txt', 'adoc', 'asciidoc', 'rst', 'org'];
// First, try to find README with extensions (prioritized order)
for (const ext of readmeExtensions) {
const readmeFile = fileList.find(file =>
file.type === 'file' &&
file.name.toLowerCase() === `readme.${ext}`
);
if (readmeFile) {
return readmeFile;
}
}
// Then check for README without extension
const readmeNoExt = fileList.find(file =>
file.type === 'file' &&
file.name.toLowerCase() === 'readme'
);
if (readmeNoExt) {
return readmeNoExt;
}
// Finally, check for any file starting with "readme." (case-insensitive)
const readmeAny = fileList.find(file =>
file.type === 'file' &&
file.name.toLowerCase().startsWith('readme.')
);
if (readmeAny) {
return readmeAny;
}
return null;
}
async function loadFile(filePath: string) { async function loadFile(filePath: string) {
loading = true; loading = true;
error = null; error = null;
@ -1894,7 +1942,15 @@
headers: buildApiHeaders() headers: buildApiHeaders()
}); });
if (response.ok) { if (response.ok) {
commits = await response.json(); const data = await response.json();
// Normalize commits: API-based commits use 'sha', local commits use 'hash'
commits = data.map((commit: any) => ({
hash: commit.hash || commit.sha || '',
message: commit.message || 'No message',
author: commit.author || 'Unknown',
date: commit.date || new Date().toISOString(),
files: commit.files || []
})).filter((commit: any) => commit.hash); // Filter out commits without hash
} }
} catch (err) { } catch (err) {
error = err instanceof Error ? err.message : 'Failed to load commit history'; error = err instanceof Error ? err.message : 'Failed to load commit history';
@ -1907,8 +1963,11 @@
loadingCommits = true; loadingCommits = true;
error = null; error = null;
try { try {
const parentHash = commits.find(c => c.hash === commitHash) // Normalize commit hash (handle both 'hash' and 'sha' properties)
? commits[commits.findIndex(c => c.hash === commitHash) + 1]?.hash || `${commitHash}^` const getCommitHash = (c: any) => c.hash || c.sha || '';
const commitIndex = commits.findIndex(c => getCommitHash(c) === commitHash);
const parentHash = commitIndex >= 0
? (commits[commitIndex + 1] ? getCommitHash(commits[commitIndex + 1]) : `${commitHash}^`)
: `${commitHash}^`; : `${commitHash}^`;
const response = await fetch(`/api/repos/${npub}/${repo}/diff?from=${parentHash}&to=${commitHash}`, { const response = await fetch(`/api/repos/${npub}/${repo}/diff?from=${parentHash}&to=${commitHash}`, {
@ -2505,16 +2564,19 @@
{:else} {:else}
<ul class="commit-list"> <ul class="commit-list">
{#each commits as commit} {#each commits as commit}
<li class="commit-item" class:selected={selectedCommit === commit.hash}> {@const commitHash = commit.hash || (commit as any).sha || ''}
<button onclick={() => viewDiff(commit.hash)} class="commit-button"> {#if commitHash}
<div class="commit-hash">{commit.hash.slice(0, 7)}</div> <li class="commit-item" class:selected={selectedCommit === commitHash}>
<div class="commit-message">{commit.message}</div> <button onclick={() => viewDiff(commitHash)} class="commit-button">
<div class="commit-hash">{commitHash.slice(0, 7)}</div>
<div class="commit-message">{commit.message || 'No message'}</div>
<div class="commit-meta"> <div class="commit-meta">
<span>{commit.author}</span> <span>{commit.author || 'Unknown'}</span>
<span>{new Date(commit.date).toLocaleString()}</span> <span>{commit.date ? new Date(commit.date).toLocaleString() : 'Unknown date'}</span>
</div> </div>
</button> </button>
</li> </li>
{/if}
{/each} {/each}
</ul> </ul>
{/if} {/if}
@ -2538,13 +2600,16 @@
{:else} {:else}
<ul class="tag-list"> <ul class="tag-list">
{#each tags as tag} {#each tags as tag}
{@const tagHash = tag.hash || ''}
{#if tagHash}
<li class="tag-item"> <li class="tag-item">
<div class="tag-name">{tag.name}</div> <div class="tag-name">{tag.name}</div>
<div class="tag-hash">{tag.hash.slice(0, 7)}</div> <div class="tag-hash">{tagHash.slice(0, 7)}</div>
{#if tag.message} {#if tag.message}
<div class="tag-message">{tag.message}</div> <div class="tag-message">{tag.message}</div>
{/if} {/if}
</li> </li>
{/if}
{/each} {/each}
</ul> </ul>
{/if} {/if}

Loading…
Cancel
Save