Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5 Docs - GitHub Action Changes #408

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"reportUnusedDisableDirectives": true,
"rules": {
"@typescript-eslint/explicit-function-return-type": "error",
"max-lines": ["warn", 500]
"max-lines": ["warn", 2000]
}
}
79 changes: 66 additions & 13 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,81 @@
name: Actions-CI
name: CI

on:
push:
branches: [master, v5]
branches: [master]
pull_request:
branches: [master, v5]

permissions:
contents: read

jobs:
build:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci
- name: Run Linter
run: npm run eslint
- name: Run Formatter
run: npm run prettier

test:
name: Test - ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [latest, lts/*, lts/-1]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js (${{ matrix.node-version }})
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies and test
run: npm install
- run: npm test
- run: npm run eslint
- run: npm run prettier
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test

api:
name: API & Doc Validation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Extract API
run: npm run api:extract
- name: Generate docs
run: npm run api:docs
- name: Ensure API and doc changes have been committed
run: |
git add --renormalize .
if (( "$(git diff --ignore-space-at-eol --ignore-cr-at-eol | wc -l)" != 0 )); then
cat << EOF >> $GITHUB_STEP_SUMMARY
### Detected uncommitted changes

\`\`\`shell
$(git diff)
\`\`\`
EOF
git diff
exit 1
fi
2 changes: 1 addition & 1 deletion api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "<projectFolder>/dist/cookie/index.d.ts",
"newlineKind": "os",
"newlineKind": "lf",
"apiReport": {
"enabled": true,
"reportFolder": "api",
Expand Down
1 change: 1 addition & 0 deletions api/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
140 changes: 70 additions & 70 deletions api/docs/tough-cookie.cookiejar._constructor_.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [tough-cookie](./tough-cookie.md) &gt; [CookieJar](./tough-cookie.cookiejar.md) &gt; [(constructor)](./tough-cookie.cookiejar._constructor_.md)
## CookieJar.(constructor)
Creates a new `CookieJar` instance.
**Signature:**
```typescript
constructor(store?: Nullable<Store>, options?: CreateCookieJarOptions | boolean);
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
store
</td><td>
[Nullable](./tough-cookie.nullable.md)<!-- -->&lt;[Store](./tough-cookie.store.md)<!-- -->&gt;
</td><td>
_(Optional)_ a custom [Store](./tough-cookie.store.md) implementation (defaults to [MemoryCookieStore](./tough-cookie.memorycookiestore.md)<!-- -->)
</td></tr>
<tr><td>
options
</td><td>
[CreateCookieJarOptions](./tough-cookie.createcookiejaroptions.md) \| boolean
</td><td>
_(Optional)_ configures how cookies are processed by the cookie jar
</td></tr>
</tbody></table>
## Remarks
- If a custom store is not passed to the constructor, an in-memory store ([MemoryCookieStore](./tough-cookie.memorycookiestore.md) will be created and used. - If a boolean value is passed as the `options` parameter, this is equivalent to passing `{ rejectPublicSuffixes: <value> }`
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [tough-cookie](./tough-cookie.md) &gt; [CookieJar](./tough-cookie.cookiejar.md) &gt; [(constructor)](./tough-cookie.cookiejar._constructor_.md)

## CookieJar.(constructor)

Creates a new `CookieJar` instance.

**Signature:**

```typescript
constructor(store?: Nullable<Store>, options?: CreateCookieJarOptions | boolean);
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

store


</td><td>

[Nullable](./tough-cookie.nullable.md)<!-- -->&lt;[Store](./tough-cookie.store.md)<!-- -->&gt;


</td><td>

_(Optional)_ a custom [Store](./tough-cookie.store.md) implementation (defaults to [MemoryCookieStore](./tough-cookie.memorycookiestore.md)<!-- -->)


</td></tr>
<tr><td>

options


</td><td>

[CreateCookieJarOptions](./tough-cookie.createcookiejaroptions.md) \| boolean


</td><td>

_(Optional)_ configures how cookies are processed by the cookie jar


</td></tr>
</tbody></table>

## Remarks

- If a custom store is not passed to the constructor, an in-memory store ([MemoryCookieStore](./tough-cookie.memorycookiestore.md) will be created and used. - If a boolean value is passed as the `options` parameter, this is equivalent to passing `{ rejectPublicSuffixes: <value> }`

118 changes: 59 additions & 59 deletions api/docs/tough-cookie.cookiejar.clone.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [tough-cookie](./tough-cookie.md) &gt; [CookieJar](./tough-cookie.cookiejar.md) &gt; [clone](./tough-cookie.cookiejar.clone.md)
## CookieJar.clone() method
Produces a deep clone of this CookieJar. Modifications to the original do not affect the clone, and vice versa.
**Signature:**
```typescript
clone(callback: Callback<CookieJar>): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
callback
</td><td>
[Callback](./tough-cookie.callback.md)<!-- -->&lt;[CookieJar](./tough-cookie.cookiejar.md)<!-- -->&gt;
</td><td>
A function to call when the CookieJar is cloned.
</td></tr>
</tbody></table>
**Returns:**
void
## Remarks
- When no [Store](./tough-cookie.store.md) is provided, a new [MemoryCookieStore](./tough-cookie.memorycookiestore.md) will be used.
- Transferring between store types is supported so long as the source implements `.getAllCookies()` and the destination implements `.putCookie()`<!-- -->.
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [tough-cookie](./tough-cookie.md) &gt; [CookieJar](./tough-cookie.cookiejar.md) &gt; [clone](./tough-cookie.cookiejar.clone.md)

## CookieJar.clone() method

Produces a deep clone of this CookieJar. Modifications to the original do not affect the clone, and vice versa.

**Signature:**

```typescript
clone(callback: Callback<CookieJar>): void;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

callback


</td><td>

[Callback](./tough-cookie.callback.md)<!-- -->&lt;[CookieJar](./tough-cookie.cookiejar.md)<!-- -->&gt;


</td><td>

A function to call when the CookieJar is cloned.


</td></tr>
</tbody></table>
**Returns:**

void

## Remarks

- When no [Store](./tough-cookie.store.md) is provided, a new [MemoryCookieStore](./tough-cookie.memorycookiestore.md) will be used.

- Transferring between store types is supported so long as the source implements `.getAllCookies()` and the destination implements `.putCookie()`<!-- -->.