memi-board 0.4.6 → 0.4.13
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/README.md +221 -73
- package/dist/composables/useMemiBoardAuth.d.ts +15 -3
- package/dist/composables/useMemiBoardModeration.d.ts +3 -1
- package/dist/composables/useMemiBoardStorage.d.ts +5 -1
- package/dist/config.d.ts +7 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +498 -141
- package/dist/index.js.map +1 -1
- package/dist/runtime/components/CommentForm.vue +13 -2
- package/dist/runtime/components/Detail.vue +19 -5
- package/dist/runtime/components/Editor.vue +215 -27
- package/dist/types.d.ts +13 -1
- package/dist/utils/compressImage.d.ts +7 -0
- package/dist/utils/extractEditorImageUrls.d.ts +5 -0
- package/dist/utils/moderation-prompt.d.ts +10 -1
- package/dist/utils/moderation-strike.d.ts +14 -0
- package/dist/utils/renderMarkdown.d.ts +10 -0
- package/dist/utils/storagePath.d.ts +7 -0
- package/docs/firebase-setup.md +106 -0
- package/docs/firestore.rules.example +97 -0
- package/docs/storage.rules.example +46 -0
- package/package.json +11 -2
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// memi-board Storage Security Rules 예시
|
|
2
|
+
//
|
|
3
|
+
// 호스트 프로젝트의 storage.rules에 아래 match 블록을 병합해서 배포해야 한다
|
|
4
|
+
// (Storage rules는 프로젝트당 파일 하나이므로, 이 블록만 통째로 복사해서 기존 규칙 안에 끼워 넣으면 된다).
|
|
5
|
+
//
|
|
6
|
+
// collectionPrefix를 바꿨다면 memiBoard(경로)와 memiBoardPosts(Firestore 컬렉션명)를 함께 바꿔야 한다.
|
|
7
|
+
|
|
8
|
+
rules_version = '2';
|
|
9
|
+
service firebase.storage {
|
|
10
|
+
match /b/{bucket}/o {
|
|
11
|
+
|
|
12
|
+
function isSignedIn() {
|
|
13
|
+
return request.auth != null;
|
|
14
|
+
}
|
|
15
|
+
function isAdmin() {
|
|
16
|
+
return isSignedIn() &&
|
|
17
|
+
firestore.get(/databases/(default)/documents/memiBoardUsers/$(request.auth.uid)).data.role == 'admin';
|
|
18
|
+
}
|
|
19
|
+
function postExists(postId) {
|
|
20
|
+
return firestore.exists(/databases/(default)/documents/memiBoardPosts/$(postId));
|
|
21
|
+
}
|
|
22
|
+
function isPostOwner(postId) {
|
|
23
|
+
return isSignedIn() &&
|
|
24
|
+
firestore.get(/databases/(default)/documents/memiBoardPosts/$(postId)).data.authorUid == request.auth.uid;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
match /memiBoard/posts/{postId}/attachments/{fileName} {
|
|
28
|
+
allow read: if true;
|
|
29
|
+
// uploadBytesResumable → create + 청크 update 필요 (write)
|
|
30
|
+
allow write: if isSignedIn()
|
|
31
|
+
&& request.resource.size < 20 * 1024 * 1024;
|
|
32
|
+
allow delete: if isSignedIn() && (!postExists(postId) || isPostOwner(postId) || isAdmin());
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 에디터 본문 이미지 + 썸네일
|
|
36
|
+
// 원본: memiBoard/posts/{postId}/images/{file}
|
|
37
|
+
// 썸네일: memiBoard/posts/{postId}/images/thumbnails/{file}
|
|
38
|
+
match /memiBoard/posts/{postId}/images/{allPaths=**} {
|
|
39
|
+
allow read: if true;
|
|
40
|
+
allow write: if isSignedIn()
|
|
41
|
+
&& request.resource.size < 5 * 1024 * 1024
|
|
42
|
+
&& request.resource.contentType.matches('image/(jpeg|png|webp|gif|jpg)');
|
|
43
|
+
allow delete: if isSignedIn() && (!postExists(postId) || isPostOwner(postId) || isAdmin());
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memi-board",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Firebase 게시판 — core composable + thin Nuxt module(UI SFC). Nuxt 4 + Nuxt UI 호스트에 붙임",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"main": "./dist/index.js",
|
|
43
43
|
"types": "./dist/index.d.ts",
|
|
44
44
|
"files": [
|
|
45
|
-
"dist"
|
|
45
|
+
"dist",
|
|
46
|
+
"docs"
|
|
46
47
|
],
|
|
47
48
|
"scripts": {
|
|
48
49
|
"prepack": "pnpm build",
|
|
@@ -55,6 +56,8 @@
|
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
58
|
"@nuxt/ui": "^4.0.0",
|
|
59
|
+
"@tiptap/core": ">=2.0.0",
|
|
60
|
+
"@tiptap/pm": ">=2.0.0",
|
|
58
61
|
"firebase": "^12.0.0",
|
|
59
62
|
"nuxt": ">=3.0.0 || >=4.0.0",
|
|
60
63
|
"vue": "^3.5.0",
|
|
@@ -67,6 +70,12 @@
|
|
|
67
70
|
},
|
|
68
71
|
"@nuxt/ui": {
|
|
69
72
|
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"@tiptap/core": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
77
|
+
"@tiptap/pm": {
|
|
78
|
+
"optional": true
|
|
70
79
|
}
|
|
71
80
|
},
|
|
72
81
|
"devDependencies": {
|