Skip to content

Commit

Permalink
fix: upgraded cacache, ssri, unplugin and all dev dependencies, moved…
Browse files Browse the repository at this point in the history
… from tsup to packem
  • Loading branch information
prisis committed Jul 22, 2024
1 parent eb512d4 commit b384e71
Show file tree
Hide file tree
Showing 35 changed files with 19,159 additions and 12,374 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ README.md
.github/ISSUE_TEMPLATE

verify-node-version.cjs

packem.config.ts
6 changes: 6 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ module.exports = defineConfig({
"jsx-a11y/heading-has-content": "off",
},
},
{
files: ["**/*.d.ts"],
rules: {
"perfectionist/sort-intersection-types": "off"
}
}
],
parserOptions: {
ecmaVersion: 2021,
Expand Down
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

3 changes: 1 addition & 2 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"
. "$(dirname "$0")/../common.sh"

# The hook should exit with non-zero status after issuing
# an appropriate message if it wants to stop the commit.
Expand Down
3 changes: 1 addition & 2 deletions .husky/post-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"
. "$(dirname "$0")/../common.sh"

# The hook should exit with non-zero status after issuing
# an appropriate message if it wants to stop the commit.
Expand Down
3 changes: 1 addition & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"
. "$(dirname "$0")/../common.sh"

# The hook should exit with non-zero status after issuing
# an appropriate message if it wants to stop the commit.
Expand Down
3 changes: 1 addition & 2 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"
. "$(dirname "$0")/../common.sh"

echo --------------------------------------------
echo Starting Git hook: prepare-commit-msg
Expand Down
20 changes: 20 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,23 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

<!-- DEPENDENCIES -->
<!-- DEPENDENCIES -->

<!-- TYPE_DEPENDENCIES -->

# Licenses of bundled types

The published @anolilab/unplugin-favicons artifact additionally contains code with the following licenses:
(MIT OR CC0-1.0)

# Bundled types:

## type-fest

License: (MIT OR CC0-1.0)
By: Sindre Sorhus
Repository: sindresorhus/type-fest

<!-- TYPE_DEPENDENCIES -->
21 changes: 21 additions & 0 deletions __tests__/utils/format-duration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,58 @@ import formatDuration from "../../src/core/utils/format-duration";

describe("formatDuration", () => {
it("should handle negative duration", () => {
expect.assertions(1);

const result = formatDuration(-5000);

expect(result).toBe("5 seconds");
});

it("should format duration less than a second", () => {
expect.assertions(1);

const result = formatDuration(500);

expect(result).toBe("500 ms");
});

it("should format duration in seconds", () => {
expect.assertions(1);

const result = formatDuration(5000);

expect(result).toBe("5 seconds");
});

it("should format duration in minutes", () => {
expect.assertions(1);

const result = formatDuration(120_000);

expect(result).toBe("2 minutes");
});

it("should format duration in hours", () => {
expect.assertions(1);

const result = formatDuration(3_600_000);

expect(result).toBe("1 hour");
});

it("should format duration in days", () => {
expect.assertions(1);

const result = formatDuration(86_400_000);

expect(result).toBe("1 day");
});

it("should format combination of days, hours, minutes, seconds, and milliseconds", () => {
expect.assertions(1);

const result = formatDuration(90_725_500);

expect(result).toBe("1 day, 1 hour, 12 minutes, 5 seconds, 500 ms");
});
});
20 changes: 20 additions & 0 deletions __tests__/utils/oracle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ describe("oracle", () => {
});

it("should guess app name from package.json", () => {
expect.assertions(1);

readPackageUpSync.mockReturnValueOnce({ packageJson: { name: "my-app" } });

const oracle = new Oracle();
Expand All @@ -33,6 +35,8 @@ describe("oracle", () => {
});

it("should return undefined if no app name in package.json", () => {
expect.assertions(1);

readPackageUpSync.mockReturnValueOnce({ packageJson: {} });

const oracle = new Oracle();
Expand All @@ -42,6 +46,8 @@ describe("oracle", () => {
});

it("should guess description from package.json", () => {
expect.assertions(1);

readPackageUpSync.mockReturnValueOnce({ packageJson: { description: "A sample app" } });

const oracle = new Oracle();
Expand All @@ -51,6 +57,8 @@ describe("oracle", () => {
});

it("should return undefined if no description in package.json", () => {
expect.assertions(1);

readPackageUpSync.mockReturnValueOnce({ packageJson: {} });

const oracle = new Oracle();
Expand All @@ -60,6 +68,8 @@ describe("oracle", () => {
});

it("should guess developer from package.json when author is a string", () => {
expect.assertions(1);

readPackageUpSync.mockReturnValueOnce({ packageJson: { author: "John Doe <john@example.com> (http://example.com)" } });

const oracle = new Oracle();
Expand All @@ -73,6 +83,8 @@ describe("oracle", () => {
});

it("should guess developer from package.json when author is an object", () => {
expect.assertions(1);

readPackageUpSync.mockReturnValueOnce({ packageJson: { author: { email: "john@example.com", name: "John Doe", url: "http://example.com" } } });

const oracle = new Oracle();
Expand All @@ -86,6 +98,8 @@ describe("oracle", () => {
});

it("should guess developer from package.json when maintainers are present", () => {
expect.assertions(1);

readPackageUpSync.mockReturnValueOnce({
packageJson: { maintainers: [{ email: "jane@example.com", name: "Jane Doe", url: "http://example.com/jane" }] },
});
Expand All @@ -101,6 +115,8 @@ describe("oracle", () => {
});

it("should return undefined for developer if no author or maintainers in package.json", () => {
expect.assertions(1);

readPackageUpSync.mockReturnValueOnce({ packageJson: {} });

const oracle = new Oracle();
Expand All @@ -114,6 +130,8 @@ describe("oracle", () => {
});

it("should guess version from package.json", () => {
expect.assertions(1);

readPackageUpSync.mockReturnValueOnce({ packageJson: { version: "1.0.0" } });

const oracle = new Oracle();
Expand All @@ -123,6 +141,8 @@ describe("oracle", () => {
});

it("should return undefined if no version in package.json", () => {
expect.assertions(1);

readPackageUpSync.mockReturnValueOnce({ packageJson: {} });

const oracle = new Oracle();
Expand Down
2 changes: 1 addition & 1 deletion examples/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
},
"dependencies": {
"@anolilab/unplugin-favicons": "workspace:*",
"astro": "^3.2.3"
"astro": "^4.12.2"
}
}
14 changes: 7 additions & 7 deletions examples/esbuild/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<title>Example</title>
</head>
<body>
test
</body>
<head>
<title>Example</title>
</head>
<body>
test
</body>
</html>
6 changes: 3 additions & 3 deletions examples/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"@anolilab/unplugin-favicons": "workspace:*"
},
"devDependencies": {
"esbuild": "^0.19.4",
"rimraf": "^5.0.5",
"typescript": "^5.2.2"
"esbuild": "^0.23.0",
"rimraf": "^6.0.1",
"typescript": "^5.5.3"
}
}
6 changes: 3 additions & 3 deletions examples/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "next start"
},
"dependencies": {
"next": "13.5.4",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18"
},
Expand All @@ -19,8 +19,8 @@
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "8.51.0",
"eslint-config-next": "13.5.4",
"eslint": "9.7.0",
"eslint-config-next": "14.2.5",
"typescript": "^5"
}
}
4 changes: 1 addition & 3 deletions examples/nuxt3/app.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<template>
<div class="markdown-body" style="padding: 2em 3em">
test
</div>
<div class="markdown-body" style="padding: 2em 3em">test</div>
</template>
6 changes: 3 additions & 3 deletions examples/nuxt3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"@anolilab/unplugin-favicons": "workspace:*"
},
"devDependencies": {
"nuxt": "^3.7.4",
"rimraf": "^5.0.5",
"typescript": "^5.2.2"
"nuxt": "^3.12.4",
"rimraf": "^6.0.1",
"typescript": "^5.5.3"
}
}
14 changes: 7 additions & 7 deletions examples/rollup/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<title>Example</title>
</head>
<body>
test
</body>
<head>
<title>Example</title>
</head>
<body>
test
</body>
</html>
4 changes: 2 additions & 2 deletions examples/rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"devDependencies": {
"@rollup/plugin-html": "^1.0.3",
"rimraf": "^5.0.5",
"rollup": "^4.0.2"
"rimraf": "^6.0.1",
"rollup": "^4.19.0"
}
}
14 changes: 7 additions & 7 deletions examples/rspack/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<title>Example</title>
</head>
<body>
test
</body>
<head>
<title>Example</title>
</head>
<body>
test
</body>
</html>
8 changes: 4 additions & 4 deletions examples/rspack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"@anolilab/unplugin-favicons": "workspace:*"
},
"devDependencies": {
"@rspack/cli": "^0.3.6",
"@rspack/plugin-html": "^0.3.6",
"html-webpack-plugin": "^5.5.3",
"rimraf": "^5.0.5"
"@rspack/cli": "^0.7.5",
"@rspack/plugin-html": "^0.5.8",
"html-webpack-plugin": "^5.6.0",
"rimraf": "^6.0.1"
}
}
18 changes: 9 additions & 9 deletions examples/svelte/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
<head>
<meta charset="UTF-8" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading

0 comments on commit b384e71

Please sign in to comment.