From fadbaefce239e2367c0d24727edf1afb14cbf03d Mon Sep 17 00:00:00 2001 From: Joachim Van Herwegen Date: Tue, 18 May 2021 10:08:58 +0200 Subject: [PATCH] refactor: Move config templates to templates folder --- package.json | 3 ++- src/pods/generate/TemplatedPodGenerator.ts | 2 +- .../storage-defaults.json => templates/config/defaults.json | 0 .../config/filesystem.json | 2 +- .../storage-memory.json => templates/config/memory.json | 2 +- test/integration/DynamicPods.test.ts | 4 ++-- 6 files changed, 7 insertions(+), 6 deletions(-) rename config/templates/storage-defaults.json => templates/config/defaults.json (100%) rename config/templates/storage-filesystem.json => templates/config/filesystem.json (94%) rename config/templates/storage-memory.json => templates/config/memory.json (88%) diff --git a/package.json b/package.json index a9319744c..ecf57bccd 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "lsd:importPaths": { "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^0.0.0/components/": "dist/components/", "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^0.0.0/config/": "config/", - "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^0.0.0/dist/": "dist/" + "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^0.0.0/dist/": "dist/", + "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^0.0.0/templates/config/": "templates/config/" }, "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/pods/generate/TemplatedPodGenerator.ts b/src/pods/generate/TemplatedPodGenerator.ts index 7e5433b0d..04187febc 100644 --- a/src/pods/generate/TemplatedPodGenerator.ts +++ b/src/pods/generate/TemplatedPodGenerator.ts @@ -11,7 +11,7 @@ import type { PodGenerator } from './PodGenerator'; import type { VariableHandler } from './variables/VariableHandler'; import { isValidVariable, TEMPLATE, TEMPLATE_VARIABLE } from './variables/Variables'; -const DEFAULT_CONFIG_PATH = joinFilePath(__dirname, '../../../config/templates'); +const DEFAULT_CONFIG_PATH = joinFilePath(__dirname, '../../../templates/config/'); /** * Creates a new ResourceStore when creating a pod based on a Components.js configuration. diff --git a/config/templates/storage-defaults.json b/templates/config/defaults.json similarity index 100% rename from config/templates/storage-defaults.json rename to templates/config/defaults.json diff --git a/config/templates/storage-filesystem.json b/templates/config/filesystem.json similarity index 94% rename from config/templates/storage-filesystem.json rename to templates/config/filesystem.json index 35dcc62c1..e077e69cb 100644 --- a/config/templates/storage-filesystem.json +++ b/templates/config/filesystem.json @@ -1,7 +1,7 @@ { "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^0.0.0/components/context.jsonld", "import": [ - "files-scs:config/templates/storage-defaults.json" + "files-scs:templates/config/defaults.json" ], "@graph": [ { diff --git a/config/templates/storage-memory.json b/templates/config/memory.json similarity index 88% rename from config/templates/storage-memory.json rename to templates/config/memory.json index d021ff994..c2dd9ccde 100644 --- a/config/templates/storage-memory.json +++ b/templates/config/memory.json @@ -1,7 +1,7 @@ { "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^0.0.0/components/context.jsonld", "import": [ - "files-scs:config/templates/storage-defaults.json" + "files-scs:templates/config/defaults.json" ], "@graph": [ { diff --git a/test/integration/DynamicPods.test.ts b/test/integration/DynamicPods.test.ts index 8e1fd3d92..6625bc637 100644 --- a/test/integration/DynamicPods.test.ts +++ b/test/integration/DynamicPods.test.ts @@ -13,10 +13,10 @@ const rootFilePath = getTestFolder('dynamicPods'); const podConfigJson = joinFilePath(rootFilePath, 'config-pod.json'); const configs: [string, any][] = [ - [ 'storage-memory.json', { + [ 'memory.json', { teardown: (): void => removeFolder(rootFilePath), }], - [ 'storage-filesystem.json', { + [ 'filesystem.json', { teardown: (): void => removeFolder(rootFilePath), }], ];