Skip to content

Commit

Permalink
Generate outputs in dist (#49)
Browse files Browse the repository at this point in the history
* Generate code in /dist

* Move outputs to dir

* Fix configuration

* Update API extractor configs

* Keep generating files

* Update TS config

* Run prettier

* Add changeset
  • Loading branch information
Jym77 authored Jun 26, 2024
1 parent a452230 commit 8749498
Show file tree
Hide file tree
Showing 115 changed files with 448 additions and 224 deletions.
32 changes: 32 additions & 0 deletions .changeset/warm-rocks-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
"@siteimprove/alfa-formatter-sarif": minor
"@siteimprove/alfa-formatter-earl": minor
"@siteimprove/alfa-formatter-json": minor
"@siteimprove/alfa-interviewer": minor
"@siteimprove/alfa-playwright": minor
"@siteimprove/alfa-unexpected": minor
"@siteimprove/alfa-formatter": minor
"@siteimprove/alfa-puppeteer": minor
"@siteimprove/alfa-webdriver": minor
"@siteimprove/alfa-frontier": minor
"@siteimprove/alfa-angular": minor
"@siteimprove/alfa-cheerio": minor
"@siteimprove/alfa-command": minor
"@siteimprove/alfa-crawler": minor
"@siteimprove/alfa-cypress": minor
"@siteimprove/alfa-jasmine": minor
"@siteimprove/alfa-scraper": minor
"@siteimprove/alfa-assert": minor
"@siteimprove/alfa-enzyme": minor
"@siteimprove/alfa-jquery": minor
"@siteimprove/alfa-react": minor
"@siteimprove/alfa-chai": minor
"@siteimprove/alfa-jest": minor
"@siteimprove/alfa-vue": minor
---

**Breaking:** The .js files are now built in the dist folder rather than in src.

⚠️ This is the first of a series of changes on the internal structure and build process of distributed packages. It is probably better to not use this version and wait until more of these internal changes have been done to jump directly to the final result. We are internally releasing these changes for validation purpose only.

This should not impact consumers, the package.json files should be set correctly to consume these files.
2 changes: 1 addition & 1 deletion config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "<projectFolder>/src/index.d.ts",
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts",
"apiReport": {
"enabled": true,
"reportFolder": "../docs/review/api/",
Expand Down
30 changes: 15 additions & 15 deletions docs/review/api/alfa-frontier.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import { Equatable } from '@siteimprove/alfa-equatable';
import * as json from '@siteimprove/alfa-json';
import { Option } from '@siteimprove/alfa-option';
import { Serializable } from '@siteimprove/alfa-json';
import { URL } from '@siteimprove/alfa-url';
import { URL as URL_2 } from '@siteimprove/alfa-url';

// @public (undocumented)
export class Frontier implements Equatable, Serializable {
complete(url: string | URL): boolean;
dequeue(): Option<URL>;
enqueue(url: string | URL): boolean;
complete(url: string | URL_2): boolean;
dequeue(): Option<URL_2>;
enqueue(url: string | URL_2): boolean;
// (undocumented)
equals(value: unknown): value is this;
error(url: string | URL): boolean;
error(url: string | URL_2): boolean;
// (undocumented)
static from(json: Frontier.JSON): Frontier;
// (undocumented)
Expand All @@ -27,21 +27,21 @@ export class Frontier implements Equatable, Serializable {
// (undocumented)
hasWaiting(): boolean;
// (undocumented)
isCompleted(url: string | URL): boolean;
isCompleted(url: string | URL_2): boolean;
// (undocumented)
isInProgress(url: string | URL): boolean;
isInProgress(url: string | URL_2): boolean;
// (undocumented)
isInScope(url: string | URL): boolean;
isSeen(url: string | URL): boolean;
isUnseen(url: string | URL): boolean;
isInScope(url: string | URL_2): boolean;
isSeen(url: string | URL_2): boolean;
isUnseen(url: string | URL_2): boolean;
// (undocumented)
isWaiting(url: string | URL): boolean;
isWaiting(url: string | URL_2): boolean;
// (undocumented)
static of(scope: string | URL, seed?: Iterable<string | URL>): Frontier;
redirect(from: string | URL, to: string | URL): boolean;
retry(url: string | URL): boolean;
static of(scope: string | URL_2, seed?: Iterable<string | URL_2>): Frontier;
redirect(from: string | URL_2, to: string | URL_2): boolean;
retry(url: string | URL_2): boolean;
// (undocumented)
get scope(): URL;
get scope(): URL_2;
// (undocumented)
toJSON(): Frontier.JSON;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/alfa-angular/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../config/api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/src/index.d.ts"
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts"
}
8 changes: 4 additions & 4 deletions packages/alfa-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"directory": "packages/alfa-angular"
},
"bugs": "https://github.com/siteimprove/alfa/issues",
"main": "src/index.js",
"types": "src/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"src/**/*.js",
"src/**/*.d.ts"
"dist/**/*.js",
"dist/**/*.d.ts"
],
"dependencies": {
"@angular/core": "^11.0.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/alfa-angular/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"compilerOptions": { "outDir": "../dist" },
"files": ["./angular.ts", "./index.ts"]
}
2 changes: 1 addition & 1 deletion packages/alfa-angular/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"files": ["src/angular.ts", "src/index.ts"]
"references": [{ "path": "./src" }]
}
2 changes: 1 addition & 1 deletion packages/alfa-assert/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../config/api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/src/index.d.ts"
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts"
}
8 changes: 4 additions & 4 deletions packages/alfa-assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"directory": "packages/alfa-assert"
},
"bugs": "https://github.com/siteimprove/alfa/issues",
"main": "src/index.js",
"types": "src/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"src/**/*.js",
"src/**/*.d.ts"
"dist/**/*.js",
"dist/**/*.d.ts"
],
"dependencies": {
"@siteimprove/alfa-act": "^0.85.1",
Expand Down
6 changes: 6 additions & 0 deletions packages/alfa-assert/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"compilerOptions": { "outDir": "../dist" },
"files": ["./asserter.ts", "./assertion.ts", "./handler.ts", "./index.ts"]
}
2 changes: 1 addition & 1 deletion packages/alfa-assert/test/asserter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Hashable } from "@siteimprove/alfa-hash";
import { Option } from "@siteimprove/alfa-option";
import { test } from "@siteimprove/alfa-test";

import { Asserter } from "../src/asserter";
import { Asserter } from "../dist/asserter";

import { CantTell, Fail, Pass } from "./fixture/rule";

Expand Down
7 changes: 7 additions & 0 deletions packages/alfa-assert/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"compilerOptions": { "outDir": "." },
"files": ["./fixture/rule.ts", "./asserter.spec.ts"],
"references": [{ "path": "../src" }]
}
10 changes: 2 additions & 8 deletions packages/alfa-assert/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"files": [
"src/asserter.ts",
"src/assertion.ts",
"src/handler.ts",
"src/index.ts",
"test/fixture/rule.ts",
"test/asserter.spec.ts"
]
"files": [],
"references": [{ "path": "./src" }, { "path": "./test" }]
}
2 changes: 1 addition & 1 deletion packages/alfa-chai/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../config/api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/src/index.d.ts"
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts"
}
8 changes: 4 additions & 4 deletions packages/alfa-chai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"directory": "packages/alfa-chai"
},
"bugs": "https://github.com/siteimprove/alfa/issues",
"main": "src/index.js",
"types": "src/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"src/**/*.js",
"src/**/*.d.ts"
"dist/**/*.js",
"dist/**/*.d.ts"
],
"dependencies": {
"@siteimprove/alfa-act": "^0.85.1",
Expand Down
7 changes: 7 additions & 0 deletions packages/alfa-chai/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"compilerOptions": { "outDir": "../dist" },
"files": ["./chai.ts", "./index.ts"],
"references": [{ "path": "../../alfa-assert" }]
}
3 changes: 1 addition & 2 deletions packages/alfa-chai/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"files": ["src/chai.ts", "src/index.ts"],
"references": [{ "path": "../alfa-assert" }]
"references": [{ "path": "./src" }]
}
2 changes: 1 addition & 1 deletion packages/alfa-cheerio/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../config/api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/src/index.d.ts"
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts"
}
8 changes: 4 additions & 4 deletions packages/alfa-cheerio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"directory": "packages/alfa-cheerio"
},
"bugs": "https://github.com/siteimprove/alfa/issues",
"main": "src/index.js",
"types": "src/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"src/**/*.js",
"src/**/*.d.ts"
"dist/**/*.js",
"dist/**/*.d.ts"
],
"dependencies": {
"@siteimprove/alfa-device": "^0.85.1",
Expand Down
6 changes: 6 additions & 0 deletions packages/alfa-cheerio/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"compilerOptions": { "outDir": "../dist" },
"files": ["./cheerio.ts", "./index.ts"]
}
2 changes: 1 addition & 1 deletion packages/alfa-cheerio/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"files": ["src/cheerio.ts", "src/index.ts"]
"references": [{ "path": "./src" }]
}
2 changes: 1 addition & 1 deletion packages/alfa-command/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../config/api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/src/index.d.ts"
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts"
}
8 changes: 4 additions & 4 deletions packages/alfa-command/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"directory": "packages/alfa-command"
},
"bugs": "https://github.com/siteimprove/alfa/issues",
"main": "src/index.js",
"types": "src/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"src/**/*.js",
"src/**/*.d.ts"
"dist/**/*.js",
"dist/**/*.d.ts"
],
"dependencies": {
"@siteimprove/alfa-functor": "^0.85.1",
Expand Down
12 changes: 12 additions & 0 deletions packages/alfa-command/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"compilerOptions": { "outDir": "../dist" },
"files": [
"./argument.ts",
"./command.ts",
"./flag.ts",
"./index.ts",
"./text.ts"
]
}
2 changes: 1 addition & 1 deletion packages/alfa-command/test/flag.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from "@siteimprove/alfa-test";

import { Flag } from "../src/flag";
import { Flag } from "../dist/flag";

test(".default() constructs a flag with a default value", (t) => {
const flag = Flag.string("foo", "").default("hello");
Expand Down
2 changes: 1 addition & 1 deletion packages/alfa-command/test/text.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test } from "@siteimprove/alfa-test";

import { Text } from "../src/text";
import { Text } from "../dist/text";

test(".indent() indents all lines of text", (t) => {
const text = `hello world\nhow are you?`;
Expand Down
7 changes: 7 additions & 0 deletions packages/alfa-command/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"compilerOptions": { "outDir": "." },
"files": ["./flag.spec.ts", "./text.spec.ts"],
"references": [{ "path": "../src" }]
}
11 changes: 2 additions & 9 deletions packages/alfa-command/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"files": [
"src/argument.ts",
"src/command.ts",
"src/flag.ts",
"src/index.ts",
"src/text.ts",
"test/flag.spec.ts",
"test/text.spec.ts"
]
"files": [],
"references": [{ "path": "./src" }, { "path": "./test" }]
}
2 changes: 1 addition & 1 deletion packages/alfa-crawler/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../config/api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/src/index.d.ts"
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts"
}
8 changes: 4 additions & 4 deletions packages/alfa-crawler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"directory": "packages/alfa-crawler"
},
"bugs": "https://github.com/siteimprove/alfa/issues",
"main": "src/index.js",
"types": "src/index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"src/**/*.js",
"src/**/*.d.ts"
"dist/**/*.js",
"dist/**/*.d.ts"
],
"dependencies": {
"@siteimprove/alfa-dom": "^0.85.1",
Expand Down
10 changes: 10 additions & 0 deletions packages/alfa-crawler/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"compilerOptions": { "outDir": "../dist" },
"files": ["./crawler.ts", "./index.ts"],
"references": [
{ "path": "../../alfa-frontier" },
{ "path": "../../alfa-scraper" }
]
}
2 changes: 1 addition & 1 deletion packages/alfa-crawler/test/crawler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { test } from "@siteimprove/alfa-test";

import { Frontier } from "@siteimprove/alfa-frontier";

import { Crawler } from "../src/crawler";
import { Crawler } from "../dist/crawler";

const fixture = `${url.pathToFileURL(__dirname).href}/fixture`;

Expand Down
7 changes: 7 additions & 0 deletions packages/alfa-crawler/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"compilerOptions": { "outDir": "." },
"files": ["./crawler.spec.ts"],
"references": [{ "path": "../src" }]
}
Loading

0 comments on commit 8749498

Please sign in to comment.