Skip to content

Commit

Permalink
feat: support typescript (#48)
Browse files Browse the repository at this point in the history
* feat: convert to typescript

* fix: remove prettier and stick with eslint

* test: unit test node-which error flow

* test: unit test child_process spawn flow

* test: improve unit test and eslint

* chore: support coveralls with tap

* chore: tap coverage-check off and add lint to travis

* chore: travis set dist to focal

* chore: travis set after_success

* docs: update README.md
  • Loading branch information
warapitiya committed Oct 23, 2022
1 parent df98690 commit b18e52e
Show file tree
Hide file tree
Showing 21 changed files with 2,988 additions and 3,966 deletions.
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["@antfu", "plugin:import/recommended", "plugin:import/typescript"],
"rules": {
"import/order": ["error", {"newlines-between": "always-and-inside-groups"}]
}
}
7 changes: 0 additions & 7 deletions .eslintrc.js

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ jspm_packages
*.tgz

/.idea
/lib/
lib/
build/

# OS
.DS_Store

test/yarn.lock
5 changes: 3 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.*
test/
/src/
/coverage
coverage/
.nyc_output
src/
3 changes: 0 additions & 3 deletions .prettierrc.yml

This file was deleted.

9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
sudo: false
dist: focal
language: node_js
node_js:
- '10'
- '12'
- '14'
- '16'
- '18'
cache:
directories:
- node_modules
install:
- yarn install
- yarn install --immutable --immutable-cache --check-cache
script:
- yarn lint
- yarn test
after_success:
- yarn coveralls
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Because we <img alt="emoji=heart" src="https://github.com/warapitiya/assets/blob/master/heart-emoji.png?raw=true" width="15"> Yarn!</p>

<p align="center">
<a href="https://travis-ci.org/warapitiya/gulp-yarn"><img alt="Travis Status" src="https://travis-ci.org/warapitiya/gulp-yarn.svg?branch=master"></a>
<a href="https://travis-ci.com/warapitiya/gulp-yarn"><img alt="Travis Status" src="https://travis-ci.org/warapitiya/gulp-yarn.svg?branch=master"></a>
<a href='https://coveralls.io/github/warapitiya/gulp-yarn?branch=master'><img src='https://coveralls.io/repos/github/warapitiya/gulp-yarn/badge.svg?branch=master' alt='Coverage Status' /></a>
<a href="https://www.npmjs.com/package/gulp-yarn"><img src="https://img.shields.io/npm/v/gulp-yarn.svg" alt="npm version"></a>
<a href="https://www.npmjs.com/package/gulp-yarn"><img src="https://img.shields.io/npm/dt/gulp-yarn.svg" alt="npm downloads"></a>
Expand All @@ -20,9 +20,15 @@ Because we <img alt="emoji=heart" src="https://github.com/warapitiya/assets/blob

---

## Installation
### SUPPORT

**SUPPORT:** v3 only support Nodejs `>= v10`.
| node-version | gulp-yarn |
|--------------|-----------|
| \>= v14 | v4 |
| \>= v10 | v3 |
| Older | v1 |

## Install

```bash
# npm
Expand All @@ -32,15 +38,15 @@ $ npm install gulp-yarn --save-dev
$ yarn add gulp-yarn -D
```

## Quick Start
## Usage

**BASIC:** Better performance when in same directory.

```javascript
var gulp = require('gulp');
var yarn = require('gulp-yarn');

gulp.task('yarn', function () {
gulp.task('yarn', function() {
return gulp.src(['./package.json'])
.pipe(yarn());
});
Expand All @@ -53,7 +59,7 @@ gulp.task('yarn', function () {
var gulp = require('gulp');
var yarn = require('gulp-yarn');

gulp.task('yarn', function () {
gulp.task('yarn', function() {
return gulp.src(['./package.json', './yarn.lock'])
.pipe(gulp.dest('./dist'))
.pipe(yarn({
Expand All @@ -64,19 +70,19 @@ gulp.task('yarn', function () {

## Options

| Option | Description | Type |
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| production | Using the `--production` flag, or when the NODE_ENV environment variable is set to production, Yarn will not install any package listed in devDependencies. | Boolean |
| dev | Yarn will only install listed devDependencies. | Boolean |
| flat | Only allow one version of a package. On the first run this will prompt you to choose a single version for each package that is depended on at multiple version ranges. | Boolean |
| force | This refetches all packages, even ones that were previously installed. | Boolean |
| ignoreEngines | Ignore all the required engines force by some packages. | Boolean |
| noBinLinks | None of `node_module` bin links getting created. | Boolean |
| noProgress | Disable progress bar | Boolean |
| noLockfile | Don't read or generate a lockfile | Boolean |
| ignoreScripts | Don't run npm scripts during installation | Boolean |
| nonInteractive| Using the '--non-interactive' flag of yarn to avoid that during the resolution (yarn install) a user input is needed. [2770](https://github.com/yarnpkg/yarn/pull/2770)| Boolean |
| args | Pass any argument with `--` to execute with yarn | String/Array |
| Option | Description | Type |
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| production | Using the `--production` flag, or when the NODE_ENV environment variable is set to production, Yarn will not install any package listed in devDependencies. | Boolean |
| dev | Yarn will only install listed devDependencies. | Boolean |
| flat | Only allow one version of a package. On the first run this will prompt you to choose a single version for each package that is depended on at multiple version ranges. | Boolean |
| force | This refetches all packages, even ones that were previously installed. | Boolean |
| ignoreEngines | Ignore all the required engines force by some packages. | Boolean |
| noBinLinks | None of `node_module` bin links getting created. | Boolean |
| noProgress | Disable progress bar | Boolean |
| noLockfile | Don't read or generate a lockfile | Boolean |
| ignoreScripts | Don't run npm scripts during installation | Boolean |
| nonInteractive | Using the '--non-interactive' flag of yarn to avoid that during the resolution (yarn install) a user input is needed. [2770](https://github.com/yarnpkg/yarn/pull/2770) | Boolean |
| args | Pass any argument with `--` to execute with yarn | String/Array |

## Test

Expand Down
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

158 changes: 0 additions & 158 deletions index.js

This file was deleted.

0 comments on commit b18e52e

Please sign in to comment.