@pezkuwi/dev-test 0.85.1 → 0.85.4

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.
Files changed (83) hide show
  1. package/.skip-deno +0 -0
  2. package/cjs/packageInfo.js +1 -1
  3. package/env/expect.d.ts +267 -264
  4. package/env/jest.d.ts +122 -118
  5. package/env/lifecycle.d.ts +11 -7
  6. package/env/suite.d.ts +10 -10
  7. package/globals.cjs +1 -1
  8. package/globals.d.ts +7 -9
  9. package/package.json +11 -11
  10. package/packageInfo.js +1 -1
  11. package/tsconfig.build.json +16 -0
  12. package/tsconfig.build.tsbuildinfo +1 -0
  13. package/tsconfig.spec.json +17 -0
  14. package/tsconfig.spec.tsbuildinfo +1 -0
  15. package/types.d.ts +12 -9
  16. package/cjs/detectOther.d.ts +0 -2
  17. package/cjs/detectOther.js +0 -3
  18. package/cjs/root.d.ts +0 -2
  19. package/cjs/root.js +0 -6
  20. package/cjs/rootJs/Clazz.d.ts +0 -18
  21. package/cjs/rootJs/Clazz.js +0 -36
  22. package/cjs/rootJs/Jsx.d.ts +0 -5
  23. package/cjs/rootJs/Jsx.js +0 -16
  24. package/cjs/rootJs/JsxChild.d.ts +0 -9
  25. package/cjs/rootJs/JsxChild.js +0 -9
  26. package/cjs/rootJs/augmented.d.ts +0 -8
  27. package/cjs/rootJs/augmented.js +0 -3
  28. package/cjs/rootJs/index.d.ts +0 -19
  29. package/cjs/rootJs/index.js +0 -51
  30. package/cjs/rootTests.d.ts +0 -2
  31. package/cjs/rootTests.js +0 -44
  32. package/cjs/sample.d.ts +0 -1
  33. package/cjs/sample.js +0 -4
  34. package/config/eslint.js +0 -160
  35. package/config/eslint.rules.js +0 -214
  36. package/config/prettier.cjs +0 -22
  37. package/config/rollup.js +0 -113
  38. package/config/tsconfig.json +0 -32
  39. package/config/typedoc.cjs +0 -18
  40. package/detectOther.d.ts +0 -2
  41. package/detectOther.js +0 -1
  42. package/root.d.ts +0 -2
  43. package/root.js +0 -2
  44. package/rootJs/Clazz.d.ts +0 -18
  45. package/rootJs/Clazz.js +0 -32
  46. package/rootJs/Jsx.d.ts +0 -5
  47. package/rootJs/Jsx.js +0 -13
  48. package/rootJs/JsxChild.d.ts +0 -9
  49. package/rootJs/JsxChild.js +0 -6
  50. package/rootJs/augmented.d.ts +0 -8
  51. package/rootJs/augmented.js +0 -2
  52. package/rootJs/dynamic.d.mts +0 -8
  53. package/rootJs/dynamic.mjs +0 -13
  54. package/rootJs/index.d.ts +0 -19
  55. package/rootJs/index.js +0 -39
  56. package/rootJs/testJson.json +0 -5
  57. package/rootStatic/zagros.svg +0 -1
  58. package/rootTests.d.ts +0 -2
  59. package/rootTests.js +0 -41
  60. package/scripts/pezkuwi-ci-ghact-build.mjs +0 -536
  61. package/scripts/pezkuwi-ci-ghact-docs.mjs +0 -14
  62. package/scripts/pezkuwi-ci-ghpages-force.mjs +0 -43
  63. package/scripts/pezkuwi-dev-build-docs.mjs +0 -19
  64. package/scripts/pezkuwi-dev-build-ts.mjs +0 -1518
  65. package/scripts/pezkuwi-dev-circular.mjs +0 -29
  66. package/scripts/pezkuwi-dev-clean-build.mjs +0 -61
  67. package/scripts/pezkuwi-dev-contrib.mjs +0 -74
  68. package/scripts/pezkuwi-dev-copy-dir.mjs +0 -44
  69. package/scripts/pezkuwi-dev-copy-to.mjs +0 -53
  70. package/scripts/pezkuwi-dev-deno-map.mjs +0 -35
  71. package/scripts/pezkuwi-dev-run-lint.mjs +0 -40
  72. package/scripts/pezkuwi-dev-run-node-ts.mjs +0 -9
  73. package/scripts/pezkuwi-dev-run-test.mjs +0 -163
  74. package/scripts/pezkuwi-dev-version.mjs +0 -143
  75. package/scripts/pezkuwi-dev-yarn-only.mjs +0 -11
  76. package/scripts/pezkuwi-exec-eslint.mjs +0 -7
  77. package/scripts/pezkuwi-exec-ghpages.mjs +0 -11
  78. package/scripts/pezkuwi-exec-ghrelease.mjs +0 -7
  79. package/scripts/pezkuwi-exec-node-test.mjs +0 -368
  80. package/scripts/pezkuwi-exec-rollup.mjs +0 -7
  81. package/scripts/pezkuwi-exec-tsc.mjs +0 -7
  82. package/scripts/pezkuwi-exec-webpack.mjs +0 -7
  83. package/scripts/util.mjs +0 -540
package/config/rollup.js DELETED
@@ -1,113 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/dev authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import pluginAlias from '@rollup/plugin-alias';
5
- import pluginCommonjs from '@rollup/plugin-commonjs';
6
- import pluginDynamicImportVars from '@rollup/plugin-dynamic-import-vars';
7
- import pluginInject from '@rollup/plugin-inject';
8
- import pluginJson from '@rollup/plugin-json';
9
- import { nodeResolve as pluginResolve } from '@rollup/plugin-node-resolve';
10
- import fs from 'node:fs';
11
- import path from 'node:path';
12
- import pluginCleanup from 'rollup-plugin-cleanup';
13
-
14
- /** @typedef {{ entries?: Record<string, string>; external: string[]; globals?: Record<string, string>; index?: string; inject?: Record<string, string>; pkg: string; }} BundleDef */
15
- /** @typedef {{ file: string; format: 'umd'; generatedCode: Record<string, unknown>; globals: Record<string, string>; inlineDynamicImports: true; intro: string; name: string; }} BundleOutput */
16
- /** @typedef {{ context: 'global'; external: string[]; input: string; output: BundleOutput; plugins: any[]; }} Bundle */
17
-
18
- /**
19
- * @param {string} pkg
20
- * @returns {string}
21
- */
22
- function sanitizePkg (pkg) {
23
- return pkg.replace('@pezkuwi/', '');
24
- }
25
-
26
- /**
27
- * @param {string} input
28
- * @returns {string}
29
- */
30
- function createName (input) {
31
- return `pezkuwi-${sanitizePkg(input)}`
32
- .toLowerCase()
33
- .replace(/[^a-zA-Z0-9]+(.)/g, (_, c) => c.toUpperCase());
34
- }
35
-
36
- /**
37
- * @param {string} pkg
38
- * @param {string} [index]
39
- * @returns {string}
40
- */
41
- export function createInput (pkg, index) {
42
- const partialPath = `packages/${sanitizePkg(pkg)}/build`;
43
-
44
- return `${partialPath}/${
45
- index ||
46
- fs.existsSync(path.join(process.cwd(), partialPath, 'bundle.js'))
47
- ? 'bundle.js'
48
- : (
49
- JSON.parse(fs.readFileSync(path.join(process.cwd(), partialPath, 'package.json'), 'utf8')).browser ||
50
- 'index.js'
51
- )
52
- }`;
53
- }
54
-
55
- /**
56
- *
57
- * @param {string} pkg
58
- * @param {string[]} external
59
- * @param {Record<string, string>} globals
60
- * @returns {BundleOutput}
61
- */
62
- export function createOutput (pkg, external, globals) {
63
- const name = sanitizePkg(pkg);
64
-
65
- return {
66
- file: `packages/${name}/build/bundle-pezkuwi-${name}.js`,
67
- format: 'umd',
68
- generatedCode: {
69
- constBindings: true
70
- },
71
- globals: external.reduce((all, p) => ({
72
- [p]: createName(p),
73
- ...all
74
- }), { ...globals }),
75
- // combine multi-chunk builds with dynamic imports
76
- inlineDynamicImports: true,
77
- // this is a mini x-global, determine where our context lies
78
- intro: 'const global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : window;',
79
- name: createName(pkg)
80
- };
81
- }
82
-
83
- /**
84
- *
85
- * @param {BundleDef} param0
86
- * @returns {Bundle}
87
- */
88
- export function createBundle ({ entries = {}, external, globals = {}, index, inject = {}, pkg }) {
89
- return {
90
- // specify this (we define global in the output intro as globalThis || self || window)
91
- context: 'global',
92
- external,
93
- input: createInput(pkg, index),
94
- output: createOutput(pkg, external, globals),
95
- // NOTE The expect-error directives are due to rollup plugins, see
96
- // - https://github.com/rollup/plugins/issues/1488
97
- // - https://github.com/rollup/plugins/issues/1329
98
- plugins: [
99
- // @ts-expect-error See the linked rollup issues above
100
- pluginAlias({ entries }),
101
- // @ts-expect-error See the linked rollup issues above
102
- pluginJson(),
103
- // @ts-expect-error See the linked rollup issues above
104
- pluginCommonjs(),
105
- // @ts-expect-error See the linked rollup issues above
106
- pluginDynamicImportVars(),
107
- // @ts-expect-error See the linked rollup issues above
108
- pluginInject(inject),
109
- pluginResolve({ browser: true }),
110
- pluginCleanup()
111
- ]
112
- };
113
- }
@@ -1,32 +0,0 @@
1
- {
2
- /**
3
- * There uses the strictest configs as the base
4
- * https://github.com/tsconfig/bases/blob/f674fa6cbca17062ff02511b02872f8729a597ec/bases/strictest.json
5
- */
6
- "extends": "@tsconfig/strictest/tsconfig.json",
7
- "compilerOptions": {
8
- /**
9
- * Aligns with packages/dev/scripts/pezkuwi-dev-build-ts & packages/dev-ts/src/loader
10
- * (target here is specifically tied to the minimum supported Node version)
11
- */
12
- "module": "nodenext",
13
- "moduleResolution": "nodenext",
14
- "target": "es2022",
15
-
16
- /**
17
- * Specific compilation configs for pezkuwi-js projects as it is used
18
- * (we only compile *.d.ts via the tsc command-line)
19
- */
20
- "declaration": true,
21
- "emitDeclarationOnly": true,
22
- "jsx": "preserve",
23
- "verbatimModuleSyntax": true,
24
-
25
- /**
26
- * These appear in strictest, however we don't (yet) use them. For the most part it means
27
- * that we actually do have a large number of these lurking (especially on index checks)
28
- */
29
- "exactOptionalPropertyTypes": false,
30
- "noUncheckedIndexedAccess": false,
31
- }
32
- }
@@ -1,18 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/dev authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- module.exports = {
5
- exclude: '**/*+(index|e2e|spec|types).ts',
6
- excludeExternals: true,
7
- excludeNotExported: true,
8
- excludePrivate: true,
9
- excludeProtected: true,
10
- hideGenerator: true,
11
- includeDeclarations: false,
12
- module: 'commonjs',
13
- moduleResolution: 'node',
14
- name: 'pezkuwi{.js}',
15
- out: 'docs',
16
- stripInternal: 'true',
17
- theme: 'markdown'
18
- };
package/detectOther.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: never[];
2
- export default _default;
package/detectOther.js DELETED
@@ -1 +0,0 @@
1
- export default [];
package/root.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './rootJs/index.js';
2
- export declare const TEST_PURE = "testRoot";
package/root.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './rootJs/index.js';
2
- export const TEST_PURE = /*#__PURE__*/ 'testRoot';
package/rootJs/Clazz.d.ts DELETED
@@ -1,18 +0,0 @@
1
- export declare class Clazz {
2
- #private;
3
- readonly and: number;
4
- static staticProperty: string;
5
- static staticFunction: () => string | null;
6
- /**
7
- * @param and the number we should and with
8
- */
9
- constructor(and: number);
10
- get something(): number;
11
- doAsync(): Promise<boolean>;
12
- /**
13
- * @description Sets something to something
14
- * @param something The addition
15
- */
16
- setSomething: (something?: number) => number;
17
- toString(): string;
18
- }
package/rootJs/Clazz.js DELETED
@@ -1,32 +0,0 @@
1
- export class Clazz {
2
- #something = 123_456_789;
3
- and;
4
- static staticProperty = 'foobar';
5
- static staticFunction = () => Clazz.staticProperty;
6
- /**
7
- * @param and the number we should and with
8
- */
9
- constructor(and) {
10
- this.and = and;
11
- this.#something = this.#something & and;
12
- }
13
- get something() {
14
- return this.#something;
15
- }
16
- async doAsync() {
17
- const res = await new Promise((resolve) => resolve(true));
18
- console.log(res);
19
- return res;
20
- }
21
- /**
22
- * @description Sets something to something
23
- * @param something The addition
24
- */
25
- setSomething = (something) => {
26
- this.#something = (something ?? 123_456) & this.and;
27
- return this.#something;
28
- };
29
- toString() {
30
- return `something=${this.#something}`;
31
- }
32
- }
package/rootJs/Jsx.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import type { Props } from './JsxChild.js';
2
- import React from 'react';
3
- declare function Hidden({ children, className }: Props): React.ReactElement<Props>;
4
- declare const _default: React.MemoExoticComponent<typeof Hidden>;
5
- export default _default;
package/rootJs/Jsx.js DELETED
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { useCallback, useState } from 'react';
3
- import { styled } from 'styled-components';
4
- import Child from './JsxChild.js';
5
- function Hidden({ children, className }) {
6
- const [isMessageVisible, setMessageVisibility] = useState(false);
7
- const onShow = useCallback((e) => setMessageVisibility(e.target.checked), []);
8
- return (_jsxs(StyledDiv, { className: className, children: [_jsx("label", { htmlFor: 'toggle', children: "Show Message" }), _jsx("input", { checked: isMessageVisible, id: 'toggle', onChange: onShow, type: 'checkbox' }), isMessageVisible && (_jsxs(_Fragment, { children: [children, _jsx(Child, { label: 'hello' })] }))] }));
9
- }
10
- const StyledDiv = styled.div `
11
- background: red;
12
- `;
13
- export default React.memo(Hidden);
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export interface Props {
3
- children?: React.ReactNode;
4
- className?: string;
5
- label?: string;
6
- }
7
- declare function Child({ children, className, label }: Props): React.ReactElement<Props>;
8
- declare const _default: React.MemoExoticComponent<typeof Child>;
9
- export default _default;
@@ -1,6 +0,0 @@
1
- import { jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- function Child({ children, className, label }) {
4
- return (_jsxs("div", { className: className, children: [label || '', children] }));
5
- }
6
- export default React.memo(Child);
@@ -1,8 +0,0 @@
1
- /** This tests augmentation outputs, e.g. as used in the pezkuwi-js/api */
2
- export interface Something {
3
- bar: string;
4
- foo: string;
5
- }
6
- declare module '@pezkuwi/dev/types' {
7
- const blah: string;
8
- }
@@ -1,2 +0,0 @@
1
- /* eslint-disable */
2
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * Returns the sum of 2 numbers
3
- *
4
- * @param {number} a
5
- * @param {number} b
6
- * @returns {number}
7
- */
8
- export function sum(a: number, b: number): number;
@@ -1,13 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/dev authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- /**
5
- * Returns the sum of 2 numbers
6
- *
7
- * @param {number} a
8
- * @param {number} b
9
- * @returns {number}
10
- */
11
- export function sum (a, b) {
12
- return a + b;
13
- }
package/rootJs/index.d.ts DELETED
@@ -1,19 +0,0 @@
1
- /** This should appear as-is in the output with: 1. extension added, 2. augmented.d.ts correct */
2
- import './augmented.js';
3
- /** Double double work, i.e. re-exports */
4
- export { Clazz } from './Clazz.js';
5
- /** Function to ensure that BigInt does not have the Babel Math.pow() transform */
6
- export declare function bigIntExp(): bigint;
7
- /** Function to ensure that dynamic imports work */
8
- export declare function dynamic(a: number, b: number): Promise<number>;
9
- /** Function to ensure we have json correctly imported */
10
- export declare function json(): string;
11
- /** Check support for the ?? operator */
12
- export declare function jsOpExp(a?: number): number;
13
- /** This is an actual check to ensure PURE is all-happy */
14
- export declare const pureOpExp: number;
15
- declare const fooA = 1;
16
- declare const fooB = 2;
17
- declare const fooC = 3;
18
- declare const fooD = 4;
19
- export { fooA, fooB, fooC, fooD };
package/rootJs/index.js DELETED
@@ -1,39 +0,0 @@
1
- /** This should appear as-is in the output with: 1. extension added, 2. augmented.d.ts correct */
2
- import './augmented.js';
3
- /** This import should appear as-in in the ouput (cjs without asserts) */
4
- import testJson from '@pezkuwi/dev/rootJs/testJson.json' assert { type: 'json' };
5
- /** Double double work, i.e. re-exports */
6
- export { Clazz } from './Clazz.js';
7
- /** Function to ensure that BigInt does not have the Babel Math.pow() transform */
8
- export function bigIntExp() {
9
- // 123_456n * 137_858_491_849n
10
- return 123456789n * (13n ** 10n);
11
- }
12
- /** Function to ensure that dynamic imports work */
13
- export async function dynamic(a, b) {
14
- // NOTE we go via this path so it points to the same location in both ESM
15
- // and CJS output (a './dynamic' import would be different otherwise)
16
- const { sum } = await import('@pezkuwi/dev/rootJs/dynamic.mjs');
17
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
18
- return sum(a, b);
19
- }
20
- /** Function to ensure we have json correctly imported */
21
- export function json() {
22
- return testJson.test.json;
23
- }
24
- /** Check support for the ?? operator */
25
- export function jsOpExp(a) {
26
- const defaults = {
27
- a: 42,
28
- b: 43,
29
- c: 44
30
- };
31
- return a ?? defaults.a;
32
- }
33
- /** This is an actual check to ensure PURE is all-happy */
34
- export const pureOpExp = /*#__PURE__*/ jsOpExp();
35
- const fooA = 1;
36
- const fooB = 2;
37
- const fooC = 3;
38
- const fooD = 4;
39
- export { fooA, fooB, fooC, fooD };
@@ -1,5 +0,0 @@
1
- {
2
- "test": {
3
- "json": "works"
4
- }
5
- }
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 441 441"><defs><style>.cls-1{stroke:#000;stroke-miterlimit:10;}.cls-2{fill:#fff;}</style></defs><title>kusama-ksm-logo</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><rect class="cls-1" x="0.5" y="0.5" width="440" height="440"/><path class="cls-2" d="M373.6,127.4c-5.2-4.1-11.4-9.7-22.7-11.1-10.6-1.4-21.4,5.7-28.7,10.4s-21.1,18.5-26.8,22.7-20.3,8.1-43.8,22.2-115.7,73.3-115.7,73.3l24,.3-107,55.1H63.6L48.2,312s13.6,3.6,25-3.6v3.3s127.4-50.2,152-37.2l-15,4.4c1.3,0,25.5,1.6,25.5,1.6a34.34,34.34,0,0,0,15.4,24.8c14.6,9.6,14.9,14.9,14.9,14.9s-7.6,3.1-7.6,7c0,0,11.2-3.4,21.6-3.1a82.64,82.64,0,0,1,19.5,3.1s-.8-4.2-10.9-7-20.1-13.8-25-19.8a28,28,0,0,1-4.1-27.4c3.5-9.1,15.7-14.1,40.9-27.1,29.7-15.4,36.5-26.8,40.7-35.7s10.4-26.6,13.9-34.9c4.4-10.7,9.8-16.4,14.3-19.8s24.5-10.9,24.5-10.9S378.5,131.3,373.6,127.4Z"/></g></g></svg>
package/rootTests.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import type * as testRoot from './root.js';
2
- export declare function runTests({ Clazz, TEST_PURE, bigIntExp, dynamic, jsOpExp, json }: typeof testRoot): void;
package/rootTests.js DELETED
@@ -1,41 +0,0 @@
1
- export function runTests({ Clazz, TEST_PURE, bigIntExp, dynamic, jsOpExp, json }) {
2
- describe('Clazz', () => {
3
- it('has staticProperty', () => {
4
- expect(Clazz.staticProperty).toBe('foobar');
5
- });
6
- it('creates an instance with get/set', () => {
7
- const c = new Clazz(456);
8
- expect(c.something).toBe(123_456_789 & 456);
9
- c.setSomething(123);
10
- expect(c.something).toBe(123 & 456);
11
- });
12
- });
13
- describe('TEST_PURE', () => {
14
- it('should have the correct value', () => {
15
- expect(TEST_PURE).toBe('testRoot');
16
- });
17
- });
18
- describe('dynamic()', () => {
19
- it('should allow dynamic import usage', async () => {
20
- expect(await dynamic(5, 37)).toBe(42);
21
- });
22
- });
23
- describe('bigIntExp()', () => {
24
- it('should return the correct value', () => {
25
- expect(bigIntExp()).toBe(123456789n * 137858491849n);
26
- });
27
- });
28
- describe('jsOpExp', () => {
29
- it('handles 0 ?? 42 correctly', () => {
30
- expect(jsOpExp(0)).toBe(0);
31
- });
32
- it('handles undefined ?? 42 correctly', () => {
33
- expect(jsOpExp()).toBe(42);
34
- });
35
- });
36
- describe('json()', () => {
37
- it('should return the correct value', () => {
38
- expect(json()).toBe('works');
39
- });
40
- });
41
- }