Skip to content

Commit

Permalink
feat: first version
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Mar 9, 2021
0 parents commit 26c96bf
Show file tree
Hide file tree
Showing 14 changed files with 5,267 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# DO NOT MODIFY, WILL BE OVERWRITTEN BY @naturalcycles/dev-lib
#
# http://editorconfig.org
#

root = true

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

[**.md]
trim_trailing_whitespace = false
indent_size = 4

[**.html]
indent_size = 2

[**.{css,scss}]
indent_size = 2

[**.{js,ts}]
indent_size = 2

[**.json]
indent_size = 2

[**.xml]
indent_size = 2

[**.java]
indent_size = 4

[**.sql]
indent_size = 2

[.eslintrc]
indent_size = 2

[**.min.*]
indent_style = ignore
trim_trailing_whitespace = false
insert_final_newline = ignore
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: release

on:
push:
branches: [master, next, act]

jobs:
release-job:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
env: { NODE_OPTIONS: '--max-old-space-size=3200' }
steps:
- { uses: actions/checkout@v2, with: { persist-credentials: true } }
- { uses: actions/setup-node@v1, with: { node-version: 14 } }

# Cache for npm/npx in ~/.npm
- uses: actions/cache@v2
with:
path: ~/.npm
key: npm-v1-${{ runner.os }}

# Normal cache for yarn in ./node_modules
- uses: actions/cache@v2
with:
path: ./node_modules
key: deps-v1-${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: yarn
run: yarn --frozen-lockfile

- name: test
run: |
yarn test
- name: release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx @naturalcycles/semantic-release
51 changes: 51 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# DO NOT MODIFY, WILL BE OVERWRITTEN BY @naturalcycles/dev-lib
#
# You can put more .gitignore files in your respective subfolders (e.g `src`) to ignore additional things.
# Or PR to @naturalcycles/dev-lib if you want to ignore something generic.
#

#
# Global (all dirs)
#
*.iml
.idea
.DS_Store
node_modules
.env
.npmrc
.classpath
.project
.settings
.externalToolBuilders
.cache
.stencil
.nuxt
.gitconfig
.lighthouseci

#
# Root dir
#
/target
/*.log
/log.txt
/.sass-cache
/.sourcemaps
/docs/.vuepress/dist

/coverage

/dist
/dist-cjs
/dist-esm
/tmp

# All secrets are ignored, except encrypted
/secret/**/*.*
!/secret/**/*.enc

/scripts/try.*
/logs
/www/*
!/www/.gitkeep
34 changes: 34 additions & 0 deletions index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict'
Object.defineProperty(exports, '__esModule', { value: true })
const fetch = require('node-fetch')
const ky = require('./ky.cjs')

const TEN_MEGABYTES = 1000 * 1000 * 10

if (!globalThis.fetch) {
globalThis.fetch = (url, options) => fetch(url, { highWaterMark: TEN_MEGABYTES, ...options })
}

if (!globalThis.Headers) {
globalThis.Headers = fetch.Headers
}

if (!globalThis.Request) {
globalThis.Request = fetch.Request
}

if (!globalThis.Response) {
globalThis.Response = fetch.Response
}

// if (!globalThis.AbortController) {
// globalThis.AbortController = AbortController;
// }
//
// if (!globalThis.ReadableStream) {
// try {
// globalThis.ReadableStream = await import('web-streams-polyfill/ponyfill/es2018');
// } catch {}
// }

exports.default = ky.default

0 comments on commit 26c96bf

Please sign in to comment.