diff --git a/src/VocabGeneration.test.js b/src/VocabGeneration.test.js index df1ec963..f5cc1531 100644 --- a/src/VocabGeneration.test.js +++ b/src/VocabGeneration.test.js @@ -11,7 +11,7 @@ const VERSION_LIT_VOCAB_TERM = "^0.2.4"; const NPM_REGISTRY = "http://localhost:4873"; const RUN_NPM_INSTALL = false; const SUPPORT_BUNDLING = true; -const RUN_PACKAGING = ["localMaven", "localNpmNode"]; +const RUN_PACKAGING = ["mavenLocal", "npmLocal"]; const ConfigAll = { _: "generate", diff --git a/templates/rdfLibraryDependent/typescript/rdfext/package.hbs b/templates/rdfLibraryDependent/typescript/rdfext/package.hbs index b31abc84..2e608e2d 100644 --- a/templates/rdfLibraryDependent/typescript/rdfext/package.hbs +++ b/templates/rdfLibraryDependent/typescript/rdfext/package.hbs @@ -36,8 +36,8 @@ }, {{/if}} "dependencies": { - "@rdfjs/data-model": "{{rdfjsDatamodelVersion}}", - "@types/rdf-js": "{{rdfjsTypesVersion}}" + "@rdfjs/namespace": "{{rdfjsNamespaceVersion}}", + "@types/rdfjs__namespace": "{{rdfjsNamespaceTypesVersion}}" }, "devDependencies": { "typescript": "{{typescriptVersion}}" diff --git a/templates/rdfLibraryDependent/typescript/rdfext/vocab.hbs b/templates/rdfLibraryDependent/typescript/rdfext/vocab.hbs index ef309736..537bcec1 100644 --- a/templates/rdfLibraryDependent/typescript/rdfext/vocab.hbs +++ b/templates/rdfLibraryDependent/typescript/rdfext/vocab.hbs @@ -1,76 +1,78 @@ -{{#if license/header}} -{{license/header}} - -{{/if}} -const namespace = require("@rdfjs/namespace"); - -/** - Generated by artifact generator [{{generatorName}}], version [{{artifactGeneratorVersion}}] - as part of artifact: [{{artifactName}}], version: [{{artifactVersion}}] - at '{{generatedTimestamp}}'. - - {{sourceRdfResources}} -{{#if description}} - - {{{description}}} -{{/if}} - */ - -const RDFJS_NAMESPACE = namespace("{{namespace}}"); - -const _NAMESPACE = "{{namespace}}"; -function _NS (localName) { - return (_NAMESPACE + localName); -} - -const {{vocabNameUpperCase}} = { - PREFIX: "{{vocabPrefix}}", - NAMESPACE: _NAMESPACE, - PREFIX_AND_NAMESPACE: { "{{vocabPrefix}}": "{{namespace}}" }, - NS: _NS, - -{{#if classes}} - // ***************** - // All the Classes. - // ***************** - {{#each classes}} - - /** - *{{#if comment}} {{{comment}}}{{/if}} - */ - {{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), -{{/each}} -{{/if}} - -{{#if properties}} - // ******************* - // All the Properties. - // ******************* - {{#each properties}} - - /** - *{{#if comment}} {{{comment}}}{{/if}} - */ - {{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), -{{/each}} -{{/if}} - -{{#if literals}} - // ******************* - // All the Literals. - // ******************* - {{#each literals}} - - /** - *{{#if comment}} {{{comment}}}{{/if}} - */ - {{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), -{{/each}} -{{/if}} - // - // Marker allowing us put commas at the end of all lines above (only the last line does not have a comma). - // - END_OF_VOCAB: "End of vocab." -} - -module.exports = {{vocabNameUpperCase}}; +{{#if license/header}} +{{license/header}} + +{{/if}} +import namespace from "@rdfjs/namespace"; + +/** + Generated by artifact generator [{{generatorName}}], version [{{artifactGeneratorVersion}}] + as part of artifact: [{{artifactName}}], version: [{{artifactVersion}}] + at '{{generatedTimestamp}}'. + + {{sourceRdfResources}} +{{#if description}} + + {{{description}}} +{{/if}} + */ + +const RDFJS_NAMESPACE = namespace("{{namespace}}"); + +const _NAMESPACE = "{{namespace}}"; +function _NS (localName: string) { + return (_NAMESPACE + localName); +} + +const {{vocabNameUpperCase}} = { + PREFIX: "{{vocabPrefix}}", + NAMESPACE: _NAMESPACE, + PREFIX_AND_NAMESPACE: { "{{vocabPrefix}}": "{{namespace}}" }, + NS: _NS, + +{{#if classes}} + // ***************** + // All the Classes. + // ***************** + {{#each classes}} + + /** + *{{#if comment}} {{{comment}}}{{/if}}{{#if isDefinedBy}} + * + * Defined by the vocabulary: {{isDefinedBy}}{{/if}} + */ + {{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), +{{/each}} +{{/if}} + +{{#if properties}} + // ******************* + // All the Properties. + // ******************* + {{#each properties}} + + /** + *{{#if comment}} {{{comment}}}{{/if}}{{#if isDefinedBy}} + * + * Defined by the vocabulary: {{isDefinedBy}}{{/if}} + */ + {{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), +{{/each}} +{{/if}} + +{{#if literals}} + // ******************* + // All the Literals. + // ******************* + {{#each literals}} + + /** + *{{#if comment}} {{{comment}}}{{/if}}{{#if isDefinedBy}} + * + * Defined by the vocabulary: {{isDefinedBy}}{{/if}} + */ + {{nameEscapedForLanguage}}: RDFJS_NAMESPACE("{{{name}}}"), +{{/each}} +{{/if}} +}; + +export { {{vocabNameUpperCase}} };