Skip to content

Commit

Permalink
Update CSS to version 7
Browse files Browse the repository at this point in the history
  • Loading branch information
surilindur committed Feb 20, 2024
1 parent a8e48df commit f19ef16
Show file tree
Hide file tree
Showing 5 changed files with 2,040 additions and 1,570 deletions.
26 changes: 14 additions & 12 deletions lib/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@ export class Server {
public async serve(): Promise<void> {
return new AppRunner().run(
{
mainModulePath: Path.join(__dirname, '..'),
logLevel: <any> this.logLevel,
typeChecking: false,
},
this.configPath,
{
'urn:solid-server:default:variable:port': this.port,
'urn:solid-server:default:variable:rootFilePath': this.rootFilePath,
'urn:solid-server:default:variable:loggingLevel': this.logLevel,
'urn:solid-server:default:variable:baseUrl': this.baseUrl || `http://localhost:${this.port}/`,
'urn:solid-server:default:variable:seededPodConfigJson': '',
'urn:solid-server:default:variable:showStackTrace': false,
loaderProperties: {
mainModulePath: Path.join(__dirname, '..'),
typeChecking: false,
logLevel: <any> this.logLevel,
},
config: this.configPath,
variableBindings: {
'urn:solid-server:default:variable:port': this.port,
'urn:solid-server:default:variable:rootFilePath': this.rootFilePath,
'urn:solid-server:default:variable:loggingLevel': this.logLevel,
'urn:solid-server:default:variable:baseUrl': this.baseUrl || `http://localhost:${this.port}/`,
'urn:solid-server:default:variable:seededPodConfigJson': '',
'urn:solid-server:default:variable:showStackTrace': false,
},
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"index.ts"
],
"dependencies": {
"@solid/community-server": "^6.0.2",
"@solid/community-server": "^7.0.0",
"@types/dockerode": "^3.2.3",
"@types/unzipper": "^0.10.5",
"@types/yargs": "^16.0.1",
Expand Down
33 changes: 10 additions & 23 deletions templates/server-config.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^6.0.0/components/context.jsonld",
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^7.0.0/components/context.jsonld",
"import": [
"css:config/app/init/initializers/logger.json",
"css:config/app/init/initializers/server.json",
"css:config/app/main/default.json",
"css:config/app/setup/disabled.json",
"css:config/app/variables/default.json",
"css:config/http/handler/default.json",
"css:config/http/middleware/default.json",
"css:config/http/notifications/websockets.json",
"css:config/http/notifications/disabled.json",
"css:config/http/server-factory/http.json",
"css:config/http/static/default.json",
"css:config/identity/access/public.json",
"css:config/identity/email/default.json",
"css:config/identity/handler/default.json",
"css:config/identity/handler/disabled.json",
"css:config/identity/oidc/disabled.json",
"css:config/identity/ownership/token.json",
"css:config/identity/pod/static.json",
"css:config/identity/registration/enabled.json",
"css:config/ldp/authentication/dpop-bearer.json",
"css:config/ldp/authorization/allow-all.json",
"css:config/ldp/handler/default.json",
Expand All @@ -23,6 +24,7 @@
"css:config/ldp/modes/default.json",
"css:config/storage/backend/file.json",
"css:config/storage/key-value/memory.json",
"css:config/storage/location/root.json",
"css:config/storage/middleware/default.json",
"css:config/util/auxiliary/empty.json",
"css:config/util/index/default.json",
Expand All @@ -31,17 +33,8 @@
"css:config/util/resource-locker/debug-void.json",
"css:config/util/variables/default.json"
],
"comment": "Adapted from \"css:config/file-no-setup.json\"",
"@graph": [
{
"comment": "A single-pod server that stores its resources on disk."
},
{ "comment": "Adapted from \"css:config/app/init/initialize-root.json\", with things removed" },
{
"import": [
"css:config/app/init/initializers/logger.json",
"css:config/app/init/initializers/server.json"
],
"comment": "These initializers will be all be executed sequentially when starting the server.",
"@id": "urn:solid-server:default:Initializer",
"@type": "SequenceHandler",
Expand All @@ -50,20 +43,14 @@
{ "@id": "urn:solid-server:default:ServerInitializer" }
]
},
{ "comment": "Adapted from \"css:config/util/identifiers/suffix.json\", with FixedContentTypeMapper" },
{
"comment": "Taken from css:config/util/identifiers/suffix.json",
"@id": "urn:solid-server:default:IdentifierStrategy",
"@type": "SingleRootIdentifierStrategy",
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" }
},
{
"comment": "Only required when pod creation is enabled.",
"@id": "urn:solid-server:default:IdentifierGenerator",
"@type": "SuffixIdentifierGenerator",
"base": { "@id": "urn:solid-server:default:variable:baseUrl" }
},
{
"comment": "Only required when using a file-based backend.",
"comment": "Taken from css:config/util/identifiers/suffix.json, changed to serve only .nq",
"@id": "urn:solid-server:default:FileIdentifierMapper",
"@type": "FixedContentTypeMapper",
"base": { "@id": "urn:solid-server:default:variable:baseUrl" },
Expand All @@ -72,4 +59,4 @@
"pathSuffix": ".nq"
}
]
}
}
26 changes: 14 additions & 12 deletions test/Server-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@ describe('Server', () => {
await server.serve();
expect(run).toHaveBeenCalledWith(
{
mainModulePath: Path.join(__dirname, '..'),
logLevel: 'info',
typeChecking: false,
},
'CONFIG',
{
'urn:solid-server:default:variable:baseUrl': 'http://localhost:3000/',
'urn:solid-server:default:variable:loggingLevel': 'info',
'urn:solid-server:default:variable:port': 3_000,
'urn:solid-server:default:variable:rootFilePath': 'out-fragments/http/localhost_3000/',
'urn:solid-server:default:variable:seededPodConfigJson': '',
'urn:solid-server:default:variable:showStackTrace': false,
loaderProperties: {
mainModulePath: Path.join(__dirname, '..'),
typeChecking: false,
logLevel: 'info',
},
config: 'CONFIG',
variableBindings: {
'urn:solid-server:default:variable:baseUrl': 'http://localhost:3000/',
'urn:solid-server:default:variable:loggingLevel': 'info',
'urn:solid-server:default:variable:port': 3_000,
'urn:solid-server:default:variable:rootFilePath': 'out-fragments/http/localhost_3000/',
'urn:solid-server:default:variable:seededPodConfigJson': '',
'urn:solid-server:default:variable:showStackTrace': false,
},
},
);
});
Expand Down
Loading

0 comments on commit f19ef16

Please sign in to comment.