Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:digita-ai/semcom into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
woutermont committed Jul 7, 2021
2 parents 293a767 + 486aff6 commit 1854e81
Show file tree
Hide file tree
Showing 13 changed files with 157 additions and 62 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"bootstrap:no-ci": "npm i && lerna bootstrap --no-ci",
"bootstrap:clean": "npm i && lerna run clean --parallel && lerna bootstrap --no-ci",
"start": "lerna run start --parallel",
"start:dev": "lerna run start:dev --parallel --no-bail",
"build": "lerna run build --since HEAD",
"build:all": "lerna run build",
"lint": "lerna run lint --since HEAD --parallel",
Expand Down
2 changes: 1 addition & 1 deletion packages/semcom-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"scripts": {
"clean": "rimraf ./dist && rimraf ./package-lock.json && rimraf ./node_modules",
"start": "npm run start:watch",
"start:watch": "vite",
"start:dev": "vite",
"build": "rimraf ./dist && npm run build:bundle && npm run build:ts",
"build:bundle": "vite build",
"build:ts": "tsc",
Expand Down
1 change: 1 addition & 0 deletions packages/semcom-demo-app/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_SEMCOM_NODE_URI=http://localhost:3000
1 change: 1 addition & 0 deletions packages/semcom-demo-app/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_SEMCOM_NODE_URI=https://node.semcom.digita.ai
80 changes: 40 additions & 40 deletions packages/semcom-demo-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/semcom-demo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.4.1",
"scripts": {
"start": "http-server -p 4200 --gzip --brotli --proxy http://localhost:4200? dist/",
"start:watch": "vite --config vite.config.ts",
"start:dev": "vite",
"build": "rimraf ./dist && vite build --config vite.config.ts && tsc",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
Expand Down Expand Up @@ -41,7 +41,7 @@
"rollup-plugin-node-polyfills": "^0.2.1",
"ts-node": "^9.1.1",
"typescript": "^4.2.4",
"vite": "^2.2.3"
"vite": "2.2.3"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
Expand Down
12 changes: 9 additions & 3 deletions packages/semcom-demo-app/src/services/semcom.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import { fetch } from '@digita-ai/inrupt-solid-client';

export class SemComService {

private registry: AbstractRegisterComponentService = new RegisterComponentService();
// private repo: QueryComponentService = new QueryComponentRemoteService('http://localhost:3000');
private repo: QueryComponentService = new QueryComponentRemoteService('http://localhost:3000');
private registry: AbstractRegisterComponentService;
private repo: QueryComponentService;

constructor() {

this.registry = new RegisterComponentService();
this.repo = new QueryComponentRemoteService(process.env.VITE_SEMCOM_NODE_URI);

}

detectShapes(uri: string): Observable<string[]> {

Expand Down
1 change: 0 additions & 1 deletion packages/semcom-demo-app/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"baseUrl": "./",
"outDir": "./dist",
"strict": true,
"strictPropertyInitialization": false, // for angular decorators
"target": "es2015",
"module": "es2020",
},
Expand Down
51 changes: 41 additions & 10 deletions packages/semcom-demo-app/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,43 @@
import { defineConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';

export default defineConfig({
root: 'src',
build: {
target: 'es2015',
outDir: '../dist',
},
server: {
port: 4200,
export default defineConfig( ({ command, mode }) => {
const env = loadEnv(mode, process.cwd());

// expose .env as process.env instead of import.meta since jest does not import meta yet
const envWithProcessPrefix = Object.entries(env).reduce(
(prev, [key, val]) => {
return {
...prev,
['process.env.' + key]: `"${val}"`,
['process.env.DEV']: `"${command === 'serve'}"`,
['process.env.PROD']: `"${command === 'build'}"`,
['process.env.MODE']: command === 'build' ? `"PROD"` : `"DEV"`,
}
},
{},
);

if (command === 'serve') {
return {
root: 'src',
server: {
port: 4200,
},
mode: 'development',
define: envWithProcessPrefix,
}
} else if (command === 'build'){
return {
root: 'src',
build: {
target: 'es2015',
outDir: '../dist',
},
server: {
port: 4200,
},
mode: 'production',
define: envWithProcessPrefix,
}
}
});
});
3 changes: 2 additions & 1 deletion packages/semcom-demo-pods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"license": "",
"scripts": {
"clean": "rimraf ./dist && rimraf ./package-lock.json && rimraf ./node_modules",
"start": "community-solid-server -p 9000 --rootFilePath /tmp/css -c config/config-file.json"
"start": "community-solid-server -p 9000 --rootFilePath /tmp/css -c config/config-file.json",
"start:dev": "npm run start"
},
"dependencies": {
"@solid/community-server": "0.8.1"
Expand Down
54 changes: 54 additions & 0 deletions packages/semcom-node/config/config-default.dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@digita-ai/semcom-node/^0.0.0/components/context.jsonld",
"https://linkedsoftwaredependencies.org/bundles/npm/@digita-ai/semcom-core/^0.0.0/components/context.jsonld"
],
"import": [
"files-dasn:config/presets/logger.json",
"files-dasn:config/presets/serializer.json",
"files-dasn:config/presets/component.json",
"files-dasn:config/presets/handlers.json",
"files-dasn:config/presets/server.json"
],
"@graph": [
{
"@id": "urn:semcom-node:default:ComponentStore",
"@type": "ComponentInMemoryStore",
"ComponentInMemoryStore:_components": [
{
"@type": "ComponentMetadata",
"ComponentMetadata:_description": "Digita SemCom component for profile information.",
"ComponentMetadata:_label": "SemCom Profile Component",
"ComponentMetadata:_uri": "http://localhost:8080/components/profile.component.js",
"ComponentMetadata:_shapes": "http://xmlns.com/foaf/0.1/PersonalProfileDocument",
"ComponentMetadata:_author": "https://digita.ai",
"ComponentMetadata:_tag": "profile",
"ComponentMetadata:_version": "0.1.0",
"ComponentMetadata:_latest": true
},
{
"@type": "ComponentMetadata",
"ComponentMetadata:_description": "Digita SemCom component with an input field.",
"ComponentMetadata:_label": "SemCom Input Component",
"ComponentMetadata:_uri": "http://localhost:8080/components/input.component.js",
"ComponentMetadata:_shapes": "http://digita.ai/voc/input#input",
"ComponentMetadata:_author": "https://digita.ai",
"ComponentMetadata:_tag": "input",
"ComponentMetadata:_version": "0.1.0",
"ComponentMetadata:_latest": true
},
{
"@type": "ComponentMetadata",
"ComponentMetadata:_description": "Digita SemCom component for payslip information.",
"ComponentMetadata:_label": "SemCom Payslip Component",
"ComponentMetadata:_uri": "http://localhost:8080/components/payslip.component.js",
"ComponentMetadata:_shapes": "http://digita.ai/voc/payslip#payslip",
"ComponentMetadata:_author": "https://digita.ai",
"ComponentMetadata:_tag": "payslip",
"ComponentMetadata:_version": "0.1.0",
"ComponentMetadata:_latest": true
}
]
}
]
}
8 changes: 4 additions & 4 deletions packages/semcom-node/config/presets/store.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
"@type": "ComponentMetadata",
"ComponentMetadata:_description": "Digita SemCom component for profile information.",
"ComponentMetadata:_label": "SemCom Profile Component",
"ComponentMetadata:_uri": "https://components.semcom.digita.ai/components/profile.component.ts",
"ComponentMetadata:_uri": "https://components.semcom.digita.ai/components/profile.component.js",
"ComponentMetadata:_shapes": "http://xmlns.com/foaf/0.1/PersonalProfileDocument",
"ComponentMetadata:_author": "https://digita.ai",
"ComponentMetadata:_tag": "profile",
"ComponentMetadata:_version": "0.1.0",
"ComponentMetadata:_latest": false
"ComponentMetadata:_latest": true
},
{
"@type": "ComponentMetadata",
"ComponentMetadata:_description": "Digita SemCom component with an input field.",
"ComponentMetadata:_label": "SemCom Input Component",
"ComponentMetadata:_uri": "https://components.semcom.digita.ai/components/input.component.ts",
"ComponentMetadata:_uri": "https://components.semcom.digita.ai/components/input.component.js",
"ComponentMetadata:_shapes": "http://digita.ai/voc/input#input",
"ComponentMetadata:_author": "https://digita.ai",
"ComponentMetadata:_tag": "input",
Expand All @@ -34,7 +34,7 @@
"@type": "ComponentMetadata",
"ComponentMetadata:_description": "Digita SemCom component for payslip information.",
"ComponentMetadata:_label": "SemCom Payslip Component",
"ComponentMetadata:_uri": "https://components.semcom.digita.ai/components/payslip.component.ts",
"ComponentMetadata:_uri": "https://components.semcom.digita.ai/components/payslip.component.js",
"ComponentMetadata:_shapes": "http://digita.ai/voc/payslip#payslip",
"ComponentMetadata:_author": "https://digita.ai",
"ComponentMetadata:_tag": "payslip",
Expand Down
1 change: 1 addition & 0 deletions packages/semcom-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lint:fix": "eslint --fix .",
"lint:staged": "lint-staged",
"start": "node bin/server.js",
"start:dev": "node bin/server.js -c config/config-default.dev.json",
"test": "jest",
"test:ci": "jest --runInBand --silent",
"posttest": "jest-coverage-thresholds-bumper --silent --coverage-summary-path coverage-summary.json"
Expand Down

0 comments on commit 1854e81

Please sign in to comment.