@ember-template-lint/todo-utils
Advanced tools
Comparing version 3.0.2 to 3.1.0
@@ -0,1 +1,13 @@ | ||
## v3.1.0 (2020-12-17) | ||
#### :rocket: Enhancement | ||
* [#32](https://github.com/ember-template-lint/ember-template-lint-todo-utils/pull/32) Expose applyTodoChanges API ([@scalvert](https://github.com/scalvert)) | ||
#### :memo: Documentation | ||
* [#31](https://github.com/ember-template-lint/ember-template-lint-todo-utils/pull/31) [RFC] Todo due date spec ([@scalvert](https://github.com/scalvert)) | ||
#### Committers: 1 | ||
- Steve Calvert ([@scalvert](https://github.com/scalvert)) | ||
## v3.0.2 (2020-12-01) | ||
@@ -2,0 +14,0 @@ |
export { _buildTodoDatum, buildTodoData } from './builders'; | ||
export { ensureTodoStorageDir, getTodoStorageDirPath, getTodoBatches, todoStorageDirExists, todoDirFor, todoFileNameFor, todoFilePathFor, readTodos, readTodosForFilePath, writeTodos, } from './io'; | ||
export { ensureTodoStorageDir, applyTodoChanges, getTodoStorageDirPath, getTodoBatches, todoStorageDirExists, todoDirFor, todoFileNameFor, todoFilePathFor, readTodos, readTodosForFilePath, writeTodos, } from './io'; | ||
export * from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -9,2 +9,3 @@ "use strict"; | ||
Object.defineProperty(exports, "ensureTodoStorageDir", { enumerable: true, get: function () { return io_1.ensureTodoStorageDir; } }); | ||
Object.defineProperty(exports, "applyTodoChanges", { enumerable: true, get: function () { return io_1.applyTodoChanges; } }); | ||
Object.defineProperty(exports, "getTodoStorageDirPath", { enumerable: true, get: function () { return io_1.getTodoStorageDirPath; } }); | ||
@@ -11,0 +12,0 @@ Object.defineProperty(exports, "getTodoBatches", { enumerable: true, get: function () { return io_1.getTodoBatches; } }); |
@@ -72,2 +72,10 @@ import { FilePath, LintResult, TodoData } from './types'; | ||
export declare function getTodoBatches(lintResults: Map<FilePath, TodoData>, existing: Map<FilePath, TodoData>): Promise<Map<FilePath, TodoData>[]>; | ||
/** | ||
* Applies todo changes, either adding or removing, based on batches from `getTodoBatches`. | ||
* | ||
* @param todoStorageDir The .lint-todo storage directory. | ||
* @param add Batch of todos to add. | ||
* @param remove Batch of todos to remove. | ||
*/ | ||
export declare function applyTodoChanges(todoStorageDir: string, add: Map<FilePath, TodoData>, remove: Map<FilePath, TodoData>): Promise<void>; | ||
//# sourceMappingURL=io.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTodoBatches = exports.readTodosForFilePath = exports.readTodos = exports.writeTodos = exports.todoFileNameFor = exports.todoDirFor = exports.todoFilePathFor = exports.getTodoStorageDirPath = exports.ensureTodoStorageDir = exports.todoStorageDirExists = void 0; | ||
exports.applyTodoChanges = exports.getTodoBatches = exports.readTodosForFilePath = exports.readTodos = exports.writeTodos = exports.todoFileNameFor = exports.todoDirFor = exports.todoFilePathFor = exports.getTodoStorageDirPath = exports.ensureTodoStorageDir = exports.todoStorageDirExists = void 0; | ||
const crypto_1 = require("crypto"); | ||
@@ -84,3 +84,3 @@ const path_1 = require("path"); | ||
const [add, remove] = await getTodoBatches(builders_1.buildTodoData(baseDir, lintResults), existing); | ||
await _generateFiles(todoStorageDir, add, remove); | ||
await applyTodoChanges(todoStorageDir, add, remove); | ||
return todoStorageDir; | ||
@@ -164,3 +164,10 @@ } | ||
exports.getTodoBatches = getTodoBatches; | ||
async function _generateFiles(todoStorageDir, add, remove) { | ||
/** | ||
* Applies todo changes, either adding or removing, based on batches from `getTodoBatches`. | ||
* | ||
* @param todoStorageDir The .lint-todo storage directory. | ||
* @param add Batch of todos to add. | ||
* @param remove Batch of todos to remove. | ||
*/ | ||
async function applyTodoChanges(todoStorageDir, add, remove) { | ||
for (const [fileHash, todoDatum] of add) { | ||
@@ -175,2 +182,3 @@ const { dir } = path_1.posix.parse(fileHash); | ||
} | ||
exports.applyTodoChanges = applyTodoChanges; | ||
//# sourceMappingURL=io.js.map |
{ | ||
"name": "@ember-template-lint/todo-utils", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"repository": "https://github.com/ember-template-lint/ember-template-lint-todo-utils.git", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
# @ember-template-lint/todo-utils | ||
![CI Build](https://github.com/ember-template-lint/ember-template-lint-todo-utils/workflows/CI%20Build/badge.svg) | ||
[![License](https://img.shields.io/npm/l/@checkup/cli.svg)](https://github.com/checkupjs/checkup/blob/master/package.json) | ||
![Dependabot](https://badgen.net/badge/icon/dependabot?icon=dependabot&label) | ||
![Volta Managed](https://img.shields.io/static/v1?label=volta&message=managed&color=yellow&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAeQC6AMEpK7AhAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH5AMGFS07qAYEaAAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAFmSURBVDjLY2CgB/g/j0H5/2wGW2xyTAQ1r2DQYOBgm8nwh+EY6TYvZtD7f9rn5e81fAGka17GYPL/esObP+dyj5Cs+edqZsv/V8o//H+z7P+XHarW+NSyoAv8WsFszyKTtoVBM5Tn7/Xys+zf7v76vYrJlPEvAwPjH0YGxp//3jGl/L8LU8+IrPnPUkY3ZomoDQwOpZwMv14zMHy8yMDwh4mB4Q8jA8OTgwz/L299wMDyx4Mp9f9NDAP+bWVwY3jGsJpB3JaDQVCEgYHlLwPDfwYWRqVQJgZmHoZ/+3PPfWP+68Mb/Pw5sqUoLni9ipuRnekrAwMjA8Ofb6K8/PKBF5nU7RX+Hize8Y2DOZTP7+kXogPy1zrH+f/vT/j/Z5nUvGcr5VhJioUf88UC/59L+/97gUgDyVH4YzqXxL8dOs/+zuFLJivd/53HseLPPHZPsjT/nsHi93cqozHZue7rLDYhUvUAADjCgneouzo/AAAAAElFTkSuQmCC&link=https://volta.sh) | ||
![TypeScript](https://badgen.net/badge/icon/typescript?icon=typescript&label) | ||
[![Code Style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](#badge) | ||
@@ -40,2 +45,5 @@ A collection of utilities to generate and store lint item metadata. | ||
</dd> | ||
<dt><a href="#applyTodoChanges">applyTodoChanges(todoStorageDir, add, remove)</a></dt> | ||
<dd><p>Applies todo changes, either adding or removing, based on batches from `getTodoBatches`.</p> | ||
</dd> | ||
</dl> | ||
@@ -42,0 +50,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41598
399
170