зеркало из https://github.com/microsoft/just.git
Build and doc updates (#743)
This commit is contained in:
Родитель
b6d2f42cb8
Коммит
feb6217bf3
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"type": "none",
|
||||||
|
"comment": "Update build setup",
|
||||||
|
"packageName": "just-scripts-utils",
|
||||||
|
"email": "elcraig@microsoft.com",
|
||||||
|
"dependentChangeType": "none"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "none",
|
||||||
|
"comment": "Update build setup",
|
||||||
|
"packageName": "just-scripts",
|
||||||
|
"email": "elcraig@microsoft.com",
|
||||||
|
"dependentChangeType": "none"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "none",
|
||||||
|
"comment": "Update build setup",
|
||||||
|
"packageName": "just-task-logger",
|
||||||
|
"email": "elcraig@microsoft.com",
|
||||||
|
"dependentChangeType": "none"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "none",
|
||||||
|
"comment": "Update build setup",
|
||||||
|
"packageName": "just-task",
|
||||||
|
"email": "elcraig@microsoft.com",
|
||||||
|
"dependentChangeType": "none"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -8,10 +8,10 @@ Unlike other build libraries, Just strives to be useful from the beginning. You
|
||||||
|
|
||||||
> NOTE: even though `just-scripts` interacts with `typescript`, it does not take `typescript` as a dependency. It assumes that the developers will include that in their own projects. This gives `just-scripts` the flexibility of targeting many different versions of individual build tools without imposing a version on the consumers.
|
> NOTE: even though `just-scripts` interacts with `typescript`, it does not take `typescript` as a dependency. It assumes that the developers will include that in their own projects. This gives `just-scripts` the flexibility of targeting many different versions of individual build tools without imposing a version on the consumers.
|
||||||
|
|
||||||
These scripts are coded as higher order task functions. Each of these script functions return a task function to be registered as a task in your own `just-task.js` like this:
|
These scripts are coded as higher order task functions. Each of these script functions return a task function to be registered as a task in your own `just.config.js` like this:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
// just-task.js
|
// just.config.js
|
||||||
import { tscTask } from 'just-scripts';
|
import { tscTask } from 'just-scripts';
|
||||||
task('ts', tscTask());
|
task('ts', tscTask());
|
||||||
```
|
```
|
||||||
|
@ -19,7 +19,7 @@ task('ts', tscTask());
|
||||||
Generally, these higher order functions also take an `options` argument to generate a specific task function preconfigured according to the options. For example:
|
Generally, these higher order functions also take an `options` argument to generate a specific task function preconfigured according to the options. For example:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
// just-task.js
|
// just.config.js
|
||||||
import { tscTask } from 'just-scripts';
|
import { tscTask } from 'just-scripts';
|
||||||
task('ts:commonjs', tscTask({ module: 'commonjs' }));
|
task('ts:commonjs', tscTask({ module: 'commonjs' }));
|
||||||
task('ts:esnext', tscTask({ module: 'esnext' }));
|
task('ts:esnext', tscTask({ module: 'esnext' }));
|
||||||
|
|
|
@ -7,7 +7,7 @@ sidebar_label: Jest
|
||||||
Jest is one of the most popular testing libraries in the Javascript ecosystem. It is also a preset supported out of the box inside the `just-scripts` library. Similar to the other presets, this task function assumes that you have a `jest.config.js` at the root of the project.
|
Jest is one of the most popular testing libraries in the Javascript ecosystem. It is also a preset supported out of the box inside the `just-scripts` library. Similar to the other presets, this task function assumes that you have a `jest.config.js` at the root of the project.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// just-task.js
|
// just.config.js
|
||||||
import { jestTask } from 'just-scripts';
|
import { jestTask } from 'just-scripts';
|
||||||
task('test', jestTask());
|
task('test', jestTask());
|
||||||
```
|
```
|
||||||
|
@ -15,7 +15,7 @@ task('test', jestTask());
|
||||||
You can pass in a few options like any another preset tasks in the `just-scripts` library.
|
You can pass in a few options like any another preset tasks in the `just-scripts` library.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// just-task.js
|
// just.config.js
|
||||||
import { jestTask } from 'just-scripts';
|
import { jestTask } from 'just-scripts';
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
|
|
|
@ -7,7 +7,7 @@ sidebar_label: TypeScript Lint
|
||||||
TypeScript is a very popular compiler. But as the amount of code grows, developers need a way to keep the code looking consistent. `tslint` is the de facto linter for TS code.
|
TypeScript is a very popular compiler. But as the amount of code grows, developers need a way to keep the code looking consistent. `tslint` is the de facto linter for TS code.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// just-task.js
|
// just.config.js
|
||||||
import { tslintTask } from 'just-scripts';
|
import { tslintTask } from 'just-scripts';
|
||||||
task('tslint', tslintTask());
|
task('tslint', tslintTask());
|
||||||
```
|
```
|
||||||
|
|
|
@ -11,7 +11,7 @@ Given a library with TypeScript source code, it might be desirable to have multi
|
||||||
A list of available options are located at the [TypeScript documentation site](http://www.typescriptlang.org/docs/handbook/compiler-options.html). The options passed into the preset function will be passed in as command line arguments as a string.
|
A list of available options are located at the [TypeScript documentation site](http://www.typescriptlang.org/docs/handbook/compiler-options.html). The options passed into the preset function will be passed in as command line arguments as a string.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// just-task.js
|
// just.config.js
|
||||||
import { tscTask } from 'just-scripts';
|
import { tscTask } from 'just-scripts';
|
||||||
task('ts', tscTask());
|
task('ts', tscTask());
|
||||||
```
|
```
|
||||||
|
@ -19,7 +19,7 @@ task('ts', tscTask());
|
||||||
For variety, try having two kinds of output at the same time (built in parallel)
|
For variety, try having two kinds of output at the same time (built in parallel)
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// just-task.js
|
// just.config.js
|
||||||
import { parallel } from 'just-task';
|
import { parallel } from 'just-task';
|
||||||
import { tscTask } from 'just-scripts';
|
import { tscTask } from 'just-scripts';
|
||||||
task('ts:commonjs', tscTask({ module: 'commonjs' }));
|
task('ts:commonjs', tscTask({ module: 'commonjs' }));
|
||||||
|
|
|
@ -4,7 +4,7 @@ title: Controlling Task Flow with Conditionals
|
||||||
sidebar_label: Conditionals
|
sidebar_label: Conditionals
|
||||||
---
|
---
|
||||||
|
|
||||||
Sometimes a `just-task.js` includes tasks that are skipped depending on the arguments that are given. Use a `condition()` function to decide to run a task or to skip it.
|
Sometimes a `just.config.js` includes tasks that are skipped depending on the arguments that are given. Use a `condition()` function to decide to run a task or to skip it.
|
||||||
|
|
||||||
## Running tasks in a series
|
## Running tasks in a series
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,9 @@
|
||||||
CHANGELOG.*
|
|
||||||
__tests__
|
__tests__
|
||||||
|
*.log
|
||||||
|
*.tgz
|
||||||
|
api-extractor.json
|
||||||
|
CHANGELOG.*
|
||||||
|
etc/
|
||||||
|
jest.config.js
|
||||||
|
package-deps.json
|
||||||
|
tsconfig.json
|
|
@ -3,6 +3,5 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"]
|
||||||
"exclude": ["**/__tests__/**"]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
CHANGELOG.*
|
__tests__
|
||||||
*.tgz
|
|
||||||
*.log
|
*.log
|
||||||
package-deps.json
|
*.tgz
|
||||||
|
api-extractor.json
|
||||||
|
CHANGELOG.*
|
||||||
|
etc/
|
||||||
jest.config.js
|
jest.config.js
|
||||||
|
package-deps.json
|
||||||
tsconfig.json
|
tsconfig.json
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
||||||
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
|
|
||||||
"docModel": {
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
"dtsRollup": {
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
"apiReport": {
|
|
||||||
"enabled": true
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -4,6 +4,5 @@
|
||||||
"outDir": "lib",
|
"outDir": "lib",
|
||||||
"sourceMap": true
|
"sourceMap": true
|
||||||
},
|
},
|
||||||
"include": ["src", "typings/*.d.ts"],
|
"include": ["src"]
|
||||||
"exclude": ["**/__tests__/**"]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,9 @@
|
||||||
CHANGELOG.*
|
|
||||||
__tests__
|
__tests__
|
||||||
|
*.log
|
||||||
|
*.tgz
|
||||||
|
api-extractor.json
|
||||||
|
CHANGELOG.*
|
||||||
|
etc/
|
||||||
|
jest.config.js
|
||||||
|
package-deps.json
|
||||||
|
tsconfig.json
|
|
@ -3,6 +3,5 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"]
|
||||||
"exclude": ["**/__tests__/**"]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
CHANGELOG.*
|
__tests__
|
||||||
*.tgz
|
|
||||||
*.log
|
*.log
|
||||||
package-deps.json
|
*.tgz
|
||||||
|
api-extractor.json
|
||||||
|
CHANGELOG.*
|
||||||
|
etc/
|
||||||
jest.config.js
|
jest.config.js
|
||||||
|
package-deps.json
|
||||||
tsconfig.json
|
tsconfig.json
|
|
@ -3,6 +3,5 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"include": ["src", "types"],
|
"include": ["src"]
|
||||||
"exclude": ["**/__tests__/**"]
|
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче