Skip to content

Commit

Permalink
fix: apply upstream v2-studio fixes, add semver automation workflow
Browse files Browse the repository at this point in the history
- fix: correctly infer filename from files containing uppercase extensions, tweak upload card layout
- fix: fix minor regression with tag positioning, dont portal tooltips to prevent overflow issues
- ci: add semver automation workflow
- fix: catch errors when preview images fail to be generated (#88)
- fix: throw an error when trying to call window.crypto from insecure contexts (#50)
- fix: don't hardcode z-indices, correctly render last filter item (#57, #82)
  • Loading branch information
robinpyon committed Oct 6, 2022
1 parent 4517bb5 commit 100f3eb
Show file tree
Hide file tree
Showing 43 changed files with 19,741 additions and 14,533 deletions.
1 change: 0 additions & 1 deletion .d.ts

This file was deleted.

4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
extends: [
'sanity/react', // must come before sanity/typescript
'sanity/typescript',
'plugin:prettier/recommended'
'prettier'
],
overrides: [
{
Expand All @@ -19,7 +19,7 @@ module.exports = {
},
project: './tsconfig.json'
},
plugins: ['@typescript-eslint'],
plugins: ['prettier'],
rules: {
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-shadow': 'error',
Expand Down
96 changes: 77 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,85 @@
name: CI
name: CI & Release
on:
- push
- pull_request
# Build on pushes to release branches
push:
branches: ['main', 'v3']
# Build on pull requests targeting release branches
pull_request:
branches: ['main', 'v3']
workflow_dispatch:
inputs:
release:
description: Release new version
required: true
default: false
type: boolean

jobs:
test:
runs-on: ${{ matrix.platform }}
name: Node.js ${{ matrix.node-version }} / ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
node-version:
- 16
log-the-inputs:
name: Log inputs
runs-on: ubuntu-latest
steps:
- run: |
echo "Inputs: $INPUTS"
env:
INPUTS: ${{ toJSON(inputs) }}
build:
name: Lint & Build
runs-on: ubuntu-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
cache: npm
- run: npm ci
- run: npm run lint --if-present
- run: npm run prepublishOnly

test:
name: Test
needs: build
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
node: [lts/*, current]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm test --if-present

release:
name: Semantic release
needs: test
runs-on: ubuntu-latest
# only run if opt-in during workflow_dispatch
if: inputs.release == true
steps:
- uses: actions/checkout@v3
with:
# Need to fetch entire commit history to
# analyze every commit since last release
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run lint
- run: npm run build
#- run: npm test
node-version: lts/*
cache: npm
- run: npm ci
# Branches that will release new versions are defined in .releaserc.json
- run: npx semantic-release
# Don't allow interrupting the release step if the job is cancelled, as it can lead to an inconsistent state
# e.g. git tags were pushed but it exited before `npm publish`
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
4 changes: 4 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "@sanity/semantic-release-preset",
"branches": ["main", {"name": "v3", "channel": "studio-v3", "prerelease": "v3-studio"}]
}
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Robin Pyon
Copyright (c) 2022 Robin Pyon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sanity Media

> ⚠️ This version of `sanity-plugin-media` is for [Sanity Studio V3](https://www.sanity.io/blog/sanity-studio-v3-developer-preview), which is currently in developer preview.
> This version of `sanity-plugin-media` is for [Sanity Studio V3](https://www.sanity.io/blog/sanity-studio-v3-developer-preview), which is currently in developer preview.
>
> The Studio V2 compatible version can be found on the [V2 branch](https://github.com/robinpyon/sanity-plugin-media).
Expand Down Expand Up @@ -48,20 +48,18 @@ _Individual asset view_

## Install (V3 Studio only)

In your Sanity project folder, install the plugin and its peer dependency:
In your Sanity project folder:

```sh
npm install --save sanity-plugin-media@v3-studio @mdx-js/react
npm install --save sanity-plugin-media@v3-studio
```

or

```sh
yarn add sanity-plugin-media@v3-studio @mdx-js/react
yarn add sanity-plugin-media@v3-studio
```

`@mdx-js/react` will be removed as a dependency in a future version.

## Usage

Add it as a plugin in your `sanity.config.ts` (or .js) file:
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
extends: ['@commitlint/config-conventional']
}

0 comments on commit 100f3eb

Please sign in to comment.