chore(core/strapi): remove postinstall

This commit is contained in:
Alexandre Bodin 2023-10-16 15:55:15 +02:00
parent 4abb081aed
commit 157058b96a
3 changed files with 0 additions and 38 deletions

View File

@ -70,7 +70,6 @@
"files": [
"./dist",
"./bin",
"./scripts",
"./resources",
"index.js"
],
@ -79,7 +78,6 @@
"build:ts": "run build",
"clean": "run -T rimraf ./dist",
"copy-files": "copyfiles -u 1 -a 'src/**/*.html' 'src/**/*.png' dist",
"postinstall": "node ./scripts/postinstall.js",
"lint": "run -T eslint .",
"prepublishOnly": "yarn clean && yarn build",
"test:unit": "run -T jest",

View File

@ -1,7 +0,0 @@
'use strict';
try {
require('./dist/utils/postinstall');
} catch (e) {
// ignore
}

View File

@ -1,29 +0,0 @@
import fetch from 'node-fetch';
import machineID from './machine-id';
/*
* No need to worry about this file, we only retrieve anonymous data here.
* It allows us to know on how many times the package has been installed globally.
*/
try {
if (
process.env.npm_config_global === 'true' ||
JSON.parse(process.env.npm_config_argv as any).original.includes('global')
) {
const event = 'didInstallStrapi';
fetch('https://analytics.strapi.io/api/v2/track', {
method: 'POST',
body: JSON.stringify({
event,
deviceId: machineID(),
}),
headers: {
'Content-Type': 'application/json',
'X-Strapi-Event': event,
},
}).catch(() => {});
}
} catch (e) {
// ...
}