@sewing-kit/plugins
Advanced tools
Comparing version 0.0.14 to 0.0.17
@@ -1,31 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.createStep = createStep; | ||
const defaultSkip = () => false; | ||
function createStep(runOrStep, run) { | ||
return typeof runOrStep === 'function' ? { | ||
run: runOrStep, | ||
skip: defaultSkip | ||
} : { | ||
run: run, | ||
...normalizeOptions(runOrStep) | ||
}; | ||
} | ||
function normalizeOptions({ | ||
skip, | ||
...rest | ||
}) { | ||
return { ...rest, | ||
skip: skip ? normalizeSkip(skip) : defaultSkip | ||
}; | ||
} | ||
function normalizeSkip(skipper) { | ||
return typeof skipper === 'function' ? skipper : skipped => skipped.some(skip => skipper.test(skip)); | ||
} | ||
"use strict"; |
@@ -8,5 +8,5 @@ "use strict"; | ||
var _ui = require("@sewing-kit/ui"); | ||
var _core = require("@sewing-kit/core"); | ||
class MissingPluginError extends _ui.DiagnosticError { | ||
class MissingPluginError extends _core.DiagnosticError { | ||
constructor(plugin) { | ||
@@ -13,0 +13,0 @@ super({ |
@@ -28,3 +28,3 @@ "use strict"; | ||
get: function () { | ||
return _ui.DiagnosticError; | ||
return _core.DiagnosticError; | ||
} | ||
@@ -35,3 +35,3 @@ }); | ||
get: function () { | ||
return _ui.LogLevel; | ||
return _core.LogLevel; | ||
} | ||
@@ -42,3 +42,3 @@ }); | ||
get: function () { | ||
return _ui.Loggable; | ||
return _core.Loggable; | ||
} | ||
@@ -131,3 +131,3 @@ }); | ||
var _ui = require("@sewing-kit/ui"); | ||
var _core = require("@sewing-kit/core"); | ||
@@ -134,0 +134,0 @@ var _tasks = require("@sewing-kit/tasks"); |
@@ -1,2 +0,2 @@ | ||
declare type Step = import('@sewing-kit/ui').Step; | ||
declare type Step = import('@sewing-kit/core').Step; | ||
export interface PluginApi { | ||
@@ -9,10 +9,5 @@ read(path: string): Promise<string>; | ||
tmpPath(...parts: string[]): string; | ||
createStep: typeof createStep; | ||
createStep(options: Omit<Step, 'run' | 'source'>, run: Step['run']): Step; | ||
} | ||
declare type Skipper = ((skipped: readonly string[]) => boolean) | RegExp; | ||
export declare function createStep(run: Step['run']): Step; | ||
export declare function createStep(options: Omit<Step, 'run' | 'skip'> & { | ||
skip?: Skipper; | ||
}, run: Step['run']): Step; | ||
export {}; | ||
//# sourceMappingURL=api.d.ts.map |
"use strict"; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const defaultSkip = () => false; | ||
function createStep(runOrStep, run) { | ||
return typeof runOrStep === 'function' | ||
? { run: runOrStep, skip: defaultSkip } | ||
: Object.assign({ run: run }, normalizeOptions(runOrStep)); | ||
} | ||
exports.createStep = createStep; | ||
function normalizeOptions(_a) { | ||
var { skip } = _a, rest = __rest(_a, ["skip"]); | ||
return Object.assign(Object.assign({}, rest), { skip: skip ? normalizeSkip(skip) : defaultSkip }); | ||
} | ||
function normalizeSkip(skipper) { | ||
return typeof skipper === 'function' | ||
? skipper | ||
: (skipped) => skipped.some((skip) => skipper.test(skip)); | ||
} |
@@ -1,2 +0,2 @@ | ||
import { DiagnosticError } from '@sewing-kit/ui'; | ||
import { DiagnosticError } from '@sewing-kit/core'; | ||
export declare class MissingPluginError extends DiagnosticError { | ||
@@ -3,0 +3,0 @@ constructor(plugin: string); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const ui_1 = require("@sewing-kit/ui"); | ||
class MissingPluginError extends ui_1.DiagnosticError { | ||
const core_1 = require("@sewing-kit/core"); | ||
class MissingPluginError extends core_1.DiagnosticError { | ||
constructor(plugin) { | ||
@@ -6,0 +6,0 @@ super({ |
@@ -1,2 +0,2 @@ | ||
export { DiagnosticError, LogLevel, Loggable } from '@sewing-kit/ui'; | ||
export { DiagnosticError, LogLevel, Loggable } from '@sewing-kit/core'; | ||
export { Task, Env, WorkspaceTasks, ProjectTasks } from '@sewing-kit/tasks'; | ||
@@ -3,0 +3,0 @@ export { SeriesHook, WaterfallHook } from '@sewing-kit/hooks'; |
@@ -6,5 +6,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ui_1 = require("@sewing-kit/ui"); | ||
exports.DiagnosticError = ui_1.DiagnosticError; | ||
exports.LogLevel = ui_1.LogLevel; | ||
var core_1 = require("@sewing-kit/core"); | ||
exports.DiagnosticError = core_1.DiagnosticError; | ||
exports.LogLevel = core_1.LogLevel; | ||
var tasks_1 = require("@sewing-kit/tasks"); | ||
@@ -24,5 +24,4 @@ exports.Task = tasks_1.Task; | ||
exports.Runtime = model_1.Runtime; | ||
__export(require("./api")); | ||
__export(require("./plugins")); | ||
__export(require("./utilities")); | ||
__export(require("./errors")); |
@@ -13,2 +13,3 @@ import { Project, WebApp, Package, Service, Workspace } from '@sewing-kit/model'; | ||
readonly [PLUGIN_MARKER]: true; | ||
readonly parent?: BasePlugin; | ||
} | ||
@@ -26,2 +27,3 @@ export interface PluginComposer<Plugin extends BasePlugin> { | ||
readonly target: PluginTarget.Project; | ||
readonly parent?: ProjectPlugin<Project>; | ||
run?(context: ProjectPluginContext<Type>): any; | ||
@@ -37,2 +39,3 @@ compose?(composer: PluginComposer<ProjectPlugin<Type>>): any; | ||
readonly target: PluginTarget.Workspace; | ||
readonly parent?: WorkspacePlugin; | ||
run?(context: WorkspacePluginContext): any; | ||
@@ -39,0 +42,0 @@ compose?(composer: PluginComposer<WorkspacePlugin>): any; |
{ | ||
"name": "@sewing-kit/plugins", | ||
"license": "MIT", | ||
"version": "0.0.14", | ||
"version": "0.0.17", | ||
"sideEffects": false, | ||
@@ -11,10 +11,10 @@ "publishConfig": { | ||
"dependencies": { | ||
"@sewing-kit/hooks": "^0.0.16", | ||
"@sewing-kit/model": "^0.0.8", | ||
"@sewing-kit/tasks": "^0.0.12", | ||
"@sewing-kit/ui": "^0.0.17", | ||
"@sewing-kit/core": "^0.0.36", | ||
"@sewing-kit/hooks": "^0.0.19", | ||
"@sewing-kit/model": "^0.0.10", | ||
"@sewing-kit/tasks": "^0.0.15", | ||
"change-case": "^4.1.0", | ||
"tapable": "^1.1.3" | ||
}, | ||
"gitHead": "5331c444a48f26365e68363b96871cb88b60734b" | ||
"gitHead": "0136728eb88b6ab0a69292fab288b9700516a0d9" | ||
} |
@@ -1,2 +0,2 @@ | ||
type Step = import('@sewing-kit/ui').Step; | ||
type Step = import('@sewing-kit/core').Step; | ||
@@ -10,35 +10,4 @@ export interface PluginApi { | ||
tmpPath(...parts: string[]): string; | ||
createStep: typeof createStep; | ||
} | ||
type Skipper = ((skipped: readonly string[]) => boolean) | RegExp; | ||
const defaultSkip = () => false; | ||
export function createStep(run: Step['run']): Step; | ||
export function createStep( | ||
options: Omit<Step, 'run' | 'skip'> & {skip?: Skipper}, | ||
run: Step['run'], | ||
): Step; | ||
export function createStep( | ||
runOrStep: Step['run'] | (Omit<Step, 'run' | 'skip'> & {skip?: Skipper}), | ||
run?: Step['run'], | ||
): Step { | ||
return typeof runOrStep === 'function' | ||
? {run: runOrStep, skip: defaultSkip} | ||
: {run: run!, ...normalizeOptions(runOrStep!)}; | ||
createStep(options: Omit<Step, 'run' | 'source'>, run: Step['run']): Step; | ||
} | ||
function normalizeOptions({ | ||
skip, | ||
...rest | ||
}: Omit<Step, 'run' | 'skip'> & {skip?: Skipper}): Omit<Step, 'run'> { | ||
return {...rest, skip: skip ? normalizeSkip(skip) : defaultSkip}; | ||
} | ||
function normalizeSkip(skipper: Skipper) { | ||
return typeof skipper === 'function' | ||
? skipper | ||
: (skipped: readonly string[]) => | ||
skipped.some((skip) => skipper.test(skip)); | ||
} |
@@ -1,2 +0,2 @@ | ||
import {DiagnosticError} from '@sewing-kit/ui'; | ||
import {DiagnosticError} from '@sewing-kit/core'; | ||
@@ -3,0 +3,0 @@ export class MissingPluginError extends DiagnosticError { |
@@ -1,2 +0,2 @@ | ||
export {DiagnosticError, LogLevel, Loggable} from '@sewing-kit/ui'; | ||
export {DiagnosticError, LogLevel, Loggable} from '@sewing-kit/core'; | ||
export {Task, Env, WorkspaceTasks, ProjectTasks} from '@sewing-kit/tasks'; | ||
@@ -3,0 +3,0 @@ export {SeriesHook, WaterfallHook} from '@sewing-kit/hooks'; |
@@ -28,2 +28,3 @@ import {Project, WebApp, Package, Service, Workspace} from '@sewing-kit/model'; | ||
readonly [PLUGIN_MARKER]: true; | ||
readonly parent?: BasePlugin; | ||
} | ||
@@ -45,2 +46,3 @@ | ||
readonly target: PluginTarget.Project; | ||
readonly parent?: ProjectPlugin<Project>; | ||
run?(context: ProjectPluginContext<Type>): any; | ||
@@ -58,2 +60,3 @@ compose?(composer: PluginComposer<ProjectPlugin<Type>>): any; | ||
readonly target: PluginTarget.Workspace; | ||
readonly parent?: WorkspacePlugin; | ||
run?(context: WorkspacePluginContext): any; | ||
@@ -60,0 +63,0 @@ compose?(composer: PluginComposer<WorkspacePlugin>): any; |
@@ -9,3 +9,7 @@ { | ||
"include": ["src/**/*.ts"], | ||
"references": [{"path": "../ui"}, {"path": "../tasks"}, {"path": "../model"}] | ||
"references": [ | ||
{"path": "../tasks"}, | ||
{"path": "../model"}, | ||
{"path": "../core"} | ||
] | ||
} |
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
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
209591
32
825
+ Added@sewing-kit/core@^0.0.36
+ Added@sec-ant/readable-stream@0.4.1(transitive)
+ Added@sewing-kit/core@0.0.36(transitive)
+ Added@sewing-kit/hooks@0.0.19(transitive)
+ Added@sewing-kit/model@0.0.10(transitive)
+ Added@sewing-kit/tasks@0.0.15(transitive)
+ Added@sindresorhus/merge-streams@4.0.0(transitive)
+ Added@types/execa@2.0.2(transitive)
+ Addedexeca@9.5.1(transitive)
+ Addedfigures@6.1.0(transitive)
+ Addedget-stream@9.0.1(transitive)
+ Addedhuman-signals@8.0.0(transitive)
+ Addedis-plain-obj@4.1.0(transitive)
+ Addedis-stream@4.0.1(transitive)
+ Addedis-unicode-supported@2.1.0(transitive)
+ Addednpm-run-path@6.0.0(transitive)
+ Addedparse-ms@4.0.0(transitive)
+ Addedpath-key@4.0.0(transitive)
+ Addedpretty-ms@9.2.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstrip-final-newline@4.0.0(transitive)
+ Addedunicorn-magic@0.3.0(transitive)
+ Addedyoctocolors@2.1.1(transitive)
- Removed@sewing-kit/ui@^0.0.17
- Removed@sewing-kit/hooks@0.0.16(transitive)
- Removed@sewing-kit/model@0.0.8(transitive)
- Removed@sewing-kit/tasks@0.0.12(transitive)
- Removed@sewing-kit/ui@0.0.17(transitive)
- Removedansi-escapes@4.3.2(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedchalk@3.0.0(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedexeca@3.4.0(transitive)
- Removedget-stream@5.2.0(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedhuman-signals@1.1.1(transitive)
- Removedis-stream@2.0.1(transitive)
- Removedmerge-stream@2.0.0(transitive)
- Removedmimic-fn@2.1.0(transitive)
- Removednpm-run-path@4.0.1(transitive)
- Removedonetime@5.1.2(transitive)
- Removedp-finally@2.0.1(transitive)
- Removedpump@3.0.2(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstrip-final-newline@2.0.0(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedsupports-hyperlinks@2.3.0(transitive)
- Removedtype-fest@0.21.3(transitive)
Updated@sewing-kit/hooks@^0.0.19
Updated@sewing-kit/model@^0.0.10
Updated@sewing-kit/tasks@^0.0.15