You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@annotator.apache.org by ge...@apache.org on 2020/05/28 11:01:22 UTC

[incubator-annotator] 03/03: Organise folder structure

This is an automated email from the ASF dual-hosted git repository.

gerben pushed a commit to branch dom-tests
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git

commit 9c9d2fa78560c8270d70988b6eb081f3bdca5a49
Author: Gerben <ge...@treora.com>
AuthorDate: Thu May 28 12:51:24 2020 +0200

    Organise folder structure
    
    Note that test files directly in dom/test/ are not found by mocha now
    there are also test files present in its subdirectory; presumably due to
    a bug in how the ** wildcard is interpreted in
    packages/*/test/**/*.test.[jt]s; I have been unable to find out exactly
    why or in which module this occurs.
---
 packages/dom/src/index.ts                                         | 2 +-
 packages/dom/src/{ => range}/cartesian.ts                         | 0
 packages/dom/{test/index.js => src/range/index.ts}                | 2 +-
 packages/dom/src/{range.ts => range/match.ts}                     | 6 +++---
 packages/dom/src/text-quote/index.ts                              | 2 +-
 packages/dom/test/{ => range}/cartesian.test.ts                   | 2 +-
 .../describe-cases.ts}                                            | 2 +-
 .../{text-quote-describe.test.ts => text-quote/describe.test.ts}  | 6 +++---
 .../test/{text-quote-match-cases.ts => text-quote/match-cases.ts} | 2 +-
 .../test/{text-quote-match.test.ts => text-quote/match.test.ts}   | 8 ++++----
 packages/dom/test/{ => text-quote}/utils.ts                       | 0
 11 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/packages/dom/src/index.ts b/packages/dom/src/index.ts
index 5b89ef6..6ef53d7 100644
--- a/packages/dom/src/index.ts
+++ b/packages/dom/src/index.ts
@@ -19,6 +19,6 @@
  */
 
 export * from './css';
-export * from './range';
+export * from './range/index';
 export * from './text-quote/index';
 export * from './highlight-range';
diff --git a/packages/dom/src/cartesian.ts b/packages/dom/src/range/cartesian.ts
similarity index 100%
rename from packages/dom/src/cartesian.ts
rename to packages/dom/src/range/cartesian.ts
diff --git a/packages/dom/test/index.js b/packages/dom/src/range/index.ts
similarity index 97%
rename from packages/dom/test/index.js
rename to packages/dom/src/range/index.ts
index ebd8b07..011e994 100644
--- a/packages/dom/test/index.js
+++ b/packages/dom/src/range/index.ts
@@ -18,4 +18,4 @@
  * under the License.
  */
 
-export {};
+export * from './match';
diff --git a/packages/dom/src/range.ts b/packages/dom/src/range/match.ts
similarity index 91%
rename from packages/dom/src/range.ts
rename to packages/dom/src/range/match.ts
index e465386..e540d5c 100644
--- a/packages/dom/src/range.ts
+++ b/packages/dom/src/range/match.ts
@@ -18,10 +18,10 @@
  * under the License.
  */
 
-import { ownerDocument } from './scope';
+import { ownerDocument } from '../scope';
 import { product } from './cartesian';
-import { RangeSelector, Selector } from '../../selector/src/types';
-import { DomMatcher, DomScope } from './types';
+import { RangeSelector, Selector } from '../../../selector/src/types';
+import { DomMatcher, DomScope } from '../types';
 
 export function makeCreateRangeSelectorMatcher(
   createMatcher: <T extends Selector>(selector: T) => DomMatcher
diff --git a/packages/dom/src/text-quote/index.ts b/packages/dom/src/text-quote/index.ts
index 9f77e75..bb73732 100644
--- a/packages/dom/src/text-quote/index.ts
+++ b/packages/dom/src/text-quote/index.ts
@@ -18,5 +18,5 @@
  * under the License.
  */
 
- export * from './describe';
+export * from './describe';
 export * from './match';
diff --git a/packages/dom/test/cartesian.test.ts b/packages/dom/test/range/cartesian.test.ts
similarity index 96%
rename from packages/dom/test/cartesian.test.ts
rename to packages/dom/test/range/cartesian.test.ts
index 9ff47eb..5fd854b 100644
--- a/packages/dom/test/cartesian.test.ts
+++ b/packages/dom/test/range/cartesian.test.ts
@@ -19,7 +19,7 @@
  */
 
 import { assert } from 'chai';
-import { product } from '../src/cartesian';
+import { product } from '../../src/range/cartesian';
 
 async function* gen1() {
   yield 1;
diff --git a/packages/dom/test/text-quote-describe-cases.ts b/packages/dom/test/text-quote/describe-cases.ts
similarity index 97%
rename from packages/dom/test/text-quote-describe-cases.ts
rename to packages/dom/test/text-quote/describe-cases.ts
index a7e556e..c40ec3e 100644
--- a/packages/dom/test/text-quote-describe-cases.ts
+++ b/packages/dom/test/text-quote/describe-cases.ts
@@ -1,4 +1,4 @@
-import { TextQuoteSelector } from "../../selector/src";
+import { TextQuoteSelector } from "../../../selector/src";
 import { RangeInfo } from "./utils";
 
 const testCases: {
diff --git a/packages/dom/test/text-quote-describe.test.ts b/packages/dom/test/text-quote/describe.test.ts
similarity index 95%
rename from packages/dom/test/text-quote-describe.test.ts
rename to packages/dom/test/text-quote/describe.test.ts
index ba5a52c..f962157 100644
--- a/packages/dom/test/text-quote-describe.test.ts
+++ b/packages/dom/test/text-quote/describe.test.ts
@@ -19,9 +19,9 @@
  */
 
 import { assert } from 'chai';
-import { describeTextQuote } from '../src/text-quote/describe';
-import testCases from './text-quote-describe-cases';
-import testMatchCases from './text-quote-match-cases';
+import { describeTextQuote } from '../../src/text-quote/describe';
+import testCases from './describe-cases';
+import testMatchCases from './match-cases';
 import { hydrateRange, evaluateXPath } from './utils';
 
 const domParser = new window.DOMParser();
diff --git a/packages/dom/test/text-quote-match-cases.ts b/packages/dom/test/text-quote/match-cases.ts
similarity index 99%
rename from packages/dom/test/text-quote-match-cases.ts
rename to packages/dom/test/text-quote/match-cases.ts
index 0fd757a..856169a 100644
--- a/packages/dom/test/text-quote-match-cases.ts
+++ b/packages/dom/test/text-quote/match-cases.ts
@@ -1,4 +1,4 @@
-import { TextQuoteSelector } from "../../selector/src";
+import { TextQuoteSelector } from "../../../selector/src";
 import { RangeInfo } from "./utils";
 
 const testCases: {
diff --git a/packages/dom/test/text-quote-match.test.ts b/packages/dom/test/text-quote/match.test.ts
similarity index 97%
rename from packages/dom/test/text-quote-match.test.ts
rename to packages/dom/test/text-quote/match.test.ts
index e7a025e..3148a3f 100644
--- a/packages/dom/test/text-quote-match.test.ts
+++ b/packages/dom/test/text-quote/match.test.ts
@@ -19,10 +19,10 @@
  */
 
 import { assert } from 'chai';
-import { createTextQuoteSelectorMatcher } from '../src/text-quote/match';
-import { TextQuoteSelector } from '../../selector/src/types';
-import { DomScope } from '../src/types';
-import testCases from './text-quote-match-cases';
+import { createTextQuoteSelectorMatcher } from '../../src/text-quote/match';
+import { TextQuoteSelector } from '../../../selector/src/types';
+import { DomScope } from '../../src/types';
+import testCases from './match-cases';
 import { evaluateXPath, RangeInfo } from './utils';
 
 const domParser = new window.DOMParser();
diff --git a/packages/dom/test/utils.ts b/packages/dom/test/text-quote/utils.ts
similarity index 100%
rename from packages/dom/test/utils.ts
rename to packages/dom/test/text-quote/utils.ts