syncodemayo 1.0.9 → 2.0.0
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.
- package/CHANGELOG.md +81 -0
- package/README.md +91 -25
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +66 -0
- package/dist/cli.js.map +1 -0
- package/dist/env.d.ts +1 -0
- package/dist/env.js +17 -0
- package/dist/env.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/Args.d.ts +21 -0
- package/dist/lib/Args.js +99 -0
- package/dist/lib/Args.js.map +1 -0
- package/{lib → dist/lib}/Cli.d.ts +1 -1
- package/dist/lib/Cli.js +104 -0
- package/dist/lib/Cli.js.map +1 -0
- package/{lib → dist/lib}/Client.d.ts +4 -4
- package/dist/lib/Client.js +73 -0
- package/dist/lib/Client.js.map +1 -0
- package/dist/lib/Config.d.ts +48 -0
- package/dist/lib/Config.js +92 -0
- package/dist/lib/Config.js.map +1 -0
- package/dist/lib/ConfigSchema.d.ts +3 -0
- package/dist/lib/ConfigSchema.js +132 -0
- package/dist/lib/ConfigSchema.js.map +1 -0
- package/dist/lib/Connection.d.ts +41 -0
- package/dist/lib/Connection.js +176 -0
- package/dist/lib/Connection.js.map +1 -0
- package/dist/lib/Filelist.d.ts +42 -0
- package/dist/lib/Filelist.js +156 -0
- package/dist/lib/Filelist.js.map +1 -0
- package/{lib → dist/lib}/Log.d.ts +1 -1
- package/{lib → dist/lib}/Log.js +9 -16
- package/dist/lib/Log.js.map +1 -0
- package/dist/lib/Prompt.d.ts +15 -0
- package/dist/lib/Prompt.js +31 -0
- package/dist/lib/Prompt.js.map +1 -0
- package/dist/lib/RemoteConnection.d.ts +37 -0
- package/dist/lib/RemoteConnection.js +2 -0
- package/dist/lib/RemoteConnection.js.map +1 -0
- package/dist/lib/Sync.d.ts +18 -0
- package/dist/lib/Sync.js +127 -0
- package/dist/lib/Sync.js.map +1 -0
- package/dist/lib/TargetServer.d.ts +31 -0
- package/dist/lib/TargetServer.js +76 -0
- package/dist/lib/TargetServer.js.map +1 -0
- package/dist/lib/index.d.ts +8 -0
- package/dist/lib/index.js +9 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/vendor/strip-json-comments.d.ts +23 -0
- package/dist/vendor/strip-json-comments.js +126 -0
- package/dist/vendor/strip-json-comments.js.map +1 -0
- package/package.json +24 -26
- package/.npmignore +0 -9
- package/cli.d.ts +0 -0
- package/cli.js +0 -102
- package/index.d.ts +0 -1
- package/index.js +0 -7
- package/lib/Cli.js +0 -130
- package/lib/Client.js +0 -85
- package/lib/Config.d.ts +0 -32
- package/lib/Config.js +0 -114
- package/lib/ConfigSchema.d.ts +0 -7
- package/lib/ConfigSchema.js +0 -65
- package/lib/Connection.d.ts +0 -14
- package/lib/Connection.js +0 -112
- package/lib/Filelist.d.ts +0 -11
- package/lib/Filelist.js +0 -59
- package/lib/Sync.d.ts +0 -18
- package/lib/Sync.js +0 -140
- package/lib/TargetServer.d.ts +0 -22
- package/lib/TargetServer.js +0 -74
- package/lib/index.d.ts +0 -7
- package/lib/index.js +0 -13
- package/missing-types.d.ts +0 -14
- package/tsconfig.json +0 -48
- package/yarn.lock +0 -975
package/lib/TargetServer.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IConfig, ITargetConfig } from './Config';
|
|
2
|
-
import { IChangeset } from './Sync';
|
|
3
|
-
export declare class TargetServer {
|
|
4
|
-
private _config;
|
|
5
|
-
private _targetConfig;
|
|
6
|
-
readonly config: ITargetConfig;
|
|
7
|
-
readonly name: string;
|
|
8
|
-
constructor(config: IConfig, target: string | ITargetConfig | undefined);
|
|
9
|
-
/**
|
|
10
|
-
* Add a cache file, if there's not one
|
|
11
|
-
*/
|
|
12
|
-
prepare(force?: boolean): Promise<boolean>;
|
|
13
|
-
/**
|
|
14
|
-
* Verify the server has a cache file
|
|
15
|
-
*/
|
|
16
|
-
verify(): Promise<boolean>;
|
|
17
|
-
/**
|
|
18
|
-
* Sync local files to target server
|
|
19
|
-
*/
|
|
20
|
-
sync(isDryRun: boolean, forceConfirmation?: boolean): Promise<IChangeset | null>;
|
|
21
|
-
static create(config: IConfig, targetConfig: string | ITargetConfig | undefined): TargetServer;
|
|
22
|
-
}
|
package/lib/TargetServer.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
const Log = require("./Log");
|
|
12
|
-
const Config_1 = require("./Config");
|
|
13
|
-
const Connection_1 = require("./Connection");
|
|
14
|
-
const Sync_1 = require("./Sync");
|
|
15
|
-
class TargetServer {
|
|
16
|
-
get config() {
|
|
17
|
-
return this._targetConfig;
|
|
18
|
-
}
|
|
19
|
-
get name() {
|
|
20
|
-
return this.config._name;
|
|
21
|
-
}
|
|
22
|
-
constructor(config, target) {
|
|
23
|
-
this._config = config;
|
|
24
|
-
this._targetConfig = Config_1.resolveTarget(config, target);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Add a cache file, if there's not one
|
|
28
|
-
*/
|
|
29
|
-
prepare(force) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const remoteCachePath = `${this._targetConfig.path}/${this._targetConfig.cache}`;
|
|
32
|
-
const conn = Connection_1.Connection.create(this._targetConfig);
|
|
33
|
-
const remoteIsConfigured = yield conn.remoteFileExists(remoteCachePath);
|
|
34
|
-
if (remoteIsConfigured && force !== true) {
|
|
35
|
-
Log.info(`${this._targetConfig.host} already is initialized.`);
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
const remoteDirExists = yield conn.remoteDirectoryExists(this._targetConfig.path);
|
|
39
|
-
if (!remoteDirExists) {
|
|
40
|
-
throw new Error("Remote path not found: " + this._targetConfig.path);
|
|
41
|
-
}
|
|
42
|
-
yield conn.putContent("{}", remoteCachePath);
|
|
43
|
-
return true;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Verify the server has a cache file
|
|
48
|
-
*/
|
|
49
|
-
verify() {
|
|
50
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
const remoteCachePath = `${this._targetConfig.path}/${this._targetConfig.cache}`;
|
|
52
|
-
const conn = Connection_1.Connection.create(this._targetConfig);
|
|
53
|
-
const remoteIsConfigured = yield conn.remoteFileExists(remoteCachePath);
|
|
54
|
-
if (remoteIsConfigured) {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Sync local files to target server
|
|
62
|
-
*/
|
|
63
|
-
sync(isDryRun, forceConfirmation = false) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
const sync = Sync_1.Sync.create(Connection_1.Connection.create(this._targetConfig), this._config, this._targetConfig);
|
|
66
|
-
return sync.run(isDryRun, forceConfirmation);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
static create(config, targetConfig) {
|
|
70
|
-
return new TargetServer(config, targetConfig);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.TargetServer = TargetServer;
|
|
74
|
-
//# sourceMappingURL=TargetServer.js.map
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
function __export(m) {
|
|
3
|
-
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
-
}
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
__export(require("./Client"));
|
|
7
|
-
__export(require("./Config"));
|
|
8
|
-
__export(require("./ConfigSchema"));
|
|
9
|
-
__export(require("./Connection"));
|
|
10
|
-
__export(require("./Filelist"));
|
|
11
|
-
__export(require("./Sync"));
|
|
12
|
-
__export(require("./TargetServer"));
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
package/missing-types.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare module 'jsftp'
|
|
2
|
-
declare module 'jsftp-mkdirp'
|
|
3
|
-
declare module 'yesno'
|
|
4
|
-
declare module 'strip-json-comments'
|
|
5
|
-
|
|
6
|
-
// declare module 'strip-json-comments' {
|
|
7
|
-
// interface StripJsonOptions {
|
|
8
|
-
// whitespace?: boolean;
|
|
9
|
-
// }
|
|
10
|
-
|
|
11
|
-
// export function stripJsonComments(input: string, opts?: StripJsonOptions): string;
|
|
12
|
-
|
|
13
|
-
// // export = stripJsonComments;
|
|
14
|
-
// }
|
package/tsconfig.json
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Basic Options */
|
|
4
|
-
"target": "es2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
|
|
5
|
-
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
|
6
|
-
// "lib": [], /* Specify library files to be included in the compilation: */
|
|
7
|
-
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
8
|
-
// "checkJs": true, /* Report errors in .js files. */
|
|
9
|
-
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
10
|
-
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
11
|
-
"sourceMap": true, /* Generates corresponding '.map' file. */
|
|
12
|
-
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
13
|
-
// "outDir": "./", /* Redirect output structure to the directory. */
|
|
14
|
-
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
15
|
-
"removeComments": false, /* Do not emit comments to output. */
|
|
16
|
-
// "noEmit": true, /* Do not emit outputs. */
|
|
17
|
-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
18
|
-
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
|
19
|
-
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
20
|
-
/* Strict Type-Checking Options */
|
|
21
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
22
|
-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
23
|
-
// "strictNullChecks": true, /* Enable strict null checks. */
|
|
24
|
-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
25
|
-
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
26
|
-
/* Additional Checks */
|
|
27
|
-
"noUnusedLocals": true, /* Report errors on unused locals. */
|
|
28
|
-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
29
|
-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
30
|
-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
31
|
-
/* Module Resolution Options */
|
|
32
|
-
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
33
|
-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
34
|
-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
35
|
-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
36
|
-
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
37
|
-
// "types": [], /* Type declaration files to be included in compilation. */
|
|
38
|
-
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
39
|
-
/* Source Map Options */
|
|
40
|
-
"sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
41
|
-
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
42
|
-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
43
|
-
"inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
44
|
-
/* Experimental Options */
|
|
45
|
-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
46
|
-
"experimentalDecorators": true /* Enables experimental support for ES7 decorators. */
|
|
47
|
-
}
|
|
48
|
-
}
|