Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
267f1b3
Add TS deps and build
shekharkhedekar Apr 28, 2022
bff58ff
build folder, fix npm scripts and config
shekharkhedekar Apr 28, 2022
c00028d
Update tsconfig.json
shekharkhedekar Apr 28, 2022
9ab5072
Move to jest
shekharkhedekar Apr 30, 2022
28d5f34
fix imports
shekharkhedekar Apr 30, 2022
19c7ff6
add prepublish script
shekharkhedekar May 1, 2022
978f5c1
Add coverage, remove types for now
shekharkhedekar May 2, 2022
c170e24
Add ts-node
shekharkhedekar May 2, 2022
8e7e30e
Remove unnecessary catch clause
shekharkhedekar May 8, 2022
dc82980
move ts deps to devDependencies
shekharkhedekar May 9, 2022
d0a5264
update deps
simonh1000 Jul 5, 2022
bffc90b
bump
simonh1000 Jul 5, 2022
f730d0e
Revert homedir change
shekharkhedekar Aug 9, 2022
5fb71f9
Add TS deps and build
shekharkhedekar Apr 28, 2022
ce03313
build folder, fix npm scripts and config
shekharkhedekar Apr 28, 2022
7fb47e7
Update tsconfig.json
shekharkhedekar Apr 28, 2022
9655030
Move to jest
shekharkhedekar Apr 30, 2022
df270ee
fix imports
shekharkhedekar Apr 30, 2022
23a80b0
add prepublish script
shekharkhedekar May 1, 2022
a40f6c6
Add coverage, remove types for now
shekharkhedekar May 2, 2022
b9c3bd0
Add ts-node
shekharkhedekar May 2, 2022
89da99b
Remove unnecessary catch clause
shekharkhedekar May 8, 2022
f78dad1
move ts deps to devDependencies
shekharkhedekar May 9, 2022
36e4713
Revert homedir change
shekharkhedekar Aug 9, 2022
8edd845
Merge branch 'typescript-build-deps' of github.com:shekharkhedekar/ft…
shekharkhedekar Aug 9, 2022
0251dd6
revert test catch removal
shekharkhedekar Aug 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# System
.DS_Store

# Dependencies
node_modules/

# Editor
ignore
.vscode
test/remote

# Test generated
test/remote/ftp
coverage

# Developer
playground
.DS_Store
notes.md
.env
dist

# Built files
build
9 changes: 9 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Config } from "@jest/types";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please dont change test framework in a PR about typescript

// Sync object
const config: Config.InitialOptions = {
verbose: true,
transform: {
"^.+\\.ts?$": "ts-jest",
},
};
export default config;
10,776 changes: 8,370 additions & 2,406 deletions package-lock.json

Large diffs are not rendered by default.

33 changes: 25 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"name": "ftp-deploy",
"version": "2.4.2",
"version": "2.4.3",
"author": "Simon Hampton",
"description": "Ftp a folder from your local disk to an ftp destination",
"main": "src/ftp-deploy",
"main": "build/ftp-deploy.js",
"scripts": {
"test": "mocha **/**.spec.js",
"server": "node test/server.js"
"test": "jest **/**.spec.js",
"tdd": "jest --watch **/**.spec.js",
"coverage": "jest --coverage **/**.spec.js",
"server": "node test/server.js",
"build": "tsc --build --clean && tsc --build",
"watch": "tsc --watch",
"prepublish": "npm run build"
},
"dependencies": {
"bluebird": "^3.7.2",
Expand All @@ -17,10 +22,18 @@
"upath": "^2.0.1"
},
"devDependencies": {
"chai": "^4.3.6",
"@types/bluebird": "^3.5.36",
"@types/jest": "^27.4.1",
"@types/minimatch": "^3.0.5",
"@types/node": "^17.0.31",
"@types/promise-ftp": "^1.3.4",
"@types/read": "^0.0.29",
"@types/ssh2-sftp-client": "^7.0.1",
"delete": "^1.1.0",
"ftp-srv": "^4.6.0",
"mocha": "^9.1.3"
"ftp-srv": "^4.6.2",
"ts-jest": "^27.1.4",
"ts-node": "^10.7.0",
"typescript": "^4.6.4"
},
"keywords": [
"ftp",
Expand Down Expand Up @@ -48,9 +61,13 @@
{
"name": "keyle",
"url": "https://github.com/keyle"
},
{
"name": "Shekhar Khedekar",
"url": "https://github.com/shekharkhedekar"
}
],
"prettier": {
"tabWidth": 4
}
}
}
30 changes: 0 additions & 30 deletions playground/test_script.js
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't remove this file

This file was deleted.

6 changes: 2 additions & 4 deletions src/ftp-deploy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
const path = require("path");
const fs = require("fs");
const utils = require("util");
const del = require("delete");

// var assert = require("assert");
const FtpDeploy = require("./ftp-deploy");

const statP = utils.promisify(fs.stat);

const del = require("delete");
const FtpDeploy = require("./ftp-deploy");

const config = {
user: "anonymous",
password: "anon", // Optional, prompted if none given
Expand Down
2 changes: 1 addition & 1 deletion src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function deleteDir(ftp, dir) {
});
}

mkDirExists = (ftp, dir) => {
const mkDirExists = (ftp, dir) => {
// Make the directory using recursive expand
return ftp.mkdir(dir, true).catch(err => {
if (err.message.startsWith("EEXIST")) {
Expand Down
5 changes: 2 additions & 3 deletions src/lib.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

const path = require("path");
var assert = require("assert");

const expect = require("chai").expect;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not change test framework without further justification

const expect = require("jest").expect;

const lib = require("../src/lib");

Expand Down Expand Up @@ -51,7 +50,7 @@ describe("canIncludePath", () => {
describe("dirParseSync", () => {
it("should throw on a bad start directory", () => {
const testDir = "./throw";
assert.throws(() => lib.parseLocal(["*"], testDir, testDir), Error);
assert.throws(() => lib.parseLocal(["*"], [], testDir, testDir), Error);
});
it("should traverse simple directory", () => {
const rootDir = path.join(__dirname, "../test/simple");
Expand Down
2 changes: 2 additions & 0 deletions test/server.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const FtpSrv = require("ftp-srv");
const path = require("path");

// Using non-standard port
const port = 2121;
const homeDir =
require("os").homedir() + "/code/projects/ftp-deploy/test/remote";

console.log("serving", homeDir);

const options = {
Expand Down
19 changes: 19 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"outDir": "./build",
"allowJs": true,
"target": "es5",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["./src/**/*"],
"exclude": ["./src/**/*.spec.js"]
}