Skip to content

Commit

Permalink
feat: add resync bin
Browse files Browse the repository at this point in the history
  • Loading branch information
ozum committed Feb 2, 2021
1 parent 56cc6e0 commit ebfdb79
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 59 deletions.
20 changes: 9 additions & 11 deletions .yo-rc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"generator-tsmod": {
"addedFilesSafe": {
".eslintrc.js": "661c7c22fbe2a894f22ac1e32568d3faa6f760c3",
"README.njk": "cc179ac48b4ec2516292f3e42be08cb793c88b47",
"jest.config.js": "0bd134f06add10c42a03e4b115aef2a323e4b136",
"lint-staged.config.js": "cbb09ecb17251589a793f69fea1a59c20f82a2c5",
"prettier.config.js": "2339672f6e5b8d3aeebe63b98613dca158b8b650",
"tsconfig.json": "86c1ebbd8975dcf218636f0a737b1bb310c2fd9a"
},
"createdDirs": ["module-files", ".github", ".husky"],
"addedData": {
"package.json": {
Expand All @@ -20,11 +12,11 @@
"files": ["dist", "!dist/**/@(*.spec|*.test)*", "!dist/**/__test__", "module-files", "@types"],
"homepage": "https://github.com/ozum/not-sync",
"repository": "ozum/not-sync",
"scripts.build": "not-sync dist && tsc --incremental",
"scripts.build": "(npm run not-sync-bin dist) && (tsc --incremental)",
"scripts.execute": "ts-node --transpile-only --compiler-options '{ \"module\": \"commonjs\" }'",
"scripts.format": "prettier . --write",
"scripts.lint": "eslint --ignore-path .gitignore --cache --max-warnings 0 --ext js,jsx,ts,tsx,vue --fix .",
"scripts.postinstall": "is-ci || husky install",
"scripts.postinstall": "(npm run not-sync-bin node_modules) && (is-ci || husky install)",
"scripts.postpublish": "pinst --enable",
"scripts.prepublishOnly": "pinst --disable",
"scripts.readme": "node module-files/scripts/tsmod.js readme",
Expand Down Expand Up @@ -56,7 +48,6 @@
"devDependencies.is-ci": "^2.0.0",
"devDependencies.jest": "^26.6.3",
"devDependencies.lint-staged": "^10.5.3",
"devDependencies.not-sync": "^1.3.2",
"devDependencies.prettier": "^2.2.1",
"devDependencies.readmeasy": "^0.2.7",
"devDependencies.ts-jest": "^26.5.0",
Expand All @@ -70,6 +61,13 @@
}
}
},
"addedFilesSafe": {
".eslintrc.js": "661c7c22fbe2a894f22ac1e32568d3faa6f760c3",
"jest.config.js": "0bd134f06add10c42a03e4b115aef2a323e4b136",
"lint-staged.config.js": "cbb09ecb17251589a793f69fea1a59c20f82a2c5",
"prettier.config.js": "2339672f6e5b8d3aeebe63b98613dca158b8b650",
"tsconfig.json": "86c1ebbd8975dcf218636f0a737b1bb310c2fd9a"
},
"addedFiles": [
".commitlintrc",
".czrc",
Expand Down
59 changes: 30 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ For more advanced options, please use [not-sync-cli](https://www.npmjs.com/packa

```sh
$ not-sync node_modules,dist,coverage
$ resync node_modules,dist,coverage
```

# Details
Expand Down Expand Up @@ -137,79 +138,79 @@ not-sync

Ƭ **MoveErrorCode**: _NOSRC_ \| _LINKEXIST_ \| _NOTALINK_ \| _NOTFOUND_ \| _NOTARGET_

Defined in: [index.ts:6](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L6)
Defined in: [index.ts:6](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L6)

---

### OnAddEntry

Ƭ **OnAddEntry**: (`service`: [_ServiceKey_](#servicekey), `ignoreFile`: _string_, `entries`: _string_[]) => _any_ \| _Promise_<_any_\>

Defined in: [index.ts:13](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L13)
Defined in: [index.ts:13](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L13)

---

### OnDelete

Ƭ **OnDelete**: (`service`: [_ServiceKey_](#servicekey), `path`: _string_, `type`: _symlink_ \| _parent_) => _any_ \| _Promise_<_any_\>

Defined in: [index.ts:12](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L12)
Defined in: [index.ts:12](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L12)

---

### OnDeleteEntry

Ƭ **OnDeleteEntry**: (`service`: [_ServiceKey_](#servicekey), `ignoreFile`: _string_, `entries`: _string_[]) => _any_ \| _Promise_<_any_\>

Defined in: [index.ts:14](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L14)
Defined in: [index.ts:14](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L14)

---

### OnFound

Ƭ **OnFound**: (`service`: [_ServiceKey_](#servicekey), `files`: _string_[]) => _any_ \| _Promise_<_any_\>

Defined in: [index.ts:7](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L7)
Defined in: [index.ts:7](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L7)

---

### OnMove

Ƭ **OnMove**: (`service`: [_ServiceKey_](#servicekey), `from`: _string_, `to`: _string_) => _any_ \| _Promise_<_any_\>

Defined in: [index.ts:9](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L9)
Defined in: [index.ts:9](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L9)

---

### OnMoveFail

Ƭ **OnMoveFail**: (`service`: [_ServiceKey_](#servicekey), `errorCode`: [_MoveErrorCode_](#moveerrorcode), `from?`: _string_, `to?`: _string_) => _any_ \| _Promise_<_any_\>

Defined in: [index.ts:10](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L10)
Defined in: [index.ts:10](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L10)

---

### OnNotFound

Ƭ **OnNotFound**: (`files`: _string_[]) => _any_ \| _Promise_<_any_\>

Defined in: [index.ts:8](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L8)
Defined in: [index.ts:8](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L8)

---

### OnSymlink

Ƭ **OnSymlink**: (`service`: [_ServiceKey_](#servicekey), `target`: _string_, `path`: _string_) => _any_ \| _Promise_<_any_\>

Defined in: [index.ts:11](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L11)
Defined in: [index.ts:11](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L11)

---

### ServiceKey

Ƭ **ServiceKey**: _iCloudDrive_ \| _dropbox_ \| _oneDrive_

Defined in: [cloud-service/cloud-service.ts:21](https://github.com/ozum/not-sync/blob/64909b1/src/cloud-service/cloud-service.ts#L21)
Defined in: [cloud-service/cloud-service.ts:21](https://github.com/ozum/not-sync/blob/56cc6e0/src/cloud-service/cloud-service.ts#L21)

## Functions

Expand All @@ -226,7 +227,7 @@ Defined in: [cloud-service/cloud-service.ts:21](https://github.com/ozum/not-sync

**Returns:** _Promise_<_void_\>

Defined in: [main.ts:32](https://github.com/ozum/not-sync/blob/64909b1/src/main.ts#L32)
Defined in: [main.ts:32](https://github.com/ozum/not-sync/blob/56cc6e0/src/main.ts#L32)

---

Expand All @@ -243,7 +244,7 @@ Defined in: [main.ts:32](https://github.com/ozum/not-sync/blob/64909b1/src/main.

**Returns:** _Promise_<_void_\>

Defined in: [main.ts:28](https://github.com/ozum/not-sync/blob/64909b1/src/main.ts#L28)
Defined in: [main.ts:28](https://github.com/ozum/not-sync/blob/56cc6e0/src/main.ts#L28)

# Interfaces

Expand Down Expand Up @@ -276,63 +277,63 @@ Defined in: [main.ts:28](https://github.com/ozum/not-sync/blob/64909b1/src/main.

`Optional` **addEntry**: _undefined_ \| [_OnAddEntry_](#onaddentry)

Defined in: [index.ts:23](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L23)
Defined in: [index.ts:23](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L23)

---

### delete

`Optional` **delete**: _undefined_ \| [_OnDelete_](#ondelete)

Defined in: [index.ts:22](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L22)
Defined in: [index.ts:22](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L22)

---

### deleteEntry

`Optional` **deleteEntry**: _undefined_ \| [_OnDeleteEntry_](#ondeleteentry)

Defined in: [index.ts:24](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L24)
Defined in: [index.ts:24](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L24)

---

### found

`Optional` **found**: _undefined_ \| [_OnFound_](#onfound)

Defined in: [index.ts:17](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L17)
Defined in: [index.ts:17](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L17)

---

### move

`Optional` **move**: _undefined_ \| [_OnMove_](#onmove)

Defined in: [index.ts:19](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L19)
Defined in: [index.ts:19](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L19)

---

### moveFail

`Optional` **moveFail**: _undefined_ \| [_OnMoveFail_](#onmovefail)

Defined in: [index.ts:20](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L20)
Defined in: [index.ts:20](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L20)

---

### notFound

`Optional` **notFound**: _undefined_ \| [_OnNotFound_](#onnotfound)

Defined in: [index.ts:18](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L18)
Defined in: [index.ts:18](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L18)

---

### symlink

`Optional` **symlink**: _undefined_ \| [_OnSymlink_](#onsymlink)

Defined in: [index.ts:21](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L21)
Defined in: [index.ts:21](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L21)

<a name="interfacesoptionsmd"></a>

Expand Down Expand Up @@ -368,7 +369,7 @@ Options

Create directories for non existing paths. (If they are in a cloud path). This may be used to disable sync of directories to be created in future.

Defined in: [index.ts:46](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L46)
Defined in: [index.ts:46](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L46)

---

Expand All @@ -378,7 +379,7 @@ Defined in: [index.ts:46](https://github.com/ozum/not-sync/blob/64909b1/src/inde

Current working directory to be used for resolving relative paths.

Defined in: [index.ts:30](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L30)
Defined in: [index.ts:30](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L30)

---

Expand All @@ -388,7 +389,7 @@ Defined in: [index.ts:30](https://github.com/ozum/not-sync/blob/64909b1/src/inde

Prevents changes to be written to disk. Executes a dry run.

Defined in: [index.ts:34](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L34)
Defined in: [index.ts:34](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L34)

---

Expand All @@ -398,7 +399,7 @@ Defined in: [index.ts:34](https://github.com/ozum/not-sync/blob/64909b1/src/inde

Ignore configuration files (e.g. .gitignore, .prettierignore) to add new created files if any.

Defined in: [index.ts:32](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L32)
Defined in: [index.ts:32](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L32)

---

Expand All @@ -408,7 +409,7 @@ Defined in: [index.ts:32](https://github.com/ozum/not-sync/blob/64909b1/src/inde

Move files near original one for iCloudDrive. For example "node_modules" is moved "node_modules.nosync" in same directory.

Defined in: [index.ts:40](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L40)
Defined in: [index.ts:40](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L40)

---

Expand All @@ -418,7 +419,7 @@ Defined in: [index.ts:40](https://github.com/ozum/not-sync/blob/64909b1/src/inde

Event handler functions to act on several events generated during operation.

Defined in: [index.ts:36](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L36)
Defined in: [index.ts:36](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L36)

---

Expand All @@ -428,7 +429,7 @@ Defined in: [index.ts:36](https://github.com/ozum/not-sync/blob/64909b1/src/inde

Roots of cloud services. If default roots has to be changed for same reson.

Defined in: [index.ts:44](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L44)
Defined in: [index.ts:44](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L44)

---

Expand All @@ -438,7 +439,7 @@ Defined in: [index.ts:44](https://github.com/ozum/not-sync/blob/64909b1/src/inde

Custom roots for each cloud service to move files.

Defined in: [index.ts:42](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L42)
Defined in: [index.ts:42](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L42)

---

Expand All @@ -448,7 +449,7 @@ Defined in: [index.ts:42](https://github.com/ozum/not-sync/blob/64909b1/src/inde

Adds extra information to event handlers.

Defined in: [index.ts:38](https://github.com/ozum/not-sync/blob/64909b1/src/index.ts#L38)
Defined in: [index.ts:38](https://github.com/ozum/not-sync/blob/56cc6e0/src/index.ts#L38)

# Related

Expand Down
1 change: 1 addition & 0 deletions README.njk
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ For more advanced options, please use [not-sync-cli](https://www.npmjs.com/packa

```sh
$ not-sync node_modules,dist,coverage
$ resync node_modules,dist,coverage
```

# Details
Expand Down
13 changes: 0 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"module-files",
"@types"
],
"bin": "dist/bin/not-sync.js",
"bin": {
"not-sync": "dist/bin/not-sync.js",
"resync": "dist/bin/resync.js"
},
"homepage": "https://github.com/ozum/not-sync",
"bugs": "https://github.com/ozum/not-sync/issues",
"repository": "ozum/not-sync",
Expand All @@ -43,13 +46,13 @@
"release": "npm run readme && git pull && git add -A && git commit && git push --follow-tags",
"test": "jest",
"readme": "node module-files/scripts/tsmod.js readme",
"build": "not-sync dist && tsc --incremental",
"preinstall": "echo not-sync cannot execute itself. It will result infinite loop.",
"postinstall": "is-ci || husky install",
"build": "(npm run not-sync-bin dist) && (tsc --incremental)",
"postinstall": "(npm run not-sync-bin node_modules) && (is-ci || husky install)",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable",
"tsmod": "node module-files/scripts/tsmod.js",
"yo:update": "yo tsmod:uninstall --no-install --force && yo 'tsmod' '--no-coverage'"
"yo:update": "yo tsmod:uninstall --no-install --force && yo 'tsmod' '--no-coverage'",
"not-sync-bin": "npm run execute src/bin/not-sync.ts"
},
"dependencies": {
"array-map-to-object": "0.0.4",
Expand Down Expand Up @@ -80,7 +83,6 @@
"is-ci": "^2.0.0",
"jest": "^26.6.3",
"lint-staged": "^10.5.3",
"not-sync": "^1.3.2",
"prettier": "^2.2.1",
"readmeasy": "^0.2.7",
"ts-jest": "^26.5.0",
Expand Down

0 comments on commit ebfdb79

Please sign in to comment.