Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed Jan 10, 2023
0 parents commit 2496da5
Show file tree
Hide file tree
Showing 33 changed files with 1,014 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_size = 4
indent_style = tab
trim_trailing_whitespace = true
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends":
[
"@isnotdefined/eslint-config"
]
}
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: henryruhs
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: ci

on: [ push, pull_request ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node 16
uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- run: npm run lint
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node 16
uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- run: npm run build
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16, 17, 18, 19 ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test
report:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node 16
uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- run: npx c8 --reporter=lcov mocha
- name: Report to Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
build
node_modules
13 changes: 13 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extension":
[
"ts"
],
"node-option":
[
"experimental-specifier-resolution=node",
"loader=ts-node/esm"
],
"spec": "tests",
"timeout": 5000
}
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Specut
======

> Cut massive test suites into equal chunks.
[![Build Status](https://img.shields.io/github/actions/workflow/status/henryruhs/specut/ci.yml.svg?branch=master)](https://github.com/henryruhs/specut/actions?query=workflow:ci)
[![Coverage Status](https://coveralls.io/repos/github/henryruhs/specut/badge.svg)](https://coveralls.io/github/henryruhs/specut)
[![NPM Version](https://img.shields.io/npm/v/specut.svg)](https://npmjs.com/package/specut)
[![License](https://img.shields.io/npm/l/specut.svg)](https://npmjs.com/package/specut)


Installation
------------

Install on your system:

```
npm install specut --global
```


Usage
-----

Run the command:

```
specut <path> <amount> [options]
-V, --version
-C, --config <config>
-A, --amount <amount>
-M, --mode <mode>
-P, --path <path>
-h, --help
```
58 changes: 58 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "specut",
"description": "Cut massive test suites into equal chunks",
"version": "1.0.0-beta.1",
"license": "MIT",
"type": "module",
"keywords":
[
"spec",
"chunk"
],
"author":
{
"name": "Henry Ruhs",
"url": "https://henryruhs.com"
},
"bugs":
{
"url": "https://github.com/henryruhs/specut/issues"
},
"repository":
{
"type": "git",
"url": "https://github.com/henryruhs/specut.git"
},
"dependencies":
{
"commander": "9.4.1"
},
"devDependencies":
{
"@isnotdefined/eslint-config": "7.2.0",
"@types/chai": "4.3.4",
"@types/mocha": "10.0.1",
"@types/node": "18.11.18",
"chai": "4.3.7",
"eslint": "8.31.0",
"mocha": "10.2.0",
"rollup": "3.9.1",
"rollup-plugin-add-shebang": "0.3.1",
"rollup-plugin-copy": "3.4.0",
"rollup-plugin-delete": "2.0.0",
"rollup-plugin-ts": "3.0.2",
"ts-node": "10.9.1",
"typescript": "4.9.4"
},
"scripts":
{
"build": "rollup --config=rollup.config.js",
"lint": "eslint src tests --ext=.ts",
"fix": "npm run lint -- --fix",
"test": "mocha"
},
"bin":
{
"specut": "cli.js"
}
}
44 changes: 44 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import del from 'rollup-plugin-delete';
import ts from 'rollup-plugin-ts';
import shebang from 'rollup-plugin-add-shebang';
import copy from 'rollup-plugin-copy';

export default
{
input: 'src/cli.ts',
output:
{
file: 'build/cli.js'
},
plugins:
[
del(
{
targets: 'build'
}),
ts(),
shebang(
{
include: 'build/cli.js'
}),
copy(
{
targets:
[
{
src: 'src/assets',
dest: 'build'
},
{
src: 'package.json',
dest: 'build'
},
{
src: 'README.md',
dest: 'build'
}
]
})
]
}

4 changes: 4 additions & 0 deletions src/assets/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "specut",
"version": "1.0.0"
}
9 changes: 9 additions & 0 deletions src/assets/option.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"config": ".specut",
"amount": 5,
"mode": "file",
"specPattern": "**/**.spec.{js,jsx,ts,tsx}",
"chunkPrefix": "__",
"chunkSuffix": "__",
"path": "."
}
7 changes: 7 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Core, Helper, Option } from './index.js';

const helper : Helper = new Helper();
const option : Option = new Option(helper);
const core : Core = new Core(helper, option);

core.cli(process);
Loading

0 comments on commit 2496da5

Please sign in to comment.