Skip to content

Commit

Permalink
feat: first blood, add basic globals
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Sep 1, 2019
1 parent 11a5ab9 commit 55340f5
Show file tree
Hide file tree
Showing 17 changed files with 4,964 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!/index.ts
/index.*
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { overrides } = require('@1stg/eslint-config/overrides')

module.exports = {
extends: '@1stg',
overrides,
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.log
*.tsbuildinfo
!/index.ts
/index.*
node_modules
1 change: 1 addition & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@1stg/husky-config')
1 change: 1 addition & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@1stg/lint-staged')
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!/index.ts
/index.*
CHANGELOG.md
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@1stg/prettier-config"
3 changes: 3 additions & 0 deletions .renovaterc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@1stg"
}
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: node_js

node_js: --lts

cache: yarn

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- git config --global user.name 'JounQin'
- git config --global user.email 'admin@1stg.me'

install: yarn --frozen-lockfile

script:
- yarn lint
- yarn build

deploy:
provider: script
skip_cleanup: true
script: bash deploy.sh
on:
branch: master
57 changes: 56 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,57 @@
# umd-globals
Union collections of umd globals mappings.

[![Travis](https://img.shields.io/travis/com/JounQin/umd-globals.svg)](https://travis-ci.com/JounQin/umd-globals)
[![npm](https://img.shields.io/npm/v/umd-globals.svg)](https://www.npmjs.com/package/umd-globals)
[![GitHub release](https://img.shields.io/github/release/JounQin/umd-globals)](https://github.com/JounQin/umd-globals/releases)

[![David Peer](https://img.shields.io/david/peer/JounQin/umd-globals.svg)](https://david-dm.org/JounQin/umd-globals?type=peer)
[![David](https://img.shields.io/david/JounQin/umd-globals.svg)](https://david-dm.org/JounQin/umd-globals)
[![David Dev](https://img.shields.io/david/dev/JounQin/umd-globals.svg)](https://david-dm.org/JounQin/umd-globals?type=dev)

[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

> Union collections of umd globals mappings.
## TOC <!-- omit in toc -->

- [Install](#install)
- [Usage](#usage)
- [Changelog](#changelog)
- [License](#license)

## Install

```sh
# yarn
yarn add -D umd-globals

# npm
npm i -D umd-globals
```

## Usage

```js
// rollup.config.js
import { globals } from 'umd-globals'

export default {
output: {
globals,
},
}
```

## Changelog

Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).

## License

[MIT][] © [JounQin][]@[1stG.me][]

[1stg.me]: https://www.1stg.me
[jounqin]: https://GitHub.com/JounQin
[mit]: http://opensource.org/licenses/MIT
18 changes: 18 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

set -e

git remote set-url origin "https://user:$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git"
npm set //registry.npmjs.org/:_authToken "$NPM_TOKEN"

git fetch origin "$TRAVIS_BRANCH":"$TRAVIS_BRANCH"
git checkout "$TRAVIS_BRANCH"

PKG_VERSION=$(jq -r '.version' package.json)

git fetch origin v"$PKG_VERSION" || {
yarn global add standard-version
standard-version -a --release-as "$PKG_VERSION"
git push --follow-tags origin "$TRAVIS_BRANCH"
npm publish --access=public
}
10 changes: 10 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const globals = {
lodash: '_',
react: 'React',
'react-router': 'ReactRouter',
'rxjs': 'rxjs',
underscore: '_',
'vue': 'Vue',
}

export { globals as default }
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "umd-globals",
"version": "0.1.0",
"description": "Union collections of umd globals mappings.",
"repository": "git@github.com:JounQin/umd-globals.git",
"author": "JounQin <admin@1stg.me>",
"license": "MIT",
"files": [
"/index.*"
],
"scripts": {
"build": "tsc -b .",
"lint": "EFF_NO_LINK_RULES=true eslint . --ext js,md,ts -f friendly",
"prepublishOnly": "yarn build --force"
},
"devDependencies": {
"@1stg/babel-preset": "^0.4.2",
"@1stg/eslint-config": "^0.5.1",
"@1stg/husky-config": "^0.2.0",
"@1stg/lint-staged": "^0.4.3",
"@1stg/prettier-config": "^0.1.1",
"@1stg/tsconfig": "^0.2.0",
"@babel/core": "^7.5.5",
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"eslint": "^6.3.0",
"eslint-formatter-friendly": "^7.0.0",
"husky": "^3.0.4",
"lint-staged": "^9.2.5",
"prettier": "^1.18.2",
"typescript": "^3.6.2"
}
}
9 changes: 9 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "@1stg/tsconfig",
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"outDir": "."
},
"files": ["index.ts"]
}

0 comments on commit 55340f5

Please sign in to comment.