Skip to content

Commit

Permalink
chore: deprecate v2 modules (#3997)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Dec 21, 2022
1 parent a464646 commit 0dba94b
Show file tree
Hide file tree
Showing 21 changed files with 253 additions and 112 deletions.
6 changes: 6 additions & 0 deletions packages/@sanity/base/README.md
@@ -1,3 +1,9 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
# base

Sanity plugin containing the base components and roles for a Sanity configuration
6 changes: 6 additions & 0 deletions packages/@sanity/core/README.md
@@ -1,3 +1,9 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
# @sanity/core

Sanity core bundle, containing required packages for the development and build process
7 changes: 6 additions & 1 deletion packages/@sanity/data-aspects/README.md
@@ -1,3 +1,9 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
# @sanity/data-aspects

Sanity plugin which controls how your data is presented.
Expand All @@ -6,7 +12,6 @@ Sanity plugin which controls how your data is presented.

We'll re-design how control of data presentation is handed over to a sanity studio maintainer. Hang on for snake tornado.


## Usage

Ensure you have data-aspects as a plugin in you Sanity installation. Either:
Expand Down
14 changes: 9 additions & 5 deletions packages/@sanity/default-layout/README.md
@@ -1,5 +1,10 @@
# default-layout
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
# default-layout

## Sidecar

Expand All @@ -9,13 +14,12 @@ The Sidecar will be enabled in a Studio if there is an implementations of the pa

An implementation of `part:@sanity/default-layout/sidecar` _must_ export these:

- `SidecarToggleButton` React component. The button which will appear in the Navbar to toggle on/off the Sidecar
- `SidecarLayout` React component. The content of the Sidecar (once it appears)
- `isSidecarEnabled` Function. Call this to check if the Sidecar implementation is happy and good to go (typically, the sidecar impl. wants to verify if config is present)
- `SidecarToggleButton` React component. The button which will appear in the Navbar to toggle on/off the Sidecar
- `SidecarLayout` React component. The content of the Sidecar (once it appears)
- `isSidecarEnabled` Function. Call this to check if the Sidecar implementation is happy and good to go (typically, the sidecar impl. wants to verify if config is present)

If you need inspiration, the `@sanity/studio-hints` package is an implementation of this part.


### `part:@sanity/default-layout/sidecar-datastore`

In addition, Sidecar relies on `part:@sanity/default-layout/sidecar-datastore`. This part already exists and shouldn't be overridden unless there's a good reason. This part exports:
Expand Down
6 changes: 6 additions & 0 deletions packages/@sanity/default-login/README.md
@@ -1,3 +1,9 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
# @sanity/default-login

Let a user log into Sanity, and get access to the child content.
Expand Down
6 changes: 6 additions & 0 deletions packages/@sanity/desk-tool/README.md
@@ -1,3 +1,9 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
# desk-tool

Tool for managing all sorts of content in a structured manner
5 changes: 5 additions & 0 deletions packages/@sanity/field/README.md
@@ -0,0 +1,5 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
77 changes: 42 additions & 35 deletions packages/@sanity/form-builder/README.md
@@ -1,3 +1,9 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
# Form Builder

## Disclaimer: Work in progress
Expand All @@ -11,29 +17,30 @@ Polymorphic arrays may only contain elements of one primitive type. Thus, this i
```json
{
"types": [
{
"name": "myType",
"type": "array",
"of": [
{"type": "string", "title": "Street"},
{"type": "string", "title": "E-mail"}
]
}
{
"name": "myType",
"type": "array",
"of": [
{"type": "string", "title": "Street"},
{"type": "string", "title": "E-mail"}
]
}
]
}
```

## Terminology

### Type

Types are the building blocks for your schema. A type defines the structure and behavior of your data model.

There is a distiction between _primitive types_ and _container types_.

A container type is a type that contains data of other types, e.g. `array` or `object`. A primitive type only represents one simple value, like the number `3` or the string `foobar`


### Field

If you define an object type, you must also define its fields. E.g. if you are defining a `person` type, it may look like this:

```json
Expand All @@ -54,17 +61,19 @@ If you define an object type, you must also define its fields. E.g. if you are d
]
}
```

You cannot create an object type that has no fields. We haven't yet had the need for a `hash` type that can have arbitrary key => value pairs (where keys are strings and value can be anything), but will consider supporting it in the future.

## Input widgets

All input fields must follow a simple convention based protocol.
Every input field must:
- Accept a `value` prop which is the field's value
- Accept an `onChange` function as prop which is called whenever a value changes

- Accept a `value` prop which is the field's value
- Accept an `onChange` function as prop which is called whenever a value changes

## Schema

When writing a schema, `type` is implicitly `object`, unless otherwise specified. You're not allowed to set type: 'object' (redundant definition).

Only built-in types can take options. Below, `email.placeholder` is an option to `string` and `versions.of` is an option to `list`.
Expand All @@ -80,59 +89,57 @@ const schema = {
name: 'email',
type: 'string',
title: 'E-mail address',
placeholder: 'murgh@example.com'
placeholder: 'murgh@example.com',
},
{
name: 'profilePicture',
type: 'image'
}
]
type: 'image',
},
],
},
{
name: 'image',
fields: [
{
name: 'fullSizeUrl',
type: 'string'
type: 'string',
},
{
name: 'aspectRatio',
type: 'number'
type: 'number',
},
{
name: 'versions',
type: 'list',
of: [{type: 'imageVersion'}]
}
]
of: [{type: 'imageVersion'}],
},
],
},
{
name: 'imageVersion',
fields: [
{
name: 'width',
type: 'number'
type: 'number',
},
{
name: 'square',
type: 'boolean'
type: 'boolean',
},
{
name: 'url',
type: 'string'
}
]
}
]
type: 'string',
},
],
},
],
}
```




## Considerations / todo
- Support for collaborative editing
- Powerful validation rules
- i18n
- List item edit modality
- Styling

- Support for collaborative editing
- Powerful validation rules
- i18n
- List item edit modality
- Styling
30 changes: 18 additions & 12 deletions packages/@sanity/imagetool/README.md
@@ -1,10 +1,15 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
# The image tool used in sanity

## Getting started

npm install --save @sanity/imagetool


## Usage

### ImageTool widget
Expand All @@ -20,18 +25,18 @@ class MyComponent extends React.Component {
x: 0.4,
y: 0.3,
height: 0.6,
width: 0.4
width: 0.4,
},
crop: {
left: 0.1,
right: 0.2,
top: 0.1,
bottom: 0.21,
}
}
},
},
}

handleImageToolchange = newValue => {
handleImageToolchange = (newValue) => {
this.setState({value: newValue})
}

Expand All @@ -52,14 +57,14 @@ class MyComponent extends React.Component {
### CSS style calculator

```js
import calculateStyles from "@sanity/imagetool/calculateStyles";
import calculateStyles from '@sanity/imagetool/calculateStyles'

const styles = calculateStyles({
hotspot: {
x: 0.4,
y: 0.3,
height: 0.6,
width: 0.4
width: 0.4,
},
crop: {
left: 0.1,
Expand All @@ -68,12 +73,12 @@ const styles = calculateStyles({
bottom: 0.21,
},
image: {height: 100, width: 125},
container: {aspectRatio: 16/10},
container: {aspectRatio: 16 / 10},
align: {
x: 'left',
y: 'center'
}
});
y: 'center',
},
})
```

returns an object with style objects that can be used with markup
Expand Down Expand Up @@ -108,6 +113,7 @@ returns an object with style objects that can be used with markup
```

this can then be passed to jsx markup with the following structure:

```jsx
<div style={styles.container}>
<div style={styles.padding} />
Expand All @@ -118,4 +124,4 @@ this can then be passed to jsx markup with the following structure:
/>
</div>
</div>
```
```
5 changes: 5 additions & 0 deletions packages/@sanity/initial-value-templates/README.md
@@ -0,0 +1,5 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
7 changes: 7 additions & 0 deletions packages/@sanity/plugin-loader/README.md
@@ -1,2 +1,9 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
# plugin-loader

Monkey-patches node's require algorithm to allow requiring of Sanity parts
5 changes: 5 additions & 0 deletions packages/@sanity/production-preview/README.md
@@ -0,0 +1,5 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
5 changes: 5 additions & 0 deletions packages/@sanity/react-hooks/README.md
@@ -1,2 +1,7 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
## React hooks for Sanity Studio
6 changes: 6 additions & 0 deletions packages/@sanity/resolver/README.md
@@ -1,3 +1,9 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.
# resolver

Resolves parts and plugins from a Sanity configuration
5 changes: 5 additions & 0 deletions packages/@sanity/server/README.md
@@ -0,0 +1,5 @@
# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.

0 comments on commit 0dba94b

Please sign in to comment.