@bieberkit/plugin-tags 0.0.1 → 0.6.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,48 @@
1
+ <!--
2
+ BieberKit
3
+
4
+ @file plugins/tags/CHANGELOG.md
5
+ @description Release history generated from changesets for @bieberkit/plugin-tags.
6
+ @author Bieber Kieu <kieutrongthien@gmail.com>
7
+ @generated pnpm changeset version (license header normalized)
8
+ @copyright Copyright (c) 2026 Bieber Kieu
9
+ @license Apache-2.0
10
+
11
+ Licensed under the Apache License, Version 2.0 (the "License");
12
+ you may not use this file except in compliance with the License.
13
+ You may obtain a copy of the License at
14
+
15
+ http://www.apache.org/licenses/LICENSE-2.0
16
+
17
+ Unless required by applicable law or agreed to in writing, software
18
+ distributed under the License is distributed on an "AS IS" BASIS,
19
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
+ See the License for the specific language governing permissions and
21
+ limitations under the License.
22
+
23
+ SPDX-License-Identifier: Apache-2.0
24
+ -->
25
+
26
+ # @bieberkit/plugin-tags
27
+
28
+ ## 0.6.0
29
+
30
+ ### Minor Changes
31
+
32
+ - f8dcdec: Add `--template cms` with localized pages and articles, categories, tags, menus, SEO, redirects and a public theme. The public site is enabled by default. Use `--no-site` for an API and admin project.
33
+
34
+ After creating a CMS project, run `pnpm exec bieberkit migrate:make`, `pnpm exec bieberkit migrate` and `pnpm exec bieberkit db:seed` to publish the starter homepage and article and add the main menu. Rerunning the seed preserves existing editorial content.
35
+
36
+ ### Patch Changes
37
+
38
+ - Updated dependencies [f8dcdec]
39
+ - Updated dependencies [f8dcdec]
40
+ - Updated dependencies [4958f26]
41
+ - Updated dependencies [594f5db]
42
+ - Updated dependencies [41d3311]
43
+ - Updated dependencies [ab624de]
44
+ - Updated dependencies [f1811d7]
45
+ - Updated dependencies [531fba5]
46
+ - @bieberkit/plugin-pages@0.6.0
47
+ - @bieberkit/core@0.6.0
48
+ - @bieberkit/data@0.6.0
package/README.md CHANGED
@@ -1,3 +1,29 @@
1
+ <!--
2
+ BieberKit
3
+
4
+ @file plugins/tags/README.md
5
+ @description Documents the tags plugin and its publication assignments.
6
+ @author Bieber Kieu <kieutrongthien@gmail.com>
7
+ @copyright Copyright (c) 2026 Bieber Kieu
8
+ @license Apache-2.0
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ SPDX-License-Identifier: Apache-2.0
23
+ -->
24
+
1
25
  # @bieberkit/plugin-tags
2
26
 
3
- Reserved for the first BieberKit release of this package. The release will be available under `beta`.
27
+ The CMS starter includes tags. The Tags screen manages the terms and their assignments to pages and articles. Assignments use the publication identity and follow all its locale versions.
28
+
29
+ The plugin uses the site scope and the `tags.read` and `tags.manage` permissions. It depends on `@bieberkit/plugin-pages`.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * BieberKit
3
+ *
4
+ * @file plugins/tags/src/admin/index.ts
5
+ * @description Contributes the tags administration screen.
6
+ * @author Bieber Kieu <kieutrongthien@gmail.com>
7
+ * @copyright Copyright (c) 2026 Bieber Kieu
8
+ * @license Apache-2.0
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ *
22
+ * SPDX-License-Identifier: Apache-2.0
23
+ */
24
+ import { TaxonomyAdminPart } from "@bieberkit/plugin-pages/admin";
25
+ declare const part: TaxonomyAdminPart;
26
+ export { part as default };
@@ -0,0 +1,46 @@
1
+ import { taxonomyAdmin } from "@bieberkit/plugin-pages/admin";
2
+ // src/admin/index.ts
3
+ /**
4
+ * BieberKit
5
+ *
6
+ * @file plugins/tags/src/admin/index.ts
7
+ * @description Contributes the tags administration screen.
8
+ * @author Bieber Kieu <kieutrongthien@gmail.com>
9
+ * @copyright Copyright (c) 2026 Bieber Kieu
10
+ * @license Apache-2.0
11
+ *
12
+ * Licensed under the Apache License, Version 2.0 (the "License");
13
+ * you may not use this file except in compliance with the License.
14
+ * You may obtain a copy of the License at
15
+ *
16
+ * http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software
19
+ * distributed under the License is distributed on an "AS IS" BASIS,
20
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ * See the License for the specific language governing permissions and
22
+ * limitations under the License.
23
+ *
24
+ * SPDX-License-Identifier: Apache-2.0
25
+ */
26
+ const part = taxonomyAdmin("tags", {
27
+ en: {
28
+ title: "Tags",
29
+ term: "tag",
30
+ read: "Read tags",
31
+ manage: "Manage tags"
32
+ },
33
+ vi: {
34
+ title: "Thẻ",
35
+ term: "thẻ",
36
+ read: "Xem thẻ",
37
+ manage: "Quản lý thẻ"
38
+ },
39
+ zh: {
40
+ title: "标签",
41
+ term: "标签",
42
+ read: "查看标签",
43
+ manage: "管理标签"
44
+ }
45
+ });
46
+ export { part as default };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * BieberKit
3
+ *
4
+ * @file plugins/tags/src/index.ts
5
+ * @description Declares the tags plugin and its editorial routes.
6
+ * @author Bieber Kieu <kieutrongthien@gmail.com>
7
+ * @copyright Copyright (c) 2026 Bieber Kieu
8
+ * @license Apache-2.0
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ *
22
+ * SPDX-License-Identifier: Apache-2.0
23
+ */
24
+ import { PluginDef } from "@bieberkit/core";
25
+ declare const plugin: PluginDef;
26
+ export { plugin as default };
package/dist/index.js ADDED
@@ -0,0 +1,158 @@
1
+ import { definePlugin } from "@bieberkit/core";
2
+ import { defineEntity, f } from "@bieberkit/data";
3
+ import { Publication, taxonomyRoutes } from "@bieberkit/plugin-pages";
4
+ // package.json
5
+ var version = "0.6.0";
6
+ // src/entities/tag.ts
7
+ /**
8
+ * BieberKit
9
+ *
10
+ * @file plugins/tags/src/entities/tag.ts
11
+ * @description Defines the site-wide tag records.
12
+ * @author Bieber Kieu <kieutrongthien@gmail.com>
13
+ * @copyright Copyright (c) 2026 Bieber Kieu
14
+ * @license Apache-2.0
15
+ *
16
+ * Licensed under the Apache License, Version 2.0 (the "License");
17
+ * you may not use this file except in compliance with the License.
18
+ * You may obtain a copy of the License at
19
+ *
20
+ * http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing, software
23
+ * distributed under the License is distributed on an "AS IS" BASIS,
24
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25
+ * See the License for the specific language governing permissions and
26
+ * limitations under the License.
27
+ *
28
+ * SPDX-License-Identifier: Apache-2.0
29
+ */
30
+ const Tag = defineEntity({
31
+ name: "tags.Tag",
32
+ table: "bk_site_tags",
33
+ label: {
34
+ en: "Tag",
35
+ vi: "Thẻ",
36
+ zh: "标签"
37
+ },
38
+ fields: {
39
+ id: f.id(),
40
+ name: f.string({
41
+ min: 1,
42
+ max: 120
43
+ }),
44
+ slug: f.string({
45
+ min: 1,
46
+ max: 80
47
+ }).unique(),
48
+ createdAt: f.createdAt(),
49
+ updatedAt: f.updatedAt()
50
+ }
51
+ });
52
+ // src/entities/assignment.ts
53
+ /**
54
+ * BieberKit
55
+ *
56
+ * @file plugins/tags/src/entities/assignment.ts
57
+ * @description Links publications to their tags.
58
+ * @author Bieber Kieu <kieutrongthien@gmail.com>
59
+ * @copyright Copyright (c) 2026 Bieber Kieu
60
+ * @license Apache-2.0
61
+ *
62
+ * Licensed under the Apache License, Version 2.0 (the "License");
63
+ * you may not use this file except in compliance with the License.
64
+ * You may obtain a copy of the License at
65
+ *
66
+ * http://www.apache.org/licenses/LICENSE-2.0
67
+ *
68
+ * Unless required by applicable law or agreed to in writing, software
69
+ * distributed under the License is distributed on an "AS IS" BASIS,
70
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71
+ * See the License for the specific language governing permissions and
72
+ * limitations under the License.
73
+ *
74
+ * SPDX-License-Identifier: Apache-2.0
75
+ */
76
+ const Assignment = defineEntity({
77
+ name: "tags.Assignment",
78
+ table: "bk_site_tag_publications",
79
+ fields: {
80
+ id: f.id(),
81
+ term: f.belongsTo(() => Tag),
82
+ publication: f.belongsTo(() => Publication).index()
83
+ },
84
+ orm: {
85
+ uniques: [{
86
+ properties: ["term", "publication"],
87
+ name: "bk_site_tag_publication_uq"
88
+ }],
89
+ properties: {
90
+ term: { deleteRule: "cascade" },
91
+ publication: { deleteRule: "cascade" }
92
+ }
93
+ }
94
+ });
95
+ // src/routes/index.ts
96
+ /**
97
+ * BieberKit
98
+ *
99
+ * @file plugins/tags/src/routes/index.ts
100
+ * @description Declares the management API for editorial tags.
101
+ * @author Bieber Kieu <kieutrongthien@gmail.com>
102
+ * @copyright Copyright (c) 2026 Bieber Kieu
103
+ * @license Apache-2.0
104
+ *
105
+ * Licensed under the Apache License, Version 2.0 (the "License");
106
+ * you may not use this file except in compliance with the License.
107
+ * You may obtain a copy of the License at
108
+ *
109
+ * http://www.apache.org/licenses/LICENSE-2.0
110
+ *
111
+ * Unless required by applicable law or agreed to in writing, software
112
+ * distributed under the License is distributed on an "AS IS" BASIS,
113
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
114
+ * See the License for the specific language governing permissions and
115
+ * limitations under the License.
116
+ *
117
+ * SPDX-License-Identifier: Apache-2.0
118
+ */
119
+ const routes = taxonomyRoutes("tags", Tag, Assignment);
120
+ // src/index.ts
121
+ /**
122
+ * BieberKit
123
+ *
124
+ * @file plugins/tags/src/index.ts
125
+ * @description Declares the tags plugin and its editorial routes.
126
+ * @author Bieber Kieu <kieutrongthien@gmail.com>
127
+ * @copyright Copyright (c) 2026 Bieber Kieu
128
+ * @license Apache-2.0
129
+ *
130
+ * Licensed under the Apache License, Version 2.0 (the "License");
131
+ * you may not use this file except in compliance with the License.
132
+ * You may obtain a copy of the License at
133
+ *
134
+ * http://www.apache.org/licenses/LICENSE-2.0
135
+ *
136
+ * Unless required by applicable law or agreed to in writing, software
137
+ * distributed under the License is distributed on an "AS IS" BASIS,
138
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139
+ * See the License for the specific language governing permissions and
140
+ * limitations under the License.
141
+ *
142
+ * SPDX-License-Identifier: Apache-2.0
143
+ */
144
+ const plugin = definePlugin({
145
+ name: "@bieberkit/plugin-tags",
146
+ version,
147
+ core: "*",
148
+ dialects: [
149
+ "postgres",
150
+ "mysql",
151
+ "sqlite"
152
+ ],
153
+ requires: { "@bieberkit/plugin-pages": "*" },
154
+ permissions: ["tags.read", "tags.manage"],
155
+ entities: [Tag, Assignment],
156
+ routes
157
+ });
158
+ export { plugin as default };
package/package.json CHANGED
@@ -1,19 +1,86 @@
1
1
  {
2
2
  "name": "@bieberkit/plugin-tags",
3
- "version": "0.0.1",
4
- "description": "Reserved for the first BieberKit release of this package.",
3
+ "version": "0.6.0",
4
+ "description": "Assigns reusable tags to publications.",
5
+ "keywords": [
6
+ "bieberkit",
7
+ "bieberkit-plugin"
8
+ ],
9
+ "homepage": "https://github.com/kieutrongthien/bieberkit#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/kieutrongthien/bieberkit/issues"
12
+ },
5
13
  "license": "Apache-2.0",
6
14
  "author": "Bieber Kieu <kieutrongthien@gmail.com>",
7
- "homepage": "https://github.com/kieutrongthien/bieberkit#readme",
8
15
  "repository": {
9
16
  "type": "git",
10
17
  "url": "git+https://github.com/kieutrongthien/bieberkit.git",
11
18
  "directory": "plugins/tags"
12
19
  },
13
20
  "files": [
14
- "NOTICE"
21
+ "dist",
22
+ "NOTICE",
23
+ "CHANGELOG.md"
15
24
  ],
25
+ "type": "module",
26
+ "sideEffects": false,
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "./admin": {
33
+ "types": "./dist/admin/index.d.ts",
34
+ "default": "./dist/admin/index.js"
35
+ },
36
+ "./package.json": "./package.json"
37
+ },
16
38
  "publishConfig": {
17
- "registry": "https://registry.npmjs.org/"
39
+ "access": "public"
40
+ },
41
+ "dependencies": {
42
+ "@bieberkit/core": "0.6.0",
43
+ "@bieberkit/data": "0.6.0",
44
+ "@bieberkit/plugin-pages": "0.6.0"
45
+ },
46
+ "devDependencies": {
47
+ "@bieberkit/plugin-redirects": "0.6.0",
48
+ "@bieberkit/testing": "0.6.0"
49
+ },
50
+ "engines": {
51
+ "node": ">=24.12"
52
+ },
53
+ "bieberkit": {
54
+ "core": "*",
55
+ "dialects": [
56
+ "mysql",
57
+ "postgres",
58
+ "sqlite"
59
+ ],
60
+ "requires": {
61
+ "@bieberkit/plugin-pages": "*"
62
+ },
63
+ "conflicts": [],
64
+ "env": [],
65
+ "tables": [
66
+ "bk_site_tag_publications",
67
+ "bk_site_tags"
68
+ ],
69
+ "routes": [
70
+ "DELETE /api/v1/tags/tags/:id",
71
+ "GET /api/v1/tags/tags",
72
+ "GET /api/v1/tags/tags/:id",
73
+ "PATCH /api/v1/tags/tags/:id",
74
+ "POST /api/v1/tags/tags"
75
+ ],
76
+ "permissions": [
77
+ "tags.manage",
78
+ "tags.read"
79
+ ],
80
+ "admin": []
81
+ },
82
+ "scripts": {
83
+ "build": "tsdown && tsdown -c tsdown.admin.config.ts && node --conditions=@bieberkit/source ../../tools/plugin-manifests.ts --write --plugin .",
84
+ "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p src/admin/tsconfig.json"
18
85
  }
19
86
  }