@openhps/rdf 0.1.12 → 0.1.13

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/.eslintrc.js ADDED
@@ -0,0 +1,39 @@
1
+ module.exports = {
2
+ "env": {
3
+ "browser": true,
4
+ "es6": true,
5
+ "node": true
6
+ },
7
+ "parser": "@typescript-eslint/parser",
8
+ "parserOptions": {
9
+ "project": "tsconfig.json",
10
+ "sourceType": "module",
11
+ },
12
+ "plugins": [
13
+ "@typescript-eslint",
14
+ "eslint-plugin-import",
15
+ "eslint-plugin-jsdoc",
16
+ "prettier",
17
+ "deprecation"
18
+ ],
19
+ "rules": {
20
+ "@typescript-eslint/no-explicit-any": "off",
21
+ "@typescript-eslint/no-empty-interface": "off",
22
+ "@typescript-eslint/explicit-module-boundary-types": "off",
23
+ "@typescript-eslint/no-unused-vars": "warn",
24
+ "deprecation/deprecation": "warn",
25
+ "import/no-cycle": ["error", { "maxDepth": 15 }],
26
+ "import/no-unresolved": "off",
27
+ "prettier/prettier": ["error"],
28
+ "jsdoc/check-tag-names": ["error", { "definedTags": ["category"] }],
29
+ },
30
+ "extends": [
31
+ "eslint:recommended",
32
+ "plugin:@typescript-eslint/eslint-recommended",
33
+ "plugin:@typescript-eslint/recommended",
34
+ "plugin:eslint-plugin-jsdoc/recommended",
35
+ "plugin:eslint-plugin-import/recommended",
36
+ "plugin:import/typescript",
37
+ "prettier"
38
+ ]
39
+ };
package/.prettierrc.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ semi: true,
3
+ trailingComma: "all",
4
+ singleQuote: true,
5
+ printWidth: 120,
6
+ tabWidth: 4,
7
+ endOfLine: 'lf'
8
+ };
@@ -0,0 +1 @@
1
+ module.exports = { extends: ['@commitlint/config-conventional'] }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openhps/rdf",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Open Hybrid Positioning System",
5
5
  "author": "Maxim Van de Wynckel",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,9 @@
41
41
  "jsdelivr": "dist/web/openhps-rdf.min.js",
42
42
  "files": [
43
43
  "dist/**/*",
44
- "src/**/*"
44
+ "src/**/*",
45
+ "*.js",
46
+ "*.d.ts"
45
47
  ],
46
48
  "scripts": {
47
49
  "test": "mocha --config test/.mocharc.json",
@@ -0,0 +1 @@
1
+ export * from './dist/types/index.serialization';
@@ -0,0 +1 @@
1
+ export * from './dist/esm/index.browser';
package/vocab.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/types/index.vocab';
package/vocab.js ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/esm/index.vocab';
@@ -0,0 +1,87 @@
1
+ const TerserPlugin = require('terser-webpack-plugin');
2
+ const path = require('path');
3
+ const pkg = require("./package.json");
4
+
5
+ const LIBRARY_NAME = pkg.name;
6
+ const PROJECT_NAME = pkg.name.replace("@", "").replace("/", "-");
7
+
8
+ const defaultConfig = env => ({
9
+ mode: env.prod ? "production" : "development",
10
+ devtool: 'source-map',
11
+ resolve: {
12
+ alias: {
13
+ typescript: false,
14
+ },
15
+ fallback: {
16
+ path: false,
17
+ fs: false,
18
+ os: false,
19
+ util: false,
20
+ stream: false,
21
+ url: false,
22
+ assert: false,
23
+ tls: false,
24
+ net: false,
25
+ buffer: require.resolve("buffer"),
26
+ }
27
+ },
28
+ optimization: {
29
+ minimize: env.prod,
30
+ minimizer: [
31
+ new TerserPlugin({
32
+ parallel: true,
33
+ terserOptions: {
34
+ keep_classnames: true,
35
+ sourceMap: true,
36
+ }
37
+ })
38
+ ],
39
+ portableRecords: true,
40
+ usedExports: true,
41
+ },
42
+ performance: {
43
+ hints: false,
44
+ maxEntrypointSize: 300000,
45
+ maxAssetSize: 300000
46
+ },
47
+ });
48
+
49
+ const bundle = (env, module, entry = 'index', suffix = '') => ({
50
+ name: PROJECT_NAME,
51
+ entry: `./dist/esm/${entry}.js`,
52
+ output: {
53
+ path: path.resolve(__dirname, 'dist'),
54
+ filename: `web/${PROJECT_NAME}${suffix}${module ? ".es" : ""}${env.prod ? ".min" : ""}.js`,
55
+ library: module ? undefined : ['OpenHPS', LIBRARY_NAME.substring(LIBRARY_NAME.indexOf("/") + 1)],
56
+ libraryTarget: module ? "module" : "umd",
57
+ umdNamedDefine: !module,
58
+ globalObject: module ? undefined : `(typeof self !== 'undefined' ? self : this)`,
59
+ environment: { module },
60
+ },
61
+ experiments: {
62
+ outputModule: module,
63
+ },
64
+ externalsType: module ? "module" : undefined,
65
+ externals: {
66
+ '@openhps/core': module ? "./openhps-core.es" + (env.prod ? ".min" : "") + ".js" : {
67
+ commonjs: '@openhps/core',
68
+ commonjs2: '@openhps/core',
69
+ amd: 'core',
70
+ root: ['OpenHPS', 'core']
71
+ }
72
+ },
73
+ devtool: 'source-map',
74
+ plugins: [],
75
+ ...defaultConfig(env)
76
+ });
77
+
78
+ module.exports = env => [
79
+ bundle(env, true, 'index', '.all'),
80
+ bundle(env, false, 'index', '.all'),
81
+ bundle(env, true, 'index.sparql', '.sparql'),
82
+ bundle(env, false, 'index.sparql', '.sparql'),
83
+ bundle(env, true, 'index.serialization', '.serialization'),
84
+ bundle(env, false, 'index.serialization', '.serialization'),
85
+ bundle(env, true, 'index.vocab', '.vocab'),
86
+ bundle(env, false, 'index.vocab', '.vocab'),
87
+ ];