tetrons 2.3.65 → 2.3.66

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.
@@ -0,0 +1,38 @@
1
+ import {
2
+ EditorContent
3
+ } from "./chunk-IHAH6ILP.browser.js";
4
+
5
+ // src/index.nodeimpl.ts
6
+ import fs from "fs";
7
+ import path from "path";
8
+ var USAGE_FILE = path.join(process.cwd(), ".tetrons-usage.json");
9
+ async function getOrCreateInstallDate() {
10
+ try {
11
+ if (fs.existsSync(USAGE_FILE)) {
12
+ const raw = fs.readFileSync(USAGE_FILE, "utf-8");
13
+ try {
14
+ const data = JSON.parse(raw);
15
+ if (typeof data.installedAt === "string") {
16
+ return new Date(data.installedAt);
17
+ }
18
+ } catch {
19
+ console.warn(
20
+ "[TETRONS] Malformed .tetrons-usage.json. Reinitializing..."
21
+ );
22
+ }
23
+ }
24
+ const now = (/* @__PURE__ */ new Date()).toISOString();
25
+ fs.writeFileSync(USAGE_FILE, JSON.stringify({ installedAt: now }), {
26
+ encoding: "utf-8",
27
+ flag: "w"
28
+ });
29
+ return new Date(now);
30
+ } catch (err) {
31
+ console.error("[TETRONS] Failed to read/write install date:", err);
32
+ throw new Error("Failed to access local usage record.");
33
+ }
34
+ }
35
+ export {
36
+ EditorContent,
37
+ getOrCreateInstallDate
38
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tetrons",
3
- "version": "2.3.65",
3
+ "version": "2.3.66",
4
4
  "description": "A Next.js project written in TypeScript",
5
5
  "main": "./dist/index.node.cjs",
6
6
  "module": "./dist/index.node.mjs",
@@ -75,12 +75,16 @@
75
75
  "license": "MIT",
76
76
  "exports": {
77
77
  ".": {
78
- "import": "./dist/index.node.mjs",
79
- "require": "./dist/index.node.cjs"
80
- },
81
- "./node": {
82
- "import": "./dist/index.node.mjs",
83
- "require": "./dist/index.node.cjs"
78
+ "import": {
79
+ "node": "./dist/index.node.mjs",
80
+ "browser": "./dist/index.browser.js",
81
+ "default": "./dist/index.node.mjs"
82
+ },
83
+ "require": {
84
+ "node": "./dist/index.node.cjs",
85
+ "browser": "./dist/index.browser.js",
86
+ "default": "./dist/index.node.cjs"
87
+ }
84
88
  },
85
89
  "./browser": {
86
90
  "import": "./dist/index.browser.js",
@@ -113,6 +117,8 @@
113
117
  }
114
118
  },
115
119
  "browser": {
120
+ "./dist/index.node.mjs": "./dist/index.browser.js",
121
+ "./dist/index.node.cjs": "./dist/index.browser.js",
116
122
  "./dist/licenseUtils.server.js": false
117
123
  },
118
124
  "files": [