chore(core): collect basic static on workspace creation in ci vs dev
This commit is contained in:
parent
2c114ce624
commit
5a8214923f
@ -300,7 +300,8 @@
|
||||
"string-width": "^4.2.3",
|
||||
"tailwindcss": "3.1.8",
|
||||
"tslib": "^2.3.0",
|
||||
"weak-napi": "^2.0.2"
|
||||
"weak-napi": "^2.0.2",
|
||||
"axios": "0.21.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"**/xmlhttprequest-ssl": "~1.6.2",
|
||||
|
||||
@ -5,7 +5,7 @@ import * as path from 'path';
|
||||
import { dirSync } from 'tmp';
|
||||
import * as yargs from 'yargs';
|
||||
import { showNxWarning, unparse } from './shared';
|
||||
import { output } from './output';
|
||||
import { isCI, output } from './output';
|
||||
import * as ora from 'ora';
|
||||
import {
|
||||
detectInvokedPackageManager,
|
||||
@ -23,6 +23,7 @@ import chalk = require('chalk');
|
||||
import { ciList } from './ci';
|
||||
import { join } from 'path';
|
||||
import { initializeGitRepo } from './git';
|
||||
import axios from 'axios';
|
||||
|
||||
type Arguments = {
|
||||
name: string;
|
||||
@ -306,6 +307,8 @@ async function main(parsedArgs: yargs.Arguments<Arguments>) {
|
||||
if (nxCloud && nxCloudInstallRes.code === 0) {
|
||||
printNxCloudSuccessMessage(nxCloudInstallRes.stdout);
|
||||
}
|
||||
|
||||
await recordWorkspaceCreationStats(nxCloud);
|
||||
}
|
||||
|
||||
async function getConfiguration(
|
||||
@ -1012,3 +1015,24 @@ function pointToFreeCourseOnEgghead(): string[] {
|
||||
`https://egghead.io/playlists/scale-react-development-with-nx-4038`,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* We are incrementing a counter to track how often create-nx-workspace is used in CI
|
||||
* vs dev environments. No personal information is collected.
|
||||
*/
|
||||
async function recordWorkspaceCreationStats(useCloud: boolean) {
|
||||
try {
|
||||
const major = Number(nxVersion.split('.')[0]);
|
||||
if (major < 10 || major > 30) return; // test version, skip it
|
||||
await axios
|
||||
.create({
|
||||
baseURL: 'https://cloud.nx.app',
|
||||
timeout: 400,
|
||||
})
|
||||
.post('/nx-cloud/stats', {
|
||||
command: 'create-nx-workspace',
|
||||
isCI: isCI(),
|
||||
useCloud,
|
||||
});
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
"ora": "5.3.0",
|
||||
"tmp": "~0.2.1",
|
||||
"tslib": "^2.3.0",
|
||||
"yargs": "^17.4.0"
|
||||
"yargs": "^17.4.0",
|
||||
"axios": "0.21.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -7351,6 +7351,13 @@ axe-core@^4.3.5, axe-core@^4.4.3:
|
||||
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.3.tgz#11c74d23d5013c0fa5d183796729bc3482bd2f6f"
|
||||
integrity sha512-32+ub6kkdhhWick/UjvEwRchgoetXqTK14INLqbGm5U2TzBkBNF3nQtLYm8ovxSkQWArjEQvftCKryjZaATu3w==
|
||||
|
||||
axios@0.21.1:
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
|
||||
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
|
||||
dependencies:
|
||||
follow-redirects "^1.10.0"
|
||||
|
||||
axios@^0.21.1:
|
||||
version "0.21.4"
|
||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
|
||||
@ -11902,7 +11909,7 @@ flush-write-stream@^1.0.0:
|
||||
inherits "^2.0.3"
|
||||
readable-stream "^2.3.6"
|
||||
|
||||
follow-redirects@^1.0.0, follow-redirects@^1.14.0:
|
||||
follow-redirects@^1.0.0, follow-redirects@^1.10.0, follow-redirects@^1.14.0:
|
||||
version "1.15.1"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5"
|
||||
integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user