apextree 1.2.0 → 1.4.0

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.
package/package.json CHANGED
@@ -1,23 +1,26 @@
1
1
  {
2
2
  "name": "apextree",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "dependencies": {
5
5
  "@svgdotjs/svg.js": "^3.2.0",
6
6
  "@svgdotjs/svg.panzoom.js": "^2.1.2",
7
- "d3-flextree": "^2.1.2"
8
- },
9
- "peerDependencies": {
10
- "@svgdotjs/svg.js": "*",
11
- "@svgdotjs/svg.panzoom.js": "^2.1.2"
7
+ "@dagrejs/dagre": "^1.1.4"
12
8
  },
13
9
  "type": "module",
14
- "typings": "./index.d.ts",
15
- "main": "./apextree.js",
16
- "module": "./apextree.es.js",
10
+ "types": "./index.d.ts",
11
+ "main": "./apextree.min.js",
12
+ "module": "./apextree.es.min.js",
13
+ "license": "See LICENSE in LICENSE",
17
14
  "exports": {
18
15
  ".": {
19
- "import": "./apextree.es.js",
20
- "require": "./apextree.js"
16
+ "import": {
17
+ "types": "./index.d.ts",
18
+ "default": "./apextree.es.min.js"
19
+ },
20
+ "require": {
21
+ "types": "./index.d.ts",
22
+ "default": "./apextree.min.js"
23
+ }
21
24
  }
22
25
  }
23
26
  }
package/tsconfig.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowSyntheticDefaultImports": true,
4
+ "baseUrl": ".",
5
+ "rootDir": ".",
6
+ "module": "commonjs",
7
+ "moduleResolution": "Node",
8
+ "resolveJsonModule": true,
9
+ "target": "es6",
10
+ "esModuleInterop": true,
11
+ "noImplicitAny": true,
12
+ "strictNullChecks": true,
13
+ "lib": [
14
+ "es2021",
15
+ "dom"
16
+ ]
17
+ },
18
+ "include": ["src/**/*"],
19
+ "exclude": [
20
+ "node_modules",
21
+ "dist",
22
+ ],
23
+ "ts-node": {
24
+ "esm": true,
25
+ "experimentalSpecifierResolution": "node"
26
+ },
27
+ "files": ["globals.d.ts"]
28
+ }
@@ -0,0 +1,68 @@
1
+ import path from 'path';
2
+ import {Compiler, Configuration, WebpackPluginInstance} from 'webpack';
3
+
4
+ export const ROOT = path.resolve(__dirname, '.');
5
+
6
+ interface CommonConfig extends Configuration {
7
+ plugins: (((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance)[];
8
+ }
9
+
10
+ export const commonConfig: CommonConfig = {
11
+ entry: [path.resolve(__dirname, 'src/ApexTree.ts')],
12
+ output: {
13
+ clean: true,
14
+ filename: 'ApexTree.js',
15
+ path: path.resolve(__dirname, 'dist'),
16
+ library: 'ApexTree',
17
+ libraryTarget: 'umd',
18
+ libraryExport: 'ApexTree',
19
+ },
20
+ module: {
21
+ rules: [
22
+ {
23
+ // Include ts, tsx, js, and jsx files.
24
+ test: /\.(ts|js)?$/,
25
+ include: [ROOT],
26
+ exclude: [/node_modules/],
27
+ use: [
28
+ {
29
+ loader: 'babel-loader',
30
+ options: {
31
+ // Rely on babel loading it's `babel.config.js` file. If we need to edit it for
32
+ // Hot Module Reloading support so be it.
33
+ // https://gist.github.com/rmoorman/94eeed830942758e218d92f15ce58d88
34
+ presets: [['@babel/preset-env', {targets: 'defaults'}]],
35
+ plugins: ['@babel/plugin-proposal-class-properties', '@babel/plugin-transform-runtime'],
36
+ },
37
+ },
38
+ ],
39
+ },
40
+ {
41
+ test: /\.ts?$/,
42
+ include: [ROOT],
43
+ exclude: [/node_modules/],
44
+ use: [
45
+ 'babel-loader',
46
+ {
47
+ loader: 'ts-loader',
48
+ options: {
49
+ configFile: 'tsconfig.json',
50
+ transpileOnly: true,
51
+ experimentalWatchApi: true,
52
+ },
53
+ },
54
+ ],
55
+ },
56
+ {test: /\.(less)$/, loader: 'asset/resource'},
57
+ {
58
+ test: /\.svg$/,
59
+ loader: 'raw-loader',
60
+ },
61
+ ],
62
+ },
63
+ resolve: {
64
+ modules: [__dirname, 'src', 'node_modules'],
65
+ extensions: ['.ts', '.js'],
66
+ },
67
+ plugins: [],
68
+ };
@@ -0,0 +1,7 @@
1
+ import {Configuration} from 'webpack';
2
+
3
+ export default (argv: any, env: any = {mode: 'production'}): Configuration => {
4
+ const mode = argv?.mode || env.mode;
5
+ const config: Configuration = require(`./webpack.${mode === 'development' ? 'dev' : 'prod'}`).default;
6
+ return config;
7
+ };
package/webpack.dev.ts ADDED
@@ -0,0 +1,12 @@
1
+ import {Configuration} from 'webpack';
2
+ import {commonConfig} from './webpack.common';
3
+
4
+ const config: Configuration = {
5
+ ...commonConfig,
6
+ mode: 'development',
7
+ optimization: {
8
+ minimize: false
9
+ },
10
+ };
11
+
12
+ export default config;
@@ -0,0 +1,9 @@
1
+ import {Configuration} from 'webpack';
2
+ import {commonConfig} from './webpack.common';
3
+
4
+ const config: Configuration = {
5
+ ...commonConfig,
6
+ mode: 'production',
7
+ };
8
+
9
+ export default config;