Skip to content

Commit

Permalink
feat: v3 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrees committed May 5, 2022
1 parent 3e0f201 commit e3d1bdb
Show file tree
Hide file tree
Showing 23 changed files with 22,773 additions and 27,199 deletions.
9 changes: 9 additions & 0 deletions .eslintignore
@@ -0,0 +1,9 @@
.eslintrc.js
commitlint.config.js
lib
lint-staged.config.js
rollup.config.js
node_modules
tools/
docs
jest.config.js
44 changes: 44 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,44 @@
module.exports = {
env: {
browser: true,
node: false,
},
extends: [
'sanity/react', // must come before sanity/typescript
'sanity/typescript',
'plugin:prettier/recommended',
],
overrides: [
{
files: ['*.{ts,tsx}'],
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: './tsconfig.json',
},
plugins: ['prettier'],
globals: { it: 'readonly', describe: 'readonly', expect: 'readonly' },
rules: {
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-unused-vars': 1,
'no-shadow': 'off',
'react/display-name': 0,
'react/jsx-no-bind': 0,
'react/jsx-handler-names': 0,
'react/no-array-index-key': 0,
},
settings: {
'import/ignore': ['\\.css$', '.*node_modules.*', '.*:.*'],
'import/resolver': {
node: {
paths: ['src'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
}
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,42 @@
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Begin CI...
uses: actions/checkout@v2

- name: Use Node 16
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Use cached node_modules
uses: actions/cache@v1
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
nodeModules-
- name: Install dependencies
run: npm ci
env:
CI: true

- name: Lint
run: npm run lint
env:
CI: true

- name: Test
run: npm run test
env:
CI: true

- name: Build
run: npm run build
env:
CI: true
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@ compiled
.awcache
.rpt2_cache
docs
lib
4 changes: 4 additions & 0 deletions .husky/commit-msg
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit ""
4 changes: 4 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
@@ -1,8 +1,8 @@
# [Compare to upstream](https://github.com/sanity-io/sanity-plugin-asset-source-unsplash/compare/9d46bbd2b4930ce48999e8bfdb5d68002e88dbfb...master)

# Sanity Asset Source Plugin: Unsplash
Search for photos on Unsplash and add them to your project right inside Sanity Studio.

[![Build Status](https://travis-ci.org/sanity-io/sanity-plugin-asset-source-unsplash.svg?branch=master)](https://travis-ci.org/sanity-io/sanity-plugin-asset-source-unsplash)

## Installation

`sanity install asset-source-unsplash`
Expand Down
8 changes: 4 additions & 4 deletions jest.config.js
Expand Up @@ -3,7 +3,7 @@ const moduleNameMapper = require('tsconfig-paths-jest')(tsconfig)

module.exports = {
transform: {
'.(ts|tsx)': 'ts-jest'
'.(ts|tsx)': 'ts-jest',
},
testEnvironment: 'node',
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$',
Expand All @@ -12,10 +12,10 @@ module.exports = {
globals: {
document: {},
window: {},
HTMLElement: {}
HTMLElement: {},
},
collectCoverageFrom: ['src/*.{js,ts}'],
moduleNameMapper: {
...moduleNameMapper
}
...moduleNameMapper,
},
}
4 changes: 4 additions & 0 deletions lint-staged.config.js
@@ -0,0 +1,4 @@
module.exports = {
'**/*.{js,jsx}': ['eslint'],
'**/*.{ts,tsx}': ['eslint', () => 'tsc --noEmit'],
}

0 comments on commit e3d1bdb

Please sign in to comment.