@autometa/jest-transformer 0.1.111 → 1.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -2
- package/dist/index.cjs +445 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +31 -14
- package/dist/index.js +429 -55
- package/dist/index.js.map +1 -1
- package/package.json +32 -25
- package/.eslintignore +0 -3
- package/.eslintrc.cjs +0 -4
- package/.turbo/turbo-lint$colon$fix.log +0 -4
- package/.turbo/turbo-prettify.log +0 -0
- package/.turbo/turbo-test.log +0 -13
- package/CHANGELOG.md +0 -730
- package/LICENSE +0 -21
- package/dist/esm/index.js +0 -26
- package/dist/esm/index.js.map +0 -1
- package/dist/index.d.mts +0 -16
- package/tsup.config.ts +0 -14
package/dist/esm/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// src/index.ts
|
|
2
|
-
import crypto from "crypto";
|
|
3
|
-
import { transform } from "@babel/core";
|
|
4
|
-
var canInstrument;
|
|
5
|
-
var getCacheKey = (fileData, filename, _configString, instrument) => crypto.createHash("md5").update("\0", "utf8").update(fileData).update("\0", "utf8").update(filename).update("\0", "utf8").update("\0", "utf8").update("\0", "utf8").update(instrument ? "instrument" : "").digest("hex");
|
|
6
|
-
var src_default = {
|
|
7
|
-
getCacheKey,
|
|
8
|
-
process: (_src, filePath, jestConfig) => {
|
|
9
|
-
const windowsFix = filePath.replace(/\\/g, "/");
|
|
10
|
-
const testFile = `
|
|
11
|
-
const { Feature } = require('@autometa/runner');
|
|
12
|
-
Feature('${windowsFix}')
|
|
13
|
-
`;
|
|
14
|
-
const featureFile = transform(testFile, {
|
|
15
|
-
filename: windowsFix,
|
|
16
|
-
root: jestConfig.cwd
|
|
17
|
-
});
|
|
18
|
-
return featureFile;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
canInstrument,
|
|
23
|
-
src_default as default,
|
|
24
|
-
getCacheKey
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import crypto from \"crypto\";\n\nimport { transform } from \"@babel/core\";\nimport type { Config } from \"@jest/types\";\n// import jestPreset from \"babel-preset-jest\";\n\nexport let canInstrument: false;\nexport const getCacheKey = (\n fileData: crypto.BinaryLike,\n filename: crypto.BinaryLike,\n _configString: crypto.BinaryLike,\n instrument: { instrument?: crypto.BinaryLike }\n) =>\n crypto\n .createHash(\"md5\")\n .update(\"\\0\", \"utf8\")\n .update(fileData)\n .update(\"\\0\", \"utf8\")\n .update(filename)\n .update(\"\\0\", \"utf8\")\n .update(\"\\0\", \"utf8\")\n .update(\"\\0\", \"utf8\")\n .update(instrument ? \"instrument\" : \"\")\n .digest(\"hex\");\n\nexport default {\n getCacheKey,\n process: (\n _src: string,\n filePath: string,\n jestConfig: Config.ProjectConfig\n ) => {\n const windowsFix = filePath.replace(/\\\\/g, \"/\");\n const testFile = `\nconst { Feature } = require('@autometa/runner'); \nFeature('${windowsFix}')\n`;\n\n const featureFile = transform(testFile, {\n filename: windowsFix,\n root: jestConfig.cwd,\n });\n\n return featureFile;\n },\n};\n"],"mappings":";AAAA,OAAO,YAAY;AAEnB,SAAS,iBAAiB;AAInB,IAAI;AACJ,IAAM,cAAc,CACzB,UACA,UACA,eACA,eAEA,OACG,WAAW,KAAK,EAChB,OAAO,MAAM,MAAM,EACnB,OAAO,QAAQ,EACf,OAAO,MAAM,MAAM,EACnB,OAAO,QAAQ,EACf,OAAO,MAAM,MAAM,EACnB,OAAO,MAAM,MAAM,EACnB,OAAO,MAAM,MAAM,EACnB,OAAO,aAAa,eAAe,EAAE,EACrC,OAAO,KAAK;AAEjB,IAAO,cAAQ;AAAA,EACb;AAAA,EACA,SAAS,CACP,MACA,UACA,eACG;AACH,UAAM,aAAa,SAAS,QAAQ,OAAO,GAAG;AAC9C,UAAM,WAAW;AAAA;AAAA,WAEV,UAAU;AAAA;AAGjB,UAAM,cAAc,UAAU,UAAU;AAAA,MACtC,UAAU;AAAA,MACV,MAAM,WAAW;AAAA,IACnB,CAAC;AAED,WAAO;AAAA,EACT;AACF;","names":[]}
|
package/dist/index.d.mts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as _babel_core from '@babel/core';
|
|
2
|
-
import crypto from 'crypto';
|
|
3
|
-
import { Config } from '@jest/types';
|
|
4
|
-
|
|
5
|
-
declare let canInstrument: false;
|
|
6
|
-
declare const getCacheKey: (fileData: crypto.BinaryLike, filename: crypto.BinaryLike, _configString: crypto.BinaryLike, instrument: {
|
|
7
|
-
instrument?: crypto.BinaryLike | undefined;
|
|
8
|
-
}) => string;
|
|
9
|
-
declare const _default: {
|
|
10
|
-
getCacheKey: (fileData: crypto.BinaryLike, filename: crypto.BinaryLike, _configString: crypto.BinaryLike, instrument: {
|
|
11
|
-
instrument?: crypto.BinaryLike | undefined;
|
|
12
|
-
}) => string;
|
|
13
|
-
process: (_src: string, filePath: string, jestConfig: Config.ProjectConfig) => _babel_core.BabelFileResult | null;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { canInstrument, _default as default, getCacheKey };
|
package/tsup.config.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
clean: true, // clean up the dist folder
|
|
5
|
-
format: ["cjs", "esm"], // generate cjs and esm files
|
|
6
|
-
dts: true,
|
|
7
|
-
sourcemap: true, // generate sourcemaps
|
|
8
|
-
skipNodeModulesBundle: true,
|
|
9
|
-
entryPoints: ["src/index.ts"],
|
|
10
|
-
target: "es2020",
|
|
11
|
-
outDir: "dist",
|
|
12
|
-
legacyOutput: true,
|
|
13
|
-
external: ["dist"],
|
|
14
|
-
});
|