@batijs/cli 0.0.278 → 0.0.279

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.
@@ -30,6 +30,7 @@ export default tseslint.config(
30
30
  {
31
31
  languageOptions: {
32
32
  parserOptions: {
33
+ warnOnUnsupportedTypeScriptVersion: false,
33
34
  sourceType: "module",
34
35
  ecmaVersion: "latest",
35
36
  },
@@ -243,35 +243,6 @@
243
243
  "files"
244
244
  ]
245
245
  },
246
- {
247
- "config": {
248
- "if": {
249
- "$and": [
250
- {
251
- "flag": "sentry"
252
- },
253
- {
254
- "flag": {
255
- "$not": {
256
- "$in": [
257
- "react",
258
- "vue",
259
- "solid",
260
- "svelte",
261
- "preact",
262
- "angular"
263
- ]
264
- }
265
- }
266
- }
267
- ]
268
- }
269
- },
270
- "folder": "@batijs/plain-sentry",
271
- "subfolders": [
272
- "files"
273
- ]
274
- },
275
246
  {
276
247
  "config": {
277
248
  "if": {
@@ -420,28 +391,6 @@
420
391
  "files"
421
392
  ]
422
393
  },
423
- {
424
- "config": {
425
- "if": {
426
- "flag": {
427
- "$not": {
428
- "$in": [
429
- "react",
430
- "vue",
431
- "solid",
432
- "svelte",
433
- "preact",
434
- "angular"
435
- ]
436
- }
437
- }
438
- }
439
- },
440
- "folder": "@batijs/shared-plain",
441
- "subfolders": [
442
- "files"
443
- ]
444
- },
445
394
  {
446
395
  "config": {
447
396
  "if": {
package/dist/index.js CHANGED
@@ -1677,7 +1677,7 @@ var createDefaultQueryTester = function(query, options) {
1677
1677
  // package.json
1678
1678
  var package_default = {
1679
1679
  name: "@batijs/cli",
1680
- version: "0.0.278",
1680
+ version: "0.0.279",
1681
1681
  type: "module",
1682
1682
  scripts: {
1683
1683
  "check-types": "tsc --noEmit",
@@ -1939,6 +1939,19 @@ async function checkArguments(args) {
1939
1939
  }
1940
1940
  }
1941
1941
  }
1942
+ function checkFlagsIncludesUiFramework(flags) {
1943
+ const uiFlags = features.filter((fs) => fs.category === "UI Framework").map((fs) => fs.flag);
1944
+ const uiFlagFound = flags.some((f) => uiFlags.includes(f));
1945
+ if (!uiFlagFound) {
1946
+ const lf = new Intl.ListFormat("en", {
1947
+ type: "disjunction"
1948
+ });
1949
+ console.error(
1950
+ `${red("\u26A0")} A ${yellow("UI Framework")} is required when using Bati. Choose one of ${lf.format(uiFlags.map((f) => bold(`--${f}`)))}`
1951
+ );
1952
+ process.exit(5);
1953
+ }
1954
+ }
1942
1955
  function checkFlagsExist(flags) {
1943
1956
  const inValidOptions = flags.reduce((acc, flag) => {
1944
1957
  if (!Object.prototype.hasOwnProperty.call(defaultDef, flag) && !features.some((f) => f.flag === flag)) {
@@ -2060,6 +2073,7 @@ async function run() {
2060
2073
  )
2061
2074
  ];
2062
2075
  checkFlagsExist(flags);
2076
+ checkFlagsIncludesUiFramework(flags);
2063
2077
  checkRules(flags);
2064
2078
  boilerplates.sort((b1, b2) => {
2065
2079
  if (b1.config.enforce === "pre") return -1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batijs/cli",
3
- "version": "0.0.278",
3
+ "version": "0.0.279",
4
4
  "type": "module",
5
5
  "keywords": [],
6
6
  "description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
@@ -20,12 +20,12 @@
20
20
  "typescript": "^5.6.2",
21
21
  "unplugin-purge-polyfills": "^0.0.5",
22
22
  "vite": "^5.4.5",
23
- "@batijs/build": "0.0.278",
24
- "@batijs/compile": "0.0.278"
23
+ "@batijs/build": "0.0.279",
24
+ "@batijs/compile": "0.0.279"
25
25
  },
26
26
  "dependencies": {
27
- "@batijs/core": "0.0.278",
28
- "@batijs/features": "0.0.278"
27
+ "@batijs/core": "0.0.279",
28
+ "@batijs/features": "0.0.279"
29
29
  },
30
30
  "bin": "./dist/index.js",
31
31
  "exports": {
@@ -1,116 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
- // If the importer is in node compatibility mode or this is not an ESM
20
- // file that has been converted to a CommonJS file using a Babel-
21
- // compatible transform (i.e. "__esModule" has not been set), then set
22
- // "default" to the CommonJS "module.exports" for node compatibility.
23
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
- mod
25
- ));
26
-
27
- // package.json
28
- var require_package = __commonJS({
29
- "package.json"(exports, module) {
30
- module.exports = {
31
- name: "@batijs/plain-sentry",
32
- private: true,
33
- version: "0.0.1",
34
- description: "",
35
- type: "module",
36
- scripts: {
37
- "check-types": "tsc --noEmit",
38
- build: "bati-compile-boilerplate"
39
- },
40
- keywords: [],
41
- author: "",
42
- license: "MIT",
43
- devDependencies: {
44
- "@batijs/compile": "workspace:*",
45
- "@sentry/browser": "^8.30.0",
46
- "@types/node": "^18.19.14",
47
- vite: "^5.4.5"
48
- },
49
- dependencies: {
50
- "@batijs/core": "workspace:*"
51
- },
52
- files: [
53
- "dist/"
54
- ],
55
- bati: {
56
- if: {
57
- $and: [
58
- {
59
- flag: "sentry"
60
- },
61
- {
62
- flag: {
63
- $not: {
64
- $in: [
65
- "react",
66
- "vue",
67
- "solid",
68
- "svelte",
69
- "preact",
70
- "angular"
71
- ]
72
- }
73
- }
74
- }
75
- ]
76
- }
77
- },
78
- exports: {
79
- "./sentry.browser.config": {
80
- types: "./dist/types/sentry.browser.config.d.ts"
81
- },
82
- "./pages/sentry/+Page": {
83
- types: "./dist/types/pages/sentry/+Page.d.ts"
84
- },
85
- "./pages/sentry/+client": {
86
- types: "./dist/types/pages/sentry/+client.d.ts"
87
- }
88
- },
89
- typesVersions: {
90
- "*": {
91
- "sentry.browser.config": [
92
- "./dist/types/sentry.browser.config.d.ts"
93
- ],
94
- "pages/sentry/+Page": [
95
- "./dist/types/pages/sentry/+Page.d.ts"
96
- ],
97
- "pages/sentry/+client": [
98
- "./dist/types/pages/sentry/+client.d.ts"
99
- ]
100
- }
101
- }
102
- };
103
- }
104
- });
105
-
106
- // files/$package.json.ts
107
- import { addDependency, loadAsJson } from "@batijs/core";
108
- async function getPackageJson(props) {
109
- const packageJson = await loadAsJson(props);
110
- return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
111
- dependencies: ["@sentry/browser"]
112
- });
113
- }
114
- export {
115
- getPackageJson as default
116
- };
@@ -1,19 +0,0 @@
1
- export { Page };
2
-
3
- function Page() {
4
- // language=HTML
5
- return `
6
- <h1>Sentry Test Page</h1>
7
- <p id="sentry_state" style="color:red">
8
- Sentry Client is not initialized! Vite Mode: ${import.meta.env.PROD ? "PROD" : "DEV"}
9
- </p>
10
- <p id="sentry_dsn" style="color:red">
11
- Sentry Client DSN is missing! Vite Mode: ${import.meta.env.PROD ? "PROD" : "DEV"}
12
- </p>
13
- <div>
14
- <button id="errorButton">
15
- Throw JavaScript Error
16
- </button>
17
- </div>
18
- `;
19
- }
@@ -1,37 +0,0 @@
1
- import "../+client";
2
- /**
3
- * @typedef {Object} SentryClient
4
- * @property {function(): SentryOptions} getOptions
5
- */
6
-
7
- /**
8
- * @typedef {Object} SentryOptions
9
- * @property {string} dsn
10
- */
11
-
12
- /**
13
- * @type {Window & { Sentry?: { getClient: () => SentryClient } }}
14
- */
15
- const globalWindow = globalThis?.window;
16
-
17
- if (typeof window !== "undefined") {
18
- const window = globalThis?.window;
19
-
20
- window.onload = function () {
21
- const options = globalWindow?.Sentry?.getClient()?.getOptions();
22
- if (options) {
23
- const elmSentryState = document?.getElementById("sentry_state");
24
- if (elmSentryState) elmSentryState.hidden = true;
25
- if (options?.dsn?.length > 1) {
26
- const elmSentryDSN = document?.getElementById("sentry_dsn");
27
- if (elmSentryDSN) elmSentryDSN.hidden = true;
28
- }
29
- }
30
-
31
- const elmSentryButton = document?.getElementById("errorButton");
32
- if (elmSentryButton)
33
- elmSentryButton.addEventListener("click", function () {
34
- throw new Error("This is a SENTRY Browser Test!");
35
- });
36
- };
37
- }
@@ -1,25 +0,0 @@
1
- import * as Sentry from "@sentry/browser";
2
-
3
- export const sentryBrowserConfig = () => {
4
- // eslint-disable-next-line
5
- import.meta.env.PROD === true &&
6
- Sentry.init({
7
- dsn: import.meta.env.PUBLIC_ENV__SENTRY_DSN,
8
- environment: "production-frontend",
9
- //enabled: import.meta.env.DEV ? false : true,
10
- integrations: [Sentry.replayIntegration()],
11
- autoSessionTracking: globalThis?.window?.document ? true : false, // disable autoSessionTracking in SSR
12
- // Set tracesSampleRate to 1.0 to capture 100%
13
- // of transactions for tracing.
14
- tracesSampleRate: 1.0,
15
- // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled
16
- tracePropagationTargets: [/^\//, /^https:\/\/yourserver\.io\/api/],
17
- // Capture Replay for 10% of all sessions,
18
- // plus for 100% of sessions with an error
19
- replaysSessionSampleRate: 0.1,
20
- replaysOnErrorSampleRate: 1.0,
21
- });
22
-
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- (window as any).Sentry = Sentry;
25
- };
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1 +0,0 @@
1
- export function Page(): string;
@@ -1,6 +0,0 @@
1
- export type SentryClient = {
2
- getOptions: () => SentryOptions;
3
- };
4
- export type SentryOptions = {
5
- dsn: string;
6
- };
@@ -1 +0,0 @@
1
- export declare const sentryBrowserConfig: () => void;
@@ -1,9 +0,0 @@
1
- export { Page };
2
-
3
- /**
4
- * An empty page
5
- * @see {@link https://vike.dev/render-modes#html-only}
6
- */
7
- function Page() {
8
- return "Created with Bâti";
9
- }
@@ -1,12 +0,0 @@
1
- // Environment: config
2
-
3
- /**
4
- * @see {@link https://vike.dev/render-modes#html-only}
5
- */
6
- export default {
7
- meta: {
8
- Page: {
9
- env: { server: true, client: false }, // HTML-only for all pages
10
- },
11
- },
12
- };
@@ -1,39 +0,0 @@
1
- // Environment: server
2
-
3
- import { dangerouslySkipEscape, escapeInject } from "vike/server";
4
- import type { OnRenderHtmlAsync } from "vike/types";
5
-
6
- export { onRenderHtml };
7
-
8
- /**
9
- * The onRenderHtml() hook defines how pages are rendered to HTML.
10
- * @see {@link https://vike.dev/onRenderHtml}
11
- */
12
- const onRenderHtml: OnRenderHtmlAsync = async (pageContext): ReturnType<OnRenderHtmlAsync> => {
13
- // Retrieve contextual data here and call your rendering framework
14
-
15
- // const { Page, pageProps } = pageContext;
16
- const { Page } = pageContext;
17
- // const pageHtml = await renderToHtml(createElement(Page, pageProps));
18
- const pageHtml = (Page as () => string)();
19
-
20
- const documentHtml = escapeInject`<!DOCTYPE html>
21
- <html>
22
- <head>
23
- <meta charset="UTF-8">
24
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
25
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
26
- <title>My App</title>
27
- </head>
28
- <body>
29
- <div id="page-root">${dangerouslySkipEscape(pageHtml)}</div>
30
- </body>
31
- </html>`;
32
-
33
- return {
34
- documentHtml,
35
- pageContext: {
36
- // We can define pageContext values here
37
- },
38
- };
39
- };
@@ -1,6 +0,0 @@
1
- export { Page };
2
- /**
3
- * An empty page
4
- * @see {@link https://vike.dev/render-modes#html-only}
5
- */
6
- declare function Page(): string;
@@ -1,14 +0,0 @@
1
- /**
2
- * @see {@link https://vike.dev/render-modes#html-only}
3
- */
4
- declare const _default: {
5
- meta: {
6
- Page: {
7
- env: {
8
- server: boolean;
9
- client: boolean;
10
- };
11
- };
12
- };
13
- };
14
- export default _default;
@@ -1,7 +0,0 @@
1
- import type { OnRenderHtmlAsync } from "vike/types";
2
- export { onRenderHtml };
3
- /**
4
- * The onRenderHtml() hook defines how pages are rendered to HTML.
5
- * @see {@link https://vike.dev/onRenderHtml}
6
- */
7
- declare const onRenderHtml: OnRenderHtmlAsync;