<commit_before>// npm
const fs =      Plugin.fs
const path =    Plugin.path
const less =    Npm.require('less')
const Future =  Npm.require('fibers/future')


// Paths and filenames
const assetsPath =        path.join('assets')
const defaultsPath =      path.join(assetsPath, 'defaults')
const lessPath =          path.join(assetsPath, 'bootstrap', 'less')
const jsPath =            path.join(assetsPath, 'bootstrap', 'js')
const fontsUrl =          'packages/huttonr_bootstrap3-assets/assets/bootstrap/fonts/'

const jsLoadFirst = [ // Specifies which js modules should be loaded first due to other js modules depending on them
  'tooltip.js'
]

const bootstrapSettings =   'bootstrap-settings.json'
const bootstrapVariables =  'bootstrap-variables.less'
const bootstrapMixins =     'bootstrap-mixins.less'

const variablesFilesInstruction =
`// These are custom bootstrap variables for you to edit.
// These simply override any default bootstrap variables.
// This means that you may delete anything in this file
// and the default bootstrap values will be used instead.
`

const mixinFilesInstruction =
`// Editing these mixins will not edit the mixins used by the core bootstrap modules.
// They are exposed here for your use and convenience.
// They can be imported using @import "path/to/${ bootstrapMixins }"

`




const getAsset = _bootstrapGetAsset
const getJsFilenames = _bootstrapGetJsList



// Register the compiler for the bootstrap-settings json file
Plugin.registerCompiler({
  extensions: [],
  filenames: [bootstrapSettings/*, bootstrapVariables, bootstrapMixins*/]
}, () => new BootstrapCompiler)


// BootstrapCompiler class
class BootstrapCompiler {
  // Actual processing of file (bootstrap-settings json)
  processFilesForTarget(filesFound) {
    let settingsFile

    // Loop through and find the settings file
    for (let file of filesFound) {
      let fn = path.basename(file.getDisplayPath())
      if (fn === bootstrapSettings) {
        if (settingsFile)
          throw new Error('You cannot have more than one ' + bootstrapSettings + ' in your Meteor project.')

        settingsFile = file
      }
    }

    if (settingsFile) {
      // (1) Get the bootstrap-settings json

      // Flag the settings file as being present so a warning isn't displayed later
      settingsFile.addJavaScript({
        data: 'this._bootstrapSettingsFileLoaded = true;\n',
        path: path.join('client', 'lib', 'settings-file-checked.generated.js')
      })


      // Get the settings file dir
      const settingsPathDir = path.dirname(path.join('.', settingsFile.getDisplayPath()))


      // Get the settings data
      const settingsContents = settingsFile.getContentsAsString()
      let settings
      if (settingsContents.trim()) {
        settings = JSON.parse(settingsContents)
      }
      else {<commit_msg>fixed leading slash path error on Windows.<commit_after>// npm
const fs =      Plugin.fs
const path =    Plugin.path
const less =    Npm.require('less')
const Future =  Npm.require('fibers/future')


// Paths and filenames
const assetsPath =        path.join('assets')
const defaultsPath =      path.join(assetsPath, 'defaults')
const lessPath =          path.join(assetsPath, 'bootstrap', 'less')
const jsPath =            path.join(assetsPath, 'bootstrap', 'js')
const fontsUrl =          'packages/huttonr_bootstrap3-assets/assets/bootstrap/fonts/'

const jsLoadFirst = [ // Specifies which js modules should be loaded first due to other js modules depending on them
  'tooltip.js'
]

const bootstrapSettings =   'bootstrap-settings.json'
const bootstrapVariables =  'bootstrap-variables.less'
const bootstrapMixins =     'bootstrap-mixins.less'

const variablesFilesInstruction =
`// These are custom bootstrap variables for you to edit.
// These simply override any default bootstrap variables.
// This means that you may delete anything in this file
// and the default bootstrap values will be used instead.
`

const mixinFilesInstruction =
`// Editing these mixins will not edit the mixins used by the core bootstrap modules.
// They are exposed here for your use and convenience.
// They can be imported using @import "path/to/${ bootstrapMixins }"

`




const getAsset = _bootstrapGetAsset
const getJsFilenames = _bootstrapGetJsList



// Register the compiler for the bootstrap-settings json file
Plugin.registerCompiler({
  extensions: [],
  filenames: [bootstrapSettings/*, bootstrapVariables, bootstrapMixins*/]
}, () => new BootstrapCompiler)


// BootstrapCompiler class
class BootstrapCompiler {
  // Actual processing of file (bootstrap-settings json)
  processFilesForTarget(filesFound) {
    let settingsFile

    // Loop through and find the settings file
    for (let file of filesFound) {
      let fn = path.basename(path.join('.', file.getDisplayPath()))
      if (fn === bootstrapSettings) {
        if (settingsFile)
          throw new Error('You cannot have more than one ' + bootstrapSettings + ' in your Meteor project.')

        settingsFile = file
      }
    }

    if (settingsFile) {
      // (1) Get the bootstrap-settings json

      // Flag the settings file as being present so a warning isn't displayed later
      settingsFile.addJavaScript({
        data: 'this._bootstrapSettingsFileLoaded = true;\n',
        path: path.join('client', 'lib', 'settings-file-checked.generated.js')
      })


      // Get the settings file dir
      const settingsPathDir = path.dirname(path.join('.', settingsFile.getDisplayPath()))


      // Get the settings data
      const settingsContents = settingsFile.getContentsAsString()
      let settings
      if (settingsContents.trim()) {
        settings = JSON.parse(settingsContents)
      }
      else {
{'fraction_non_alphanumeric': 0.09467248908296944, 'fraction_numerical': 0.0006986899563318777, 'mean_word_length': 3.282722513089005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '617989', 'n_tokens_mistral': 1549, 'n_tokens_neox': 1471, 'n_words': 521}