Skip to content

Commit 01ac239

Browse files
committed
release: v3.0.0-rc.0
1 parent 4a92628 commit 01ac239

30 files changed

+196
-6530
lines changed

.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"plugin:import/errors",
55
"plugin:import/warnings",
66
"plugin:unicorn/recommended",
7-
"xo/esnext",
7+
"xo",
88
"xo/browser"
99
],
1010
"rules": {
@@ -51,6 +51,7 @@
5151
"unicorn/prefer-dom-node-append": "off",
5252
"unicorn/prefer-dom-node-dataset": "off",
5353
"unicorn/prefer-dom-node-remove": "off",
54+
"unicorn/prefer-module": "off",
5455
"unicorn/prefer-query-selector": "off",
5556
"unicorn/prefer-spread": "off",
5657
"unicorn/prevent-abbreviations": "off"

.gitignore

+40-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
2+
# Ignore docs files
3+
/_gh_pages/
4+
# Hugo resources folder
5+
/resources/
6+
7+
# Numerous always-ignore extensions
8+
*.diff
9+
*.err
10+
*.log
11+
*.orig
12+
*.rej
13+
*.swo
14+
*.swp
15+
*.vi
16+
*.zip
17+
*~
18+
19+
# OS or Editor folders
20+
._*
21+
.cache
122
.DS_Store
223
.idea
3-
node_modules
24+
.project
25+
.settings
26+
.tmproj
27+
*.esproj
28+
*.sublime-project
29+
*.sublime-workspace
30+
nbproject
31+
Thumbs.db
32+
/.vscode/
33+
# Local Netlify folder
34+
.netlify
35+
36+
# Komodo
37+
.komodotools
38+
*.komodoproject
39+
40+
# Folders to ignore
41+
/js/coverage/
42+
/node_modules/

build/.eslintrc.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"env": {
3+
"browser": false,
4+
"node": true
5+
},
6+
"parserOptions": {
7+
"sourceType": "script"
8+
},
9+
"extends": "../.eslintrc.json",
10+
"rules": {
11+
"no-console": "off",
12+
"strict": "error"
13+
}
14+
}

build/banner.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const year = new Date().getFullYear()
66

77
function getBanner(pluginFilename) {
88
return `/*!
9-
* CoreUI Plugins - Chart.js for CoreUI 3${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
9+
* CoreUI Plugins - Chart.js for CoreUI 4 ${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
1010
* Copyright ${year} ${pkg.author.name}
1111
* Licensed under MIT (${pkg.homepage}/license/)
1212
*/`

build/change-version.js

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env node
2+
3+
/*!
4+
* Script to update version number references in the project.
5+
* Copyright 2017-2021 The Bootstrap Authors
6+
* Copyright 2017-2021 Twitter, Inc.
7+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
8+
*/
9+
10+
'use strict'
11+
12+
const fs = require('fs').promises
13+
const path = require('path')
14+
const globby = require('globby')
15+
16+
const VERBOSE = process.argv.includes('--verbose')
17+
const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-run')
18+
19+
// These are the filetypes we only care about replacing the version
20+
const GLOB = [
21+
'**/*.{css,html,js,json,md,scss,txt,yml}'
22+
]
23+
const GLOBBY_OPTIONS = {
24+
cwd: path.join(__dirname, '..'),
25+
gitignore: true
26+
}
27+
const EXCLUDED_FILES = [
28+
'CHANGELOG.md'
29+
]
30+
31+
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
32+
function regExpQuote(string) {
33+
return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&')
34+
}
35+
36+
function regExpQuoteReplacement(string) {
37+
return string.replace(/\$/g, '$$')
38+
}
39+
40+
async function replaceRecursively(file, oldVersion, newVersion) {
41+
const originalString = await fs.readFile(file, 'utf8')
42+
const newString = originalString.replace(
43+
new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion)
44+
)
45+
46+
// No need to move any further if the strings are identical
47+
if (originalString === newString) {
48+
return
49+
}
50+
51+
if (VERBOSE) {
52+
console.log(`FILE: ${file}`)
53+
}
54+
55+
if (DRY_RUN) {
56+
return
57+
}
58+
59+
await fs.writeFile(file, newString, 'utf8')
60+
}
61+
62+
async function main(args) {
63+
const [oldVersion, newVersion] = args
64+
65+
if (!oldVersion || !newVersion) {
66+
console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]')
67+
console.error('Got arguments:', args)
68+
process.exit(1)
69+
}
70+
71+
// Strip any leading `v` from arguments because otherwise we will end up with duplicate `v`s
72+
[oldVersion, newVersion].map(arg => arg.startsWith('v') ? arg.slice(1) : arg)
73+
74+
try {
75+
const files = await globby(GLOB, GLOBBY_OPTIONS, EXCLUDED_FILES)
76+
77+
await Promise.all(files.map(file => replaceRecursively(file, oldVersion, newVersion)))
78+
} catch (error) {
79+
console.error(error)
80+
process.exit(1)
81+
}
82+
}
83+
84+
main(process.argv.slice(2))

build/postcss.config.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
module.exports = ctx => {
44
return {
5+
map: ctx.file.dirname.includes('examples') ?
6+
false :
7+
{
8+
inline: false,
9+
annotation: true,
10+
sourcesContent: true
11+
},
512
plugins: {
613
autoprefixer: {
714
cascade: false
815
},
9-
'postcss-combine-duplicated-selectors': {},
10-
rtlcss: ctx.env === 'RTL' ? {} : false
16+
'postcss-combine-duplicated-selectors': {}
1117
}
1218
}
1319
}

build/rollup.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ const plugins = [
2020
})
2121
]
2222
const globals = {
23-
'chart.js': 'Chart'
23+
'chart.js/auto': 'Chart',
24+
'chart.js/helpers': 'Chart.helpers'
2425
}
2526

2627
if (BUNDLE) {
2728
fileDest += '.bundle'
2829
// Remove last entry in external array to bundle Chart.js
2930
external.pop()
3031
delete globals['chart.js']
32+
delete globals['chart.js/helpers']
3133
plugins.push(
3234
replace(),
3335
nodeResolve()

dist/css/coreui-chartjs.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/coreui-chartjs.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/coreui-chartjs.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/coreui-chartjs.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)