{"id":13535592,"url":"https://github.com/deepsweet/start","last_synced_at":"2025-04-02T01:31:24.506Z","repository":{"id":57140868,"uuid":"41490675","full_name":"deepsweet/start","owner":"deepsweet","description":":red_circle: Functional task runner for Node.js","archived":true,"fork":false,"pushed_at":"2020-03-27T06:24:10.000Z","size":3716,"stargazers_count":476,"open_issues_count":7,"forks_count":19,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-28T03:20:39.779Z","etag":null,"topics":["concurrency","nodejs","parallelism","promise","runner","tasks"],"latest_commit_sha":null,"homepage":"https://start.js.org/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepsweet.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-27T14:13:53.000Z","updated_at":"2024-10-25T19:21:16.000Z","dependencies_parsed_at":"2022-09-03T19:01:24.113Z","dependency_job_id":null,"html_url":"https://github.com/deepsweet/start","commit_stats":null,"previous_names":["start-runner/start"],"tags_count":276,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fstart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fstart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fstart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepsweet%2Fstart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepsweet","download_url":"https://codeload.github.com/deepsweet/start/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222788514,"owners_count":17037777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["concurrency","nodejs","parallelism","promise","runner","tasks"],"created_at":"2024-08-01T08:01:00.089Z","updated_at":"2024-11-02T23:31:38.966Z","avatar_url":"https://github.com/deepsweet.png","language":"TypeScript","readme":"# start\n\n**:warning: Project has been transferred to [NexTools metarepo](https://github.com/nextools/metarepo/tree/master/packages/start)**\n\n[![linux](https://img.shields.io/travis/deepsweet/start/master.svg?label=linux\u0026style=flat-square)](https://travis-ci.org/deepsweet/start) [![windows](https://img.shields.io/appveyor/ci/deepsweet/start/master.svg?label=windows\u0026style=flat-square)](https://ci.appveyor.com/project/deepsweet/start) [![coverage](https://img.shields.io/codecov/c/github/deepsweet/start/master.svg?style=flat-square)](https://codecov.io/github/deepsweet/start)\n\n\u003cimg src=\"logo.svg\" width=\"110\" height=\"110\" align=\"right\" alt=\"logo\"/\u003e\n\n* functional – in all senses\n* fast – [parallelism and concurrency](https://stackoverflow.com/questions/1050222/what-is-the-difference-between-concurrency-and-parallelism)\n* shareable – presets as published packages\n* 4th line to align with logo on the right\n\n## TOC\n\n* [Example](#example)\n* [How to](#how-to)\n* [Recipes](#recipes)\n* [Packages](#packages)\n  * [Core](#core)\n  * [Plugins](#plugins)\n    * [FS](#fs)\n    * [Build and bundle](#build-and-bundle)\n    * [Tests](#tests)\n    * [Lint, check and fix](#lint-check-and-fix)\n    * [CI and publish](#ci-and-publish)\n  * [Tasks](#tasks)\n* [Roadmap](#roadmap)\n* [Copyright](#copyright)\n\n## Example\n\n```\n.\n├── packages/\n│   ├── foo/\n│   │   ├── src/\n│   │   │   └── index.ts\n│   │   ├── test/\n│   │   │   └── index.ts\n│   │   └── package.json\n│   └── bar/\n│       ├── src/\n│       │   └── index.ts\n│       ├── test/\n│       │   └── index.ts\n│       └── package.json\n├── package.json\n└── tasks.ts\n```\n\n```sh\n$ yarn add --dev --ignore-workspace-root-check \\\n  @babel/core \\\n  @babel/register \\\n  @babel/preset-env \\\n  @babel/preset-typescript \\\n  @start/cli \\\n  @start/reporter-verbose \\\n  @start/plugin-sequence \\\n  @start/plugin-parallel \\\n  @start/plugin-xargs \\\n  @start/plugin-find \\\n  @start/plugin-find-git-staged \\\n  @start/plugin-remove \\\n  @start/plugin-read \\\n  @start/plugin-rename \\\n  @start/plugin-write \\\n  @start/plugin-lib-babel \\\n  @start/plugin-lib-typescript-generate \\\n  @start/plugin-lib-eslint \\\n  @start/plugin-lib-istanbul \\\n  @start/plugin-lib-tape \\\n  @start/plugin-lib-codecov\n```\n\n```js\n// package.json\n\n{\n  \"private\": true,\n  \"description\": \"Start example\",\n  \"workspaces\": [\n    \"packages/*\"\n  ],\n  \"devDependencies\": {},\n  \"start\": {\n    // tasks file, default to `./tasks`\n    \"file\": \"./tasks\"\n    \"require\": [\n      [\n        \"@babel/register\",\n        {\n          \"extensions\": [\n            \".ts\",\n            \".js\"\n          ]\n        }\n      ]\n    ],\n    \"reporter\": \"@start/reporter-verbose\"\n  },\n  \"babel\": {\n    \"presets\": [\n      [\n        \"@babel/preset-env\",\n        {\n          \"targets\": {\n            \"node\": \"current\"\n          }\n        }\n      ],\n      // Babel 7\n      \"@babel/preset-typescript\"\n    ]\n  }\n}\n```\n\n```ts\n// tasks.ts\n\n// write tasks file once, publish it and then reuse or even extend\n// in all projects using `start.preset` option in `package.json`,\n// something like `my-start-preset` package with everything included\n\nimport sequence from '@start/plugin-sequence'\nimport parallel from '@start/plugin-parallel'\nimport xargs from '@start/plugin-xargs'\nimport find from '@start/plugin-find'\nimport findGitStaged from '@start/plugin-find-git-staged'\nimport remove from '@start/plugin-remove'\nimport read from '@start/plugin-read'\nimport rename from '@start/plugin-rename'\nimport write from '@start/plugin-write'\nimport babel from '@start/plugin-lib-babel'\nimport typescriptGenerate from '@start/plugin-lib-typescript-generate'\nimport eslint from '@start/plugin-lib-eslint'\nimport {\n  istanbulInstrument,\n  istanbulReport,\n  istanbulThresholds\n} from '@start/plugin-lib-istanbul'\nimport tape from '@start/plugin-lib-tape'\nimport codecov from '@start/plugin-lib-codecov'\n\nconst babelConfig = {\n  babelrc: false,\n  presets: [\n    [\n      '@babel/preset-env',\n      {\n        targets: {\n          node: 6\n        },\n        modules: false\n      }\n    ],\n    '@babel/preset-typescript'\n  ]\n}\n\n// each named export is a \"task\"\nexport const build = (packageName: string) =\u003e\n  sequence(\n    find(`packages/${packageName}/src/**/*.ts`),\n    read,\n    babel(babelConfig),\n    rename((file) =\u003e file.replace(/\\.ts$/, '.js')),\n    write(`packages/${packageName}/build/`)\n  )\n\nexport const dts = (packageName: string) =\u003e\n  sequence(\n    find(`packages/${packageName}/src/index.ts`),\n    typescriptGenerate(`packages/${packageName}/build/`)\n  )\n\nexport const pack = (packageName: string) =\u003e\n  sequence(\n    find(`packages/${packageName}/build/`),\n    remove,\n    // child-processes\n    parallel(['build', 'dts'])(packageName)\n  )\n\n// child processes\nexport const packs = xargs('pack')\n\nexport const dev = (packageName: string) =\u003e\n  watch(`packages/${packageName}/**/*.ts`)(\n    build(packageName)\n  )\n\nexport const lint = () =\u003e\n  sequence(\n    findGitStaged(['packages/*/{src,test}/**/*.ts']),\n    read,\n    eslint()\n  )\n\nexport const lintAll = () =\u003e\n  sequence(\n    find(['packages/*/{src,test}/**/*.ts']),\n    read,\n    eslint()\n  )\n\nexport const test = () =\u003e\n  sequence(\n    find('coverage/'),\n    remove,\n    find('packages/*/src/**/*.ts'),\n    istanbulInstrument({ esModules: true, extensions: ['.ts'] }),\n    find('packages/*/test/**/*.ts'),\n    tape(),\n    istanbulReport(['lcovonly', 'html', 'text-summary']),\n    istanbulThresholds({ functions: 100 })\n  )\n\nexport const ci = () =\u003e\n  sequence(\n    // nested task\n    lintAll(),\n    // nested task\n    test(),\n    find('coverage/lcov.info'),\n    read,\n    codecov\n  )\n```\n\n```sh\n$ yarn start\n# or\n$ npx start\n\nOne of the following task names is required:\n* build\n* dts\n* pack\n* packs\n* dev\n* lint\n* lintAll\n* test\n* ci\n```\n\n```sh\n$ yarn start build foo\n$ yarn start dts foo\n$ yarn start pack foo\n$ yarn start packs foo bar\n$ yarn start dev bar\n$ yarn start lint\n$ yarn start lintAll\n$ yarn start test\n$ yarn start ci\n```\n\n## How to\n\n* [Use CLI and pass in options](packages/cli)\n* [Create a plugin](packages/plugin)\n* [Create a reporter](packages/reporter-verbose)\n* [Create a preset](https://github.com/deepsweet/_/tree/master/packages/start-preset-node-ts-lib)\n\n## Recipes\n\n* Node.js TypeScript library preset – [@deepsweet/start-preset-node-ts-lib](https://github.com/deepsweet/_/tree/master/packages/start-preset-node-ts-lib)\n* Node.js TypeScript libraries monorepo – Start project builds itself from sources using sources, see [`tasks/index.ts`](tasks/index.ts)\n* React / React Native (higher-order) components monorepo – [hocs](https://github.com/deepsweet/hocs)\n* React app – to be added\n\n## Packages\n\n### Core\n\n* ⬛️ [cli](packages/cli) – CLI entry point\n* ⚙️ [plugin](packages/plugin) – plugin creator\n* 📃 [reporter-verbose](packages/reporter-verbose) – verbose reporter\n\n### Plugins\n\n#### Misc\n\n* ⏩ [plugin-sequence](packages/plugin-sequence) – run plugins in sequence\n* 🔀 [plugin-parallel](packages/plugin-parallel) – run tasks as parallel child processes with same agruments\n* 🔂 [plugin-xargs](packages/plugin-xargs) – run task as parallel child process for each argument\n* 🐣 [plugin-spawn](packages/plugin-spawn) – spawn new child process\n* 👔 [plugin-env](packages/plugin-env) – set environment variable using [`process.env`](https://nodejs.org/api/all.html#process_process_env)\n* 🔌 [plugin-input-files](packages/plugin-input-files) – inject arguments as files into Start flow files\n* 🔌 plugin-output-files – to be added\n\n#### FS\n\n* 🔍 [plugin-find](packages/plugin-find) – find files using glob patterns\n* 🔍 [plugin-find-git-staged](packages/plugin-find-git-staged) – find Git staged files and filter them using glob patterns\n* 📖 [plugin-read](packages/plugin-read) – read files content\n* 🔠 [plugin-rename](packages/plgun-rename) – rename files\n* ❌ [plugin-remove](packages/plugin-remove) – remove files or directories\n* 👯 [plugin-copy](packages/plugin-copy) – copy files to relative destination using streams and keeping folders structure\n* ✏️ [plugin-write](packages/plugin-write) – write files with source maps to relative destination keeping folders structure\n* ✏️ [plugin-overwrite](packages/plugin-overwrite) – overwrite files\n* 👀 [plugin-watch](packages/plugin-watch) – watch for new or changed files matched by glob patterns\n* 🗜 [plugin-unpack](packages/plugin-unpack) – unpack .tar/.tar.bz2/.tar.gz/.zip archives\n\n#### Build and bundle\n\n* 🏭 [plugin-lib-babel](packages/plugin-lib-babel) – transform files using [Babel](https://babeljs.io/)\n* 🏭 [plugin-lib-esm-loader](packages/plugin-lib-esm-loader) – copy a predefined [ESM loader](https://github.com/standard-things/esm) file to a directory\n* 🏭 [plugin-lib-webpack](packages/plugin-lib-webpack) – bundle files using [Webpack](https://webpack.js.org/)\n* 🏭 [plugin-lib-webpack-dev-server](packages/plugin-lib-webpack-dev-server) – run [Webpack development server](https://github.com/webpack/webpack-dev-server)\n* 🏭 [plugin-lib-rollup](packages/plugin-lib-rollup) – bundle files using [Rollup](https://rollupjs.org/)\n* 🏭 [plugin-lib-typescript-generate](packages/plugin-lib-typescript-generate) – generate `.d.ts` files using [TypeScript](https://www.typescriptlang.org/)\n* 🏭 [plugin-lib-flow-generate](packages/plugin-lib-flow-generate) – generate `.js.flow` files using [Flow](https://flow.org/)\n* 🏭 [plugin-lib-postcss](packages/plugin-lib-postcss) – transform files using [PostCSS](https://postcss.org/)\n* 🏭 plugin-lib-less – [to be migrated](https://github.com/start-runner/less)\n* 🏭 plugin-lib-clean-css – [to be migrated](https://github.com/start-runner/clean-css)\n* 🏭 plugin-lib-uglify – [to be migrated](https://github.com/start-runner/uglify)\n\n#### Tests\n\n* ✅ [plugin-lib-jest](packages/plugin-lib-jest) – run tests using [Jest](https://facebook.github.io/jest/)\n* ✅ [plugin-lib-tape](packages/plugin-lib-tape) – run tests using [Tape](https://github.com/substack/tape)\n* ✅ [plugin-lib-karma](packages/plugin-lib-karma) – run tests using [Karma](https://github.com/karma-runner/karma)\n* 💯 [plugin-lib-instanbul](packages/plugin-lib-istanbul) – collect, report and check code coverage using [Istanbul](https://istanbul.js.org/)\n* ✅ plugin-lib-ava – [to be migrated](https://github.com/start-runner/ava)\n* ✅ plugin-lib-mocha – [to be migrated](https://github.com/start-runner/mocha)\n* ❓ [plugin-assert](packages/plugin-assert) – Node.js [`assert()`](https://nodejs.org/docs/latest-v8.x/api/all.html#assert_assert_value_message)\n\n#### Lint, check and fix\n\n* 🚷 [plugin-lib-eslint](packages/plugin-lib-eslint) – lint and/or fix code using [ESLint](https://eslint.org/)\n* 🚷 [plugin-lib-prettier-eslint](packages/plugin-lib-prettier-eslint) – fix code(style) using [Prettier + ESLint](https://github.com/prettier/prettier-eslint)\n* 🚷 [plugin-lib-typescript-check](packages/plugin-lib-typescript-check) – check types using [TypeScript](https://www.typescriptlang.org/)\n* 🚷 [plugin-lib-flow-check](packages/plugin-lib-flow-check) – check types using [Flow](https://flow.org/)\n\n#### CI and publish\n\n* 💯 [plugin-lib-codecov](packages/plugin-lib-codecov) – send code coverage report to [codecov.io](https://codecov.io/)\n* 🔢 [plugin-lib-npm-version](packages/plugin-lib-npm-version) – bump package version\n* 📦 [plugin-lib-npm-publish](packages/plugin-lib-npm-publish) – publish package to NPM\n* 💯 plugin-lib-coveralls – [to be migrated](https://github.com/start-runner/coveralls)\n\n### Tasks\n\nComing soon.\n\n## Roadmap\n\n* [x] stabilize and publish 0.1.0 of everything\n* [x] documentation\n* [ ] more tests\n* [ ] migrate the rest of important plugins\n\n## Copyright\n\nAll the packages in this repository are released under the terms of the [MIT License](license.md).\n\nThe font used in logo is [supernova fat](http://www.ffonts.net/supernova-fat.font).\n","funding_links":[],"categories":["包","Packages","Build tools","目录","TypeScript"],"sub_categories":["构建工具","Build tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepsweet%2Fstart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepsweet%2Fstart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepsweet%2Fstart/lists"}