Gathering detailed insights and metrics for @teamteanpm2024/alias-vel-occaecati
Gathering detailed insights and metrics for @teamteanpm2024/alias-vel-occaecati
npm install @teamteanpm2024/alias-vel-occaecati
Typescript
Module System
Node Version
NPM Version
50.8
Supply Chain
93.5
Quality
79.8
Maintenance
100
Vulnerability
100
License
Cumulative downloads
Total Downloads
Last day
0%
0
Compared to previous day
Last week
0%
0
Compared to previous week
Last month
0%
0
Compared to previous month
Last year
0%
0
Compared to previous year
37
CLI to create or edit React or React Native components with your own structure
Via yarn and interactive mode
$ yarn add -D @teamteanpm2024/alias-vel-occaecati
$ yarn rcci
or via npm and flags
$ npm i -D @teamteanpm2024/alias-vel-occaecati
$ npx rcci --name Header Body Footer --dest src/App
To install via npm:
npm install --save-dev @teamteanpm2024/alias-vel-occaecati
To install via yarn:
yarn add --dev @teamteanpm2024/alias-vel-occaecati
On first run CLI will ask you about automatic configuration. Just run a command:
npx rcci
This command creates file rcci.config.js
and template folder with basic template set.
Config file contains next parameters:
folderPath
src/
templatesFolder
templates
multiProject
false
skipFinalStep
false
checkExistenceOnCreate
false
templates
processFileAndFolderName
PascalCase
camelCase
PascalCase
snake_case
dash-case
(name: string, parts: string[], isFolder: boolean) => string
1{ 2 ...config, 3 processFileAndFolderName: (name, parts, isFolder) => 4 isFolder ? name : parts.map((part) => part.toLowerCase()).join('-') 5}
placeholders
#NAME#
for a component name#STYLE#
for css-module import#STORY_PATH#
for storybook titleafterCreation
undefined
1{ 2 ...config, 3 afterCreation: { 4 prettier: { 5 extensions: ['.ts', '.tsx'], // optional 6 cmd: 'prettier --write [filepath]' 7 } 8 } 9}
Each placeholder is a function which get some data to build your own placeholder.
During the multiple component creation all functions will be called for every single component.
Example:
1placeholders: { 2 NAME: ({ componentName }) => componentName 3}
After this set up you are able to use this placeholder by #NAME#
inside your template files.
Below, you can see the list of all available data and functions to create a new one.
Field | Description |
---|---|
project | Project name in multy-project mode |
componentName ,objectName | Name of the component or another object in multi-template mode |
objectType | Type of object which was selected by user. It is component by default. |
pathToObject | path to objects folder Example: src/components |
destinationFolder | relative path to folder of object which is being created Example: App/Header/Logo |
objectFolder | Absolute path to your object (component) folder |
relativeObjectFolder | Relative path to your object (component) folder |
filePrefix | processed object(component) name for filename |
folderName | processed object(component) name for folder |
files | Object of files which is being created |
getRelativePath(to: string) | Function to get relative path to any another path Example: ../../src/helpers |
join(...parts: string) | Function to get joined parts of path. Example: join(project, destinationFolder, componentName) => Project/Footer/Email |
stringToCase(str: string, toCase: string) | Function to map any string to case. Example: stringToCase('dash-case-string', 'PascalCase') => DashCaseString |
--update
, -u
--dest
, -d
--skip-search
, -s
dest
argument as is--name
, -n
--files
, -f
--files style test component[1]
style
and test
and will select second type of component by index--project
, -p
--sls
skipFinalStep
in config fileIf you need to generate something else, not components only, you are able to set up array of templates.
Example bellow:
1{ 2 ...config, 3 templates: [ 4 { 5 name: 'component', // will be added to default folderPath folder 6 files: { 7 index: { 8 name: 'index.ts', 9 file: 'component.ts' 10 } 11 } 12 }, 13 { 14 name: 'service', 15 folderPath: 'services/', // will be added by the specific path 16 files: { 17 index: { 18 name: 'index.ts', 19 file: 'service.ts' 20 } 21 } 22 } 23 ] 24}
No vulnerabilities found.
No security vulnerabilities found.