<commit_before>const grunt = require("grunt");

function uniq(names) {
    return [...new Set(names)];
}

function sync(patterns) {
    return uniq(grunt.file.expand({ filter: path => !new RegExp(/__test__/g).test(path) }, patterns)).map(name => `./${name}`);
}

const fixJs = "./dist/fix/fix.js";
const fixProxyJs = './dist/fix/fix.proxy.js';
const fixCompact = "./dist/fix/fix.compact.js";
const workerCompact = './dist/fix/worker.compact.js';
const lodashJs = "src/core/1.lodash.js";

const basicAttachmentMap = {
    polyfill: sync(["src/core/0.foundation.js", "src/polyfill/**/*.js"]).concat(["@babel/polyfill", "es6-promise/auto"]),
    core: sync([
        "src/less/core/**/*.less",
        "src/less/theme/**/*.less",
        lodashJs,
        "src/core/**/*.js",
        "src/data/**/*.js",
    ]),
    // 最基础的控件
    base: sync([
        "src/less/base/**/*.less",
        "src/third/**/*.js",
        "src/base/**/*.js",
    ]),
    // 实现好的一些基础实例
    case: sync([
        "src/case/**/*.js",
    ]),
    widget: sync([
        "src/less/widget/**/*.less",
        "src/widget/**/*.js",
        "src/component/**/*.js",
    ]),
    router: sync([
        "src/router/**/*.js",
    ]),
    'core_without_normalize': sync(
        ["src/less/core/**/*.less", "src/less/theme/**/*.less", "!src/less/core/normalize.less", "!src/less/core/normalize2.less"],
    ),
    resource: sync(["src/less/resource/**/*.less"]),
    font: sync(["public/less/font.less"]),
    ts: ['./typescript/bundle.ts'],
    ui: sync([
        'ui/less/app.less',
        'ui/less/**/*.less',
        'ui/js/**/*.js',
    ]),
    config: sync(["demo/version.js", "i18n/i18n.cn.js"]),
    utils: sync([
        "src/core/0.foundation.js",
        lodashJs,
        "src/core/constant/**/*.js",
        "src/core/func/**/*.js",
        "src/core/2.base.js",
        "src/core/3.ob.js",
        "src/core/6.inject.js",
        "src/core/utils/*.js",
        "i18n/i18n.cn.js",
        "_mobile/date.i18n.cn.js",
        "src/data/**/*.js",
    ]),
    fix: [fixJs],
    fixProxy: [fixProxyJs],
};

const bundle = [].concat(
    basicAttachmentMap.polyfill,
    basicAttachmentMap.core,
    basicAttachmentMap.fix,
    basicAttachmentMap.base,
    basicAttachmentMap.case,
    basicAttachmentMap.widget,
    sync(["public/less/app.less", "public/less/**/*.less"]),
    [fixCompact, workerCompact],
    basicAttachmentMap.router,
    sync(["public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"]),
    basicAttachmentMap.ts,
);

const bundleModern = [].concat(
    sync(["src/less/modern.less"]),
    sync(["public/modern/app.less", "public/modern/**/*.less"]),
);

const coreJs = [].concat(
    basicAttachmentMap.polyfill,
    basicAttachmentMap.core,
    basicAttachmentMap.fix,
    basicAttachmentMap.base,
    basicAttachmentMap.case,
    basicAttachmentMap.widget,
    ['./dist/fix/fix.compact.js'],
    basicAttachmentMap.router,
    basicAttachmentMap.ts,
);

const resource = sync(["private/less/app.less", "private/less/**/*.less"]);

const config = sync(["public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"]);

const bundleWithoutNormalize = [].concat(
    basicAttachmentMap.core_without_normalize,
    sync([
        "src/less/base/**/*.less",
        "src/less/widget/**/*.less",
        "public/less/**/*.less",
        "!public/less/app.less",
        // ts的less
    ]),
);

const fineuiWithoutNormalize = [].concat(
    basicAttachmentMap.core_without_normalize,
    sync([
        "src/less/base/**/*.less",
        "src/less/widget/**/*.less",
        'ui/less/app.less',
        'ui/less/**/*.less',
    ]),
);

const fineui = [].concat(
    basicAttachmentMap.polyfill,
    basicAttachmentMap.core,
    basicAttachmentMap.fix,
    basicAttachmentMap.base,
    basicAttachmentMap.case,
    basicAttachmentMap.widget,
    basicAttachmentMap.router,
    [fixCompact, workerCompact],
    basicAttachmentMap.ui,
    basicAttachmentMap.ts,
);

const fineuiModern = [].concat(
    sync(["src/less/modern.less"]),
    sync([
        'ui/modern/app.less',
        'ui/modern/**/*.less',
    ]),
);

const fineuiProxy = [].concat(
    basicAttachmentMap.core,
    basicAttachmentMap.fixProxy,
    basicAttachmentMap.base,
    basicAttachmentMap.case,
    basicAttachmentMap.widget,
    basicAttachmentMap.router,
    [fixCompact, workerCompact],
    basicAttachmentMap.ui,
    basicAttachmentMap.ts,
);

const fineuiWithoutJqueryAndPolyfillJs = [].concat(
    sync([
        "src/core/foundation.js",
        lodashJs,
        "src/core/**/*.js",
        "src/data/**/*.js",
        "!src/core/platform/web/**/*.js",
    ]),
    basicAttachmentMap.fix,
    sync([
        "src/base/**/*.js",
        "src/case/**/*.js",

        "!src/base/single/input/file.js",
        "!src/case/ztree/**/*.js",
    ]),
    basicAttachmentMap.widget,
    sync([fixCompact, workerCompact, "ui/js/**/*.js"]),
    basicAttachmentMap.ts,
);

const demo = [].concat(
    basicAttachmentMap.polyfill,
    basicAttachmentMap.core,
    basicAttachmentMap.router,
    basicAttachmentMap.fix,
    basicAttachmentMap.base,
    basicAttachmentMap.case,
    basicAttachmentMap.widget,
    sync(["public/less/app.less", "public/less/**/*.less"]),
    [fixCompact, workerCompact],
    basicAttachmentMap.config,
    basicAttachmentMap.ts,
    sync(["demo/less/*.less", "demo/less/**/*.less", "demo/app.js", "demo/js/**/*.js", "demo/config.js"]),
);

module.exports = {
    fix: fixJs,
    fixProxy: fixProxyJs,
    lodash: lodashJs,
    font: basicAttachmentMap.font,
    bundle: uniq(bundle),
    bundleModern: uniq(bundleModern),
    fineuiWithoutNormalize: uniq(fineuiWithoutNormalize),
    bundleWithoutNormalize: uniq(bundleWithoutNormalize),
    fineui: uniq(fineui),
    fineuiModern: uniq(fineuiModern),
    fineuiProxy: uniq(fineuiProxy),
    fineuiWithoutJqueryAndPolyfillJs: uniq(fineuiWithoutJqueryAndPolyfillJs),
    utils: uniq(basicAttachmentMap.utils),
    demo: uniq(demo),
    coreJs: uniq(coreJs),
    resource: uniq((resource)),
    config: uniq(config),
};
<commit_msg>Pull request #2259: 无JIRA任务 优化<commit_after>const grunt = require("grunt");

function uniq(names) {
    return [...new Set(names)];
}

function sync(patterns) {
    return uniq(grunt.file.expand({ filter: path => !new RegExp(/__test__/g).test(path) }, patterns)).map(name => `./${name}`);
}

const fixJs = "./dist/fix/fix.js";
const fixProxyJs = './dist/fix/fix.proxy.js';
const fixCompact = "./dist/fix/fix.compact.js";
const workerCompact = './dist/fix/worker.compact.js';
const lodashJs = "src/core/1.lodash.js";

const basicAttachmentMap = {
    polyfill: sync(["src/core/0.foundation.js", "src/polyfill/**/*.js"]).concat(["@babel/polyfill", "es6-promise/auto"]),
    core: sync([
        "src/less/core/**/*.less",
        "src/less/theme/**/*.less",
        lodashJs,
        "src/core/**/*.js",
        "src/data/**/*.js",
    ]),
    // 最基础的控件
    base: sync([
        "src/less/base/**/*.less",
        "src/third/**/*.js",
        "src/base/**/*.js",
    ]),
    // 实现好的一些基础实例
    case: sync([
        "src/case/**/*.js",
    ]),
    widget: sync([
        "src/less/widget/**/*.less",
        "src/widget/**/*.js",
        "src/component/**/*.js",
    ]),
    router: sync([
        "src/router/**/*.js",
    ]),
    'core_without_normalize': sync(
        ["src/less/core/**/*.less", "src/less/theme/**/*.less", "!src/less/core/normalize.less", "!src/less/core/normalize2.less"],
    ),
    resource: sync(["src/less/resource/**/*.less"]),
    font: sync(["public/less/font.less"]),
    ts: ['./typescript/bundle.ts'],
    ui: sync([
        'ui/less/app.less',
        'ui/less/**/*.less',
        'ui/js/**/*.js',
    ]),
    config: sync(["demo/version.js", "i18n/i18n.cn.js"]),
    utils: sync([
        "src/core/0.foundation.js",
        lodashJs,
        "src/core/constant/**/*.js",
        "src/core/func/**/*.js",
        "src/core/2.base.js",
        "src/core/3.ob.js",
        "src/core/6.inject.js",
        "src/core/utils/*.js",
        "i18n/i18n.cn.js",
        "_mobile/date.i18n.cn.js",
        "src/data/**/*.js",
    ]),
    fix: [fixJs],
    fixProxy: [fixProxyJs],
};

const bundle = [].concat(
    basicAttachmentMap.polyfill,
    basicAttachmentMap.core,
    basicAttachmentMap.fix,
    basicAttachmentMap.base,
    basicAttachmentMap.case,
    basicAttachmentMap.widget,
    sync(["public/less/app.less", "public/less/**/*.less"]),
    [fixCompact, workerCompact],
    basicAttachmentMap.router,
    sync(["public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"]),
    basicAttachmentMap.ts,
);

const bundleModern = [].concat(
    sync(["src/less/modern.less"]),
    sync(["public/modern/app.less", "public/modern/**/*.less"]),
);

const coreJs = [].concat(
    basicAttachmentMap.polyfill,
    basicAttachmentMap.core,
    basicAttachmentMap.fix,
    basicAttachmentMap.base,
    basicAttachmentMap.case,
    basicAttachmentMap.widget,
    ['./dist/fix/fix.compact.js'],
    basicAttachmentMap.router,
    basicAttachmentMap.ts,
);

const resource = sync(["private/less/app.less", "private/less/**/*.less"]);

const config = sync(["public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"]);

const bundleWithoutNormalize = [].concat(
    basicAttachmentMap.core_without_normalize,
    sync([
        "src/less/base/**/*.less",
        "src/less/widget/**/*.less",
        "public/less/**/*.less",
        "!public/less/app.less",
        // ts的less
    ]),
);

const fineuiWithoutNormalize = [].concat(
    basicAttachmentMap.core_without_normalize,
    sync([
        "src/less/base/**/*.less",
        "src/less/widget/**/*.less",
        'ui/less/app.less',
        'ui/less/**/*.less',
    ]),
);

const fineui = [].concat(
    basicAttachmentMap.polyfill,
    basicAttachmentMap.core,
    basicAttachmentMap.fix,
    basicAttachmentMap.base,
    basicAttachmentMap.case,
    basicAttachmentMap.widget,
    basicAttachmentMap.router,
    [fixCompact, workerCompact],
    basicAttachmentMap.ui,
    basicAttachmentMap.ts,
);

const fineuiModern = [].concat(
    sync(["src/less/modern.less"]),
    sync([
        'ui/modern/app.less',
        'ui/modern/**/*.less',
    ]),
);

const fineuiProxy = [].concat(
    basicAttachmentMap.core,
    basicAttachmentMap.fixProxy,
    basicAttachmentMap.base,
    basicAttachmentMap.case,
    basicAttachmentMap.widget,
    basicAttachmentMap.router,
    [fixCompact, workerCompact],
    basicAttachmentMap.ui,
    basicAttachmentMap.ts,
);

const fineuiWithoutJqueryAndPolyfillJs = [].concat(
    sync([
        "src/core/0.foundation.js",
        lodashJs,
        "src/core/**/*.js",
        "src/data/**/*.js",
        "!src/core/platform/web/**/*.js",
    ]),
    basicAttachmentMap.fix,
    sync([
        "src/base/**/*.js",
        "src/case/**/*.js",

        "!src/base/single/input/file.js",
        "!src/case/ztree/**/*.js",
    ]),
    basicAttachmentMap.widget,
    sync([fixCompact, workerCompact, "ui/js/**/*.js"]),
    basicAttachmentMap.ts,
);

const demo = [].concat(
    basicAttachmentMap.polyfill,
    basicAttachmentMap.core,
    basicAttachmentMap.router,
    basicAttachmentMap.fix,
    basicAttachmentMap.base,
    basicAttachmentMap.case,
    basicAttachmentMap.widget,
    sync(["public/less/app.less", "public/less/**/*.less"]),
    [fixCompact, workerCompact],
    basicAttachmentMap.config,
    basicAttachmentMap.ts,
    sync(["demo/less/*.less", "demo/less/**/*.less", "demo/app.js", "demo/js/**/*.js", "demo/config.js"]),
);

module.exports = {
    fix: fixJs,
    fixProxy: fixProxyJs,
    lodash: lodashJs,
    font: basicAttachmentMap.font,
    bundle: uniq(bundle),
    bundleModern: uniq(bundleModern),
    fineuiWithoutNormalize: uniq(fineuiWithoutNormalize),
    bundleWithoutNormalize: uniq(bundleWithoutNormalize),
    fineui: uniq(fineui),
    fineuiModern: uniq(fineuiModern),
    fineuiProxy: uniq(fineuiProxy),
    fineuiWithoutJqueryAndPolyfillJs: uniq(fineuiWithoutJqueryAndPolyfillJs),
    utils: uniq(basicAttachmentMap.utils),
    demo: uniq(demo),
    coreJs: uniq(coreJs),
    resource: uniq((resource)),
    config: uniq(config),
};

{'fraction_non_alphanumeric': 0.1983532317826266, 'fraction_numerical': 0.0046932894195142036, 'mean_word_length': 2.7885215221459765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7021817', 'n_tokens_mistral': 4357, 'n_tokens_neox': 4376, 'n_words': 554}