@bbn/bbn 2.0.8 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,8 @@
1
- import dayjs from 'dayjs';
2
- import isLeapYear from 'dayjs/plugin/isLeapYear.js';
3
- import dayjs_plugin_calendar from 'dayjs/plugin/calendar.js';
4
1
  import date from '../../date.js';
5
2
  import isString from '../type/isString.js';
6
3
  const bbn = {
7
4
  _: st => st
8
5
  };
9
- dayjs.extend(dayjs_plugin_calendar);
10
- dayjs.extend(isLeapYear);
11
6
  /**
12
7
  * Returns a date relative to the current day.
13
8
  *
package/dist/fn/init.js CHANGED
@@ -31,47 +31,6 @@ export default function init(cfg, force) {
31
31
  if (bbn.env.root.length && substr(bbn.env.root, -1) !== "/") {
32
32
  bbn.env.root += "/";
33
33
  }
34
- if (!bbn.env.isInit && typeof dayjs !== "undefined") {
35
- each([
36
- "advancedFormat",
37
- "arraySupport",
38
- "badMutable",
39
- "buddhistEra",
40
- "calendar",
41
- "customParseFormat",
42
- "dayOfYear",
43
- "devHelper",
44
- "duration",
45
- "isBetween",
46
- "isLeapYear",
47
- "isSameOrAfter",
48
- "isSameOrBefore",
49
- "isToday",
50
- "isTomorrow",
51
- "isYesterday",
52
- "isoWeek",
53
- "isoWeeksInYear",
54
- "localeData",
55
- "localizedFormat",
56
- "minMax",
57
- "objectSupport",
58
- "pluralGetSet",
59
- "quarterOfYear",
60
- "relativeTime",
61
- "timezone",
62
- "toArray",
63
- "toObject",
64
- "updateLocale",
65
- "utc",
66
- "weekOfYear",
67
- "weekYear",
68
- "weekday",
69
- ], (plugin) => {
70
- if (window["dayjs_plugin_" + plugin]) {
71
- dayjs.extend(window["dayjs_plugin_" + plugin]);
72
- }
73
- });
74
- }
75
34
  /* The server's path (difference between the host and the current dir */
76
35
  if (typeof cfg === "object") {
77
36
  extend(true, bbn, cfg);
@@ -88,11 +47,6 @@ export default function init(cfg, force) {
88
47
  if (bbn.var.colors) {
89
48
  addColors(bbn.var.colors);
90
49
  }
91
- if (bbn.env.lang && undefined !== dayjs) {
92
- import('dayjs/locale/' + bbn.env.lang + '.js').then(() => {
93
- dayjs.locale(bbn.env.lang);
94
- });
95
- }
96
50
  document.addEventListener("visibilitychange", () => {
97
51
  if (document.hidden && bbn.env.isFocused) {
98
52
  bbn.env.isFocused = false;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import dayjs from 'dayjs';
2
1
  declare const bbn: Bbn;
3
- export { bbn as default, bbn, dayjs };
2
+ export default bbn;
package/dist/index.js CHANGED
@@ -1,38 +1,3 @@
1
- import dayjs from 'dayjs';
2
- import calendar from 'dayjs/plugin/calendar.js';
3
- import customParseFormat from 'dayjs/plugin/customParseFormat.js';
4
- import dayOfYear from 'dayjs/plugin/dayOfYear.js';
5
- import duration from 'dayjs/plugin/duration.js';
6
- import isBetween from 'dayjs/plugin/isBetween.js';
7
- import isLeapYear from 'dayjs/plugin/isLeapYear.js';
8
- import isoWeek from 'dayjs/plugin/isoWeek.js';
9
- import localeData from 'dayjs/plugin/localeData.js';
10
- import localizedFormat from 'dayjs/plugin/localizedFormat.js';
11
- import minMax from 'dayjs/plugin/minMax.js';
12
- import quarterOfYear from 'dayjs/plugin/quarterOfYear.js';
13
- import relativeTime from 'dayjs/plugin/relativeTime.js';
14
- import timezone from 'dayjs/plugin/timezone.js';
15
- import updateLocale from 'dayjs/plugin/updateLocale.js';
16
- import utc from 'dayjs/plugin/utc.js';
17
- import weekday from 'dayjs/plugin/weekday.js';
18
- import weekOfYear from 'dayjs/plugin/weekOfYear.js';
19
- dayjs.extend(calendar);
20
- dayjs.extend(customParseFormat);
21
- dayjs.extend(dayOfYear);
22
- dayjs.extend(duration);
23
- dayjs.extend(isBetween);
24
- dayjs.extend(isLeapYear);
25
- dayjs.extend(isoWeek);
26
- dayjs.extend(localeData);
27
- dayjs.extend(localizedFormat);
28
- dayjs.extend(minMax);
29
- dayjs.extend(quarterOfYear);
30
- dayjs.extend(relativeTime);
31
- dayjs.extend(timezone);
32
- dayjs.extend(updateLocale);
33
- dayjs.extend(utc);
34
- dayjs.extend(weekday);
35
- dayjs.extend(weekOfYear);
36
1
  import _ from './_.js';
37
2
  import $ from './$.js';
38
3
  import lng from './lng.js';
@@ -127,7 +92,6 @@ const bbn = {
127
92
  ]
128
93
  };
129
94
  if ('undefined' !== typeof window) {
130
- window.dayjs = dayjs;
131
95
  window.bbn = bbn;
132
96
  }
133
- export { bbn as default, bbn, dayjs };
97
+ export default bbn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,30 +24,27 @@
24
24
  "author": "Thomas Nabet <thomas.nabet@gmail.com>",
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "chai": "^5.2.1",
28
- "jsdom": "26.1.0",
27
+ "@rollup/plugin-commonjs": "^29.0.0",
28
+ "@rollup/plugin-json": "^6.1.0",
29
+ "@rollup/plugin-node-resolve": "^16.0.3",
30
+ "@rollup/plugin-replace": "^6.0.3",
31
+ "@rollup/plugin-terser": "^0.4.4",
32
+ "@rollup/plugin-typescript": "^12.3.0",
33
+ "chai": "^6.2.1",
34
+ "jsdom": "27.2.0",
29
35
  "jsdom-global": "3.0.2",
30
- "mocha": "^11.7.1",
31
- "ts-loader": "^9.5.2",
32
- "typescript": "^5.8.3",
33
- "webpack": "^5.101.0",
36
+ "mocha": "^11.0.0",
37
+ "rollup": "^4.53.2",
38
+ "ts-loader": "^9.5.4",
39
+ "tslib": "^2.8.1",
40
+ "typescript": "^5.9.3",
41
+ "webpack": "^5.102.1",
34
42
  "webpack-cli": "^6.0.1"
35
43
  },
36
44
  "bugs": {
37
45
  "url": "https://github.com/nabab/bbn-js/issues"
38
46
  },
39
47
  "homepage": "https://github.com/nabab/bbn-js#readme",
40
- "dependencies": {
41
- "@rollup/plugin-commonjs": "^28.0.6",
42
- "@rollup/plugin-json": "^6.1.0",
43
- "@rollup/plugin-node-resolve": "^16.0.1",
44
- "@rollup/plugin-replace": "^6.0.2",
45
- "@rollup/plugin-terser": "^0.4.4",
46
- "@rollup/plugin-typescript": "^12.1.4",
47
- "dayjs": "^1.11.13",
48
- "rollup": "^4.46.1",
49
- "tslib": "^2.8.1"
50
- },
51
48
  "directories": {
52
49
  "doc": "doc",
53
50
  "test": "test"