Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
skogsmaskin committed Nov 12, 2019
0 parents commit bc66cba
Show file tree
Hide file tree
Showing 27 changed files with 20,184 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
indent_size = 2

[*.md]
trim_trailing_whitespace = false
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules
coverage
.nyc_output
.DS_Store
*.log
.vscode
.idea
dist
compiled
.awcache
.rpt2_cache
docs
18 changes: 18 additions & 0 deletions .postcssrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"modules": true,
"plugins": {
"postcss-preset-env": {
"stage": 3,
"features": {
"color-mod-function": { "unresolved": "warn" },
"custom-media-queries": {
"preserve": false
},
"custom-properties": {
"preserve": false
},
"nesting-rules": true
}
}
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Sanity, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
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.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Sanity Asset Source: Unsplash

## Developing on this module

To simulate using your development version as a real module inside a studio, you can do the following:

* Run `npm install && npm link` from the root of this repository.
* Run `npm run watch` to start developing and build the module when changes are made.

#### Displaying your development version inside a studio

**With the mono-repo's `test-studio`:**

* Bootstrap the monorepo: `npm run bootstrap`
* Add `sanity-plugin-asset-source-unsplash` with the current version number to `package.json` in the `test-studio` root folder (but don't run `npm install` afterwards)
* Run `npm link sanity-plugin-asset-source-unsplash` inside the mono-repo's root.
* Add `asset-source-unsplash` to the list of the studios plugins in `sanity.json`.
* Restart the `test-studio`

**With a regular Sanity Studio:**
* Run `npm install`
* Add `sanity-plugin-asset-source-unsplash` with the current version number to `package.json`.
* Run `npm link sanity-plugin-asset-source-unsplash`
* Add `asset-source-unsplash` to the list of the studios plugins in `sanity.json`.
* Start the studio

When you are done and have published your new version, you can run `npm unlink` inside this repo, and `npm unlink sanity-plugin-asset-source-unsplash` inside the mono-repo or studio to get back to the normal state. Then run `npm run bootstrap` for the mono-repo or `npm install` inside the regular studio to use the published version.


## Futher reading

https://github.com/danielma/unsplash-react

3 changes: 3 additions & 0 deletions config.dist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"accessKey": ""
}
22 changes: 22 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const tsconfig = require('./tsconfig.json')
const moduleNameMapper = require('tsconfig-paths-jest')(tsconfig)

module.exports = {
transform: {
'.(ts|tsx)': 'ts-jest'
},
testEnvironment: 'node',
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'css'],
coveragePathIgnorePatterns: ['/node_modules/', '/test/'],
globals: {
document: {},
window: {},
HTMLElement: {}
},
collectCoverageFrom: ['src/*.{js,ts}'],
moduleNameMapper: {
...moduleNameMapper,
'\\.(css|less|sass|scss)$': '<rootDir>/test/__mocks__/styleMock.js'
}
}
Loading

0 comments on commit bc66cba

Please sign in to comment.