Skip to content

Commit

Permalink
fix: building webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximvdw committed Jan 26, 2025
1 parent 4e0ec9c commit 2526911
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 37 deletions.
4 changes: 2 additions & 2 deletions examples/cli/src/ObservableProperty.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SerializableMember, SerializableObject } from "@openhps/core";
import { sosa, rdfs, ssn } from "@openhps/rdf/vocab";
import { sosa, rdfs, ssn } from "@openhps/rdf";
import { DataFactory } from 'n3';
import { SerializableNamedNode, IriString, Thing } from "@openhps/rdf/serialization";
import { SerializableNamedNode, IriString, Thing } from "@openhps/rdf";

@SerializableObject({
rdf: {
Expand Down
2 changes: 1 addition & 1 deletion examples/server/src/models/Deployment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SerializableMember, SerializableObject } from "@openhps/core";
import { rdfs, ssn } from "@openhps/rdf/vocab";
import { rdfs, ssn } from "@openhps/rdf";
import { Platform } from "./Platform";

@SerializableObject({
Expand Down
4 changes: 2 additions & 2 deletions examples/server/src/models/FeatureOfInterest.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SerializableArrayMember, SerializableMember, SerializableObject } from "@openhps/core";
import { rdfs, sosa, ssn } from "@openhps/rdf/vocab";
import { rdfs, sosa, ssn } from "@openhps/rdf";
import { ObservableProperty } from "./ObservableProperty";
import { SerializableNamedNode } from "@openhps/rdf/serialization";
import { SerializableNamedNode } from "@openhps/rdf";

@SerializableObject({
rdf: {
Expand Down
2 changes: 1 addition & 1 deletion examples/server/src/models/Geometry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SerializableMember, SerializableObject } from "@openhps/core";
import { ogc } from "@openhps/rdf/vocab";
import { ogc } from "@openhps/rdf";
import { QuantityValue } from "./QuantityValue";
import { DataFactory } from 'n3';

Expand Down
4 changes: 2 additions & 2 deletions examples/server/src/models/ObservableProperty.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SerializableMember, SerializableObject } from "@openhps/core";
import { sosa, rdfs, ssn } from "@openhps/rdf/vocab";
import { sosa, rdfs, ssn } from "@openhps/rdf";
import { DataFactory } from 'n3';
import { SerializableNamedNode, IriString, Thing } from "@openhps/rdf/serialization";
import { SerializableNamedNode, IriString, Thing } from "@openhps/rdf";

@SerializableObject({
rdf: {
Expand Down
4 changes: 2 additions & 2 deletions examples/server/src/models/Observation.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { SerializableArrayMember, SerializableMember, SerializableObject } from "@openhps/core";
import { sosa } from "@openhps/rdf/vocab";
import { sosa } from "@openhps/rdf";
import { FeatureOfInterest } from "./FeatureOfInterest";
import { ObservableProperty } from "./ObservableProperty";
import { SerializableNamedNode, xsd } from "@openhps/rdf/serialization";
import { SerializableNamedNode, xsd } from "@openhps/rdf";

@SerializableObject({
rdf: {
Expand Down
4 changes: 2 additions & 2 deletions examples/server/src/models/Platform.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SerializableMember, SerializableObject } from "@openhps/core";
import { SerializableNamedNode } from "@openhps/rdf/serialization";
import { sosa, rdfs } from "@openhps/rdf/vocab";
import { SerializableNamedNode } from "@openhps/rdf";
import { sosa, rdfs } from "@openhps/rdf";

@SerializableObject({
rdf: {
Expand Down
2 changes: 1 addition & 1 deletion examples/server/src/models/QuantityValue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SerializableMember, SerializableObject, Unit } from "@openhps/core";
import { qudt } from "@openhps/rdf/vocab";
import { qudt } from "@openhps/rdf";

@SerializableObject({
rdf: {
Expand Down
4 changes: 2 additions & 2 deletions examples/server/src/models/System.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SerializableArrayMember, SerializableMember, SerializableObject } from "@openhps/core";
import { SerializableNamedNode } from "@openhps/rdf/serialization";
import { rdfs, ssn } from "@openhps/rdf/vocab";
import { SerializableNamedNode } from "@openhps/rdf";
import { rdfs, ssn } from "@openhps/rdf";
import { Deployment } from "./Deployment";

@SerializableObject({
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
},
"peerDependencies": {
"@openhps/core": ">=0.6.9",
"@openhps/rdf": ">=0.4.98",
"@openhps/rdf": ">=0.4.99",
"reflect-metadata": ">=0.2.1"
},
"devDependencies": {
Expand All @@ -111,7 +111,7 @@
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@openhps/core": ">=0.7.10",
"@openhps/rdf": ">=0.4.95",
"@openhps/rdf": ">=0.4.99",
"@openhps/rf": "^1.0.1",
"@types/chai": "^4.3.19",
"@types/cookie-session": "^2.0.49",
Expand Down
3 changes: 2 additions & 1 deletion src/common/SolidPropertyService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import {
RDFBuilder,
DataFactory,
SerializableThing,
Observation,
} from '@openhps/rdf';
import { SolidProfileObject } from './SolidProfileObject';
import { SolidDataDriver, SolidFilterQuery } from './SolidDataDriver';
import { SolidService, SolidSession } from './SolidService';
import { Observation } from '@openhps/rdf/models';

import { EventStream } from '../models/ldes';
import { Node } from '../models/tree';
import { tree } from '../terms';
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import '@openhps/rdf/minimal';
import '@openhps/rdf';
export * from './index.node';
2 changes: 1 addition & 1 deletion src/mapping/Event.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SerializableObject } from '@openhps/core';
import { ssn } from '@openhps/rdf/vocab';
import { ssn } from '@openhps/rdf';

@SerializableObject({
rdf: {
Expand Down
34 changes: 21 additions & 13 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,27 @@ const bundle = (env, module, entry = 'index', suffix = '') => {
outputModule: module,
},
externalsType: module ? "module" : undefined,
externals: {
'@openhps/core': module ? "./openhps-core.es" + (env.prod ? ".min" : "") + ".js" : {
commonjs: '@openhps/core',
commonjs2: '@openhps/core',
amd: 'core',
root: ['OpenHPS', 'core']
},
'@openhps/rdf': module ? "./openhps-rdf.es" + (env.prod ? ".min" : "") + ".js" : {
commonjs: '@openhps/rdf',
commonjs2: '@openhps/rdf',
amd: 'rdf',
root: ['OpenHPS', 'rdf']
},
externals: function ({ context, request }, callback) {
const packages = ['core', 'rdf', 'rf'];
const knownExternals = packages.reduce((externals, pkg) => {
const packageName = `@openhps/${pkg}`;
externals[packageName] = module ? `./openhps-${pkg}.es${env.prod ? ".min" : ""}.js` : {
commonjs: packageName,
commonjs2: packageName,
amd: pkg,
root: ['OpenHPS', pkg]
};
return externals;
}, {});
const external = knownExternals[request];
if (external) {
if (!module || typeof external === 'object') {
return callback(null, external);
} else if (module && typeof external === 'string') {
return callback(null, `promise import('${external}')`)
}
}
callback();
},
devtool: 'source-map',
plugins: [],
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5080,10 +5080,10 @@
robust-predicates "^3.0.2"
wkt "^0.1.1"

"@openhps/rdf@>=0.4.95":
version "0.4.97"
resolved "https://registry.yarnpkg.com/@openhps/rdf/-/rdf-0.4.97.tgz#181a78227e6dab213c3aff88ad2ee3c222dd8a04"
integrity sha512-+hB+pk8G/72jWZdfTCbhxugOoYrxJIMr+zc8Bxtpnhf/GFjnCBAlnSodIa2jijPdX7YzLPK0M0d//D5XELl97Q==
"@openhps/rdf@>=0.4.99":
version "0.4.99"
resolved "https://registry.yarnpkg.com/@openhps/rdf/-/rdf-0.4.99.tgz#08f0104a1183413fa0a9079429976bba3531958c"
integrity sha512-onaMDzIHFlhqEAbBFV0WnWPMQPHOfSbed7a+AzTeGNp42UxiDnrve9uPDaxJ2K3JIPFPazXlOnDYlg6QF2uqng==
dependencies:
"@comunica/query-sparql" "^4.0.2"
"@inquirer/prompts" "^5.1.0"
Expand Down

0 comments on commit 2526911

Please sign in to comment.