-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make this project a npm module, follow latest login process (#2)
- Loading branch information
Showing
24 changed files
with
5,548 additions
and
2,189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": [ | ||
"@changesets/changelog-github", | ||
{ | ||
"repo": "rx-ts/dl-iconfont" | ||
} | ||
], | ||
"commit": false, | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"dl-iconfont": minor | ||
--- | ||
|
||
feat: make this project a npm module, follow latest login process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"node": "14", | ||
"sandboxes": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@1stg" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
iconfont.js | ||
lib | ||
!/.*.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@1stg" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: [JounQin] | ||
open_collective: rxts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: CI | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
ci: | ||
name: Lint and Test with Node.js ${{ matrix.node }} | ||
strategy: | ||
matrix: | ||
node: | ||
- 12 | ||
- 14 | ||
- 16 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@master | ||
|
||
- name: Setup Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@master | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: yarn | ||
|
||
- name: Link Yarn global binaries into PATH | ||
run: echo "$(yarn global bin)" >> $GITHUB_PATH | ||
|
||
- name: Install Dependencies | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Build, Lint and test | ||
run: | | ||
yarn build | ||
yarn lint | ||
yarn typecov | ||
env: | ||
EFF_NO_LINK_RULES: true | ||
PARSER_NO_WATCH: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js 14.x | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14.x | ||
cache: yarn | ||
|
||
- name: Install Dependencies | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
uses: changesets/action@master | ||
with: | ||
# This expects you to have a script called release which does a build for your packages and calls changeset publish | ||
publish: yarn release | ||
commit: 'chore: release dl-iconfont' | ||
title: 'chore: release dl-iconfont' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,7 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.type-coverage | ||
lib | ||
node_modules | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# Next.js build output | ||
.next | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# screenshot | ||
screenshot/ | ||
# iconfont.js | ||
iconfont.js | ||
.*cache | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('@1stg/lint-staged/tsc') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"@1stg/prettier-config" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"plugins": [ | ||
"@1stg/remark-config" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"@1stg" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('@1stg/simple-git-hooks') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,83 @@ | ||
# puppeteer-playground | ||
# dl-iconfont | ||
|
||
## how to use | ||
[](https://github.com/rx-ts/dl-iconfont/actions/workflows/ci.yml) | ||
[](https://www.codacy.com/gh/rx-ts/dl-iconfont) | ||
[](https://github.com/plantain-00/type-coverage) | ||
[](https://www.npmjs.com/package/dl-iconfont) | ||
[](https://github.com/rx-ts/dl-iconfont/releases) | ||
|
||
- 1.export login=foo && export password=bar (`which is your github account to login to inconfont`) | ||
- 2.yarn start | ||
[](https://david-dm.org/rx-ts/dl-iconfont?type=peer) | ||
[](https://david-dm.org/rx-ts/dl-iconfont) | ||
[](https://david-dm.org/rx-ts/dl-iconfont?type=dev) | ||
|
||
that's all, enjoy it | ||
[](https://conventionalcommits.org) | ||
[](https://renovatebot.com) | ||
[](https://standardjs.com) | ||
[](https://github.com/prettier/prettier) | ||
[](https://github.com/atlassian/changesets) | ||
|
||
An iconfont downloader for [iconfont][] via [puppeteer][]. | ||
|
||
## TOC <!-- omit in toc --> | ||
|
||
- [Install](#install) | ||
- [Usage](#usage) | ||
- [CLI](#cli) | ||
- [Environments](#environments) | ||
- [Command](#command) | ||
- [API](#api) | ||
- [Changelog](#changelog) | ||
- [License](#license) | ||
|
||
## Install | ||
|
||
```sh | ||
# yarn | ||
yarn global add dl-iconfont | ||
|
||
# npm | ||
npm i -g dl-iconfont | ||
``` | ||
|
||
## Usage | ||
|
||
### CLI | ||
|
||
[dotenv][] is used inside the CLI, so you can simply create a `.env` file. | ||
|
||
#### Environments | ||
|
||
1. `ICONFONT_PROJECT_ID` (required) | ||
2. `ICONFONT_LOGIN` (required) | ||
3. `ICONFONT_PASSWORD` (required) | ||
4. `ICONFONT_DOWNLOAD_FILE` (optional) | ||
5. `PUPPETEER_HEADLESS` (optional) | ||
|
||
#### Command | ||
|
||
```sh | ||
# [iconfont.js] is optional, it can be provided via env `ICONFONT_DOWNLOAD_FILE` too | ||
dli iconfont.js | ||
``` | ||
|
||
### API | ||
|
||
```ts | ||
import { fetchJsUrl, download } from 'dl-iconfont' | ||
|
||
const jsUrl = await fetchJsUrl({ projectId, login, password, headless }) | ||
await download(jsUrl, 'iconfont.js') | ||
``` | ||
|
||
## Changelog | ||
|
||
Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md). | ||
|
||
## License | ||
|
||
[MIT][] | ||
|
||
[dotenv]: https://github.com/motdotla/dotenv | ||
[iconfont]: https://www.iconfont.cn | ||
[mit]: http://opensource.org/licenses/MIT | ||
[puppeteer]: https://github.com/puppeteer/puppeteer |
Oops, something went wrong.