push the uni-demo project
This commit is contained in:
183
uni-demo/node_modules/echarts/build/addHeader.js
generated
vendored
Normal file
183
uni-demo/node_modules/echarts/build/addHeader.js
generated
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
const fs = require('fs');
|
||||
const preamble = require('./preamble');
|
||||
const pathTool = require('path');
|
||||
const chalk = require('chalk');
|
||||
|
||||
// In the `.headerignore`, each line is a pattern in RegExp.
|
||||
// all relative path (based on the echarts base directory) is tested.
|
||||
// The pattern should match the relative path completely.
|
||||
const excludesPath = pathTool.join(__dirname, '../.headerignore');
|
||||
const ecBasePath = pathTool.join(__dirname, '../');
|
||||
|
||||
const isVerbose = process.argv[2] === '--verbose';
|
||||
|
||||
// const lists = [
|
||||
// '../src/**/*.js',
|
||||
// '../build/*.js',
|
||||
// '../benchmark/src/*.js',
|
||||
// '../benchmark/src/gulpfile.js',
|
||||
// '../extension-src/**/*.js',
|
||||
// '../extension/**/*.js',
|
||||
// '../map/js/**/*.js',
|
||||
// '../test/build/**/*.js',
|
||||
// '../test/node/**/*.js',
|
||||
// '../test/ut/core/*.js',
|
||||
// '../test/ut/spe/*.js',
|
||||
// '../test/ut/ut.js',
|
||||
// '../test/*.js',
|
||||
// '../theme/*.js',
|
||||
// '../theme/tool/**/*.js',
|
||||
// '../echarts.all.js',
|
||||
// '../echarts.blank.js',
|
||||
// '../echarts.common.js',
|
||||
// '../echarts.simple.js',
|
||||
// '../index.js',
|
||||
// '../index.common.js',
|
||||
// '../index.simple.js'
|
||||
// ];
|
||||
|
||||
function run() {
|
||||
const updatedFiles = [];
|
||||
const passFiles = [];
|
||||
const pendingFiles = [];
|
||||
|
||||
eachFile(function (absolutePath, fileExt) {
|
||||
const fileStr = fs.readFileSync(absolutePath, 'utf-8');
|
||||
|
||||
const existLicense = preamble.extractLicense(fileStr, fileExt);
|
||||
|
||||
if (existLicense) {
|
||||
passFiles.push(absolutePath);
|
||||
return;
|
||||
}
|
||||
|
||||
// Conside binary files, only add for files with known ext.
|
||||
if (!preamble.hasPreamble(fileExt)) {
|
||||
pendingFiles.push(absolutePath);
|
||||
return;
|
||||
}
|
||||
|
||||
fs.writeFileSync(absolutePath, preamble.addPreamble(fileStr, fileExt), 'utf-8');
|
||||
updatedFiles.push(absolutePath);
|
||||
});
|
||||
|
||||
console.log('\n');
|
||||
console.log('----------------------------');
|
||||
console.log(' Files that exists license: ');
|
||||
console.log('----------------------------');
|
||||
if (passFiles.length) {
|
||||
if (isVerbose) {
|
||||
passFiles.forEach(function (path) {
|
||||
console.log(chalk.green(path));
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log(chalk.green(passFiles.length + ' files. (use argument "--verbose" see details)'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log('Nothing.');
|
||||
}
|
||||
|
||||
console.log('\n');
|
||||
console.log('--------------------');
|
||||
console.log(' License added for: ');
|
||||
console.log('--------------------');
|
||||
if (updatedFiles.length) {
|
||||
updatedFiles.forEach(function (path) {
|
||||
console.log(chalk.green(path));
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log('Nothing.');
|
||||
}
|
||||
|
||||
console.log('\n');
|
||||
console.log('----------------');
|
||||
console.log(' Pending files: ');
|
||||
console.log('----------------');
|
||||
if (pendingFiles.length) {
|
||||
pendingFiles.forEach(function (path) {
|
||||
console.log(chalk.red(path));
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log('Nothing.');
|
||||
}
|
||||
|
||||
console.log('\nDone.');
|
||||
}
|
||||
|
||||
function eachFile(visit) {
|
||||
|
||||
const excludePatterns = [];
|
||||
const extReg = /\.([a-zA-Z0-9_-]+)$/;
|
||||
|
||||
prepareExcludePatterns();
|
||||
travel('./');
|
||||
|
||||
function travel(relativePath) {
|
||||
if (isExclude(relativePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const absolutePath = pathTool.join(ecBasePath, relativePath);
|
||||
const stat = fs.statSync(absolutePath);
|
||||
|
||||
if (stat.isFile()) {
|
||||
visit(absolutePath, getExt(absolutePath));
|
||||
}
|
||||
else if (stat.isDirectory()) {
|
||||
fs.readdirSync(relativePath).forEach(function (file) {
|
||||
travel(pathTool.join(relativePath, file));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function prepareExcludePatterns() {
|
||||
const content = fs.readFileSync(excludesPath, {encoding: 'utf-8'});
|
||||
content.replace(/\r/g, '\n').split('\n').forEach(function (line) {
|
||||
line = line.trim();
|
||||
if (line && line.charAt(0) !== '#') {
|
||||
excludePatterns.push(new RegExp(line));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function isExclude(relativePath) {
|
||||
for (let i = 0; i < excludePatterns.length; i++) {
|
||||
if (excludePatterns[i].test(relativePath)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getExt(path) {
|
||||
if (path) {
|
||||
const mathResult = path.match(extReg);
|
||||
return mathResult && mathResult[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
114
uni-demo/node_modules/echarts/build/build-i18n.js
generated
vendored
Normal file
114
uni-demo/node_modules/echarts/build/build-i18n.js
generated
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const preamble = require('./preamble');
|
||||
const ts = require('typescript');
|
||||
const path = require('path');
|
||||
const fsExtra = require('fs-extra');
|
||||
|
||||
const umdWrapperHead = `
|
||||
${preamble.js}
|
||||
/**
|
||||
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||
*/
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports'], factory);
|
||||
} else if (
|
||||
typeof exports === 'object' &&
|
||||
typeof exports.nodeName !== 'string'
|
||||
) {
|
||||
// CommonJS
|
||||
factory(exports);
|
||||
} else {
|
||||
// Browser globals
|
||||
factory({});
|
||||
}
|
||||
})(this, function(exports) {
|
||||
`;
|
||||
|
||||
const umdWrapperHeadWithEcharts = `
|
||||
${preamble.js}
|
||||
/**
|
||||
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||
*/
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports', 'echarts'], factory);
|
||||
} else if (
|
||||
typeof exports === 'object' &&
|
||||
typeof exports.nodeName !== 'string'
|
||||
) {
|
||||
// CommonJS
|
||||
factory(exports, require('echarts/lib/echarts'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory({}, root.echarts);
|
||||
}
|
||||
})(this, function(exports, echarts) {
|
||||
`;
|
||||
|
||||
const umdWrapperTail = `
|
||||
});`;
|
||||
|
||||
async function buildI18nWrap() {
|
||||
const targetDir = path.join(__dirname, '../i18n');
|
||||
const sourceDir = path.join(__dirname, '../src/i18n');
|
||||
const files = fs.readdirSync(sourceDir);
|
||||
files.forEach(t => {
|
||||
if(!t.startsWith('lang')) {
|
||||
return;
|
||||
}
|
||||
const fileName = t.replace(/\.ts$/, '');
|
||||
const type = fileName.replace(/^lang/, '');
|
||||
const echartsRegister = `
|
||||
echarts.registerLocale('${type}', localeObj);
|
||||
`;
|
||||
const pureExports = `
|
||||
for (var key in localeObj) {
|
||||
if (localeObj.hasOwnProperty(key)) {
|
||||
exports[key] = localeObj[key];
|
||||
}
|
||||
}
|
||||
`;
|
||||
const code = fs.readFileSync(path.join(sourceDir, t), 'utf-8');
|
||||
// const outputText = ts.transpileModule(code, {
|
||||
// module: ts.ModuleKind.CommonJS,
|
||||
// }).outputText;
|
||||
// Simple regexp replace is enough
|
||||
const outputCode = code.replace(/export\s+?default/, 'var localeObj =')
|
||||
.replace(/\/\*([\w\W]*?)\*\//, '');
|
||||
|
||||
fsExtra.ensureDirSync(targetDir);
|
||||
|
||||
fs.writeFileSync(path.join(targetDir, fileName + '.js'), umdWrapperHeadWithEcharts + outputCode + echartsRegister + umdWrapperTail, 'utf-8');
|
||||
fs.writeFileSync(path.join(targetDir, fileName + '-obj.js'), umdWrapperHead + outputCode + pureExports + umdWrapperTail, 'utf-8');
|
||||
})
|
||||
console.log('i18n build completed');
|
||||
}
|
||||
|
||||
buildI18nWrap();
|
||||
|
||||
module.exports = {
|
||||
buildI18n: buildI18nWrap
|
||||
};
|
||||
210
uni-demo/node_modules/echarts/build/build.js
generated
vendored
Normal file
210
uni-demo/node_modules/echarts/build/build.js
generated
vendored
Normal file
@@ -0,0 +1,210 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const config = require('./config.js');
|
||||
const commander = require('commander');
|
||||
const chalk = require('chalk');
|
||||
const rollup = require('rollup');
|
||||
const prePublish = require('./pre-publish');
|
||||
const transformDEV = require('./transform-dev');
|
||||
|
||||
async function run() {
|
||||
|
||||
/**
|
||||
* Tips for `commander`:
|
||||
* (1) If arg xxx not specified, `commander.xxx` is undefined.
|
||||
* Otherwise:
|
||||
* If '-x, --xxx', `commander.xxx` can only be true/false, even if '--xxx yyy' input.
|
||||
* If '-x, --xxx <some>', the 'some' string is required, or otherwise error will be thrown.
|
||||
* If '-x, --xxx [some]', the 'some' string is optional, that is, `commander.xxx` can be boolean or string.
|
||||
* (2) `node ./build/build.js --help` will print helper info and exit.
|
||||
*/
|
||||
|
||||
let descIndent = ' ';
|
||||
let egIndent = ' ';
|
||||
|
||||
commander
|
||||
.usage('[options]')
|
||||
.description([
|
||||
'Build echarts and generate result files in directory `echarts/dist`.',
|
||||
'',
|
||||
' For example:',
|
||||
'',
|
||||
egIndent + 'node build/build.js --prepublish'
|
||||
+ '\n' + descIndent + '# Only prepublish.',
|
||||
egIndent + 'node build/build.js --type ""'
|
||||
+ '\n' + descIndent + '# Only generate `dist/echarts.js`.',
|
||||
egIndent + 'node build/build.js --type common --min'
|
||||
+ '\n' + descIndent + '# Only generate `dist/echarts.common.min.js`.',
|
||||
egIndent + 'node build/build.js --type simple --min'
|
||||
+ '\n' + descIndent + '# Only generate `dist/echarts-en.simple.min.js`.',
|
||||
].join('\n'))
|
||||
.option(
|
||||
'--prepublish',
|
||||
'Build all for release'
|
||||
)
|
||||
.option(
|
||||
'--min',
|
||||
'Whether to compress the output file, and remove error-log-print code.'
|
||||
)
|
||||
.option(
|
||||
'--type <type name>', [
|
||||
'Can be "simple" or "common" or "all" (default). Or can be simple,common,all to build multiple. For example,',
|
||||
descIndent + '`--type ""` or `--type "common"`.'
|
||||
].join('\n'))
|
||||
.option(
|
||||
'--format <format>',
|
||||
'The format of output bundle. Can be "umd", "amd", "iife", "cjs", "esm".'
|
||||
)
|
||||
.parse(process.argv);
|
||||
|
||||
let isPrePublish = !!commander.prepublish;
|
||||
let buildType = commander.type || 'all';
|
||||
|
||||
let opt = {
|
||||
min: commander.min,
|
||||
format: commander.format || 'umd'
|
||||
};
|
||||
|
||||
validateIO(opt.input, opt.output);
|
||||
|
||||
if (isPrePublish) {
|
||||
await prePublish();
|
||||
}
|
||||
else if (buildType === 'extension') {
|
||||
const cfgs = [
|
||||
config.createBMap(opt),
|
||||
config.createDataTool(opt)
|
||||
];
|
||||
await build(cfgs);
|
||||
}
|
||||
else if (buildType === 'myTransform') {
|
||||
const cfgs = [
|
||||
config.createMyTransform(opt)
|
||||
];
|
||||
await build(cfgs);
|
||||
}
|
||||
else {
|
||||
const types = buildType.split(',').map(a => a.trim());
|
||||
const cfgs = types.map(type =>
|
||||
config.createECharts({
|
||||
...opt,
|
||||
type
|
||||
})
|
||||
);
|
||||
await build(cfgs);
|
||||
}
|
||||
}
|
||||
|
||||
function checkBundleCode(cfg) {
|
||||
// Make sure process.env.NODE_ENV is eliminated.
|
||||
for (let output of cfg.output) {
|
||||
let code = fs.readFileSync(output.file, {encoding: 'utf-8'});
|
||||
if (!code) {
|
||||
throw new Error(`${output.file} is empty`);
|
||||
}
|
||||
transformDEV.recheckDEV(code);
|
||||
console.log(chalk.green.dim('Check code: correct.'));
|
||||
}
|
||||
}
|
||||
|
||||
function validateIO(input, output) {
|
||||
if ((input != null && output == null)
|
||||
|| (input == null && output != null)
|
||||
) {
|
||||
throw new Error('`input` and `output` must be both set.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<Object>} configs A list of rollup configs:
|
||||
* See: <https://rollupjs.org/#big-list-of-options>
|
||||
* For example:
|
||||
* [
|
||||
* {
|
||||
* ...inputOptions,
|
||||
* output: [outputOptions],
|
||||
* },
|
||||
* ...
|
||||
* ]
|
||||
*/
|
||||
async function build(configs) {
|
||||
console.log(chalk.yellow(`
|
||||
NOTICE: If you are using 'npm run build'. Run 'npm run prepublish' before build !!!
|
||||
`));
|
||||
|
||||
console.log(chalk.yellow(`
|
||||
NOTICE: If you are using syslink on zrender. Run 'npm run prepublish' in zrender first !!
|
||||
`));
|
||||
|
||||
for (let singleConfig of configs) {
|
||||
console.log(
|
||||
chalk.cyan.dim('\Bundling '),
|
||||
chalk.cyan(singleConfig.input)
|
||||
);
|
||||
|
||||
console.time('rollup build');
|
||||
const bundle = await rollup.rollup(singleConfig);
|
||||
|
||||
for (let output of singleConfig.output) {
|
||||
console.log(
|
||||
chalk.green.dim('Created '),
|
||||
chalk.green(output.file),
|
||||
chalk.green.dim(' successfully.')
|
||||
);
|
||||
|
||||
await bundle.write(output);
|
||||
|
||||
};
|
||||
console.timeEnd('rollup build');
|
||||
|
||||
checkBundleCode(singleConfig);
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
await run();
|
||||
}
|
||||
catch (err) {
|
||||
console.log(chalk.red('BUILD ERROR!'));
|
||||
// rollup parse error.
|
||||
if (err) {
|
||||
if (err.loc) {
|
||||
console.warn(chalk.red(`${err.loc.file} (${err.loc.line}:${err.loc.column})`));
|
||||
console.warn(chalk.red(err.message));
|
||||
}
|
||||
if (err.frame) {
|
||||
console.warn(chalk.red(err.frame));
|
||||
}
|
||||
console.log(chalk.red(err ? err.stack : err));
|
||||
|
||||
err.id != null && console.warn(chalk.red(`id: ${err.id}`));
|
||||
err.hook != null && console.warn(chalk.red(`hook: ${err.hook}`));
|
||||
err.code != null && console.warn(chalk.red(`code: ${err.code}`));
|
||||
err.plugin != null && console.warn(chalk.red(`plugin: ${err.plugin}`));
|
||||
}
|
||||
// console.log(err);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
176
uni-demo/node_modules/echarts/build/config.js
generated
vendored
Normal file
176
uni-demo/node_modules/echarts/build/config.js
generated
vendored
Normal file
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
const nodeResolvePlugin = require('@rollup/plugin-node-resolve').default;
|
||||
const nodePath = require('path');
|
||||
const ecDir = nodePath.resolve(__dirname, '..');
|
||||
const {terser} = require('rollup-plugin-terser');
|
||||
const replace = require('@rollup/plugin-replace');
|
||||
const MagicString = require('magic-string');
|
||||
const preamble = require('./preamble');
|
||||
|
||||
function createAddLicensePlugin(sourcemap) {
|
||||
return {
|
||||
renderChunk(code, chunk) {
|
||||
const s = new MagicString(code);
|
||||
s.prepend(preamble.js);
|
||||
return {
|
||||
code: s.toString(),
|
||||
map: sourcemap ? s.generateMap({ hires: true }).toString() : null
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createOutputs(basename, { min }, commonOutputOpts) {
|
||||
commonOutputOpts = {
|
||||
format: 'umd',
|
||||
...commonOutputOpts
|
||||
}
|
||||
function createReplacePlugin(replacement) {
|
||||
const plugin = replace({
|
||||
'process.env.NODE_ENV': JSON.stringify(replacement)
|
||||
});
|
||||
// Remove transform hook. It will have warning when using in output
|
||||
delete plugin.transform;
|
||||
return plugin;
|
||||
}
|
||||
const output = [{
|
||||
...commonOutputOpts,
|
||||
// Disable sourcemap in
|
||||
sourcemap: true,
|
||||
plugins: [
|
||||
createReplacePlugin('development'),
|
||||
createAddLicensePlugin(true)
|
||||
],
|
||||
file: basename + '.js'
|
||||
}];
|
||||
|
||||
if (min) {
|
||||
output.push({
|
||||
...commonOutputOpts,
|
||||
// Disable sourcemap in min file.
|
||||
sourcemap: false,
|
||||
// TODO preamble
|
||||
plugins: [
|
||||
createReplacePlugin('production'),
|
||||
terser(),
|
||||
createAddLicensePlugin(false)
|
||||
],
|
||||
file: basename + '.min.js'
|
||||
})
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} [opt]
|
||||
* @param {string} [opt.type=''] 'all' or 'simple' or 'common', default is 'all'
|
||||
* @param {boolean} [opt.sourcemap] If set, `opt.input` is required too, and `opt.type` is ignored.
|
||||
* @param {string} [opt.format='umd'] If set, `opt.input` is required too, and `opt.type` is ignored.
|
||||
* @param {string} [opt.min=false] If build minified output
|
||||
* @param {boolean} [opt.addBundleVersion=false] Only for debug in watch, prompt that the two build is different.
|
||||
*/
|
||||
exports.createECharts = function (opt = {}) {
|
||||
const srcType = opt.type !== 'all' ? '.' + opt.type : '';
|
||||
const postfixType = srcType;
|
||||
const format = opt.format || 'umd';
|
||||
const postfixFormat = (format !== 'umd') ? '.' + format.toLowerCase() : '';
|
||||
|
||||
const input = nodePath.resolve(ecDir, `index${srcType}.js`);
|
||||
|
||||
return {
|
||||
plugins: [nodeResolvePlugin()],
|
||||
treeshake: {
|
||||
moduleSideEffects: false
|
||||
},
|
||||
|
||||
input: input,
|
||||
|
||||
output: createOutputs(
|
||||
nodePath.resolve(ecDir, `dist/echarts${postfixFormat}${postfixType}`),
|
||||
opt,
|
||||
{
|
||||
name: 'echarts',
|
||||
// Ignore default exports, which is only for compitable code like:
|
||||
// import echarts from 'echarts/lib/echarts';
|
||||
exports: 'named',
|
||||
format: format
|
||||
}
|
||||
)
|
||||
};
|
||||
};
|
||||
|
||||
exports.createBMap = function (opt) {
|
||||
const input = nodePath.resolve(ecDir, `extension/bmap/bmap.js`);
|
||||
|
||||
return {
|
||||
plugins: [nodeResolvePlugin()],
|
||||
input: input,
|
||||
external: ['echarts'],
|
||||
output: createOutputs(
|
||||
nodePath.resolve(ecDir, `dist/extension/bmap`),
|
||||
opt,
|
||||
{
|
||||
name: 'bmap',
|
||||
globals: {
|
||||
// For UMD `global.echarts`
|
||||
echarts: 'echarts'
|
||||
}
|
||||
}
|
||||
)
|
||||
};
|
||||
};
|
||||
|
||||
exports.createDataTool = function (opt) {
|
||||
let input = nodePath.resolve(ecDir, `extension/dataTool/index.js`);
|
||||
|
||||
return {
|
||||
plugins: [nodeResolvePlugin()],
|
||||
input: input,
|
||||
external: ['echarts'],
|
||||
output: createOutputs(
|
||||
nodePath.resolve(ecDir, `dist/extension/dataTool`),
|
||||
opt,
|
||||
{
|
||||
name: 'dataTool',
|
||||
globals: {
|
||||
// For UMD `global.echarts`
|
||||
echarts: 'echarts'
|
||||
}
|
||||
}
|
||||
)
|
||||
};
|
||||
};
|
||||
|
||||
exports.createMyTransform = function (opt) {
|
||||
let input = nodePath.resolve(ecDir, `test/lib/myTransform/src/index.ts`);
|
||||
|
||||
return {
|
||||
plugins: [nodeResolvePlugin()],
|
||||
input: input,
|
||||
output: createOutputs(
|
||||
nodePath.resolve(ecDir, `test/lib/myTransform/dist/myTransform`),
|
||||
opt,
|
||||
{
|
||||
name: 'myTransform'
|
||||
}
|
||||
)
|
||||
};
|
||||
};
|
||||
67
uni-demo/node_modules/echarts/build/dev-fast.js
generated
vendored
Normal file
67
uni-demo/node_modules/echarts/build/dev-fast.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const {build} = require('esbuild');
|
||||
const commander = require('commander');
|
||||
const outFilePath = path.resolve(__dirname, '../dist/echarts.js');
|
||||
|
||||
const umdWrapperHead = `(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports'], factory);
|
||||
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
|
||||
// CommonJS
|
||||
factory(exports);
|
||||
} else {
|
||||
// Browser globals
|
||||
factory((root.echarts = {}));
|
||||
}
|
||||
}(typeof self !== 'undefined' ? self : this, function (exports, b) {
|
||||
`;
|
||||
|
||||
const umdWrapperTail = `
|
||||
}));`;
|
||||
|
||||
build({
|
||||
entryPoints: [path.resolve(__dirname, '../src/echarts.all.ts')],
|
||||
outfile: outFilePath,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
bundle: true,
|
||||
banner: umdWrapperHead,
|
||||
footer: umdWrapperTail,
|
||||
define: {
|
||||
'process.env.NODE_ENV': '"development"',
|
||||
'__DEV__': 'true'
|
||||
},
|
||||
watch: {
|
||||
async onRebuild(error) {
|
||||
if (error) {
|
||||
console.error('watch build failed:', error)
|
||||
}
|
||||
else {
|
||||
console.log('Bundled with esbuild')
|
||||
}
|
||||
},
|
||||
},
|
||||
}).then(async () => {
|
||||
console.log('Bundled with esbuild')
|
||||
}).catch(e => console.error(e.toString()))
|
||||
428
uni-demo/node_modules/echarts/build/pre-publish.js
generated
vendored
Normal file
428
uni-demo/node_modules/echarts/build/pre-publish.js
generated
vendored
Normal file
@@ -0,0 +1,428 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* [Create CommonJS files]:
|
||||
* Compatible with prevoius folder structure: `echarts/lib` exists in `node_modules`
|
||||
* (1) Build all files to CommonJS to `echarts/lib`.
|
||||
* (2) Remove __DEV__.
|
||||
* (3) Mount `echarts/src/export.js` to `echarts/lib/echarts.js`.
|
||||
*
|
||||
* [Create ESModule files]:
|
||||
* Build all files to CommonJS to `echarts/esm`.
|
||||
*/
|
||||
|
||||
const nodePath = require('path');
|
||||
const assert = require('assert');
|
||||
const fs = require('fs');
|
||||
const fsExtra = require('fs-extra');
|
||||
const chalk = require('chalk');
|
||||
const ts = require('typescript');
|
||||
const globby = require('globby');
|
||||
const transformDEVUtil = require('./transform-dev');
|
||||
const preamble = require('./preamble');
|
||||
const dts = require('@lang/rollup-plugin-dts').default;
|
||||
const rollup = require('rollup');
|
||||
const { transformImport } = require('zrender/build/transformImport');
|
||||
|
||||
const ecDir = nodePath.resolve(__dirname, '..');
|
||||
const tmpDir = nodePath.resolve(ecDir, 'pre-publish-tmp');
|
||||
|
||||
const tsConfig = readTSConfig();
|
||||
|
||||
const autoGeneratedFileAlert = `
|
||||
/**
|
||||
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||
*/
|
||||
|
||||
`;
|
||||
|
||||
const mainSrcGlobby = {
|
||||
patterns: [
|
||||
'src/**/*.ts'
|
||||
],
|
||||
cwd: ecDir
|
||||
};
|
||||
const extensionSrcGlobby = {
|
||||
patterns: [
|
||||
'extension-src/**/*.ts'
|
||||
],
|
||||
cwd: ecDir
|
||||
};
|
||||
const extensionSrcDir = nodePath.resolve(ecDir, 'extension-src');
|
||||
const extensionESMDir = nodePath.resolve(ecDir, 'extension');
|
||||
|
||||
const typesDir = nodePath.resolve(ecDir, 'types');
|
||||
const esmDir = 'lib';
|
||||
|
||||
|
||||
const compileWorkList = [
|
||||
{
|
||||
logLabel: 'main ts -> js-esm',
|
||||
compilerOptionsOverride: {
|
||||
module: 'ES2015',
|
||||
rootDir: ecDir,
|
||||
outDir: tmpDir,
|
||||
// Generate types when buidling esm
|
||||
declaration: true,
|
||||
declarationDir: typesDir
|
||||
},
|
||||
srcGlobby: mainSrcGlobby,
|
||||
transformOptions: {
|
||||
filesGlobby: {patterns: ['**/*.js'], cwd: tmpDir},
|
||||
preamble: preamble.js,
|
||||
transformDEV: true
|
||||
},
|
||||
before: async function () {
|
||||
fsExtra.removeSync(tmpDir);
|
||||
fsExtra.removeSync(nodePath.resolve(ecDir, 'types'));
|
||||
fsExtra.removeSync(nodePath.resolve(ecDir, esmDir));
|
||||
fsExtra.removeSync(nodePath.resolve(ecDir, 'index.js'));
|
||||
fsExtra.removeSync(nodePath.resolve(ecDir, 'index.blank.js'));
|
||||
fsExtra.removeSync(nodePath.resolve(ecDir, 'index.common.js'));
|
||||
fsExtra.removeSync(nodePath.resolve(ecDir, 'index.simple.js'));
|
||||
},
|
||||
after: async function () {
|
||||
fs.renameSync(nodePath.resolve(tmpDir, 'src/echarts.all.js'), nodePath.resolve(ecDir, 'index.js'));
|
||||
fs.renameSync(nodePath.resolve(tmpDir, 'src/echarts.blank.js'), nodePath.resolve(ecDir, 'index.blank.js'));
|
||||
fs.renameSync(nodePath.resolve(tmpDir, 'src/echarts.common.js'), nodePath.resolve(ecDir, 'index.common.js'));
|
||||
fs.renameSync(nodePath.resolve(tmpDir, 'src/echarts.simple.js'), nodePath.resolve(ecDir, 'index.simple.js'));
|
||||
fs.renameSync(nodePath.resolve(tmpDir, 'src'), nodePath.resolve(ecDir, esmDir));
|
||||
|
||||
transformRootFolderInEntry(nodePath.resolve(ecDir, 'index.js'), esmDir);
|
||||
transformRootFolderInEntry(nodePath.resolve(ecDir, 'index.blank.js'), esmDir);
|
||||
transformRootFolderInEntry(nodePath.resolve(ecDir, 'index.common.js'), esmDir);
|
||||
transformRootFolderInEntry(nodePath.resolve(ecDir, 'index.simple.js'), esmDir);
|
||||
|
||||
await transformLibFiles(nodePath.resolve(ecDir, esmDir), esmDir);
|
||||
await transformLibFiles(nodePath.resolve(ecDir, 'types'), esmDir);
|
||||
fsExtra.removeSync(tmpDir);
|
||||
}
|
||||
},
|
||||
{
|
||||
logLabel: 'extension ts -> js-esm',
|
||||
compilerOptionsOverride: {
|
||||
module: 'ES2015',
|
||||
declaration: false,
|
||||
rootDir: extensionSrcDir,
|
||||
outDir: extensionESMDir
|
||||
},
|
||||
srcGlobby: extensionSrcGlobby,
|
||||
transformOptions: {
|
||||
filesGlobby: {patterns: ['**/*.js'], cwd: extensionESMDir},
|
||||
preamble: preamble.js,
|
||||
transformDEV: true
|
||||
},
|
||||
before: async function () {
|
||||
fsExtra.removeSync(extensionESMDir);
|
||||
},
|
||||
after: async function () {
|
||||
await transformLibFiles(extensionESMDir, 'lib');
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
module.exports = async function () {
|
||||
|
||||
for (let {
|
||||
logLabel, compilerOptionsOverride, srcGlobby,
|
||||
transformOptions, before, after
|
||||
} of compileWorkList) {
|
||||
|
||||
process.stdout.write(chalk.green.dim(`[${logLabel}]: compiling ...`));
|
||||
|
||||
before && await before();
|
||||
|
||||
let srcPathList = await readFilePaths(srcGlobby);
|
||||
|
||||
await tsCompile(compilerOptionsOverride, srcPathList);
|
||||
|
||||
process.stdout.write(chalk.green.dim(` done \n`));
|
||||
|
||||
process.stdout.write(chalk.green.dim(`[${logLabel}]: transforming ...`));
|
||||
|
||||
await transformCode(transformOptions);
|
||||
|
||||
after && await after();
|
||||
|
||||
process.stdout.write(chalk.green.dim(` done \n`));
|
||||
}
|
||||
|
||||
process.stdout.write(chalk.green.dim(`Generating entries ...`));
|
||||
generateEntries();
|
||||
process.stdout.write(chalk.green.dim(`Bundling DTS ...`));
|
||||
await bundleDTS();
|
||||
|
||||
console.log(chalk.green.dim('All done.'));
|
||||
};
|
||||
|
||||
async function runTsCompile(localTs, compilerOptions, srcPathList) {
|
||||
// Must do it. becuase the value in tsconfig.json might be different from the inner representation.
|
||||
// For example: moduleResolution: "NODE" => moduleResolution: 2
|
||||
const {options, errors} = localTs.convertCompilerOptionsFromJson(compilerOptions, ecDir);
|
||||
|
||||
if (errors.length) {
|
||||
let errMsg = 'tsconfig parse failed: '
|
||||
+ errors.map(error => error.messageText).join('. ')
|
||||
+ '\n compilerOptions: \n' + JSON.stringify(compilerOptions, null, 4);
|
||||
assert(false, errMsg);
|
||||
}
|
||||
|
||||
// See: https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API
|
||||
|
||||
let program = localTs.createProgram(srcPathList, options);
|
||||
let emitResult = program.emit();
|
||||
|
||||
let allDiagnostics = localTs
|
||||
.getPreEmitDiagnostics(program)
|
||||
.concat(emitResult.diagnostics);
|
||||
|
||||
allDiagnostics.forEach(diagnostic => {
|
||||
if (diagnostic.file) {
|
||||
let {line, character} = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
|
||||
let message = localTs.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
|
||||
console.log(chalk.red(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`));
|
||||
}
|
||||
else {
|
||||
console.log(chalk.red(localTs.flattenDiagnosticMessageText(diagnostic.messageText, '\n')));
|
||||
}
|
||||
});
|
||||
if (allDiagnostics.length > 0) {
|
||||
throw new Error('TypeScript Compile Failed')
|
||||
}
|
||||
}
|
||||
module.exports.runTsCompile = runTsCompile;
|
||||
|
||||
async function tsCompile(compilerOptionsOverride, srcPathList) {
|
||||
assert(
|
||||
compilerOptionsOverride
|
||||
&& compilerOptionsOverride.module
|
||||
&& compilerOptionsOverride.rootDir
|
||||
&& compilerOptionsOverride.outDir
|
||||
);
|
||||
|
||||
let compilerOptions = {
|
||||
...tsConfig.compilerOptions,
|
||||
...compilerOptionsOverride,
|
||||
sourceMap: false
|
||||
};
|
||||
|
||||
runTsCompile(ts, compilerOptions, srcPathList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform import/require path in the entry file to `esm` or `lib`.
|
||||
*/
|
||||
function transformRootFolderInEntry(entryFile, replacement) {
|
||||
let code = fs.readFileSync(entryFile, 'utf-8');
|
||||
// Simple regex replacement
|
||||
// TODO More robust way?
|
||||
assert(
|
||||
!/(import\s+|from\s+|require\(\s*)["']\.\/echarts\./.test(code)
|
||||
&& !/(import\s+|from\s+|require\(\s*)["']echarts\./.test(code),
|
||||
'Import echarts.xxx.ts is not supported.'
|
||||
);
|
||||
code = code.replace(/((import\s+|from\s+|require\(\s*)["'])\.\//g, `$1./${replacement}/`);
|
||||
fs.writeFileSync(
|
||||
entryFile,
|
||||
// Also transform zrender.
|
||||
singleTransformImport(code, replacement),
|
||||
'utf-8'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform `zrender/src` to `zrender/lib` in all files
|
||||
*/
|
||||
async function transformLibFiles(rooltFolder, replacement) {
|
||||
const files = await readFilePaths({
|
||||
patterns: ['**/*.js', '**/*.d.ts'],
|
||||
cwd: rooltFolder
|
||||
});
|
||||
// Simple regex replacement
|
||||
// TODO More robust way?
|
||||
for (let fileName of files) {
|
||||
let code = fs.readFileSync(fileName, 'utf-8');
|
||||
code = singleTransformImport(code, replacement);
|
||||
// For lower ts version, not use import type
|
||||
// TODO Use https://github.com/sandersn/downlevel-dts ?
|
||||
// if (fileName.endsWith('.d.ts')) {
|
||||
// code = singleTransformImportType(code);
|
||||
// }
|
||||
fs.writeFileSync(fileName, code, 'utf-8');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Transform zrender/src to zrender/lib
|
||||
* 2. Add .js extensions
|
||||
*/
|
||||
function singleTransformImport(code, replacement) {
|
||||
return transformImport(
|
||||
code.replace(/([\"\'])zrender\/src\//g, `$1zrender/${replacement}/`),
|
||||
(moduleName) => {
|
||||
// Ignore 'tslib' and 'echarts' in the extensions.
|
||||
if (moduleName === 'tslib' || moduleName === 'echarts') {
|
||||
return moduleName;
|
||||
}
|
||||
else if (moduleName === 'zrender/lib/export') {
|
||||
throw new Error('Should not import the whole zrender library.');
|
||||
}
|
||||
else if (moduleName.endsWith('.ts')) {
|
||||
// Replace ts with js
|
||||
return moduleName.replace(/\.ts$/, '.js');
|
||||
}
|
||||
else if (moduleName.endsWith('.js')) {
|
||||
return moduleName;
|
||||
}
|
||||
else {
|
||||
return moduleName + '.js'
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// function singleTransformImportType(code) {
|
||||
// return code.replace(/import\s+type\s+/g, 'import ');
|
||||
// }
|
||||
|
||||
/**
|
||||
* @param {Object} transformOptions
|
||||
* @param {Object} transformOptions.filesGlobby {patterns: string[], cwd: string}
|
||||
* @param {string} [transformOptions.preamble] See './preamble.js'
|
||||
* @param {boolean} [transformOptions.transformDEV]
|
||||
*/
|
||||
async function transformCode({filesGlobby, preamble, transformDEV}) {
|
||||
|
||||
let filePaths = await readFilePaths(filesGlobby);
|
||||
|
||||
filePaths.map(filePath => {
|
||||
let code = fs.readFileSync(filePath, 'utf8');
|
||||
|
||||
if (transformDEV) {
|
||||
let result = transformDEVUtil.transform(code, false);
|
||||
code = result.code;
|
||||
}
|
||||
|
||||
code = autoGeneratedFileAlert + code;
|
||||
|
||||
if (preamble) {
|
||||
code = preamble + code;
|
||||
}
|
||||
|
||||
fs.writeFileSync(filePath, code, 'utf8');
|
||||
});
|
||||
}
|
||||
|
||||
async function readFilePaths({patterns, cwd}) {
|
||||
assert(patterns && cwd);
|
||||
return (
|
||||
await globby(patterns, {cwd})
|
||||
).map(
|
||||
srcPath => nodePath.resolve(cwd, srcPath)
|
||||
);
|
||||
}
|
||||
|
||||
async function bundleDTS() {
|
||||
|
||||
const outDir = nodePath.resolve(__dirname, '../types/dist');
|
||||
const commonConfig = {
|
||||
onwarn(warning, rollupWarn) {
|
||||
// Not warn circular dependency
|
||||
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
|
||||
rollupWarn(warning);
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
dts({
|
||||
respectExternal: true
|
||||
})
|
||||
// {
|
||||
// generateBundle(options, bundle) {
|
||||
// for (let chunk of Object.values(bundle)) {
|
||||
// chunk.code = `
|
||||
// type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
||||
// ${chunk.code}`
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
]
|
||||
};
|
||||
|
||||
// Bundle chunks.
|
||||
const parts = [
|
||||
'core', 'charts', 'components', 'renderers', 'option', 'features'
|
||||
];
|
||||
const inputs = {};
|
||||
parts.forEach(partName => {
|
||||
inputs[partName] = nodePath.resolve(__dirname, `../types/src/export/${partName}.d.ts`)
|
||||
});
|
||||
|
||||
const bundle = await rollup.rollup({
|
||||
input: inputs,
|
||||
...commonConfig
|
||||
});
|
||||
let idx = 1;
|
||||
await bundle.write({
|
||||
dir: outDir,
|
||||
minifyInternalExports: false,
|
||||
manualChunks: (id) => {
|
||||
// Only create one chunk.
|
||||
return 'shared';
|
||||
},
|
||||
chunkFileNames: 'shared.d.ts'
|
||||
});
|
||||
|
||||
// Bundle all in one
|
||||
const bundleAllInOne = await rollup.rollup({
|
||||
input: nodePath.resolve(__dirname, `../types/src/export/all.d.ts`),
|
||||
...commonConfig
|
||||
});
|
||||
await bundleAllInOne.write({
|
||||
file: nodePath.resolve(outDir, 'echarts.d.ts')
|
||||
});
|
||||
}
|
||||
|
||||
function readTSConfig() {
|
||||
// tsconfig.json may have comment string, which is invalid if
|
||||
// using `require('tsconfig.json'). So we use a loose parser.
|
||||
let filePath = nodePath.resolve(ecDir, 'tsconfig.json');
|
||||
const tsConfigText = fs.readFileSync(filePath, {encoding: 'utf8'});
|
||||
return (new Function(`return ( ${tsConfigText} )`))();
|
||||
}
|
||||
|
||||
|
||||
function generateEntries() {
|
||||
['charts', 'components', 'renderers', 'core', 'features'].forEach(entryName => {
|
||||
if (entryName !== 'option') {
|
||||
const jsCode = fs.readFileSync(nodePath.join(__dirname, `template/${entryName}.js`), 'utf-8');
|
||||
fs.writeFileSync(nodePath.join(__dirname, `../${entryName}.js`), jsCode, 'utf-8');
|
||||
}
|
||||
|
||||
const dtsCode = fs.readFileSync(nodePath.join(__dirname, `/template/${entryName}.d.ts`), 'utf-8');
|
||||
fs.writeFileSync(nodePath.join(__dirname, `../${entryName}.d.ts`), dtsCode, 'utf-8');
|
||||
});
|
||||
}
|
||||
|
||||
module.exports.readTSConfig = readTSConfig;
|
||||
231
uni-demo/node_modules/echarts/build/preamble.js
generated
vendored
Normal file
231
uni-demo/node_modules/echarts/build/preamble.js
generated
vendored
Normal file
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
const cStyleComment = `
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
`;
|
||||
|
||||
const hashComment = `
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
`;
|
||||
|
||||
const mlComment = `
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
`;
|
||||
|
||||
function hasPreamble(fileExt) {
|
||||
return fileExt && preambleMap[fileExt];
|
||||
}
|
||||
|
||||
function addPreamble(fileStr, fileExt) {
|
||||
if (fileStr && fileExt) {
|
||||
const addFn = addFns[fileExt];
|
||||
const headStr = preambleMap[fileExt];
|
||||
return addFn && headStr && addFn(headStr, fileStr);
|
||||
}
|
||||
}
|
||||
|
||||
const addFns = {
|
||||
|
||||
ts: function (headStr, fileStr) {
|
||||
return headStr + fileStr;
|
||||
},
|
||||
|
||||
js: function (headStr, fileStr) {
|
||||
return headStr + fileStr;
|
||||
},
|
||||
|
||||
css: function (headStr, fileStr) {
|
||||
return headStr + fileStr;
|
||||
},
|
||||
|
||||
java: function (headStr, fileStr) {
|
||||
return headStr + fileStr;
|
||||
},
|
||||
|
||||
yml: addShellLikeHeader,
|
||||
|
||||
yaml: addShellLikeHeader,
|
||||
|
||||
sh: addShellLikeHeader,
|
||||
|
||||
html: function (headStr, fileStr) {
|
||||
// Git diff enables manual check.
|
||||
let resultStr = fileStr.replace(/^\s*<!DOCTYPE\s[^<>]+>/i, '$&' + headStr);
|
||||
// If no doctype
|
||||
if (resultStr.length === fileStr.length) {
|
||||
resultStr = headStr + fileStr;
|
||||
}
|
||||
return resultStr;
|
||||
},
|
||||
|
||||
xml: xmlAddFn,
|
||||
|
||||
xsl: xmlAddFn
|
||||
};
|
||||
|
||||
function addShellLikeHeader(headStr, fileStr) {
|
||||
// Git diff enables manual check.
|
||||
if (/^#\!/.test(fileStr)) {
|
||||
const lines = fileStr.split('\n');
|
||||
lines.splice(1, 0, headStr);
|
||||
return lines.join('\n');
|
||||
}
|
||||
else {
|
||||
return headStr + fileStr;
|
||||
}
|
||||
}
|
||||
|
||||
function xmlAddFn(headStr, fileStr) {
|
||||
// Git diff enables manual check.
|
||||
let resultStr = fileStr.replace(/^\s*<\?xml\s[^<>]+\?>/i, '$&' + headStr);
|
||||
// If no <?xml version='1.0' ?>
|
||||
if (resultStr.length === fileStr.length) {
|
||||
resultStr = headStr + fileStr;
|
||||
}
|
||||
return resultStr;
|
||||
}
|
||||
|
||||
const preambleMap = {
|
||||
ts: cStyleComment,
|
||||
js: cStyleComment,
|
||||
css: cStyleComment,
|
||||
java: cStyleComment,
|
||||
yml: hashComment,
|
||||
yaml: hashComment,
|
||||
sh: hashComment,
|
||||
html: mlComment,
|
||||
xml: mlComment,
|
||||
xsl: mlComment
|
||||
};
|
||||
|
||||
const licenseReg = [
|
||||
{name: 'Apache', reg: /apache (license|commons)/i},
|
||||
{name: 'BSD', reg: /BSD/},
|
||||
{name: 'LGPL', reg: /LGPL/},
|
||||
{name: 'GPL', reg: /GPL/},
|
||||
{name: 'Mozilla', reg: /mozilla public/i},
|
||||
{name: 'MIT', reg: /mit license/i},
|
||||
{name: 'BSD-d3', reg: /Copyright\s+\(c\)\s+2010-2015,\s+Michael\s+Bostock/i}
|
||||
];
|
||||
|
||||
function extractLicense(fileStr, fileExt) {
|
||||
let commentText = extractComment(fileStr.trim(), fileExt);
|
||||
if (!commentText) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < licenseReg.length; i++) {
|
||||
if (licenseReg[i].reg.test(commentText)) {
|
||||
return licenseReg[i].name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const cStyleCommentReg = /\/\*[\S\s]*?\*\//;
|
||||
const hashCommentReg = /^\s*#.*$/gm;
|
||||
const mlCommentReg = /<\!\-\-[\S\s]*?\-\->/;
|
||||
const commentReg = {
|
||||
ts: cStyleCommentReg,
|
||||
js: cStyleCommentReg,
|
||||
css: cStyleCommentReg,
|
||||
java: cStyleCommentReg,
|
||||
yml: hashCommentReg,
|
||||
yaml: hashCommentReg,
|
||||
sh: hashCommentReg,
|
||||
html: mlCommentReg,
|
||||
xml: mlCommentReg,
|
||||
xsl: mlCommentReg
|
||||
};
|
||||
|
||||
function extractComment(str, fileExt) {
|
||||
const reg = commentReg[fileExt];
|
||||
|
||||
if (!fileExt || !reg || !str) {
|
||||
return;
|
||||
}
|
||||
|
||||
reg.lastIndex = 0;
|
||||
|
||||
if (fileExt === 'sh' || fileExt === 'yml' || fileExt === 'yaml') {
|
||||
let result = str.match(reg);
|
||||
return result && result.join('\n');
|
||||
}
|
||||
else {
|
||||
let result = reg.exec(str);
|
||||
return result && result[0];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Object.assign({
|
||||
extractLicense,
|
||||
hasPreamble,
|
||||
addPreamble
|
||||
}, preambleMap);
|
||||
73
uni-demo/node_modules/echarts/build/prepareNightly.js
generated
vendored
Normal file
73
uni-demo/node_modules/echarts/build/prepareNightly.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
const fs = require('fs');
|
||||
const packageJsonPath = __dirname + '/../package.json';
|
||||
const nightlyPackageName = 'echarts-nightly';
|
||||
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
||||
|
||||
function updateVersion(version) {
|
||||
const isNext = process.argv.includes('--next');
|
||||
const parts = /(\d+)\.(\d+)\.(\d+)($|\-)/.exec(version);
|
||||
if (!parts) {
|
||||
throw new Error(`Invalid version number ${version}`);
|
||||
}
|
||||
// Add date to version.
|
||||
const major = +parts[1];
|
||||
let minor = +parts[2];
|
||||
let patch = +parts[3];
|
||||
const isStable = !parts[4];
|
||||
if (isStable) {
|
||||
// It's previous stable version. Dev version should be higher.
|
||||
if (isNext) {
|
||||
// Increase minor version for next branch.
|
||||
minor++;
|
||||
patch = 0;
|
||||
}
|
||||
else {
|
||||
// Increase main version for master branch.
|
||||
patch++;
|
||||
}
|
||||
}
|
||||
|
||||
const date = new Date().toISOString().replace(/:|T|\.|-/g, '').slice(0, 8);
|
||||
return `${major}.${minor}.${patch}-dev.${date}`;
|
||||
}
|
||||
|
||||
packageJson.name = nightlyPackageName;
|
||||
packageJson.version = updateVersion(packageJson.version);
|
||||
|
||||
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf-8');
|
||||
|
||||
|
||||
const readmePath = __dirname + '/../README.md';
|
||||
const readmeAttention = `<h3>
|
||||
<p><em>⚠️ ATTENTION PLEASE</em></p>
|
||||
<p><em>This is nightly build of Apache ECharts. Please DON't use it in your production environment.</em></p>
|
||||
</h3>`;
|
||||
const readmeContent = fs.readFileSync(readmePath, 'utf-8');
|
||||
if (!readmeContent.includes(readmeAttention)) {
|
||||
fs.writeFileSync(readmePath, `
|
||||
${readmeAttention}
|
||||
|
||||
${readmeContent}
|
||||
`, 'utf-8');
|
||||
}
|
||||
164
uni-demo/node_modules/echarts/build/source-release/prepareReleaseMaterials.js
generated
vendored
Normal file
164
uni-demo/node_modules/echarts/build/source-release/prepareReleaseMaterials.js
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
// Prepare release materials like mail, release note
|
||||
|
||||
const commander = require('commander');
|
||||
const fse = require('fs-extra');
|
||||
const pathTool = require('path');
|
||||
const https = require('https');
|
||||
|
||||
commander
|
||||
.usage('[options]')
|
||||
.description([
|
||||
'Generate source release'
|
||||
].join('\n'))
|
||||
.option(
|
||||
'--rcversion <version>',
|
||||
'Release version'
|
||||
)
|
||||
.option(
|
||||
'--commit <commit>',
|
||||
'Hash of commit'
|
||||
)
|
||||
.option(
|
||||
'--repo <repo>',
|
||||
'Repo'
|
||||
)
|
||||
.option(
|
||||
'--out <out>',
|
||||
'Out directory. Default to be tmp/release-mail'
|
||||
)
|
||||
.parse(process.argv);
|
||||
|
||||
const outDir = pathTool.resolve(process.cwd(), commander.out || 'tmp/release-materials');
|
||||
const releaseCommit = commander.commit;
|
||||
if (!releaseCommit) {
|
||||
throw new Error('Release commit is required');
|
||||
}
|
||||
const repo = commander.repo || 'apache/echarts';
|
||||
|
||||
let rcVersion = commander.rcversion + '';
|
||||
if (rcVersion.startsWith('v')) { // tag may have v prefix, v5.1.0
|
||||
rcVersion = rcVersion.substr(1);
|
||||
}
|
||||
if (rcVersion.indexOf('-rc.') < 0) {
|
||||
throw new Error('Only rc version is accepeted.');
|
||||
}
|
||||
|
||||
const parts = /(\d+)\.(\d+)\.(\d+)\-rc\.(\d+)/.exec(rcVersion);
|
||||
if (!parts) {
|
||||
throw new Error(`Invalid version number ${rcVersion}`);
|
||||
}
|
||||
|
||||
const major = +parts[1];
|
||||
const minor = +parts[2];
|
||||
const patch = +parts[3];
|
||||
const rc = +parts[4];
|
||||
|
||||
const stableVersion = `${major}.${minor}.${patch}`;
|
||||
const releaseFullName = `Apache ECharts ${stableVersion} (release candidate ${rc})`;
|
||||
|
||||
console.log('[Release Repo] ' + repo);
|
||||
console.log('[Release Verion] ' + rcVersion);
|
||||
console.log('[Release Commit] ' + releaseCommit);
|
||||
console.log('[Release Name] ' + releaseFullName);
|
||||
|
||||
const voteTpl = fse.readFileSync(pathTool.join(__dirname, './template/vote-release.tpl'), 'utf-8');
|
||||
const voteResultTpl = fse.readFileSync(pathTool.join(__dirname, './template/vote-result.tpl'), 'utf-8');
|
||||
const announceTpl = fse.readFileSync(pathTool.join(__dirname, './template/announce-release.tpl'), 'utf-8');
|
||||
const voteUntil = new Date(+new Date() + (72 + 12) * 3600 * 1000); // 3.5 day.
|
||||
|
||||
fse.ensureDirSync(outDir);
|
||||
fse.writeFileSync(
|
||||
pathTool.resolve(outDir, 'vote.txt'),
|
||||
voteTpl.replace(/{{ECHARTS_RELEASE_VERSION}}/g, rcVersion)
|
||||
.replace(/{{ECHARTS_RELEASE_VERSION_FULL_NAME}}/g, releaseFullName)
|
||||
.replace(/{{ECHARTS_RELEASE_COMMIT}}/g, releaseCommit)
|
||||
.replace(/{{VOTE_UNTIL}}/g, voteUntil.toISOString()),
|
||||
'utf-8'
|
||||
);
|
||||
|
||||
fse.ensureDirSync(outDir);
|
||||
fse.writeFileSync(
|
||||
pathTool.resolve(outDir, 'vote-result.txt'),
|
||||
voteResultTpl.replace(/{{ECHARTS_RELEASE_VERSION}}/g, rcVersion)
|
||||
.replace(/{{ECHARTS_RELEASE_VERSION_FULL_NAME}}/g, releaseFullName),
|
||||
'utf-8'
|
||||
);
|
||||
|
||||
fse.writeFileSync(
|
||||
pathTool.resolve(outDir, 'announce.txt'),
|
||||
announceTpl.replace(/{{ECHARTS_RELEASE_VERSION}}/g, stableVersion)
|
||||
.replace(/{{ECHARTS_RELEASE_COMMIT}}/g, releaseCommit),
|
||||
'utf-8'
|
||||
);
|
||||
|
||||
|
||||
// Fetch RELEASE_NOTE
|
||||
https.get({
|
||||
hostname: 'api.github.com',
|
||||
path: `/repos/${repo}/releases`,
|
||||
headers: {
|
||||
'User-Agent': 'NodeJS'
|
||||
}
|
||||
}, function (res) {
|
||||
console.log(`https://api.github.com/repos/${repo}/releases`);
|
||||
if (res.statusCode !== 200) {
|
||||
console.error(`Failed to fetch releases ${res.statusCode}`);
|
||||
res.resume();
|
||||
return;
|
||||
}
|
||||
|
||||
res.setEncoding('utf8');
|
||||
let rawData = '';
|
||||
res.on('data', (chunk) => {
|
||||
rawData += chunk;
|
||||
});
|
||||
res.on('end', () => {
|
||||
let releaseNote = '';
|
||||
|
||||
const releases = JSON.parse(rawData);
|
||||
const found = releases.find(release => release.name === rcVersion);
|
||||
if (!found) {
|
||||
throw 'Can\'t found release';
|
||||
}
|
||||
else {
|
||||
releaseNote = found.body.trim();
|
||||
if (!releaseNote) {
|
||||
throw 'Release description is empty';
|
||||
}
|
||||
}
|
||||
|
||||
const firstLine = releaseNote.split('\n')[0];
|
||||
if (firstLine.indexOf(stableVersion) < 0) {
|
||||
// Add version if release note is not start with version.
|
||||
}
|
||||
releaseNote = `## ${stableVersion}\n\n${releaseNote}`;
|
||||
|
||||
fse.writeFileSync(
|
||||
pathTool.resolve(outDir, 'RELEASE_NOTE.txt'),
|
||||
releaseNote,
|
||||
'utf-8'
|
||||
);
|
||||
});
|
||||
}).on('error', (e) => {
|
||||
throw e;
|
||||
});
|
||||
26
uni-demo/node_modules/echarts/build/source-release/template/announce-release.tpl
generated
vendored
Normal file
26
uni-demo/node_modules/echarts/build/source-release/template/announce-release.tpl
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
--- Mail to: ---
|
||||
dev@echarts.apache.org
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
--- Subject: ---
|
||||
[ANNOUNCE] Release Apache ECharts {{ECHARTS_RELEASE_VERSION}}
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Hi all,
|
||||
|
||||
The Apache ECharts team is proud to announce Apache ECharts {{ECHARTS_RELEASE_VERSION}}.
|
||||
|
||||
Apache ECharts is a powerful, interactive charting and data visualization library for browser.
|
||||
|
||||
Download Links: https://echarts.apache.org/download.html
|
||||
|
||||
Release Notes: https://echarts.apache.org/changelog.html
|
||||
|
||||
Website: https://echarts.apache.org/
|
||||
|
||||
|
||||
ECharts Resources:
|
||||
- Issue: https://github.com/apache/echarts/issues
|
||||
- Build Guide: https://github.com/apache/echarts/blob/{{ECHARTS_RELEASE_VERSION}}/README.md
|
||||
- Mailing list: dev@echarts.apache.org
|
||||
44
uni-demo/node_modules/echarts/build/source-release/template/vote-release.tpl
generated
vendored
Normal file
44
uni-demo/node_modules/echarts/build/source-release/template/vote-release.tpl
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
--- Mail To: ---
|
||||
dev@echarts.apache.org
|
||||
-----------------------------------------------------------
|
||||
|
||||
--- Subject: ---
|
||||
[VOTE] Release {{ECHARTS_RELEASE_VERSION_FULL_NAME}}
|
||||
-----------------------------------------------------------
|
||||
|
||||
Dear community,
|
||||
|
||||
We are pleased to be calling this vote for the release of {{ECHARTS_RELEASE_VERSION_FULL_NAME}}.
|
||||
|
||||
The release candidate to be voted over is available at:
|
||||
https://dist.apache.org/repos/dist/dev/echarts/{{ECHARTS_RELEASE_VERSION}}/
|
||||
|
||||
The release candidate is signed with a GPG key available at:
|
||||
https://dist.apache.org/repos/dist/dev/echarts/KEYS
|
||||
|
||||
The Git commit for this release is:
|
||||
https://gitbox.apache.org/repos/asf?p=echarts.git;a=commit;h={{ECHARTS_RELEASE_COMMIT}}
|
||||
|
||||
The Release Note is available in:
|
||||
https://dist.apache.org/repos/dist/dev/echarts/{{ECHARTS_RELEASE_VERSION}}/RELEASE_NOTE.txt
|
||||
|
||||
Build Guide:
|
||||
https://github.com/apache/echarts/blob/{{ECHARTS_RELEASE_VERSION}}/README.md#build
|
||||
|
||||
NPM Install:
|
||||
npm i echarts@{{ECHARTS_RELEASE_VERSION}}
|
||||
https://www.npmjs.com/package/echarts/v/{{ECHARTS_RELEASE_VERSION}}
|
||||
|
||||
Please vote on releasing this package as:
|
||||
{{ECHARTS_RELEASE_VERSION_FULL_NAME}}
|
||||
by "{{VOTE_UNTIL}}".
|
||||
|
||||
[ ] +1 Release this package
|
||||
[ ] 0 I don't feel strongly about it, but don't object
|
||||
[ ] -1 Do not release this package because...
|
||||
|
||||
Anyone can participate in testing and voting, not just committers, please
|
||||
feel free to try out the release candidate and provide your votes.
|
||||
|
||||
A checklist for reference:
|
||||
https://cwiki.apache.org/confluence/display/ECHARTS/Apache+ECharts+Release+Checklist
|
||||
23
uni-demo/node_modules/echarts/build/source-release/template/vote-result.tpl
generated
vendored
Normal file
23
uni-demo/node_modules/echarts/build/source-release/template/vote-result.tpl
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
--- Mail To: ---
|
||||
dev@echarts.apache.org
|
||||
-----------------------------------------------------------
|
||||
|
||||
--- Subject: ---
|
||||
[RESULT] [VOTE] Release {{ECHARTS_RELEASE_VERSION_FULL_NAME}}
|
||||
-----------------------------------------------------------
|
||||
|
||||
Thanks to all who voted or provided comments!
|
||||
|
||||
We received ______NUMBER_OF_+1_VOTES______ +1 votes from the PMC members, and the release has PASSED:
|
||||
|
||||
+1 ______NAME______ (binding)
|
||||
|
||||
Other votes from the community:
|
||||
|
||||
+1 ______NAME______
|
||||
|
||||
Vote thread:
|
||||
https://lists.apache.org/thread/xxx
|
||||
|
||||
I'm going to release the source release of Apache ECharts {{ECHARTS_RELEASE_VERSION}}.
|
||||
Thank you all for making this happen!
|
||||
20
uni-demo/node_modules/echarts/build/template/charts.d.ts
generated
vendored
Normal file
20
uni-demo/node_modules/echarts/build/template/charts.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './types/dist/charts';
|
||||
27
uni-demo/node_modules/echarts/build/template/charts.js
generated
vendored
Normal file
27
uni-demo/node_modules/echarts/build/template/charts.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
// In somehow. If we export like
|
||||
// export * as LineChart './chart/line/install'
|
||||
// The exported code will be transformed to
|
||||
// import * as LineChart_1 './chart/line/install'; export {LineChart_1 as LineChart};
|
||||
// Treeshaking in webpack will not work even if we configured sideEffects to false in package.json
|
||||
|
||||
export * from './lib/export/charts.js';
|
||||
20
uni-demo/node_modules/echarts/build/template/components.d.ts
generated
vendored
Normal file
20
uni-demo/node_modules/echarts/build/template/components.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './types/dist/components';
|
||||
20
uni-demo/node_modules/echarts/build/template/components.js
generated
vendored
Normal file
20
uni-demo/node_modules/echarts/build/template/components.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './lib/export/components.js';
|
||||
20
uni-demo/node_modules/echarts/build/template/core.d.ts
generated
vendored
Normal file
20
uni-demo/node_modules/echarts/build/template/core.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './types/dist/core';
|
||||
20
uni-demo/node_modules/echarts/build/template/core.js
generated
vendored
Normal file
20
uni-demo/node_modules/echarts/build/template/core.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './lib/export/core.js';
|
||||
20
uni-demo/node_modules/echarts/build/template/features.d.ts
generated
vendored
Normal file
20
uni-demo/node_modules/echarts/build/template/features.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './types/dist/features';
|
||||
20
uni-demo/node_modules/echarts/build/template/features.js
generated
vendored
Normal file
20
uni-demo/node_modules/echarts/build/template/features.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './lib/export/features.js';
|
||||
20
uni-demo/node_modules/echarts/build/template/option.d.ts
generated
vendored
Normal file
20
uni-demo/node_modules/echarts/build/template/option.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './types/dist/option';
|
||||
20
uni-demo/node_modules/echarts/build/template/renderers.d.ts
generated
vendored
Normal file
20
uni-demo/node_modules/echarts/build/template/renderers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './types/dist/renderers';
|
||||
20
uni-demo/node_modules/echarts/build/template/renderers.js
generated
vendored
Normal file
20
uni-demo/node_modules/echarts/build/template/renderers.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
export * from './lib/export/renderers.js';
|
||||
75
uni-demo/node_modules/echarts/build/testDts.js
generated
vendored
Normal file
75
uni-demo/node_modules/echarts/build/testDts.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
const { TypeScriptVersion } = require('@definitelytyped/typescript-versions');
|
||||
const {
|
||||
cleanTypeScriptInstalls,
|
||||
installAllTypeScriptVersions,
|
||||
typeScriptPath
|
||||
} = require('@definitelytyped/utils');
|
||||
const { runTsCompile } = require('./pre-publish');
|
||||
const globby = require('globby');
|
||||
const semver = require('semver');
|
||||
|
||||
const MIN_VERSION = '3.5.0';
|
||||
|
||||
async function installTs() {
|
||||
// await cleanTypeScriptInstalls();
|
||||
await installAllTypeScriptVersions();
|
||||
}
|
||||
|
||||
async function runTests() {
|
||||
const compilerOptions = {
|
||||
declaration: false,
|
||||
importHelpers: false,
|
||||
sourceMap: false,
|
||||
pretty: false,
|
||||
removeComments: false,
|
||||
allowJs: false,
|
||||
outDir: __dirname + '/../test/types/tmp',
|
||||
typeRoots: [__dirname + '/../types/dist'],
|
||||
rootDir: __dirname + '/../test/types',
|
||||
|
||||
// Must pass in most strict cases
|
||||
strict: true
|
||||
};
|
||||
const testsList = await globby(__dirname + '/../test/types/*.ts');
|
||||
|
||||
for (let version of TypeScriptVersion.shipped) {
|
||||
if (semver.lt(version + '.0', MIN_VERSION)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
console.log(`Testing ts version ${version}`);
|
||||
const ts = require(typeScriptPath(version));
|
||||
await runTsCompile(ts, compilerOptions, testsList);
|
||||
|
||||
console.log(`Finished test of ts version ${version}`);
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
await installTs();
|
||||
await runTests();
|
||||
}
|
||||
|
||||
module.exports = main;
|
||||
|
||||
main();
|
||||
58
uni-demo/node_modules/echarts/build/transform-dev.js
generated
vendored
Normal file
58
uni-demo/node_modules/echarts/build/transform-dev.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
const babel = require('@babel/core');
|
||||
const parser = require('@babel/parser');
|
||||
|
||||
function transformDEVPlugin ({types, template}) {
|
||||
return {
|
||||
visitor: {
|
||||
Identifier: {
|
||||
enter(path, state) {
|
||||
if (path.isIdentifier({ name: '__DEV__' }) && path.scope.hasGlobal('__DEV__')) {
|
||||
path.replaceWith(
|
||||
parser.parseExpression(state.opts.expr)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
module.exports.transform = function (sourceCode, sourcemap, expr) {
|
||||
let {code, map} = babel.transformSync(sourceCode, {
|
||||
plugins: [ [transformDEVPlugin, {
|
||||
expr: expr || 'process.env.NODE_ENV !== \'production\''
|
||||
}] ],
|
||||
compact: false,
|
||||
sourceMaps: sourcemap
|
||||
});
|
||||
|
||||
return {code, map};
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} code
|
||||
* @throws {Error} If check failed.
|
||||
*/
|
||||
module.exports.recheckDEV = function (code) {
|
||||
return code.indexOf('process.env.NODE_ENV') >= 0;
|
||||
};
|
||||
Reference in New Issue
Block a user