How to use the @statusfy/common.path.resolve 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 / nuxt.config.js View on Github external
const { path, postcss } = require("@statusfy/common");

const pkg = require("./package");

const langDir = "locales/";
const mainColor = "#000000";
const iconSizes = [16, 120, 144, 152, 192, 384, 512];
const modulesDir = [path.join(__dirname, "node_modules")];
const tailwindJS = path.resolve(__dirname, "tailwind.js");

// Hack: allow to execute using lerna/yarn workspaces on testing
if (process.env.STATUSFY_LERNA) {
  modulesDir.push(
    path.relative(
      __dirname,
      path.join(__dirname, "..", "..", "..", "node_modules")
    )
  );
}

/**
 * @type { import("@nuxt/types").Configuration }
 */
const config = {
  srcDir: path.join(__dirname, "./client/"),
github bazzite / statusfy / packages / @statusfy / core / client / modules / statusfy / index.js View on Github external
statusfyOptions.locales.forEach(locale => {
    const localePath = path.resolve(
      __dirname,
      "../../",
      statusfyOptions.langDir,
      `${locale.code}.js`
    );
    let defaultLocaleContent = {};
    let userLocaleContent = {};

    // Default locale
    const defaultLocalePath = path.resolve(
      __dirname,
      "../../",
      "locales",
      `${locale.code}-default.json`
    );
    if (fs.existsSync(defaultLocalePath)) {
      defaultLocaleContent = require(defaultLocalePath);
    }

    // User locale
    const userLocalePath = path.join(
      statusfyOptions.sourceDir,
      "locales",
      `${locale.code}.json`
    );
    if (fs.existsSync(userLocalePath)) {
github bazzite / statusfy / packages / website / nuxt.config.js View on Github external
extend(config, ctx) {
      // Run ESLint on save
      if (ctx.isDev && process.client) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }

      // Markdown
      config.module.rules.push({
        test: /\.md$/,
        loader: path.resolve(__dirname, './webpack/markdown-loader.js'),
        include: path.resolve(__dirname, './content'),
        options: {
          markdown
        }
      })
    },
    /*
github bazzite / statusfy / packages / website / nuxt.config.js View on Github external
extend(config, ctx) {
      // Run ESLint on save
      if (ctx.isDev && process.client) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }

      // Markdown
      config.module.rules.push({
        test: /\.md$/,
        loader: path.resolve(__dirname, './webpack/markdown-loader.js'),
        include: path.resolve(__dirname, './content'),
        options: {
          markdown
        }
      })
    },
    /*
github bazzite / statusfy / packages / @statusfy / cli / index.js View on Github external
console.log(chalk.red(`Please upgrade your Node version.`))

  process.exit(1)
}

const {
  init,
  dev,
  build,
  generate,
  start,
  newIncident,
  deleteIncident,
  updateIncident
} = require('@statusfy/core/lib')
const sourceDir = path.resolve('.')

program
  .version(pkg.version)
  .usage(' [options]')

program
  .command('init')
  .description('Create a base project')
  .option('-d, --dir ', 'specify the installation directory')
  .action(({ dir }) => {
    const outDir = dir ? path.resolve(dir) : null
    wrapCommand(init)(sourceDir, { outDir })
  })

program
  .command('dev')
github bazzite / statusfy / packages / demo / scripts / prepare.js View on Github external
const prepare = () => {
  generateDemoContent(
    path.resolve(__dirname, '../content'),
    new Date(),
    50
  )
}
github bazzite / statusfy / packages / docs / src / .vuepress / config.js View on Github external
chainWebpack (config) {
    config.resolve.alias.set('@assets', path.resolve(__dirname, 'public/assets'))
    config.resolve.alias.set('@public', path.resolve(__dirname, 'public'))
  },
  extendPageData($page) {
github bazzite / statusfy / packages / @statusfy / cli / index.js View on Github external
.action(({ dir }) => {
    const outDir = dir ? path.resolve(dir) : null
    wrapCommand(init)(sourceDir, { outDir })
  })
github bazzite / statusfy / packages / @statusfy / core / lib / utils / functions.js View on Github external
const getIncidentsFromProject = async contentDir => {
  const files = await fse.readdir(contentDir);
  const incidentsList = [];

  for (let i = 0; i < files.length; i++) {
    const f = path.resolve(contentDir, files[i]);
    const ext = path.extname(f);
    const fileName = path.basename(f);

    if (ext === ".md") {
      const fileContent = await fse.readFile(f);
      const { data } = grayMatter.parse(fileContent);

      incidentsList.push({
        value: {
          name: fileName,
          path: f
        },
        name: `${fileName} > ${chalk.yellow(data.title)} (${chalk.green(
          new Date(data.date).toUTCString()
        )})`
      });
github bazzite / statusfy / packages / @statusfy / cli / index.js View on Github external
.action(({ dest, analyze }) => {
    const outDir = dest ? path.resolve(dest) : null
    wrapCommand(generate)(sourceDir, { outDir, analyze })
  })