create-payload-app 0.3.14 → 0.3.15-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/bin/cli.js +0 -0
  2. package/dist/index.js +14 -26
  3. package/dist/lib/common-files/README.template.md +9 -0
  4. package/dist/lib/common-files/docker-compose.template.yml +35 -0
  5. package/dist/{templates → lib/common-files}/gitignore.template +0 -0
  6. package/dist/{templates/js-blank → lib/common-files/javascript}/nodemon.json +0 -0
  7. package/dist/{templates/js-blank/package.json → lib/common-files/javascript/package.template.json} +3 -3
  8. package/dist/{templates → lib/common-files}/npmrc.template +0 -0
  9. package/dist/{templates/ts-blank → lib/common-files/typescript}/nodemon.json +0 -0
  10. package/dist/{templates/ts-blank/package.json → lib/common-files/typescript/package.template.json} +4 -4
  11. package/dist/{templates/ts-blank → lib/common-files/typescript}/tsconfig.json +0 -0
  12. package/dist/lib/{createProject.js → create-project.js} +25 -26
  13. package/dist/lib/{createProject.test.js → create-project.test.js} +36 -6
  14. package/dist/lib/{generateSecret.js → generate-secret.js} +0 -0
  15. package/dist/lib/{getDatabaseConnection.js → get-db-connection.js} +0 -0
  16. package/dist/lib/{parseLanguage.js → parse-language.js} +0 -0
  17. package/dist/lib/{parseProjectName.js → parse-project-name.js} +0 -0
  18. package/dist/lib/{parseTemplate.js → parse-template.js} +1 -4
  19. package/dist/lib/templates.js +6 -2
  20. package/dist/lib/write-common-files.js +118 -0
  21. package/dist/lib/{writeEnvFile.js → write-env-file.js} +0 -0
  22. package/dist/main.js +40 -45
  23. package/dist/utils/log.js +3 -3
  24. package/dist/utils/messages.js +1 -1
  25. package/package.json +22 -7
  26. package/dist/lib/constants.js +0 -4
  27. package/dist/lib/getPackageManager.js +0 -69
  28. package/dist/lib/getPayloadSecret.js +0 -69
  29. package/dist/lib/getPayloadVersion.js +0 -75
  30. package/dist/templates/js-blog/nodemon.json +0 -3
  31. package/dist/templates/js-blog/package.json +0 -20
  32. package/dist/templates/js-todo/nodemon.json +0 -3
  33. package/dist/templates/js-todo/package.json +0 -20
  34. package/dist/templates/ts-blog/nodemon.json +0 -4
  35. package/dist/templates/ts-blog/package.json +0 -30
  36. package/dist/templates/ts-blog/tsconfig.json +0 -28
  37. package/dist/templates/ts-todo/nodemon.json +0 -4
  38. package/dist/templates/ts-todo/package.json +0 -30
  39. package/dist/templates/ts-todo/tsconfig.json +0 -28
  40. package/dist/utils/telemetry.js +0 -44
  41. package/dist/utils/usage.js +0 -67
@@ -1,28 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": [
5
- "dom",
6
- "dom.iterable",
7
- "esnext"
8
- ],
9
- "allowJs": true,
10
- "strict": false,
11
- "esModuleInterop": true,
12
- "skipLibCheck": true,
13
- "outDir": "./dist",
14
- "rootDir": "./src",
15
- "jsx": "react"
16
- },
17
- "include": [
18
- "src"
19
- ],
20
- "exclude": [
21
- "node_modules",
22
- "dist",
23
- "build",
24
- ],
25
- "ts-node": {
26
- "transpileOnly": true
27
- }
28
- }
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.sendAnonymousAnalytics = void 0;
7
- var analytics_node_1 = __importDefault(require("analytics-node"));
8
- var crypto_1 = require("crypto");
9
- var os_1 = __importDefault(require("os"));
10
- var constants_1 = require("../lib/constants");
11
- var analytics = new analytics_node_1.default(constants_1.SEGMENT_WRITE_KEY, { flushAt: 1 });
12
- var userId;
13
- function sendAnonymousAnalytics(meta) {
14
- try {
15
- var projectDir = meta.projectDir, template = meta.template, packageManager = meta.packageManager;
16
- userId = userId !== null && userId !== void 0 ? userId : oneWayHash(projectDir);
17
- analytics.track({
18
- userId: userId,
19
- event: 'ProjectInitiated',
20
- properties: {
21
- systemPlatform: os_1.default.platform(),
22
- systemRelease: os_1.default.release(),
23
- systemArchitecture: os_1.default.arch(),
24
- nodeVersion: process.version,
25
- nodeEnv: process.env.NODE_ENV,
26
- template: template,
27
- packageManager: packageManager,
28
- },
29
- });
30
- }
31
- catch (error) {
32
- // Eat any errors
33
- }
34
- }
35
- exports.sendAnonymousAnalytics = sendAnonymousAnalytics;
36
- /** Hash values one-way to ensure anonymity */
37
- function oneWayHash(payload) {
38
- var hash = (0, crypto_1.createHash)('sha256');
39
- // Prepend salt to ensure truly one-way hashing.
40
- hash.update((0, crypto_1.randomBytes)(16).toString('hex'));
41
- // This appends the payload to the hash. The salt is from prior update still present!
42
- hash.update(payload);
43
- return hash.digest('hex');
44
- }
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.handleException = exports.setTags = exports.init = void 0;
41
- var Sentry = __importStar(require("@sentry/node"));
42
- var os_1 = __importDefault(require("os"));
43
- var init = function () {
44
- Sentry.init({
45
- dsn: 'https://139de3d0197f464082d5715a0c48a497@o589961.ingest.sentry.io/5739829',
46
- tracesSampleRate: 1.0,
47
- });
48
- Sentry.setTags({
49
- os_type: os_1.default.type(),
50
- os_platform: os_1.default.platform(),
51
- os_release: os_1.default.release(),
52
- node_version: process.version,
53
- });
54
- return Sentry.startTransaction({
55
- op: 'create-payload-app',
56
- name: 'New Project',
57
- });
58
- };
59
- exports.init = init;
60
- var setTags = function (tags) {
61
- Sentry.setTags(__assign({}, tags));
62
- };
63
- exports.setTags = setTags;
64
- var handleException = function (e) {
65
- Sentry.captureException(e);
66
- };
67
- exports.handleException = handleException;