Skip to content

Commit

Permalink
Added new join function for placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
coolassassin committed Aug 11, 2020
1 parent c99bb69 commit b5d1550
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.4.1
* Added join function for placeholders

## 1.4.0
* Added multi-component creation feature

Expand Down
Empty file.
14 changes: 14 additions & 0 deletions RA/Static/Scripts/React/components/Form/Item/Test123/Test123.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

import styles from './Test123.module.css';

type Test123Props = {};

export const Test123: React.FC<Test123Props> = props => {
return <div />;
};

Test123.displayName = 'Test123';


RA/Form/Item/Test123
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Test123'
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,12 @@ type templatePlaceholdersData = {
// Absolute path to your object (component) folder
relativeObjectFolder: string;
// Relative path to your object (component) folder
getRelativePath: (to: string) => string;
// Function to get relative path to any another path. For example "../../src/helpers"
files: FilesList;
// Object of files which is being created
getRelativePath: (to: string) => string;
// Function to get relative path to any another path. For example "../../src/helpers"
join: (...parts: string) => string;
// Function to get joined parts of path. For example join(project, destinationFolder, componentName)
};
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.4.0",
"main": "index.ts",
"repository": "[email protected]:coolassassin/reactcci.git",
"description": "React Create Component CLI. Create React component avoiding making manual boilerplate.",
"description": "React Create Component CLI which allows you to build your React application with your own file structure and make your components interactively without typing any paths. Setup your config once to build your app as quick as it possible (React, Preact, React Native, Vue, Node.JS)",
"author": "coolassassin <[email protected]>",
"license": "MIT",
"preferGlobal": true,
Expand Down
3 changes: 2 additions & 1 deletion src/generateFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ export const generateFiles = async () => {
destinationFolder: processPath(resultPath),
objectFolder,
relativeObjectFolder: processPath(path.join(project, projectRootPath, resultPath, componentName)),
files: fileList,
getRelativePath: (to: string) => getRelativePath(objectFolder, to),
files: fileList
join: (...parts: string[]) => processPath(path.join(...parts))
};

for (const [, options] of Object.entries(fileList)) {
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export type templatePlaceholdersData = {
destinationFolder: string;
objectFolder: string;
relativeObjectFolder: string;
getRelativePath: (to: string) => string;
files: FilesList;
getRelativePath: (to: string) => string;
join: (...parts: string[]) => string;
};

0 comments on commit b5d1550

Please sign in to comment.