Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name: CI

env:
TELEMETRY_TRACKING_TOKEN: ${{ secrets.TELEMETRY_TRACKING_TOKEN }}
DO_NOT_TRACK: '1'

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zenstack-monorepo",
"version": "0.3.12",
"version": "0.3.17",
"description": "",
"scripts": {
"build": "pnpm -r build",
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zenstackhq/runtime",
"displayName": "ZenStack Runtime Library",
"version": "0.3.12",
"version": "0.3.17",
"description": "Runtime of ZenStack for both client-side and server-side environments.",
"repository": {
"type": "git",
Expand Down
Empty file.
25 changes: 24 additions & 1 deletion packages/schema/build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@ require('esbuild')
force: true,
recursive: true,
});

require('dotenv').config();

if (process.env.TELEMETRY_TRACKING_TOKEN) {
let postInstallContent = fs.readFileSync(
'script/post-install.js',
'utf-8'
);
postInstallContent = postInstallContent.replace(
'<TELEMETRY_TRACKING_TOKEN>',
process.env.TELEMETRY_TRACKING_TOKEN
);
fs.writeFileSync('bin/post-install.js', postInstallContent, {
encoding: 'utf-8',
});
} else {
fs.writeFileSync('bin/post-install.js', '', {
encoding: 'utf-8',
});
}
})
.then(() => console.log(success))
.catch(() => process.exit(1));
.catch((err) => {
console.error(err);
process.exit(1);
});
5 changes: 3 additions & 2 deletions packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "zenstack",
"displayName": "ZenStack Language Tools",
"description": "A toolkit for modeling data and access policies in full-stack development with Next.js and Typescript",
"version": "0.3.12",
"version": "0.3.17",
"author": {
"name": "ZenStack Team"
},
Expand Down Expand Up @@ -79,7 +79,8 @@
"langium:watch": "langium generate --watch",
"watch": "concurrently --kill-others \"npm:langium:watch\" \"npm:bundle-watch\"",
"test": "jest",
"prepublishOnly": "cp ../../README.md ./ && pnpm build"
"prepublishOnly": "cp ../../README.md ./ && pnpm build",
"postinstall": "node bin/post-install.js"
},
"dependencies": {
"@zenstackhq/runtime": "workspace:../runtime/dist",
Expand Down
24 changes: 24 additions & 0 deletions packages/schema/script/post-install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
try {
if (process.env.DO_NOT_TRACK == '1') {
process.exit(0);
}

const Mixpanel = require('mixpanel');
const machineId = require('node-machine-id');
const os = require('os');

const mixpanel = Mixpanel.init('<TELEMETRY_TRACKING_TOKEN>', {
geolocate: true,
});

const version = require('../package.json').version;
const payload = {
distinct_id: machineId.machineIdSync(),
nodeVersion: process.version,
time: new Date(),
$os: os.platform(),
version,
};

mixpanel.track('npm:install', payload);
} catch {}
37 changes: 19 additions & 18 deletions samples/todo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions samples/todo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "todo",
"version": "0.3.12",
"version": "0.3.17",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -21,7 +21,7 @@
"dependencies": {
"@heroicons/react": "^2.0.12",
"@prisma/client": "^4.4.0",
"@zenstackhq/runtime": "^0.3.12",
"@zenstackhq/runtime": "^0.3.17",
"bcryptjs": "^2.4.3",
"daisyui": "^2.31.0",
"moment": "^2.29.4",
Expand All @@ -46,6 +46,6 @@
"postcss": "^8.4.16",
"tailwindcss": "^3.1.8",
"typescript": "^4.6.2",
"zenstack": "^0.3.12"
"zenstack": "^0.3.17"
}
}