@batijs/cli 0.0.261 → 0.0.263

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 (44) hide show
  1. package/dist/boilerplates/@batijs/plain-sentry/files/$package.json.js +117 -0
  2. package/dist/boilerplates/@batijs/plain-sentry/files/pages/sentry/+Page.js +19 -0
  3. package/dist/boilerplates/@batijs/plain-sentry/files/pages/sentry/+client.js +37 -0
  4. package/dist/boilerplates/@batijs/plain-sentry/files/sentry.browser.config.ts +25 -0
  5. package/dist/boilerplates/@batijs/plain-sentry/files/vite-env.d.ts +1 -0
  6. package/dist/boilerplates/@batijs/plain-sentry/types/pages/sentry/+Page.d.ts +1 -0
  7. package/dist/boilerplates/@batijs/plain-sentry/types/pages/sentry/+client.d.ts +6 -0
  8. package/dist/boilerplates/@batijs/plain-sentry/types/sentry.browser.config.d.ts +1 -0
  9. package/dist/boilerplates/@batijs/prettier/files/.prettierignore +3 -0
  10. package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +101 -0
  11. package/dist/boilerplates/@batijs/react-sentry/files/pages/sentry/+Page.tsx +43 -0
  12. package/dist/boilerplates/@batijs/react-sentry/files/sentry.browser.config.ts +22 -0
  13. package/dist/boilerplates/@batijs/react-sentry/types/pages/sentry/+Page.d.ts +1 -0
  14. package/dist/boilerplates/@batijs/react-sentry/types/sentry.browser.config.d.ts +1 -0
  15. package/dist/boilerplates/@batijs/sentry/files/$.env.js +22 -0
  16. package/dist/boilerplates/@batijs/sentry/files/$README.md.js +31 -0
  17. package/dist/boilerplates/@batijs/sentry/files/$package.json.js +86 -0
  18. package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +18 -0
  19. package/dist/boilerplates/@batijs/sentry/files/.env.sentry-build-plugin +8 -0
  20. package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +23 -0
  21. package/dist/boilerplates/@batijs/shadcn-ui/files/!tailwind.config.ts +68 -0
  22. package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +36 -0
  23. package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +112 -0
  24. package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +13 -0
  25. package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +34 -0
  26. package/dist/boilerplates/@batijs/shadcn-ui/files/components.json +17 -0
  27. package/dist/boilerplates/@batijs/shadcn-ui/files/layouts/!tailwind.css +101 -0
  28. package/dist/boilerplates/@batijs/shadcn-ui/files/lib/utils.ts +6 -0
  29. package/dist/boilerplates/@batijs/shadcn-ui/types/!tailwind.config.d.ts +72 -0
  30. package/dist/boilerplates/@batijs/shadcn-ui/types/lib/utils.d.ts +2 -0
  31. package/dist/boilerplates/@batijs/shared/files/.gitignore +3 -0
  32. package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +99 -0
  33. package/dist/boilerplates/@batijs/solid-sentry/files/pages/sentry/+Page.tsx +47 -0
  34. package/dist/boilerplates/@batijs/solid-sentry/files/sentry.browser.config.ts +22 -0
  35. package/dist/boilerplates/@batijs/solid-sentry/types/pages/sentry/+Page.d.ts +1 -0
  36. package/dist/boilerplates/@batijs/solid-sentry/types/sentry.browser.config.d.ts +1 -0
  37. package/dist/boilerplates/@batijs/vue/files/layouts/LayoutDefault.vue +3 -0
  38. package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +93 -0
  39. package/dist/boilerplates/@batijs/vue-sentry/files/pages/sentry/+Page.vue +33 -0
  40. package/dist/boilerplates/@batijs/vue-sentry/files/sentry.browser.config.ts +25 -0
  41. package/dist/boilerplates/@batijs/vue-sentry/types/sentry.browser.config.d.ts +1 -0
  42. package/dist/boilerplates/boilerplates.json +99 -0
  43. package/dist/index.js +25 -9
  44. package/package.json +5 -5
@@ -0,0 +1,117 @@
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
+ "@batijs/sentry": "workspace:*",
46
+ "@sentry/browser": "^8.27.0",
47
+ "@types/node": "^18.19.14",
48
+ vite: "^5.4.2"
49
+ },
50
+ dependencies: {
51
+ "@batijs/core": "workspace:*"
52
+ },
53
+ files: [
54
+ "dist/"
55
+ ],
56
+ bati: {
57
+ if: {
58
+ $and: [
59
+ {
60
+ flag: "sentry"
61
+ },
62
+ {
63
+ flag: {
64
+ $not: {
65
+ $in: [
66
+ "react",
67
+ "vue",
68
+ "solid",
69
+ "svelte",
70
+ "preact",
71
+ "angular"
72
+ ]
73
+ }
74
+ }
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ exports: {
80
+ "./sentry.browser.config": {
81
+ types: "./dist/types/sentry.browser.config.d.ts"
82
+ },
83
+ "./pages/sentry/+Page": {
84
+ types: "./dist/types/pages/sentry/+Page.d.ts"
85
+ },
86
+ "./pages/sentry/+client": {
87
+ types: "./dist/types/pages/sentry/+client.d.ts"
88
+ }
89
+ },
90
+ typesVersions: {
91
+ "*": {
92
+ "sentry.browser.config": [
93
+ "./dist/types/sentry.browser.config.d.ts"
94
+ ],
95
+ "pages/sentry/+Page": [
96
+ "./dist/types/pages/sentry/+Page.d.ts"
97
+ ],
98
+ "pages/sentry/+client": [
99
+ "./dist/types/pages/sentry/+client.d.ts"
100
+ ]
101
+ }
102
+ }
103
+ };
104
+ }
105
+ });
106
+
107
+ // files/$package.json.ts
108
+ import { addDependency, loadAsJson } from "@batijs/core";
109
+ async function getPackageJson(props) {
110
+ const packageJson = await loadAsJson(props);
111
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
112
+ dependencies: ["@sentry/browser"]
113
+ });
114
+ }
115
+ export {
116
+ getPackageJson as default
117
+ };
@@ -0,0 +1,19 @@
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
+ }
@@ -0,0 +1,37 @@
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
+ }
@@ -0,0 +1,25 @@
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
+ };
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1 @@
1
+ export function Page(): string;
@@ -0,0 +1,6 @@
1
+ export type SentryClient = {
2
+ getOptions: () => SentryOptions;
3
+ };
4
+ export type SentryOptions = {
5
+ dsn: string;
6
+ };
@@ -0,0 +1 @@
1
+ export declare const sentryBrowserConfig: () => void;
@@ -133,3 +133,6 @@ dist
133
133
 
134
134
  # Cloudflare
135
135
  .wrangler/
136
+
137
+ # Sentry Vite Plugin
138
+ .env.sentry-build-plugin
@@ -0,0 +1,101 @@
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/react-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/react": "^8.27.0",
46
+ "@types/node": "^18.19.14",
47
+ "@types/react": "^18.3.4",
48
+ "@types/react-dom": "^18.3.0",
49
+ react: "^18.3.1",
50
+ "react-dom": "^18.3.1",
51
+ vite: "^5.4.2"
52
+ },
53
+ dependencies: {
54
+ "@batijs/core": "workspace:*"
55
+ },
56
+ files: [
57
+ "dist/"
58
+ ],
59
+ bati: {
60
+ if: {
61
+ flag: {
62
+ $all: [
63
+ "react",
64
+ "sentry"
65
+ ]
66
+ }
67
+ }
68
+ },
69
+ exports: {
70
+ "./sentry.browser.config": {
71
+ types: "./dist/types/sentry.browser.config.d.ts"
72
+ },
73
+ "./pages/sentry/+Page": {
74
+ types: "./dist/types/pages/sentry/+Page.d.ts"
75
+ }
76
+ },
77
+ typesVersions: {
78
+ "*": {
79
+ "sentry.browser.config": [
80
+ "./dist/types/sentry.browser.config.d.ts"
81
+ ],
82
+ "pages/sentry/+Page": [
83
+ "./dist/types/pages/sentry/+Page.d.ts"
84
+ ]
85
+ }
86
+ }
87
+ };
88
+ }
89
+ });
90
+
91
+ // files/$package.json.ts
92
+ import { addDependency, loadAsJson } from "@batijs/core";
93
+ async function getPackageJson(props) {
94
+ const packageJson = await loadAsJson(props);
95
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
96
+ dependencies: ["@sentry/react"]
97
+ });
98
+ }
99
+ export {
100
+ getPackageJson as default
101
+ };
@@ -0,0 +1,43 @@
1
+ import React, { useEffect } from "react";
2
+ import * as Sentry from "@sentry/react";
3
+
4
+ export default function ReactSentryErrorPage() {
5
+ const [sentryClientStatus, setSentryClientStatus] = React.useState({
6
+ client_not_loaded: false,
7
+ enabled: true,
8
+ dsn_missing: false,
9
+ });
10
+ useEffect(() => {
11
+ const options = Sentry?.getClient()?.getOptions();
12
+ setSentryClientStatus({
13
+ client_not_loaded: !options,
14
+ dsn_missing: (options?.dsn?.length ?? 0) < 2,
15
+ enabled: (options?.enabled ?? true) !== false,
16
+ });
17
+ console.log("Sentry DSN: ", options?.dsn);
18
+ }, []);
19
+
20
+ return (
21
+ <>
22
+ <h1>Sentry Test Page</h1>
23
+ {(sentryClientStatus.client_not_loaded || sentryClientStatus.dsn_missing || !sentryClientStatus.enabled) && (
24
+ <p style={{ color: "red" }}>
25
+ <b>Sentry Config Error:</b>
26
+ {sentryClientStatus.client_not_loaded ? "Client not loaded!" : ""}{" "}
27
+ {!sentryClientStatus.client_not_loaded && sentryClientStatus.dsn_missing ? "DSN is missing! " : ""}
28
+ {!sentryClientStatus.client_not_loaded && !sentryClientStatus.enabled ? "Client is not enabled! " : ""} Vite
29
+ Mode: {import.meta.env.PROD ? "PROD" : "DEV"}
30
+ </p>
31
+ )}
32
+ <div>
33
+ <button
34
+ onClick={() => {
35
+ throw new Error(`This is a React SENTRY Browser Test! [${import.meta.env.DEV ? "DEV Mode" : "PROD Mode"}]`);
36
+ }}
37
+ >
38
+ Throw Javascript Error
39
+ </button>
40
+ </div>
41
+ </>
42
+ );
43
+ }
@@ -0,0 +1,22 @@
1
+ import * as Sentry from "@sentry/react";
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
+ };
@@ -0,0 +1 @@
1
+ export default function ReactSentryErrorPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const sentryBrowserConfig: () => void;
@@ -0,0 +1,22 @@
1
+ // files/$.env.ts
2
+ import { appendToEnv } from "@batijs/core";
3
+ async function getServerlessEnv(props) {
4
+ const sentryDNS = process.env.TEST_SENTRY_DSN;
5
+ let envContent = await props.readfile?.();
6
+ envContent = appendToEnv(
7
+ envContent,
8
+ "SENTRY_DSN",
9
+ sentryDNS ?? "",
10
+ "Sentry DNS. Used for Error Reporting on the Server"
11
+ );
12
+ envContent = appendToEnv(
13
+ envContent,
14
+ "PUBLIC_ENV__SENTRY_DSN",
15
+ "",
16
+ "Sentry DNS. Used for Error Reporting in the Browser"
17
+ );
18
+ return envContent;
19
+ }
20
+ export {
21
+ getServerlessEnv as default
22
+ };
@@ -0,0 +1,31 @@
1
+ // files/$README.md.ts
2
+ import { loadReadme } from "@batijs/core";
3
+ async function getReadme(props) {
4
+ const content = await loadReadme(props);
5
+ const about = `
6
+
7
+ ## Sentry Browser / Error Tracking & Performance Monitoring
8
+
9
+ This app is integrated with [Sentry](https://sentry.io) for error tracking.
10
+
11
+ Add your Sentry DSN to \`.env\` file.
12
+ You can configure [Sentry for the browser](` + (props.meta.BATI.has("react") ? "https://docs.sentry.io/platforms/javascript/guides/react/" : props.meta.BATI.has("solid") ? "https://docs.sentry.io/platforms/javascript/guides/solid/" : props.meta.BATI.has("vue") ? "https://docs.sentry.io/platforms/javascript/guides/vue/" : "https://docs.sentry.io/platforms/javascript/") + `) in \`sentry.browser.config.ts\`.
13
+
14
+ Upload of source maps to Sentry is handled by the [\`sentryVitePlugin\`](https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/vite/) in \`vite.config.ts\`.
15
+ You have to configure \`SENTRY_ORG\`, \`SENTRY_PROJECT\` and \`SENTRY_AUTH_TOKEN\` in the \`.env.sentry-build-plugin\` file with the values from your Sentry account.
16
+
17
+ > [!NOTE]
18
+ > Sentry Error Tracking is **only activated in production** (\`import.meta.env.PROD === true\`)!
19
+
20
+ **Testing Sentry** receiving Errors:
21
+ 1. Build & Start the app \`pnpm build && pnpm preview\`.
22
+ 2. open Testpage in browser: http://localhost:3000/sentry.
23
+ 3. check your [Sentry Dashboard](https://sentry.io) for new Errors.
24
+
25
+ `;
26
+ content.addAbout(about);
27
+ return content.finalize();
28
+ }
29
+ export {
30
+ getReadme as default
31
+ };
@@ -0,0 +1,86 @@
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/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/vite-plugin": "^2.22.3",
46
+ "@types/node": "^18.19.44",
47
+ vite: "^5.4.2"
48
+ },
49
+ dependencies: {
50
+ "@batijs/core": "workspace:*"
51
+ },
52
+ files: [
53
+ "dist/"
54
+ ],
55
+ bati: {
56
+ if: {
57
+ flag: "sentry"
58
+ }
59
+ },
60
+ exports: {
61
+ "./sentry.browser.config copy": {
62
+ types: "./dist/types/sentry.browser.config copy.d.ts"
63
+ }
64
+ },
65
+ typesVersions: {
66
+ "*": {
67
+ "sentry.browser.config copy": [
68
+ "./dist/types/sentry.browser.config copy.d.ts"
69
+ ]
70
+ }
71
+ }
72
+ };
73
+ }
74
+ });
75
+
76
+ // files/$package.json.ts
77
+ import { addDependency, loadAsJson } from "@batijs/core";
78
+ async function getPackageJson(props) {
79
+ const packageJson = await loadAsJson(props);
80
+ return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
81
+ devDependencies: ["@sentry/vite-plugin"]
82
+ });
83
+ }
84
+ export {
85
+ getPackageJson as default
86
+ };
@@ -0,0 +1,18 @@
1
+ // files/$vite.config.ts.ts
2
+ import { addVitePlugin, loadAsMagicast, deepMergeObject } from "@batijs/core";
3
+ async function getViteConfig(props) {
4
+ const mod = await loadAsMagicast(props);
5
+ addVitePlugin(mod, {
6
+ from: "@sentry/vite-plugin",
7
+ constructor: "sentryVitePlugin",
8
+ imported: "sentryVitePlugin",
9
+ options: {
10
+ sourcemaps: { disable: false }
11
+ }
12
+ });
13
+ deepMergeObject(mod.exports.default.$args[0], { build: { sourcemap: true } });
14
+ return mod.generate().code;
15
+ }
16
+ export {
17
+ getViteConfig as default
18
+ };
@@ -0,0 +1,8 @@
1
+ # Sentry Organization Slug. Used for Upload of Source Maps
2
+ SENTRY_ORG=
3
+
4
+ # Sentry Project Slug. Used for Upload of Source Maps
5
+ SENTRY_PROJECT=
6
+
7
+ # Sentry Auth Token. Used for Upload of Source Maps
8
+ SENTRY_AUTH_TOKEN=
@@ -0,0 +1,23 @@
1
+ // files/pages/$+client.ts.ts
2
+ import { builders, generateCode, loadAsMagicast, parseModule } from "@batijs/core";
3
+ async function getViteConfig(props) {
4
+ let mod;
5
+ try {
6
+ mod = await loadAsMagicast(props);
7
+ } catch {
8
+ mod = parseModule("");
9
+ }
10
+ if (!props.meta.BATI.has("vue")) {
11
+ mod.imports.$prepend({
12
+ from: "../sentry.browser.config",
13
+ imported: "sentryBrowserConfig"
14
+ });
15
+ const e = builders.functionCall("sentryBrowserConfig");
16
+ const c = generateCode(e).code;
17
+ mod.$ast.body.splice(mod.$ast.body.length - 1, 0, c);
18
+ }
19
+ return mod.generate().code;
20
+ }
21
+ export {
22
+ getViteConfig as default
23
+ };
@@ -0,0 +1,68 @@
1
+ import type { Config } from "tailwindcss";
2
+ import tailwindAnimate from "tailwindcss-animate";
3
+
4
+ export default {
5
+ darkMode: ["class"],
6
+ content: ["./{pages,layouts,components,src}/**/*.{html,js,jsx,ts,tsx,vue}"],
7
+ theme: {
8
+ extend: {
9
+ keyframes: {
10
+ "caret-blink": {
11
+ "0%,70%,100%": { opacity: "1" },
12
+ "20%,50%": { opacity: "0" },
13
+ },
14
+ },
15
+ animation: {
16
+ "caret-blink": "caret-blink 1.25s ease-out infinite",
17
+ },
18
+ borderRadius: {
19
+ lg: "var(--radius)",
20
+ md: "calc(var(--radius) - 2px)",
21
+ sm: "calc(var(--radius) - 4px)",
22
+ },
23
+ colors: {
24
+ background: "hsl(var(--background))",
25
+ foreground: "hsl(var(--foreground))",
26
+ card: {
27
+ DEFAULT: "hsl(var(--card))",
28
+ foreground: "hsl(var(--card-foreground))",
29
+ },
30
+ popover: {
31
+ DEFAULT: "hsl(var(--popover))",
32
+ foreground: "hsl(var(--popover-foreground))",
33
+ },
34
+ primary: {
35
+ DEFAULT: "hsl(var(--primary))",
36
+ foreground: "hsl(var(--primary-foreground))",
37
+ },
38
+ secondary: {
39
+ DEFAULT: "hsl(var(--secondary))",
40
+ foreground: "hsl(var(--secondary-foreground))",
41
+ },
42
+ muted: {
43
+ DEFAULT: "hsl(var(--muted))",
44
+ foreground: "hsl(var(--muted-foreground))",
45
+ },
46
+ accent: {
47
+ DEFAULT: "hsl(var(--accent))",
48
+ foreground: "hsl(var(--accent-foreground))",
49
+ },
50
+ destructive: {
51
+ DEFAULT: "hsl(var(--destructive))",
52
+ foreground: "hsl(var(--destructive-foreground))",
53
+ },
54
+ border: "hsl(var(--border))",
55
+ input: "hsl(var(--input))",
56
+ ring: "hsl(var(--ring))",
57
+ chart: {
58
+ "1": "hsl(var(--chart-1))",
59
+ "2": "hsl(var(--chart-2))",
60
+ "3": "hsl(var(--chart-3))",
61
+ "4": "hsl(var(--chart-4))",
62
+ "5": "hsl(var(--chart-5))",
63
+ },
64
+ },
65
+ },
66
+ },
67
+ plugins: [tailwindAnimate],
68
+ } satisfies Config;