summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author木杉 <zhmushan@qq.com>2019-01-11 06:11:44 +0800
committerRyan Dahl <ry@tinyclouds.org>2019-01-10 17:11:44 -0500
commit57c877c443765d7aa1f1f2d3cba801f280f19bfa (patch)
tree8a6d28410631497413fb32d9ff54b312f7e3d825
parent6f8dc44a2b218bac3fb3ebb1035cbbd10160b48b (diff)
refactor(path): reorg (denoland/deno_std#101)
Original: https://github.com/denoland/deno_std/commit/5be16ba5992b34a64d307779350b88b5cacbfa23
-rw-r--r--README.md2
-rw-r--r--fs/path.ts2
-rw-r--r--fs/path/README.md7
-rw-r--r--fs/path/basename_test.ts (renamed from path/basename_test.ts)4
-rw-r--r--fs/path/constants.ts (renamed from path/constants.ts)0
-rw-r--r--fs/path/dirname_test.ts (renamed from path/dirname_test.ts)4
-rw-r--r--fs/path/extname_test.ts (renamed from path/extname_test.ts)4
-rw-r--r--fs/path/interface.ts (renamed from path/interface.ts)0
-rw-r--r--fs/path/isabsolute_test.ts (renamed from path/isabsolute_test.ts)4
-rw-r--r--fs/path/join_test.ts (renamed from path/join_test.ts)4
-rw-r--r--fs/path/mod.ts (renamed from path/index.ts)0
-rw-r--r--fs/path/parse_format_test.ts (renamed from path/parse_format_test.ts)4
-rw-r--r--fs/path/relative_test.ts (renamed from path/relative_test.ts)4
-rw-r--r--fs/path/resolve_test.ts (renamed from path/resolve_test.ts)4
-rw-r--r--fs/path/zero_length_strings_test.ts (renamed from path/zero_length_strings_test.ts)4
-rwxr-xr-xnet/file_server.ts2
-rw-r--r--path/README.md7
-rwxr-xr-xtest.ts18
18 files changed, 38 insertions, 36 deletions
diff --git a/README.md b/README.md
index 3a2788333..0a996bce3 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@
A framework for creating HTTP/HTTPS servers inspired by GoLang.
-- **[path](./path/)**
+- **[path](./fs/path)**
File path manipulation.
diff --git a/fs/path.ts b/fs/path.ts
new file mode 100644
index 000000000..64390108d
--- /dev/null
+++ b/fs/path.ts
@@ -0,0 +1,2 @@
+export * from "./path/mod.ts";
+export * from "./path/interface.ts";
diff --git a/fs/path/README.md b/fs/path/README.md
new file mode 100644
index 000000000..938ffb358
--- /dev/null
+++ b/fs/path/README.md
@@ -0,0 +1,7 @@
+# Deno Path Manipulation Libraries
+
+Usage:
+
+```ts
+import * as path from "https://deno.land/x/fs/path.ts";
+```
diff --git a/path/basename_test.ts b/fs/path/basename_test.ts
index b605aa210..ffe9e051c 100644
--- a/path/basename_test.ts
+++ b/fs/path/basename_test.ts
@@ -1,8 +1,8 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
-import { test, assertEqual } from "../testing/mod.ts";
-import * as path from "./index.ts";
+import { test, assertEqual } from "../../testing/mod.ts";
+import * as path from "./mod.ts";
test(function basename() {
assertEqual(path.basename(".js", ".js"), "");
diff --git a/path/constants.ts b/fs/path/constants.ts
index b440be9cc..b440be9cc 100644
--- a/path/constants.ts
+++ b/fs/path/constants.ts
diff --git a/path/dirname_test.ts b/fs/path/dirname_test.ts
index e535ec891..5613d6d2c 100644
--- a/path/dirname_test.ts
+++ b/fs/path/dirname_test.ts
@@ -1,8 +1,8 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
-import { test, assertEqual } from "../testing/mod.ts";
-import * as path from "./index.ts";
+import { test, assertEqual } from "../../testing/mod.ts";
+import * as path from "./mod.ts";
test(function dirname() {
assertEqual(path.posix.dirname("/a/b/"), "/a");
diff --git a/path/extname_test.ts b/fs/path/extname_test.ts
index 0d6d283a8..63d473d34 100644
--- a/path/extname_test.ts
+++ b/fs/path/extname_test.ts
@@ -1,8 +1,8 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
-import { test, assertEqual } from "../testing/mod.ts";
-import * as path from "./index.ts";
+import { test, assertEqual } from "../../testing/mod.ts";
+import * as path from "./mod.ts";
const slashRE = /\//g;
diff --git a/path/interface.ts b/fs/path/interface.ts
index 84a3030ff..84a3030ff 100644
--- a/path/interface.ts
+++ b/fs/path/interface.ts
diff --git a/path/isabsolute_test.ts b/fs/path/isabsolute_test.ts
index 548819ac0..9591b8045 100644
--- a/path/isabsolute_test.ts
+++ b/fs/path/isabsolute_test.ts
@@ -1,8 +1,8 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
-import { test, assertEqual } from "../testing/mod.ts";
-import * as path from "./index.ts";
+import { test, assertEqual } from "../../testing/mod.ts";
+import * as path from "./mod.ts";
test(function isAbsolute() {
assertEqual(path.posix.isAbsolute("/home/foo"), true);
diff --git a/path/join_test.ts b/fs/path/join_test.ts
index 25e302eba..2051dbdaa 100644
--- a/path/join_test.ts
+++ b/fs/path/join_test.ts
@@ -1,5 +1,5 @@
-import { test, assertEqual } from "../testing/mod.ts";
-import * as path from "./index.ts";
+import { test, assertEqual } from "../../testing/mod.ts";
+import * as path from "./mod.ts";
const backslashRE = /\\/g;
diff --git a/path/index.ts b/fs/path/mod.ts
index 4201c52ad..4201c52ad 100644
--- a/path/index.ts
+++ b/fs/path/mod.ts
diff --git a/path/parse_format_test.ts b/fs/path/parse_format_test.ts
index be98f8739..8b429ce24 100644
--- a/path/parse_format_test.ts
+++ b/fs/path/parse_format_test.ts
@@ -1,8 +1,8 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
-import { test, assertEqual } from "../testing/mod.ts";
-import * as path from "./index.ts";
+import { test, assertEqual } from "../../testing/mod.ts";
+import * as path from "./mod.ts";
const winPaths = [
// [path, root]
diff --git a/path/relative_test.ts b/fs/path/relative_test.ts
index dcf8fed98..87e308b43 100644
--- a/path/relative_test.ts
+++ b/fs/path/relative_test.ts
@@ -1,8 +1,8 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
-import { test, assertEqual } from "../testing/mod.ts";
-import * as path from "./index.ts";
+import { test, assertEqual } from "../../testing/mod.ts";
+import * as path from "./mod.ts";
const relativeTests = {
win32:
diff --git a/path/resolve_test.ts b/fs/path/resolve_test.ts
index b365d40b0..7c2b55249 100644
--- a/path/resolve_test.ts
+++ b/fs/path/resolve_test.ts
@@ -1,8 +1,8 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
-import { test, assertEqual } from "../testing/mod.ts";
-import * as path from "./index.ts";
+import { test, assertEqual } from "../../testing/mod.ts";
+import * as path from "./mod.ts";
import { cwd } from "deno";
const windowsTests =
diff --git a/path/zero_length_strings_test.ts b/fs/path/zero_length_strings_test.ts
index f9b357bf1..d069c781f 100644
--- a/path/zero_length_strings_test.ts
+++ b/fs/path/zero_length_strings_test.ts
@@ -1,8 +1,8 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
-import { test, assertEqual } from "../testing/mod.ts";
-import * as path from "./index.ts";
+import { test, assertEqual } from "../../testing/mod.ts";
+import * as path from "./mod.ts";
import { cwd } from "deno";
const pwd = cwd();
diff --git a/net/file_server.ts b/net/file_server.ts
index 91afa2d57..bebb93969 100755
--- a/net/file_server.ts
+++ b/net/file_server.ts
@@ -12,7 +12,7 @@ import {
Response
} from "./http.ts";
import { cwd, DenoError, ErrorKind, args, stat, readDir, open } from "deno";
-import { extname } from "../path/index.ts";
+import { extname } from "../fs/path.ts";
import * as extensionsMap from "./extension_map.json";
const dirViewerTemplate = `
diff --git a/path/README.md b/path/README.md
deleted file mode 100644
index 924b0a993..000000000
--- a/path/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Deno Path Manipulation Libraries
-
-Usage:
-
-```ts
-import * as path from "https://deno.land/x/path/index.ts";
-```
diff --git a/test.ts b/test.ts
index 821aa4116..885096ac9 100755
--- a/test.ts
+++ b/test.ts
@@ -10,15 +10,15 @@ import "mkdirp/test.ts";
import "net/bufio_test.ts";
import "net/http_test.ts";
import "net/textproto_test.ts";
-import "path/basename_test.ts";
-import "path/dirname_test.ts";
-import "path/extname_test.ts";
-import "path/isabsolute_test.ts";
-import "path/join_test.ts";
-import "path/parse_format_test.ts";
-import "path/relative_test.ts";
-import "path/resolve_test.ts";
-import "path/zero_length_strings_test.ts";
+import "fs/path/basename_test.ts";
+import "fs/path/dirname_test.ts";
+import "fs/path/extname_test.ts";
+import "fs/path/isabsolute_test.ts";
+import "fs/path/join_test.ts";
+import "fs/path/parse_format_test.ts";
+import "fs/path/relative_test.ts";
+import "fs/path/resolve_test.ts";
+import "fs/path/zero_length_strings_test.ts";
import "testing/test.ts";
import { runTests, completePromise } from "net/file_server_test.ts";