@simpleapps-com/augur-config 2.4.0 → 2026.11.2
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/EXPORTS.md +43 -44
- package/README.md +45 -29
- package/dist/augur-doctor.d.ts +13 -0
- package/dist/augur-doctor.d.ts.map +1 -0
- package/dist/augur-doctor.js +777 -0
- package/dist/augur-doctor.js.map +1 -0
- package/dist/chunk-3L322IID.js +287 -0
- package/dist/chunk-3L322IID.js.map +1 -0
- package/dist/chunk-RY3GDLDS.js +26 -0
- package/dist/chunk-RY3GDLDS.js.map +1 -0
- package/dist/doctor/checks.d.ts +36 -0
- package/dist/doctor/checks.d.ts.map +1 -0
- package/dist/doctor/cli.d.ts +11 -0
- package/dist/doctor/cli.d.ts.map +1 -0
- package/dist/doctor/node-reader.d.ts +7 -0
- package/dist/doctor/node-reader.d.ts.map +1 -0
- package/dist/doctor/report.d.ts +5 -0
- package/dist/doctor/report.d.ts.map +1 -0
- package/dist/doctor/rules.d.ts +297 -0
- package/dist/doctor/rules.d.ts.map +1 -0
- package/dist/eslint-next.d.ts +9 -0
- package/dist/eslint-next.d.ts.map +1 -0
- package/dist/eslint-next.js +35 -0
- package/dist/eslint-next.js.map +1 -0
- package/dist/eslint-shared.d.ts +36 -0
- package/dist/eslint-shared.d.ts.map +1 -0
- package/dist/eslint.d.ts +6 -0
- package/dist/eslint.d.ts.map +1 -0
- package/dist/eslint.js +30 -0
- package/dist/eslint.js.map +1 -0
- package/dist/lighthouse.d.ts +62 -0
- package/dist/lighthouse.d.ts.map +1 -0
- package/dist/lighthouse.js +68 -0
- package/dist/lighthouse.js.map +1 -0
- package/dist/prettier-next.d.ts +5 -0
- package/dist/prettier-next.d.ts.map +1 -0
- package/{src → dist}/prettier-next.js +9 -7
- package/dist/prettier-next.js.map +1 -0
- package/dist/prettier.d.ts +5 -0
- package/dist/prettier.d.ts.map +1 -0
- package/dist/prettier.js +17 -0
- package/dist/prettier.js.map +1 -0
- package/llms.txt +40 -20
- package/package.json +50 -12
- package/bin/augur-doctor.mjs +0 -1038
- package/src/eslint-next.js +0 -40
- package/src/eslint.js +0 -35
- package/src/lighthouse.js +0 -108
- package/src/prettier.js +0 -12
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PresetConfig } from "./eslint-shared";
|
|
2
|
+
/**
|
|
3
|
+
* The ESLint preset for Next.js sites: the base rules plus Next's recommended and Core Web Vitals.
|
|
4
|
+
*
|
|
5
|
+
* Also warns on deprecated APIs (no-deprecated).
|
|
6
|
+
*/
|
|
7
|
+
declare const config: PresetConfig[];
|
|
8
|
+
export default config;
|
|
9
|
+
//# sourceMappingURL=eslint-next.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-next.d.ts","sourceRoot":"","sources":["../src/eslint-next.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE3F;;;;GAIG;AACH,QAAA,MAAM,MAAM,EAAE,YAAY,EAmBzB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ignored,
|
|
3
|
+
languageOptions,
|
|
4
|
+
sharedRules
|
|
5
|
+
} from "./chunk-RY3GDLDS.js";
|
|
6
|
+
|
|
7
|
+
// src/eslint-next.ts
|
|
8
|
+
import nextPlugin from "@next/eslint-plugin-next";
|
|
9
|
+
import tseslint from "@typescript-eslint/eslint-plugin";
|
|
10
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
11
|
+
var config = [
|
|
12
|
+
{
|
|
13
|
+
files: ["**/*.{ts,tsx,js,jsx}"],
|
|
14
|
+
languageOptions,
|
|
15
|
+
plugins: {
|
|
16
|
+
"@typescript-eslint": tseslint,
|
|
17
|
+
"react-hooks": reactHooks,
|
|
18
|
+
"@next/next": nextPlugin
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
...tseslint.configs["recommended"]?.rules,
|
|
22
|
+
...reactHooks.configs.recommended.rules,
|
|
23
|
+
...nextPlugin.configs.recommended.rules,
|
|
24
|
+
...nextPlugin.configs["core-web-vitals"].rules,
|
|
25
|
+
...sharedRules,
|
|
26
|
+
"@typescript-eslint/no-deprecated": "warn"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
ignored
|
|
30
|
+
];
|
|
31
|
+
var eslint_next_default = config;
|
|
32
|
+
export {
|
|
33
|
+
eslint_next_default as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=eslint-next.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint-next.ts"],"sourcesContent":["import nextPlugin from \"@next/eslint-plugin-next\";\nimport tseslint from \"@typescript-eslint/eslint-plugin\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\nimport { ignored, languageOptions, sharedRules, type PresetConfig } from \"./eslint-shared\";\n\n/**\n * The ESLint preset for Next.js sites: the base rules plus Next's recommended and Core Web Vitals.\n *\n * Also warns on deprecated APIs (no-deprecated).\n */\nconst config: PresetConfig[] = [\n {\n files: [\"**/*.{ts,tsx,js,jsx}\"],\n languageOptions,\n plugins: {\n \"@typescript-eslint\": tseslint,\n \"react-hooks\": reactHooks,\n \"@next/next\": nextPlugin,\n },\n rules: {\n ...tseslint.configs[\"recommended\"]?.rules,\n ...reactHooks.configs.recommended.rules,\n ...nextPlugin.configs.recommended.rules,\n ...nextPlugin.configs[\"core-web-vitals\"].rules,\n ...sharedRules,\n \"@typescript-eslint/no-deprecated\": \"warn\",\n },\n },\n ignored,\n];\n\nexport default config;\n"],"mappings":";;;;;;;AAAA,OAAO,gBAAgB;AACvB,OAAO,cAAc;AACrB,OAAO,gBAAgB;AAQvB,IAAM,SAAyB;AAAA,EAC7B;AAAA,IACE,OAAO,CAAC,sBAAsB;AAAA,IAC9B;AAAA,IACA,SAAS;AAAA,MACP,sBAAsB;AAAA,MACtB,eAAe;AAAA,MACf,cAAc;AAAA,IAChB;AAAA,IACA,OAAO;AAAA,MACL,GAAG,SAAS,QAAQ,aAAa,GAAG;AAAA,MACpC,GAAG,WAAW,QAAQ,YAAY;AAAA,MAClC,GAAG,WAAW,QAAQ,YAAY;AAAA,MAClC,GAAG,WAAW,QAAQ,iBAAiB,EAAE;AAAA,MACzC,GAAG;AAAA,MACH,oCAAoC;AAAA,IACtC;AAAA,EACF;AAAA,EACA;AACF;AAEA,IAAO,sBAAQ;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import tsParser from "@typescript-eslint/parser";
|
|
2
|
+
/**
|
|
3
|
+
* A flat-config entry as these presets build it. Typed by its own shape, not ESLint's
|
|
4
|
+
* `Linter.Config`: the presets serve the consumer's ESLint (peer `^9`), and the plugins'
|
|
5
|
+
* declarations are written for that version, so the consumer's ESLint is what checks it.
|
|
6
|
+
*/
|
|
7
|
+
export interface PresetConfig {
|
|
8
|
+
files?: string[];
|
|
9
|
+
ignores?: string[];
|
|
10
|
+
languageOptions?: Record<string, unknown>;
|
|
11
|
+
plugins?: Record<string, unknown>;
|
|
12
|
+
rules?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/** The TypeScript parser with JSX, for both presets. */
|
|
15
|
+
export declare const languageOptions: {
|
|
16
|
+
parser: typeof tsParser;
|
|
17
|
+
parserOptions: {
|
|
18
|
+
ecmaFeatures: {
|
|
19
|
+
jsx: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/** The rules both presets set after the plugins' recommended ones. */
|
|
24
|
+
export declare const sharedRules: {
|
|
25
|
+
"@typescript-eslint/no-unused-vars": (string | {
|
|
26
|
+
argsIgnorePattern: string;
|
|
27
|
+
varsIgnorePattern: string;
|
|
28
|
+
})[];
|
|
29
|
+
"@typescript-eslint/no-explicit-any": string;
|
|
30
|
+
complexity: (string | number)[];
|
|
31
|
+
"max-depth": (string | number)[];
|
|
32
|
+
"max-nested-callbacks": (string | number)[];
|
|
33
|
+
};
|
|
34
|
+
/** The folders both presets leave alone. */
|
|
35
|
+
export declare const ignored: PresetConfig;
|
|
36
|
+
//# sourceMappingURL=eslint-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-shared.d.ts","sourceRoot":"","sources":["../src/eslint-shared.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AAEjD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,wDAAwD;AACxD,eAAO,MAAM,eAAe;;;;;;;CAK3B,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,WAAW;;;;;;;;;CASvB,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,OAAO,EAAE,YAA2E,CAAC"}
|
package/dist/eslint.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PresetConfig } from "./eslint-shared";
|
|
2
|
+
export type { PresetConfig } from "./eslint-shared";
|
|
3
|
+
/** The ESLint preset for Augur packages and React sites. */
|
|
4
|
+
declare const config: PresetConfig[];
|
|
5
|
+
export default config;
|
|
6
|
+
//# sourceMappingURL=eslint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE3F,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,4DAA4D;AAC5D,QAAA,MAAM,MAAM,EAAE,YAAY,EAezB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/eslint.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ignored,
|
|
3
|
+
languageOptions,
|
|
4
|
+
sharedRules
|
|
5
|
+
} from "./chunk-RY3GDLDS.js";
|
|
6
|
+
|
|
7
|
+
// src/eslint.ts
|
|
8
|
+
import tseslint from "@typescript-eslint/eslint-plugin";
|
|
9
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
10
|
+
var config = [
|
|
11
|
+
{
|
|
12
|
+
files: ["**/*.{ts,tsx}"],
|
|
13
|
+
languageOptions,
|
|
14
|
+
plugins: {
|
|
15
|
+
"@typescript-eslint": tseslint,
|
|
16
|
+
"react-hooks": reactHooks
|
|
17
|
+
},
|
|
18
|
+
rules: {
|
|
19
|
+
...tseslint.configs["recommended"]?.rules,
|
|
20
|
+
...reactHooks.configs.recommended.rules,
|
|
21
|
+
...sharedRules
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
ignored
|
|
25
|
+
];
|
|
26
|
+
var eslint_default = config;
|
|
27
|
+
export {
|
|
28
|
+
eslint_default as default
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=eslint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/eslint.ts"],"sourcesContent":["import tseslint from \"@typescript-eslint/eslint-plugin\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\nimport { ignored, languageOptions, sharedRules, type PresetConfig } from \"./eslint-shared\";\n\nexport type { PresetConfig } from \"./eslint-shared\";\n\n/** The ESLint preset for Augur packages and React sites. */\nconst config: PresetConfig[] = [\n {\n files: [\"**/*.{ts,tsx}\"],\n languageOptions,\n plugins: {\n \"@typescript-eslint\": tseslint,\n \"react-hooks\": reactHooks,\n },\n rules: {\n ...tseslint.configs[\"recommended\"]?.rules,\n ...reactHooks.configs.recommended.rules,\n ...sharedRules,\n },\n },\n ignored,\n];\n\nexport default config;\n"],"mappings":";;;;;;;AAAA,OAAO,cAAc;AACrB,OAAO,gBAAgB;AAMvB,IAAM,SAAyB;AAAA,EAC7B;AAAA,IACE,OAAO,CAAC,eAAe;AAAA,IACvB;AAAA,IACA,SAAS;AAAA,MACP,sBAAsB;AAAA,MACtB,eAAe;AAAA,IACjB;AAAA,IACA,OAAO;AAAA,MACL,GAAG,SAAS,QAAQ,aAAa,GAAG;AAAA,MACpC,GAAG,WAAW,QAAQ,YAAY;AAAA,MAClC,GAAG;AAAA,IACL;AAAA,EACF;AAAA,EACA;AACF;AAEA,IAAO,iBAAQ;","names":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lighthouse CI preset for Augur e-commerce sites.
|
|
3
|
+
*
|
|
4
|
+
* Provides battle-tested Core Web Vitals thresholds tuned for e-commerce.
|
|
5
|
+
* Sites extend this preset and provide their own URLs and server config.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```js
|
|
9
|
+
* // lighthouserc.js
|
|
10
|
+
* import { lighthousePreset } from "@simpleapps-com/augur-config/lighthouse";
|
|
11
|
+
*
|
|
12
|
+
* export default lighthousePreset({
|
|
13
|
+
* urls: ["/", "/products", "/items/WAFL112", "/cart"],
|
|
14
|
+
* startServerCommand: "npm run start",
|
|
15
|
+
* // override any threshold
|
|
16
|
+
* assertions: {
|
|
17
|
+
* "largest-contentful-paint": ["error", { maxNumericValue: 3000 }],
|
|
18
|
+
* },
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
/** A Lighthouse CI assertion: a level, optionally with its options. */
|
|
23
|
+
type Assertion = string | [string, Record<string, unknown>];
|
|
24
|
+
/** Default assertion thresholds for Augur e-commerce sites. */
|
|
25
|
+
declare const defaultAssertions: Record<string, Assertion>;
|
|
26
|
+
export interface LighthousePresetOptions {
|
|
27
|
+
/** Pages to audit (paths appended to baseUrl). */
|
|
28
|
+
urls?: string[];
|
|
29
|
+
/** Base URL for the dev server. Default: "http://localhost:3000". */
|
|
30
|
+
baseUrl?: string;
|
|
31
|
+
/** Command to start the dev server. */
|
|
32
|
+
startServerCommand?: string;
|
|
33
|
+
/** Pattern indicating the server is ready. Default: "ready on". */
|
|
34
|
+
startServerReadyPattern?: string;
|
|
35
|
+
/** Number of Lighthouse runs per URL. Default: 3. */
|
|
36
|
+
numberOfRuns?: number;
|
|
37
|
+
/** Lighthouse settings preset. Default: "desktop". */
|
|
38
|
+
preset?: "desktop" | "perf";
|
|
39
|
+
/** Override or extend default assertion thresholds. */
|
|
40
|
+
assertions?: Record<string, Assertion>;
|
|
41
|
+
/** Override any collect options. */
|
|
42
|
+
collect?: Record<string, unknown>;
|
|
43
|
+
/** Override upload config (default: temporary-public-storage). */
|
|
44
|
+
upload?: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
/** Creates a Lighthouse CI config with Augur e-commerce defaults. */
|
|
47
|
+
export declare function lighthousePreset(options?: LighthousePresetOptions): {
|
|
48
|
+
ci: {
|
|
49
|
+
collect: Record<string, unknown>;
|
|
50
|
+
assert: {
|
|
51
|
+
preset: string;
|
|
52
|
+
assertions: {
|
|
53
|
+
[x: string]: Assertion;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
upload: {
|
|
57
|
+
target: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export { defaultAssertions };
|
|
62
|
+
//# sourceMappingURL=lighthouse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lighthouse.d.ts","sourceRoot":"","sources":["../src/lighthouse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,uEAAuE;AACvE,KAAK,SAAS,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE5D,+DAA+D;AAC/D,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAuBhD,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mEAAmE;IACnE,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC5B,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACvC,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAyBD,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B;;;;;;;;;;;;;EAYrE;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveUrl
|
|
3
|
+
} from "./chunk-3L322IID.js";
|
|
4
|
+
|
|
5
|
+
// src/lighthouse.ts
|
|
6
|
+
var defaultAssertions = {
|
|
7
|
+
// Performance — Core Web Vitals
|
|
8
|
+
"first-contentful-paint": ["warn", { maxNumericValue: 2e3 }],
|
|
9
|
+
"largest-contentful-paint": ["warn", { maxNumericValue: 2500 }],
|
|
10
|
+
"cumulative-layout-shift": ["warn", { maxNumericValue: 0.1 }],
|
|
11
|
+
"total-blocking-time": ["warn", { maxNumericValue: 300 }],
|
|
12
|
+
"speed-index": ["warn", { maxNumericValue: 3e3 }],
|
|
13
|
+
// Accessibility
|
|
14
|
+
"color-contrast": "warn",
|
|
15
|
+
"heading-order": "warn",
|
|
16
|
+
"link-name": "warn",
|
|
17
|
+
"button-name": "warn",
|
|
18
|
+
// Best Practices
|
|
19
|
+
"errors-in-console": "warn",
|
|
20
|
+
deprecations: "warn",
|
|
21
|
+
// SEO
|
|
22
|
+
"document-title": "error",
|
|
23
|
+
"meta-description": "error",
|
|
24
|
+
"http-status-code": "error",
|
|
25
|
+
// PWA — off for e-commerce sites
|
|
26
|
+
"installable-manifest": "off",
|
|
27
|
+
"service-worker": "off",
|
|
28
|
+
"maskable-icon": "off"
|
|
29
|
+
};
|
|
30
|
+
function collectConfigOf({
|
|
31
|
+
urls,
|
|
32
|
+
baseUrl = "http://localhost:3000",
|
|
33
|
+
startServerCommand,
|
|
34
|
+
startServerReadyPattern = "ready on",
|
|
35
|
+
numberOfRuns = 3,
|
|
36
|
+
preset = "desktop",
|
|
37
|
+
collect = {}
|
|
38
|
+
}) {
|
|
39
|
+
const collectConfig = {
|
|
40
|
+
url: (urls || ["/"]).map((u) => resolveUrl(u, baseUrl)),
|
|
41
|
+
numberOfRuns,
|
|
42
|
+
settings: { preset },
|
|
43
|
+
...collect
|
|
44
|
+
};
|
|
45
|
+
if (startServerCommand) {
|
|
46
|
+
collectConfig["startServerCommand"] = startServerCommand;
|
|
47
|
+
collectConfig["startServerReadyPattern"] = startServerReadyPattern;
|
|
48
|
+
}
|
|
49
|
+
return collectConfig;
|
|
50
|
+
}
|
|
51
|
+
function lighthousePreset(options = {}) {
|
|
52
|
+
const { assertions = {}, upload = {} } = options;
|
|
53
|
+
return {
|
|
54
|
+
ci: {
|
|
55
|
+
collect: collectConfigOf(options),
|
|
56
|
+
assert: {
|
|
57
|
+
preset: "lighthouse:recommended",
|
|
58
|
+
assertions: { ...defaultAssertions, ...assertions }
|
|
59
|
+
},
|
|
60
|
+
upload: { target: "temporary-public-storage", ...upload }
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
defaultAssertions,
|
|
66
|
+
lighthousePreset
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=lighthouse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lighthouse.ts"],"sourcesContent":["/**\n * Lighthouse CI preset for Augur e-commerce sites.\n *\n * Provides battle-tested Core Web Vitals thresholds tuned for e-commerce.\n * Sites extend this preset and provide their own URLs and server config.\n *\n * @example\n * ```js\n * // lighthouserc.js\n * import { lighthousePreset } from \"@simpleapps-com/augur-config/lighthouse\";\n *\n * export default lighthousePreset({\n * urls: [\"/\", \"/products\", \"/items/WAFL112\", \"/cart\"],\n * startServerCommand: \"npm run start\",\n * // override any threshold\n * assertions: {\n * \"largest-contentful-paint\": [\"error\", { maxNumericValue: 3000 }],\n * },\n * });\n * ```\n */\n\nimport { resolveUrl } from \"./doctor/rules\";\n\n/** A Lighthouse CI assertion: a level, optionally with its options. */\ntype Assertion = string | [string, Record<string, unknown>];\n\n/** Default assertion thresholds for Augur e-commerce sites. */\nconst defaultAssertions: Record<string, Assertion> = {\n // Performance — Core Web Vitals\n \"first-contentful-paint\": [\"warn\", { maxNumericValue: 2000 }],\n \"largest-contentful-paint\": [\"warn\", { maxNumericValue: 2500 }],\n \"cumulative-layout-shift\": [\"warn\", { maxNumericValue: 0.1 }],\n \"total-blocking-time\": [\"warn\", { maxNumericValue: 300 }],\n \"speed-index\": [\"warn\", { maxNumericValue: 3000 }],\n // Accessibility\n \"color-contrast\": \"warn\",\n \"heading-order\": \"warn\",\n \"link-name\": \"warn\",\n \"button-name\": \"warn\",\n // Best Practices\n \"errors-in-console\": \"warn\",\n deprecations: \"warn\",\n // SEO\n \"document-title\": \"error\",\n \"meta-description\": \"error\",\n \"http-status-code\": \"error\",\n // PWA — off for e-commerce sites\n \"installable-manifest\": \"off\",\n \"service-worker\": \"off\",\n \"maskable-icon\": \"off\",\n};\n\nexport interface LighthousePresetOptions {\n /** Pages to audit (paths appended to baseUrl). */\n urls?: string[];\n /** Base URL for the dev server. Default: \"http://localhost:3000\". */\n baseUrl?: string;\n /** Command to start the dev server. */\n startServerCommand?: string;\n /** Pattern indicating the server is ready. Default: \"ready on\". */\n startServerReadyPattern?: string;\n /** Number of Lighthouse runs per URL. Default: 3. */\n numberOfRuns?: number;\n /** Lighthouse settings preset. Default: \"desktop\". */\n preset?: \"desktop\" | \"perf\";\n /** Override or extend default assertion thresholds. */\n assertions?: Record<string, Assertion>;\n /** Override any collect options. */\n collect?: Record<string, unknown>;\n /** Override upload config (default: temporary-public-storage). */\n upload?: Record<string, unknown>;\n}\n\n/** The collect section: the URLs, runs and preset, the caller's collect options, the server. */\nfunction collectConfigOf({\n urls,\n baseUrl = \"http://localhost:3000\",\n startServerCommand,\n startServerReadyPattern = \"ready on\",\n numberOfRuns = 3,\n preset = \"desktop\",\n collect = {},\n}: LighthousePresetOptions): Record<string, unknown> {\n const collectConfig: Record<string, unknown> = {\n url: (urls || [\"/\"]).map((u) => resolveUrl(u, baseUrl)),\n numberOfRuns,\n settings: { preset },\n ...collect,\n };\n if (startServerCommand) {\n collectConfig[\"startServerCommand\"] = startServerCommand;\n collectConfig[\"startServerReadyPattern\"] = startServerReadyPattern;\n }\n return collectConfig;\n}\n\n/** Creates a Lighthouse CI config with Augur e-commerce defaults. */\nexport function lighthousePreset(options: LighthousePresetOptions = {}) {\n const { assertions = {}, upload = {} } = options;\n return {\n ci: {\n collect: collectConfigOf(options),\n assert: {\n preset: \"lighthouse:recommended\",\n assertions: { ...defaultAssertions, ...assertions },\n },\n upload: { target: \"temporary-public-storage\", ...upload },\n },\n };\n}\n\nexport { defaultAssertions };\n"],"mappings":";;;;;AA4BA,IAAM,oBAA+C;AAAA;AAAA,EAEnD,0BAA0B,CAAC,QAAQ,EAAE,iBAAiB,IAAK,CAAC;AAAA,EAC5D,4BAA4B,CAAC,QAAQ,EAAE,iBAAiB,KAAK,CAAC;AAAA,EAC9D,2BAA2B,CAAC,QAAQ,EAAE,iBAAiB,IAAI,CAAC;AAAA,EAC5D,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,IAAI,CAAC;AAAA,EACxD,eAAe,CAAC,QAAQ,EAAE,iBAAiB,IAAK,CAAC;AAAA;AAAA,EAEjD,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,eAAe;AAAA;AAAA,EAEf,qBAAqB;AAAA,EACrB,cAAc;AAAA;AAAA,EAEd,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA;AAAA,EAEpB,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,iBAAiB;AACnB;AAwBA,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,0BAA0B;AAAA,EAC1B,eAAe;AAAA,EACf,SAAS;AAAA,EACT,UAAU,CAAC;AACb,GAAqD;AACnD,QAAM,gBAAyC;AAAA,IAC7C,MAAM,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAAA,IACtD;AAAA,IACA,UAAU,EAAE,OAAO;AAAA,IACnB,GAAG;AAAA,EACL;AACA,MAAI,oBAAoB;AACtB,kBAAc,oBAAoB,IAAI;AACtC,kBAAc,yBAAyB,IAAI;AAAA,EAC7C;AACA,SAAO;AACT;AAGO,SAAS,iBAAiB,UAAmC,CAAC,GAAG;AACtE,QAAM,EAAE,aAAa,CAAC,GAAG,SAAS,CAAC,EAAE,IAAI;AACzC,SAAO;AAAA,IACL,IAAI;AAAA,MACF,SAAS,gBAAgB,OAAO;AAAA,MAChC,QAAQ;AAAA,QACN,QAAQ;AAAA,QACR,YAAY,EAAE,GAAG,mBAAmB,GAAG,WAAW;AAAA,MACpD;AAAA,MACA,QAAQ,EAAE,QAAQ,4BAA4B,GAAG,OAAO;AAAA,IAC1D;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier-next.d.ts","sourceRoot":"","sources":["../src/prettier-next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,4FAA4F;AAC5F,QAAA,MAAM,MAAM,EAAE,MAoBb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// src/prettier-next.ts
|
|
2
|
+
var config = {
|
|
3
3
|
semi: true,
|
|
4
4
|
trailingComma: "all",
|
|
5
5
|
singleQuote: false,
|
|
@@ -14,12 +14,14 @@ export default {
|
|
|
14
14
|
"^@/components/(.*)$",
|
|
15
15
|
"^@/hooks/(.*)$",
|
|
16
16
|
"^@/lib/(.*)$",
|
|
17
|
-
"^[./]"
|
|
17
|
+
"^[./]"
|
|
18
18
|
],
|
|
19
19
|
importOrderSeparation: true,
|
|
20
20
|
importOrderSortSpecifiers: true,
|
|
21
|
-
plugins: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
plugins: ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"]
|
|
22
|
+
};
|
|
23
|
+
var prettier_next_default = config;
|
|
24
|
+
export {
|
|
25
|
+
prettier_next_default as default
|
|
25
26
|
};
|
|
27
|
+
//# sourceMappingURL=prettier-next.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/prettier-next.ts"],"sourcesContent":["import type { Config } from \"prettier\";\n\n/** The Prettier preset for Next.js sites: the base options plus sorted, grouped imports. */\nconst config: Config = {\n semi: true,\n trailingComma: \"all\",\n singleQuote: false,\n printWidth: 100,\n tabWidth: 2,\n useTabs: false,\n bracketSpacing: true,\n arrowParens: \"always\",\n importOrder: [\n \"^react$\",\n \"<THIRD_PARTY_MODULES>\",\n \"^@/components/(.*)$\",\n \"^@/hooks/(.*)$\",\n \"^@/lib/(.*)$\",\n \"^[./]\",\n ],\n importOrderSeparation: true,\n importOrderSortSpecifiers: true,\n plugins: [\"@trivago/prettier-plugin-sort-imports\", \"prettier-plugin-tailwindcss\"],\n};\n\nexport default config;\n"],"mappings":";AAGA,IAAM,SAAiB;AAAA,EACrB,MAAM;AAAA,EACN,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,aAAa;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,uBAAuB;AAAA,EACvB,2BAA2B;AAAA,EAC3B,SAAS,CAAC,yCAAyC,6BAA6B;AAClF;AAEA,IAAO,wBAAQ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,4EAA4E;AAC5E,QAAA,MAAM,MAAM,EAAE,MAUb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/prettier.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/prettier.ts
|
|
2
|
+
var config = {
|
|
3
|
+
semi: true,
|
|
4
|
+
trailingComma: "all",
|
|
5
|
+
singleQuote: false,
|
|
6
|
+
printWidth: 100,
|
|
7
|
+
tabWidth: 2,
|
|
8
|
+
useTabs: false,
|
|
9
|
+
bracketSpacing: true,
|
|
10
|
+
arrowParens: "always",
|
|
11
|
+
plugins: ["prettier-plugin-tailwindcss"]
|
|
12
|
+
};
|
|
13
|
+
var prettier_default = config;
|
|
14
|
+
export {
|
|
15
|
+
prettier_default as default
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=prettier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/prettier.ts"],"sourcesContent":["import type { Config } from \"prettier\";\n\n/** The Prettier preset for Augur packages (with Tailwind class sorting). */\nconst config: Config = {\n semi: true,\n trailingComma: \"all\",\n singleQuote: false,\n printWidth: 100,\n tabWidth: 2,\n useTabs: false,\n bracketSpacing: true,\n arrowParens: \"always\",\n plugins: [\"prettier-plugin-tailwindcss\"],\n};\n\nexport default config;\n"],"mappings":";AAGA,IAAM,SAAiB;AAAA,EACrB,MAAM;AAAA,EACN,eAAe;AAAA,EACf,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,SAAS,CAAC,6BAA6B;AACzC;AAEA,IAAO,mBAAQ;","names":[]}
|
package/llms.txt
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
# Augur Platform Packages
|
|
2
2
|
|
|
3
3
|
This package is part of the @simpleapps-com/augur-* platform.
|
|
4
|
-
|
|
5
|
-
The
|
|
6
|
-
Pure transform utilities bridge user-facing types to SDK params without breaking proxy type safety.
|
|
4
|
+
Each package releases on its own CalVer version; nothing requires them to share one.
|
|
5
|
+
The docs are at https://augur.build/docs/packages (the API reference lists every export).
|
|
7
6
|
|
|
8
7
|
## Sibling packages
|
|
9
8
|
|
|
10
|
-
- @simpleapps-com/augur-config (this package) - Shared tooling configuration presets for Augur ecommerce sites
|
|
11
9
|
- @simpleapps-com/augur-core - Universal foundation for Augur packages — proxy infrastructure, cache keys, method classification, shared types
|
|
10
|
+
- @simpleapps-com/augur-utils - Shared types, cache configuration, and utility functions for Augur ecommerce sites
|
|
12
11
|
- @simpleapps-com/augur-hooks - Cross-platform React Query hooks and Zustand stores for Augur ecommerce sites
|
|
13
|
-
- @simpleapps-com/augur-mobile - React Native/Expo adapters for Augur ecommerce apps (offline sync, biometrics, push)
|
|
14
12
|
- @simpleapps-com/augur-server - Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)
|
|
15
|
-
- @simpleapps-com/augur-tailwind - Shared Tailwind CSS v4 theme with HSL variables for Augur ecommerce sites
|
|
16
|
-
- @simpleapps-com/augur-utils - Shared types, cache configuration, and utility functions for Augur ecommerce sites
|
|
17
13
|
- @simpleapps-com/augur-web - Shared React UI components for Augur ecommerce sites (Radix + Tailwind)
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
- @simpleapps-com/augur-mobile - React Native/Expo adapters for Augur ecommerce apps (offline sync, biometrics, push)
|
|
15
|
+
- @simpleapps-com/augur-tailwind - Shared Tailwind CSS v4 theme with HSL variables for Augur ecommerce sites
|
|
16
|
+
- @simpleapps-com/augur-config (this package) - Shared tooling configuration presets for Augur ecommerce sites
|
|
20
17
|
|
|
21
18
|
---
|
|
22
19
|
|
|
@@ -24,14 +21,37 @@ Each package ships its own llms.txt with exports and usage patterns.
|
|
|
24
21
|
|
|
25
22
|
> Shared tooling configuration presets for Augur ecommerce sites
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
## @simpleapps-com/augur-config/eslint
|
|
25
|
+
|
|
26
|
+
- const: default - The ESLint preset for Augur packages and React sites.
|
|
27
|
+
- type: PresetConfig
|
|
28
|
+
|
|
29
|
+
## @simpleapps-com/augur-config/eslint/next
|
|
30
|
+
|
|
31
|
+
- const: default - The ESLint preset for Next.js sites: the base rules plus Next's recommended and Core Web Vitals.
|
|
32
|
+
|
|
33
|
+
## @simpleapps-com/augur-config/prettier
|
|
34
|
+
|
|
35
|
+
- const: default - The Prettier preset for Augur packages (with Tailwind class sorting).
|
|
36
|
+
|
|
37
|
+
## @simpleapps-com/augur-config/prettier/next
|
|
38
|
+
|
|
39
|
+
- const: default - The Prettier preset for Next.js sites: the base options plus sorted, grouped imports.
|
|
40
|
+
|
|
41
|
+
## @simpleapps-com/augur-config/tsconfig/base
|
|
42
|
+
tsconfig preset: @simpleapps-com/augur-config/tsconfig/base
|
|
43
|
+
|
|
44
|
+
## @simpleapps-com/augur-config/tsconfig/react
|
|
45
|
+
tsconfig preset: @simpleapps-com/augur-config/tsconfig/react
|
|
46
|
+
|
|
47
|
+
## @simpleapps-com/augur-config/tsconfig/react-native
|
|
48
|
+
tsconfig preset: @simpleapps-com/augur-config/tsconfig/react-native
|
|
49
|
+
|
|
50
|
+
## @simpleapps-com/augur-config/tsconfig/next
|
|
51
|
+
tsconfig preset: @simpleapps-com/augur-config/tsconfig/next
|
|
52
|
+
|
|
53
|
+
## @simpleapps-com/augur-config/lighthouse
|
|
54
|
+
|
|
55
|
+
- const: defaultAssertions - Default assertion thresholds for Augur e-commerce sites.
|
|
56
|
+
- function: lighthousePreset - Creates a Lighthouse CI config with Augur e-commerce defaults.
|
|
57
|
+
- type: LighthousePresetOptions
|
package/package.json
CHANGED
|
@@ -1,31 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simpleapps-com/augur-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2026.11.2",
|
|
4
4
|
"description": "Shared tooling configuration presets for Augur ecommerce sites",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/simpleapps-com/
|
|
8
|
+
"url": "https://github.com/simpleapps-com/atlas.git",
|
|
9
9
|
"directory": "packages/augur-config"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
12
|
"bin": {
|
|
13
|
-
"augur-doctor": "./
|
|
13
|
+
"augur-doctor": "./dist/augur-doctor.js"
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
|
-
"./eslint":
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
"./eslint": {
|
|
17
|
+
"types": "./dist/eslint.d.ts",
|
|
18
|
+
"import": "./dist/eslint.js"
|
|
19
|
+
},
|
|
20
|
+
"./eslint/next": {
|
|
21
|
+
"types": "./dist/eslint-next.d.ts",
|
|
22
|
+
"import": "./dist/eslint-next.js"
|
|
23
|
+
},
|
|
24
|
+
"./prettier": {
|
|
25
|
+
"types": "./dist/prettier.d.ts",
|
|
26
|
+
"import": "./dist/prettier.js"
|
|
27
|
+
},
|
|
28
|
+
"./prettier/next": {
|
|
29
|
+
"types": "./dist/prettier-next.d.ts",
|
|
30
|
+
"import": "./dist/prettier-next.js"
|
|
31
|
+
},
|
|
20
32
|
"./tsconfig/base": "./src/tsconfig/base.json",
|
|
21
33
|
"./tsconfig/react": "./src/tsconfig/react.json",
|
|
22
34
|
"./tsconfig/react-native": "./src/tsconfig/react-native.json",
|
|
23
35
|
"./tsconfig/next": "./src/tsconfig/next.json",
|
|
24
|
-
"./lighthouse":
|
|
36
|
+
"./lighthouse": {
|
|
37
|
+
"types": "./dist/lighthouse.d.ts",
|
|
38
|
+
"import": "./dist/lighthouse.js"
|
|
39
|
+
}
|
|
25
40
|
},
|
|
26
41
|
"files": [
|
|
27
|
-
"
|
|
28
|
-
"
|
|
42
|
+
"dist",
|
|
43
|
+
"src/tsconfig",
|
|
29
44
|
"EXPORTS.md",
|
|
30
45
|
"llms.txt"
|
|
31
46
|
],
|
|
@@ -34,7 +49,7 @@
|
|
|
34
49
|
"@trivago/prettier-plugin-sort-imports": "^6.0.0",
|
|
35
50
|
"@typescript-eslint/eslint-plugin": "^8.30.0",
|
|
36
51
|
"@typescript-eslint/parser": "^8.30.0",
|
|
37
|
-
"eslint-plugin-react-hooks": "^
|
|
52
|
+
"eslint-plugin-react-hooks": "^7.0.0",
|
|
38
53
|
"prettier-plugin-tailwindcss": "^0.6.0"
|
|
39
54
|
},
|
|
40
55
|
"peerDependencies": {
|
|
@@ -57,7 +72,30 @@
|
|
|
57
72
|
"optional": true
|
|
58
73
|
}
|
|
59
74
|
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@types/node": "^26.6.6",
|
|
77
|
+
"@vitest/coverage-v8": "~5.0.3",
|
|
78
|
+
"eslint": "^10.12.0",
|
|
79
|
+
"lemmascript": "0.6.5",
|
|
80
|
+
"prettier": "^3.0.0",
|
|
81
|
+
"tsup": "^9.0.0",
|
|
82
|
+
"typescript": "~6.0.3",
|
|
83
|
+
"vitest": "~5.0.3",
|
|
84
|
+
"@atlas/eslint-config": "0.0.0",
|
|
85
|
+
"@atlas/tsconfig": "0.0.0",
|
|
86
|
+
"@atlas/tsup-config": "0.0.0",
|
|
87
|
+
"@atlas/foundation": "0.0.0",
|
|
88
|
+
"@atlas/utils": "0.0.0",
|
|
89
|
+
"@atlas/vitest-config": "0.0.0"
|
|
90
|
+
},
|
|
91
|
+
"engines": {
|
|
92
|
+
"node": ">=22.0.0"
|
|
93
|
+
},
|
|
60
94
|
"scripts": {
|
|
61
|
-
"
|
|
95
|
+
"build": "tsup && tsc -p tsconfig.build.json",
|
|
96
|
+
"lint": "eslint .",
|
|
97
|
+
"proofs": "lsc gen-check --backend=dafny && node ../../models/lsc-check.mjs",
|
|
98
|
+
"test": "vitest run --coverage",
|
|
99
|
+
"typecheck": "tsc --noEmit"
|
|
62
100
|
}
|
|
63
101
|
}
|