sanity-plugin-singleton-management 1.0.0 → 1.0.2

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.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +35 -9
  3. package/package.json +18 -12
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  MIT License
2
2
 
3
3
  Copyright (c) 2025 RC Maples
4
- Copyright (c) 2024 RD Pennell
4
+ Copyright (c) 2024-2025 RD Pennell
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -50,14 +50,29 @@ export const structure = (S) =>
50
50
  **With This Plugin:**
51
51
 
52
52
  ```js
53
- // Schema configuration
54
- export const siteSettings = {
55
- name: 'siteSettings',
56
- type: 'document',
57
- options: { singleton: true } // That's it!
58
- }
59
-
60
- // Structure configuration
53
+ // schema/singletonType.js/ts
54
+ import { defineType } from 'sanity';
55
+
56
+ export const mySingleton = defineType({
57
+ name: 'mySingleton',
58
+ title: 'My Singleton',
59
+ type: 'document',
60
+ options: {
61
+ singleton: true, // Identify this document as a singleton
62
+ },
63
+ fields: [
64
+ {
65
+ name: 'title',
66
+ title: 'Title',
67
+ type: 'string',
68
+ },
69
+ ...
70
+ ],
71
+ });
72
+ ```
73
+
74
+ ```js
75
+ // structure.js/ts
61
76
  export const structure = (S, context) =>
62
77
  S.list()
63
78
  .items([
@@ -188,6 +203,17 @@ Other reading (Sanity docs):
188
203
  - [Filtering out singletons in Structure](https://www.sanity.io/docs/studio/create-a-link-to-a-single-edit-page-in-your-main-document-type-list#fa1e82fd32be)
189
204
  - [Creating a link to a single edit page](https://www.sanity.io/docs/studio/create-a-link-to-a-single-edit-page-in-your-main-document-type-list)
190
205
 
206
+ ## Credits
207
+
208
+ This project is a fork of [sanity-plugin-singleton-tools](https://github.com/plsrd/sanity-plugin-singleton-tools)
209
+ originally created by [RD Pennell](https://github.com/plsrd).
210
+
191
211
  ## License
192
212
 
193
- [MIT](LICENSE) © RD Pennell & RC Maples
213
+ MIT License \
214
+ [LICENSE](LICENSE)
215
+
216
+ <div style="text-align: right">
217
+ Copyright © 2025 <a href="https://github.com/rcmaples" target="_blank">RC Maples</a> </br>
218
+ Copyright © 2024-2025 <a href="https://github.com/plsrd" target="_blank">RD Pennell</a>
219
+ </div>
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "sanity-plugin-singleton-management",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A plugin to streamline singleton management in your Sanity Studio",
5
5
  "keywords": [
6
6
  "sanity",
7
7
  "sanity-plugin"
8
8
  ],
9
9
  "license": "MIT",
10
- "author": "RD Pennell <racheal@sanity.io> & RC Maples <rc@rcmaples.io>",
10
+ "author": "RC Maples <rc@rcmaples.io>",
11
+ "contributors": [
12
+ "RD Pennell <racheal@sanity.io>"
13
+ ],
11
14
  "exports": {
12
15
  ".": {
13
16
  "source": "./src/index.ts",
@@ -33,6 +36,7 @@
33
36
  "scripts": {
34
37
  "build": "npm run clean && npx @sanity/pkg-utils build --strict",
35
38
  "clean": "rimraf dist",
39
+ "commit": "commit",
36
40
  "format": "prettier --write --cache --ignore-unknown .",
37
41
  "link-watch": "plugin-kit link-watch",
38
42
  "lint": "eslint .",
@@ -49,11 +53,12 @@
49
53
  "@sanity/incompatible-plugin": "^1.0.4"
50
54
  },
51
55
  "devDependencies": {
52
- "@commitlint/cli": "^19.8.1",
53
- "@commitlint/config-conventional": "^19.8.1",
56
+ "@commitlint/cli": "^20.1.0",
57
+ "@commitlint/config-conventional": "^20.0.0",
58
+ "@commitlint/prompt-cli": "^20.1.0",
54
59
  "@sanity/browserslist-config": "^1.0.5",
55
- "@sanity/pkg-utils": "^8.1.12",
56
- "@sanity/plugin-kit": "^4.0.19",
60
+ "@sanity/pkg-utils": "^8.1.24",
61
+ "@sanity/plugin-kit": "^4.0.20",
57
62
  "@semantic-release/changelog": "^6.0.3",
58
63
  "@semantic-release/git": "^10.0.1",
59
64
  "@semantic-release/github": "^11.0.6",
@@ -62,14 +67,14 @@
62
67
  "@types/react": "^19.1.13",
63
68
  "@typescript-eslint/eslint-plugin": "^8.44.0",
64
69
  "@typescript-eslint/parser": "^8.44.0",
65
- "@vitest/coverage-v8": "^3.2.4",
66
- "@vitest/ui": "^3.2.4",
70
+ "@vitest/coverage-v8": "^4.0.1",
71
+ "@vitest/ui": "^4.0.1",
67
72
  "eslint": "^9.35.0",
68
73
  "eslint-config-prettier": "^10.1.8",
69
74
  "eslint-config-sanity": "^7.1.1",
70
75
  "eslint-plugin-prettier": "^5.1.3",
71
76
  "eslint-plugin-react": "^7.34.0",
72
- "eslint-plugin-react-hooks": "^5.2.0",
77
+ "eslint-plugin-react-hooks": "^7.0.0",
73
78
  "husky": "^9.1.7",
74
79
  "jsdom": "^27.0.0",
75
80
  "npm-run-all": "^4.1.5",
@@ -79,17 +84,18 @@
79
84
  "react-dom": "^19.1.1",
80
85
  "react-is": "^19.1.1",
81
86
  "rimraf": "^6.0.1",
82
- "sanity": "^4.9.0",
87
+ "sanity": "^4.11.0",
83
88
  "semantic-release": "^24.2.8",
84
89
  "styled-components": "^6.1.15",
85
90
  "typescript": "^5.3.3",
86
91
  "typescript-eslint": "^8.44.0",
87
- "vitest": "^3.2.4"
92
+ "vitest": "^4.0.1"
88
93
  },
89
94
  "overrides": {
90
95
  "esbuild": "0.25.0",
91
96
  "prismjs": "1.30.0",
92
- "tmp": "0.2.4"
97
+ "tmp": "0.2.4",
98
+ "min-document": "2.19.0"
93
99
  },
94
100
  "peerDependencies": {
95
101
  "react": "^18 || ^19",