<commit_before>// import { run } from '@cycle/most-run'
import { run } from '@cycle/xstream-run'
import { makeDOMDriver, div } from '@cycle/dom'
import { html } from 'snabbdom-jsx'
// import { of, combine, merge, periodic, combineArray } from 'most'
import xs from 'xstream'
const {merge} = xs

import {getTranslations} from './utils/getTranslations'
import {fromMost, mergeReducers} from './utils/cycle'
import onionify from 'cycle-onionify'

import windowApiDriver from './sideEffects/windowApiDriver'
import addressBarDriver from './sideEffects/addressBarDriver'
import appMetadataDriver from './sideEffects/appMetadataDriver'

import App from './ui/App'

function main (sources) {
  // initial state
  const init = () => ({
    print: {
      settings: {
        support: {toggled: true},
        brim: {toggled: true},
        qualityPreset: undefined,
        supportExtruder: -1
      },
      status: 'n/a',
      running: false,
      paused: false
    },
    printers: [
      /* {id: 'dsqdq', name: 'fba', infos: {type: 'ultimaker3'}} */
    ],
    settings: {
      printersPollRate: 10000, // how often to update the camera
      cameraPollRate: 5000 // how often to update the camera
    },
    buildplate: {
      entities: [],
      settings: {
        snapTranslation: false,
        snapRotation: false,
        snapScaling: false,
        uniformScaling: false
      },
      activeTool: -1,
      selections: {
        instIds: []
      }
    },

    // ui related
    steps: [{name: 'Printer Setup'}, {name: 'Material Setup'}, {name: 'Monitor Print'}, {name: 'Print Settings'}],
    currentStep: 0,
    activePrinterId: undefined,

    image: undefined,
    t: x => ''// stand in
  })

  const translations$ = fromMost(getTranslations({en: {translation: require('../assets/i18n/en/strings.json')}}))

  // sub components
  const app = App(sources)

  const setTranslationsReducer$ = translations$.map(t => state => ({...state, t}))
  const state$ = sources.onion.state$

  const reducer$ = merge(
    setTranslationsReducer$,
    mergeReducers(init, [app])
  )

  // const vdom$ = app.DOM.map(app => app)

  return {
    DOM: app.DOM,
    onion: reducer$
  }
}

const wrappedMain = onionify(main)
<commit_msg>chore(data): modified data structure<commit_after>// import { run } from '@cycle/most-run'
import { run } from '@cycle/xstream-run'
import { makeDOMDriver, div } from '@cycle/dom'
import { html } from 'snabbdom-jsx'
// import { of, combine, merge, periodic, combineArray } from 'most'
import xs from 'xstream'
const {merge} = xs

import {getTranslations} from './utils/getTranslations'
import {fromMost, mergeReducers} from './utils/cycle'
import onionify from 'cycle-onionify'

import windowApiDriver from './sideEffects/windowApiDriver'
import addressBarDriver from './sideEffects/addressBarDriver'
import appMetadataDriver from './sideEffects/appMetadataDriver'

import App from './ui/App'

function main (sources) {
  // initial state
  const init = () => ({
    print: {
      settings: {
        support: {toggled: true},
        brim: {toggled: true},
        qualityPreset: undefined,
        supportExtruder: -1
      },
      status: 'n/a',
      running: false,
      paused: false
    },
    printers: [
      /* {id: 'dsqdq', name: 'fba', infos: {type: 'ultimaker3'}} */
    ],
    printersStatus: undefined,
    activePrinterId: undefined,
    printerStatus: 'fetching printer data , please wait...',

    buildplate: {
      entities: [],
      settings: {
        snapTranslation: false,
        snapRotation: false,
        snapScaling: false,
        uniformScaling: false
      },
      activeTool: -1,
      selections: {
        instIds: []
      }
    },

    settings: {
      printersPollRate: 10000, // how often to update the camera
      cameraPollRate: 10000 // how often to update the camera
    },

    // ui related
    steps: [{name: 'Printer Setup'}, {name: 'Material Setup'}, {name: 'Monitor Print'}, {name: 'Print Settings'}],
    currentStep: 0,

    image: undefined,
    t: x => ''// stand in
  })

  const translations$ = fromMost(getTranslations({en: {translation: require('../assets/i18n/en/strings.json')}}))

  // sub components
  const app = App(sources)

  const setTranslationsReducer$ = translations$.map(t => state => ({...state, t}))
  const state$ = sources.onion.state$

  const reducer$ = merge(
    setTranslationsReducer$,
    mergeReducers(init, [app])
  )

  // const vdom$ = app.DOM.map(app => app)

  return {
    DOM: app.DOM,
    onion: reducer$
  }
}

const wrappedMain = onionify(main)

{'fraction_non_alphanumeric': 0.14089121887287026, 'fraction_numerical': 0.006771515945827872, 'mean_word_length': 2.8739424703891707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '2039588', 'n_tokens_mistral': 1492, 'n_tokens_neox': 1433, 'n_words': 389}