Skip to content

Commit

Permalink
Fix build npm packages, move sample app under cypress
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitriy Lazarev <w@kich.dev>
  • Loading branch information
wKich committed Aug 21, 2024
1 parent 4586c05 commit 7fe95f4
Show file tree
Hide file tree
Showing 108 changed files with 482 additions and 28,214 deletions.
3 changes: 3 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"dom.iterable",
"dom.asynciterable"
]
},
"imports": {
"@deno/dnt": "jsr:@deno/dnt@^0.41.3"
}
}
2,457 changes: 164 additions & 2,293 deletions deno.lock

Large diffs are not rendered by default.

56 changes: 0 additions & 56 deletions package.json

This file was deleted.

9 changes: 4 additions & 5 deletions packages/core/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@
"version": "1.0.0",
"tasks": {
"test": "deno test --allow-run=deno --allow-env --allow-read",
"test:types": "tsd -f \"./types/*.test-d.ts\" -t ./mod.ts",
"build:npm": "deno run -A tasks/build-npm.ts",
"docs": "rm -rf docs && typedoc --options typedoc.json --tsconfig tsconfig.docs.json"
"docs": "rm -rf docs && deno run -A npm:typedoc@^0.25.13 --options typedoc.json --tsconfig tsconfig.docs.json"
},
"exports": "./mod.ts",
"imports": {
"@effection/core": "npm:@effection/core@2.2.0",
"@std/expect": "jsr:@std/expect@^1.0.0",
"@std/testing": "jsr:@std/testing@^1.0.0",
"@testing-library/dom": "npm:@testing-library/dom@^8.18.1",
"@testing-library/user-event": "npm:@testing-library/user-event@^14.5.2",
"change-case": "npm:change-case@^4.1.1",
"element-is-visible": "npm:element-is-visible@^1.0.0",
"jsdom": "npm:jsdom@^24.0.0",
"lodash.isequal": "npm:lodash.isequal@^4.5.0",
"performance-api": "npm:performance-api@^1.0.0",
"tsd": "npm:tsd@^0.31.0",
"typedoc": "npm:typedoc@^0.25.13"
"performance-api": "npm:performance-api@^1.0.0"
},
"lint": {
"rules": {
Expand Down
19 changes: 19 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@interactors/core",
"version": "0.0.0",
"description": "Composable page objects for components",
"license": "MIT",
"homepage": "https://frontside.com/interactors",
"author": "Frontside Engineering <engineering@frontside.com>",
"repository": {
"type": "git",
"url": "git+https://github.com/thefrontside/interactors.git"
},
"bugs": {
"url": "https://github.com/thefrontside/interactors/issues"
},
"engines": {
"node": ">= 16"
},
"sideEffects": false
}
52 changes: 9 additions & 43 deletions packages/core/tasks/build-npm.ts
Original file line number Diff line number Diff line change
@@ -1,51 +1,17 @@
import {
build,
emptyDir,
} from "https://deno.land/x/dnt@0.36.0/mod.ts?pin=v123";
import { buildNpm } from '../../../tasks/build-npm.ts'

const outDir = "./build/npm";

await emptyDir(outDir);

let [version] = Deno.args;
if (!version) {
throw new Error("a version argument is required to build the npm package");
}

await build({
importMap: "./deno.json",
entryPoints: ["./mod.ts"],
outDir,
shims: {
deno: false,
},
test: false,
typeCheck: false,
compilerOptions: {
lib: ["ESNext", "DOM"],
target: "ES2020",
sourceMap: true,
},
package: {
// package.json properties
name: "@interactors/core",
version,
description: "Composable page objects for components",
license: "MIT",
homepage: "https://frontside.com/interactors",
author: "Frontside Engineering <engineering@frontside.com>",
repository: {
type: "git",
url: "git+https://github.com/thefrontside/interactors.git",
},
bugs: {
url: "https://github.com/thefrontside/interactors/issues",
},
engines: {
node: ">= 16",
},
sideEffects: false,
},
});
const { default: denoJson } = await import('../deno.json', { with: { type: "json" } })
const { default: packageJson } = await import('../package.json', { with: { type: "json" } })

await Deno.copyFile("README.md", `${outDir}/README.md`);
await buildNpm({
version,
entryPoint: import.meta.resolve('../mod.ts'),
imports: denoJson.imports,
packageJson
})
3 changes: 2 additions & 1 deletion packages/core/test/create-interactor.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from './deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from './helpers.ts';
import { Datepicker, Details, Div, Header, Link, MainNav, TextField } from './fixtures.ts';

Expand Down
3 changes: 0 additions & 3 deletions packages/core/test/deps.ts

This file was deleted.

3 changes: 2 additions & 1 deletion packages/core/test/extend.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from './deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from './helpers.ts';

import { Header, Link, Thing, HTML } from './fixtures.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/filter-delegate.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from './deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from './helpers.ts';

import { createInteractor } from '../mod.ts';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type DOMWindow, JSDOM } from "jsdom";
import { afterEach, beforeEach } from "./deps.ts";
import { afterEach, beforeEach } from "@std/testing/bdd";
import { addInteractionWrapper, globals, setDocumentResolver, setInteractorTimeout } from "@interactors/globals";

let jsdom: JSDOM;
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/inspector.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from './deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from './helpers.ts';

import { createInspector, including } from '../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/interactor.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from './deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from './helpers.ts';
import { Header, Link, MainNav } from './fixtures.ts';

Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/locator.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from './deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from './helpers.ts';

import { createInteractor } from '../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/matcher.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from './deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from './helpers.ts';

import type { Matcher } from '../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/matchers/and.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from '../deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from '../helpers.ts';

import { createInteractor, and, including, matching } from '../../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/matchers/every.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from '../deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from '../helpers.ts';

import { createInteractor, every, including } from '../../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/matchers/including.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from '../deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from '../helpers.ts';

import { createInteractor, including } from '../../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/matchers/matching.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, beforeEach, describe, it } from '../deps.ts';
import { beforeEach, describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from '../helpers.ts';

import { createInteractor, matching } from '../../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/matchers/not.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from '../deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from '../helpers.ts';

import { createInteractor, not, including } from '../../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/matchers/or.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from '../deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from '../helpers.ts';

import { createInteractor, or, including } from '../../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/matchers/some.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from '../deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from '../helpers.ts';

import { createInteractor, some, including } from '../../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/selector.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from './deps.ts';
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { dom } from './helpers.ts';

import { createInteractor } from '../mod.ts';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/test/serialize.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, describe, it } from "./deps.ts";
import { describe, it } from '@std/testing/bdd';
import { expect } from "@std/expect";
import { HTML, TextField } from "./fixtures.ts";
import { including, or } from "../mod.ts";
import { dom } from "./helpers.ts";
Expand Down
3 changes: 1 addition & 2 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"extends": "@frontside/tsconfig",
"exclude": ["types/**/*.ts"],
"extends": "../../tsconfig-base.json",
"compilerOptions": {
"allowImportingTsExtensions": true
}
Expand Down
35 changes: 0 additions & 35 deletions packages/core/types/create-interactor.test-d.ts

This file was deleted.

Loading

0 comments on commit 7fe95f4

Please sign in to comment.