How to use the @statusfy/common.logger.success function in @statusfy/common

To help you get started, we’ve selected a few @statusfy/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bazzite / statusfy / packages / @statusfy / core / lib / init.js View on Github external
name: config.name,
            description: config.description,
            statusfyVersion: pkg.version
          }
        })
      ),
      { spaces: "  " }
    );

    // .gitignore
    fse.copySync(
      path.join(__dirname, "init", "_gitignore"),
      path.join(outDir, ".gitignore")
    );

    logger.success(
      `A new project of Statusfy was successfully created at ${chalk.cyan(
        outDir
      )}`
    );
    logger.warn(
      `Remember to run ${chalk.cyan(`${answers.packageManager} install`)}`
    );
  });
};
github bazzite / statusfy / packages / @statusfy / core / client / modules / statusfy / index.js View on Github external
const lang = locale.code;
        const calPath = path.join(
          this.options.generate.dir,
          "calendars",
          `scheduled.${locale.code}.ics`
        );

        const content = await createCalendar(statusfyOptions.siteConfig, lang);

        // Ensure no calendar file exists
        await fse.remove(calPath);
        await fse.ensureFile(calPath);

        await fse.writeFile(calPath, content);

        logger.success(`Generated /calendars/scheduled.${locale.code}.ics`);
      }
    }
  });
};
github bazzite / statusfy / packages / @statusfy / core / client / modules / statusfy / index.js View on Github external
await copyPublicFiles(
      statusfyOptions.publicFilesPath,
      this.options.generate.dir
    );

    /* Sitemap */
    const sitemap = await createSitemap(statusfyOptions.siteConfig);
    const xmlPath = path.join(this.options.generate.dir, "sitemap.xml");

    // Ensure no sitemap file exists
    await fse.remove(xmlPath);
    await fse.ensureFile(xmlPath);

    await fse.writeFile(xmlPath, sitemap);

    logger.success("Generated /sitemap.xml");

    /* Feeds */
    if (
      statusfyOptions.siteConfig.notifications &&
      statusfyOptions.siteConfig.notifications.feeds
    ) {
      // eslint-disable-next-line no-unused-vars
      for (const locale of statusfyOptions.locales) {
        const feeds = await createFeeds(
          statusfyOptions.siteConfig,
          locale.code
        );

        const rssPath = path.join(
          this.options.generate.dir,
          "feeds",
github bazzite / statusfy / packages / @statusfy / core / lib / delete-incident.js View on Github external
deletedFiles.push(localeIncidentPath);
            } catch (error) {
              logger.error(error);
            }
          } else {
            logger.warn(`This file couldn't be found:\n${localeIncidentPath}`);
          }
        }

        if (deletedFiles.length > 0) {
          const prefix =
            deletedFiles.length === 1
              ? "This file was successfully deleted"
              : "These files were successfully deleted";

          logger.success(`${prefix}: \n${deletedFiles.join("\n")}`);
        }
      }
    } catch (error) {
      logger.fatal(error);
    }
  });
};
github bazzite / statusfy / packages / @statusfy / core / lib / new-incident.js View on Github external
} else {
          fse.outputFileSync(
            filePath,
            `${content}\n\n`
          );

          createdFiles.push(path.relative(contentPath, filePath));

          if (answers.open) {
            opener(filePath);
          }
        }
      });

      if (!error) {
        logger.success(
          `The Incident was successfully created.\n${createdFiles.join("\n")}`
        );
      } else {
        logger.warn("There was an issue in creating the Incident.");
      }
    } catch (error) {
      logger.fatal(error);
    }
  });
};
github bazzite / statusfy / packages / @statusfy / core / lib / update-incident.js View on Github external
updatedFiles.push(localeIncidentPath);
            } catch (error) {
              logger.error(error);
            }
          } else {
            logger.warn(`This file couldn't be found:\n${localeIncidentPath}`);
          }
        }

        if (updatedFiles.length > 0) {
          const prefix =
            updatedFiles.length === 1
              ? "This file was successfully updated"
              : "These files were successfully updated";

          logger.success(`${prefix}: \n${updatedFiles.join("\n")}`);
        }
      }
    } catch (error) {
      logger.fatal(error);
    }
  });
};