components-helper
Advanced tools
Comparing version 2.1.3 to 2.1.4
# Changelog | ||
### 2.1.4 | ||
feat | ||
- add fastGlobConfig for fast-glob (#39) | ||
fix | ||
- the attribute-value should change with type (#38) | ||
### 2.1.3 | ||
@@ -4,0 +14,0 @@ |
@@ -510,3 +510,7 @@ import fg from'fast-glob';import {readFileSync,mkdir,writeFileSync}from'fs';import {resolve}from'path';var config = { | ||
'attribute-value': checkArray(_optionsList) | ||
? { type: 'enum' } | ||
? { | ||
type: /^string$/i.test(item[propsType] || '') | ||
? 'enum' | ||
: 'of-match', | ||
} | ||
: undefined, | ||
@@ -578,3 +582,3 @@ values: checkArray(_optionsList === null || _optionsList === void 0 ? void 0 : _optionsList.map(function (name) { return ({ name: name }); })), | ||
var _options = Object.assign(config, options); | ||
var files = fg.sync(_options.entry); | ||
var files = fg.sync(_options.entry, _options.fastGlobConfig); | ||
var data = files.map(function (path) { | ||
@@ -581,0 +585,0 @@ var fileContent = read(path); |
@@ -510,3 +510,7 @@ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var fg=require('fast-glob'),fs=require('fs'),path=require('path');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var fg__default=/*#__PURE__*/_interopDefaultLegacy(fg);var config = { | ||
'attribute-value': checkArray(_optionsList) | ||
? { type: 'enum' } | ||
? { | ||
type: /^string$/i.test(item[propsType] || '') | ||
? 'enum' | ||
: 'of-match', | ||
} | ||
: undefined, | ||
@@ -578,3 +582,3 @@ values: checkArray(_optionsList === null || _optionsList === void 0 ? void 0 : _optionsList.map(function (name) { return ({ name: name }); })), | ||
var _options = Object.assign(config, options); | ||
var files = fg__default["default"].sync(_options.entry); | ||
var files = fg__default["default"].sync(_options.entry, _options.fastGlobConfig); | ||
var data = files.map(function (path) { | ||
@@ -581,0 +585,0 @@ var fileContent = read(path); |
@@ -0,1 +1,2 @@ | ||
import type { Options as FastGlobConfig } from 'fast-glob'; | ||
export declare type ReComponentName = (title: string, fileName: string, path: string) => string; | ||
@@ -8,3 +9,4 @@ export declare type ReDocUrl = (fileName: string, header?: string, path?: string) => string | undefined; | ||
export interface OptionsConfig { | ||
entry: string; | ||
entry: string | string[]; | ||
fastGlobConfig?: FastGlobConfig; | ||
outDir: string; | ||
@@ -11,0 +13,0 @@ name: string; |
{ | ||
"name": "components-helper", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "Based on the docs to provide code prompt files for vue component library", | ||
@@ -47,3 +47,3 @@ "main": "lib/index.js", | ||
"engines": { | ||
"node": ">10.0.0" | ||
"node": ">15.0.0" | ||
}, | ||
@@ -50,0 +50,0 @@ "dependencies": { |
@@ -50,2 +50,3 @@ # components-helper | ||
- [entry (required)](#entry) | ||
- [fastGlobConfig](#fastglobconfig) | ||
- [outDir (required)](#outdir) | ||
@@ -92,3 +93,3 @@ - [name (required)](#name) | ||
- Required: `true` | ||
- Type: `string` | ||
- Type: `string` | `string[]` | ||
@@ -102,2 +103,8 @@ Specify the entry directory. refer: [fast-glob](https://github.com/mrmlnc/fast-glob#pattern-syntax) | ||
### fastGlobConfig | ||
- Type: `object` | ||
The config of [fast-glob](https://github.com/mrmlnc/fast-glob#options-3) | ||
### outDir | ||
@@ -104,0 +111,0 @@ |
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
81911
1660
437