@momentumcms/plugins-analytics 0.1.0 → 0.1.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.
Files changed (4) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/index.cjs +16 -6
  3. package/index.js +2195 -0
  4. package/package.json +55 -55
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 0.1.2 (2026-02-16)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **release:** centralize manifestRootsToUpdate to update both source and dist ([2b8f832](https://github.com/DonaldMurillo/momentum-cms/commit/2b8f832))
6
+ - **create-app:** fix Angular SSR, Analog builds, and CJS/ESM compatibility ([28d4d0a](https://github.com/DonaldMurillo/momentum-cms/commit/28d4d0a))
7
+
8
+ ### ❤️ Thank You
9
+
10
+ - Claude Opus 4.6
11
+ - Donald Murillo @DonaldMurillo
12
+
13
+ ## 0.1.1 (2026-02-16)
14
+
15
+ This was a version bump only for plugins-analytics to align it with other projects, there were no code changes.
16
+
1
17
  ## 0.1.0 (2026-02-16)
2
18
 
3
19
  ### 🚀 Features
package/index.cjs CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __esm = (fn, res) => function __init() {
7
9
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
@@ -18,6 +20,14 @@ var __copyProps = (to, from, except, desc) => {
18
20
  }
19
21
  return to;
20
22
  };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
21
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
32
 
23
33
  // libs/plugins/analytics/src/lib/client/block-tracker.ts
@@ -1220,10 +1230,10 @@ function postgresAnalyticsAdapter(options) {
1220
1230
  const logger = createLogger("Analytics:Postgres");
1221
1231
  const tableName = options.tableName ?? "_momentum_analytics";
1222
1232
  let pool = null;
1223
- function getPool() {
1233
+ async function getPool() {
1224
1234
  if (!pool) {
1225
- const pg = require("pg");
1226
- pool = new pg.Pool({
1235
+ const { Pool } = await import("pg");
1236
+ pool = new Pool({
1227
1237
  connectionString: options.connectionString,
1228
1238
  max: options.poolSize ?? 5
1229
1239
  });
@@ -1232,7 +1242,7 @@ function postgresAnalyticsAdapter(options) {
1232
1242
  }
1233
1243
  const adapter = {
1234
1244
  async initialize() {
1235
- const p = getPool();
1245
+ const p = await getPool();
1236
1246
  await p.query(`
1237
1247
  CREATE TABLE IF NOT EXISTS ${tableName} (
1238
1248
  id TEXT PRIMARY KEY,
@@ -1260,7 +1270,7 @@ function postgresAnalyticsAdapter(options) {
1260
1270
  async store(events) {
1261
1271
  if (events.length === 0)
1262
1272
  return;
1263
- const p = getPool();
1273
+ const p = await getPool();
1264
1274
  const rows = [];
1265
1275
  const values = [];
1266
1276
  for (let i = 0; i < events.length; i++) {
@@ -1289,7 +1299,7 @@ function postgresAnalyticsAdapter(options) {
1289
1299
  await p.query(sql, values);
1290
1300
  },
1291
1301
  async query(queryOptions = {}) {
1292
- const p = getPool();
1302
+ const p = await getPool();
1293
1303
  const conditions = [];
1294
1304
  const params = [];
1295
1305
  let paramIdx = 1;