<commit_before>/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
/* eslint no-console: "off" */
/* eslint global-require: "off" */
/* eslint no-param-reassign: ["error", { "props": false }] */
const fsNative = require('fs');
const path = require('path');
const glob = require('glob');
const getOutput = require('./get-output.js');
const fs = require('./utils/fs-extra');

function base64Encode(file) {
  // read binary data
  const bitmap = fsNative.readFileSync(file);
  // convert binary data to base64 encoded string
  return Buffer.from(bitmap).toString('base64');
}

function build(cb) {
  const output = `${getOutput()}/core`;
  // components package.json
  const componentsFolders = fs.readdirSync('./src/core/components').filter((folder) => {
    return fsNative.lstatSync(`./src/core/components/${folder}`).isDirectory();
  });
  componentsFolders.forEach((component) => {
    const json = JSON.stringify(
      {
        name: `framework7/${component}`,
        private: true,
        sideEffects: false,
        main: `../../cjs/components/${component}/${component}.js`,
        module: `../../esm/components/${component}/${component}.js`,
        'jsnext:main': `../../esm/components/${component}/${component}.js`,
        typings: `../../types/components/${component}.d.ts`,
      },
      '',
      2,
    );
    fs.writeFileSync(`${output}/components/${component}/package.json`, json);
  });

  // modules package.json
  const modulesFolders = fs.readdirSync('./src/core/modules').filter((folder) => {
    return fsNative.lstatSync(`./src/core/modules/${folder}`).isDirectory();
  });
  modulesFolders.forEach((moduleName) => {
    const json = JSON.stringify(
      {
        name: `framework7/${moduleName}`,
        private: true,
        sideEffects: false,
        main: `../../cjs/modules/${moduleName}/${moduleName}.js`,
        module: `../../esm/modules/${moduleName}/${moduleName}.js`,
        'jsnext:main': `../../esm/modules/${moduleName}/${moduleName}.js`,
        typings: `../../types/modules/${moduleName}.d.ts`,
      },
      '',<commit_msg>add module/component directory to typings path in package.json files<commit_after>/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
/* eslint no-console: "off" */
/* eslint global-require: "off" */
/* eslint no-param-reassign: ["error", { "props": false }] */
const fsNative = require('fs');
const path = require('path');
const glob = require('glob');
const getOutput = require('./get-output.js');
const fs = require('./utils/fs-extra');

function base64Encode(file) {
  // read binary data
  const bitmap = fsNative.readFileSync(file);
  // convert binary data to base64 encoded string
  return Buffer.from(bitmap).toString('base64');
}

function build(cb) {
  const output = `${getOutput()}/core`;
  // components package.json
  const componentsFolders = fs.readdirSync('./src/core/components').filter((folder) => {
    return fsNative.lstatSync(`./src/core/components/${folder}`).isDirectory();
  });
  componentsFolders.forEach((component) => {
    const json = JSON.stringify(
      {
        name: `framework7/${component}`,
        private: true,
        sideEffects: false,
        main: `../../cjs/components/${component}/${component}.js`,
        module: `../../esm/components/${component}/${component}.js`,
        'jsnext:main': `../../esm/components/${component}/${component}.js`,
        typings: `../../types/components/${component}/${component}.d.ts`,
      },
      '',
      2,
    );
    fs.writeFileSync(`${output}/components/${component}/package.json`, json);
  });

  // modules package.json
  const modulesFolders = fs.readdirSync('./src/core/modules').filter((folder) => {
    return fsNative.lstatSync(`./src/core/modules/${folder}`).isDirectory();
  });
  modulesFolders.forEach((moduleName) => {
    const json = JSON.stringify(
      {
        name: `framework7/${moduleName}`,
        private: true,
        sideEffects: false,
        main: `../../cjs/modules/${moduleName}/${moduleName}.js`,
        module: `../../esm/modules/${moduleName}/${moduleName}.js`,
        'jsnext:main': `../../esm/modules/${moduleName}/${moduleName}.js`,
        typings: `../../types/modules/${moduleName}/${moduleName}.d.ts`,
      },
      '',
{'fraction_non_alphanumeric': 0.2096699209669921, 'fraction_numerical': 0.0041841004184100415, 'mean_word_length': 3.133525456292027, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 11, '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': '5086980', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1304, 'n_words': 222}