Skip to content

Commit

Permalink
chore: deps upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Sep 28, 2022
1 parent 758bf9a commit 3d75c4b
Show file tree
Hide file tree
Showing 8 changed files with 8,811 additions and 14,186 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Run tests
run: npm run ci:test
- name: Report code coverage
run: npm run ci:report
uses: codecov/codecov-action@v2
4 changes: 4 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/typescript"],
"plugins": ["@babel/transform-modules-commonjs"]
}
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const common = {
transform: {
"\\.ts$": "esbuild-jest",
"\\.[cm]?[jt]s$": "babel-jest",
"\\.css$": "jest-transform-css",
},
};
Expand Down
22,917 changes: 8,771 additions & 14,146 deletions package-lock.json

Large diffs are not rendered by default.

56 changes: 29 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,36 @@
"merge-source-map": "^1.1.0"
},
"devDependencies": {
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@jest/transform": "^27.0.2",
"@types/enhanced-resolve": "^3.0.6",
"@types/jest": "^26.0.23",
"@types/node": "^15.6.2",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"codecov": "^3.8.2",
"esbuild": "^0.12.5",
"esbuild-jest": "^0.5.0",
"esbuild-register": "^2.5.0",
"eslint": "^7.27.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-prettier": "^3.4.0",
"@babel/core": "^7.19.3",
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@jest/transform": "^29.1.0",
"@types/enhanced-resolve": "^3.0.7",
"@types/jest": "^29.0.3",
"@types/node": "^18.7.23",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"babel-jest": "^29.1.0",
"esbuild": "^0.15.9",
"esbuild-register": "^3.3.3",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^27.0.4",
"eslint-plugin-prettier": "^4.2.1",
"fixpack": "^4.0.0",
"husky": "^6.0.0",
"jest": "^26.6.3",
"jest-config": "^26.6.3",
"jest-transform-css": "^2.1.0",
"lint-staged": "^11.0.0",
"marko": "^5.10.4",
"prettier": "^2.3.0",
"standard-version": "^9.3.0",
"husky": "^8.0.1",
"jest": "^29.1.1",
"jest-config": "^29.1.1",
"jest-environment-jsdom": "^29.1.1",
"jest-transform-css": "^5.0.0",
"lint-staged": "^13.0.3",
"marko": "^5.21.9",
"prettier": "^2.7.1",
"standard-version": "^9.5.0",
"tiny-glob": "^0.2.9",
"typescript": "^4.3.2"
"typescript": "^4.8.4"
},
"files": [
"dist/preset",
Expand All @@ -53,15 +56,14 @@
"license": "MIT",
"main": "transform/node.js",
"peerDependencies": {
"jest-config": "23 - 28"
"jest-config": "23 - 29"
},
"repository": {
"type": "git",
"url": "https://github.com/marko-js/jest"
},
"scripts": {
"build": "tsc && node build.js",
"ci:report": "codecov",
"ci:test": "npm run jest -- --ci --coverage",
"format": "npm run lint:eslint -- --fix && npm run lint:prettier -- --write && (fixpack || true)",
"jest": "node -r esbuild-register $(which jest) --runInBand",
Expand Down
9 changes: 1 addition & 8 deletions src/transform/create-transform.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import fs from "fs";
import { Buffer } from "buffer";
import mergeMaps from "merge-source-map";
import ConcatMap from "concat-with-sourcemaps";
import type { Transformer } from "@jest/transform";
Expand Down Expand Up @@ -128,13 +127,7 @@ export default ({ browser }: { browser: boolean }) => {
map = concatMap.sourceMap;
}

if (map) {
code += `\n//# sourceMappingURL=data:application/json;base64,${Buffer.from(
typeof map === "string" ? map : JSON.stringify(map)
).toString("base64")}`;
}

return { code };
return { code, map: map && JSON.stringify(map) };
},
};

Expand Down
6 changes: 3 additions & 3 deletions test/browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ test("transforms templates in node_modules", async () => {
const result = await Project.render({});
result.appendTo(document.body).getComponent();
expect(document.body.innerHTML).toMatchInlineSnapshot(
`"<div class=\\"direct\\"><div class=\\"indirect\\">Hello World</div></div>"`
`"<div class="direct"><div class="indirect">Hello World</div></div>"`
);
});

test("includes inline styles in jsdom", async () => {
const result = await StyledInline.render({});
result.appendTo(document.body).getComponent();
expect(document.body.innerHTML).toMatchInlineSnapshot(
`"<div class=\\"inline\\">Hello world</div>"`
`"<div class="inline">Hello world</div>"`
);

expect(
Expand All @@ -49,7 +49,7 @@ test("includes external styles in jsdom", async () => {
const result = await StyledExternal.render({});
result.appendTo(document.body).getComponent();
expect(document.body.innerHTML).toMatchInlineSnapshot(
`"<div class=\\"external\\">Hello world</div>"`
`"<div class="external">Hello world</div>"`
);

expect(
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"sourceMap": false,
"incremental": true,
"declaration": true,
"skipLibCheck": true,
"stripInternal": true,
"resolveJsonModule": true,
"moduleResolution": "node",
Expand Down

0 comments on commit 3d75c4b

Please sign in to comment.