@9of9solutions/replikator 1.0.17 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +46 -65
  2. package/main.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,93 +1,74 @@
1
- # replikator
1
+ # Replikator
2
2
 
3
+ Replikator is a command-line tool designed to share and synchronize code between multiple applications in a monorepo. It enables you to maintain shared code in a single source directory and automatically replicate it to multiple target applications, keeping everything in sync.
3
4
 
5
+ ## Features
4
6
 
5
- ## Getting started
7
+ - **Code Sharing**: Maintain shared TypeScript/JavaScript code in one location and replicate it to multiple applications.
8
+ - **Real-time Synchronization**: Automatically sync changes to shared code across all target applications.
9
+ - **File Watching**: Continuously monitor source files and instantly propagate changes to all targets.
10
+ - **Selective Inclusion**: Specify which directories and files should be replicated to each target application.
11
+ - **Read-only Protection**: Replicated files are marked as read-only with clear headers indicating their source.
12
+ - **Monorepo Support**: Works seamlessly with monorepos and includes special support for Turborepo.
6
13
 
7
- To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8
-
9
- Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10
-
11
- ## Add your files
14
+ ## Installation
12
15
 
13
- - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14
- - [ ] [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command:
16
+ To install Replikator, ensure you have Node.js installed, then run:
15
17
 
18
+ ```bash
19
+ npm install -g @9of9solutions/replikator
16
20
  ```
17
- cd existing_repo
18
- git remote add origin https://gitlab.com/9-of-9-solutions/replikator.git
19
- git branch -M main
20
- git push -uf origin main
21
- ```
22
-
23
- ## Integrate with your tools
24
-
25
- - [ ] [Set up project integrations](https://gitlab.com/9-of-9-solutions/replikator/-/settings/integrations)
26
-
27
- ## Collaborate with your team
28
-
29
- - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30
- - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31
- - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32
- - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33
- - [ ] [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)
34
-
35
- ## Test and Deploy
36
21
 
37
- Use the built-in continuous integration in GitLab.
22
+ ## Usage
38
23
 
39
- - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)
40
- - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41
- - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42
- - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43
- - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
24
+ Replikator provides the following commands:
44
25
 
45
- ***
26
+ - **rpk init**: Initialize Replikator configuration for your project.
27
+ - **rpk run**: Start the file watcher and synchronization process.
28
+ - **rpk include**: Specify which directories should be included in the replication.
29
+ - **rpk update**: Update the Replikator tool.
46
30
 
47
- # Editing this README
31
+ To set up Replikator:
48
32
 
49
- When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
33
+ ```bash
34
+ # Initialize configuration
35
+ rpk init
50
36
 
51
- ## Suggestions for a good README
37
+ # Select files to include
38
+ rpk include
52
39
 
53
- Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
40
+ # Start synchronization
41
+ rpk run
42
+ ```
54
43
 
55
- ## Name
56
- Choose a self-explaining name for your project.
44
+ ## Development
57
45
 
58
- ## Description
59
- Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
46
+ For development purposes, you can use the following script in target applications:
60
47
 
61
- ## Badges
62
- On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
48
+ ```bash
49
+ npm run dev
50
+ ```
63
51
 
64
- ## Visuals
65
- Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
52
+ This will navigate to the parent directory and execute the `rpk run` command.
66
53
 
67
- ## Installation
68
- Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
54
+ ## Dependencies
69
55
 
70
- ## Usage
71
- Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
56
+ Replikator relies on several key dependencies:
72
57
 
73
- ## Support
74
- Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
75
-
76
- ## Roadmap
77
- If you have ideas for releases in the future, it is a good idea to list them in the README.
58
+ - **commander**: For command-line interfaces.
59
+ - **chokidar**: For file watching and event handling.
60
+ - **fs-extra**: For enhanced file system operations.
61
+ - **inquirer**: For interactive command-line prompts.
78
62
 
79
63
  ## Contributing
80
- State if you are open to contributions and what your requirements are for accepting them.
81
64
 
82
- For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
65
+ Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
66
+
67
+ ## License
83
68
 
84
- You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
69
+ This project is licensed under the ISC License.
85
70
 
86
- ## Authors and acknowledgment
87
- Show your appreciation to those who have contributed to the project.
71
+ ## Author
88
72
 
89
- ## License
90
- For open source projects, say how it is licensed.
73
+ Germain LESPINGAL
91
74
 
92
- ## Project status
93
- If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
package/main.js CHANGED
@@ -232,7 +232,7 @@ async function run(prompt) {
232
232
  console.log(dest)
233
233
  await fs.copy(src, dest, { overwrite: true, filter: filterFn });
234
234
 
235
- if ((await fs.lstat(src)).isFile()) {
235
+ if ((await fs.lstat(src)).isFile() && !src.endsWith('.svg') && !src.endsWith('.png') && !src.endsWith('.jpg') && !src.endsWith('.jpeg') && !src.endsWith('.gif')) {
236
236
  const data = await fs.readFile(src);
237
237
  const fd = await fs.open(dest, 'w+');
238
238
  const header = Buffer.from(await getReplicatedFileHeader(src));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@9of9solutions/replikator",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "type": "module",
5
5
  "main": "main.js",
6
6
  "bin": {