Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put shell packages in subfolders #2

Open
chariotlily opened this issue Jul 31, 2023 · 1 comment
Open

Put shell packages in subfolders #2

chariotlily opened this issue Jul 31, 2023 · 1 comment

Comments

@chariotlily
Copy link

chariotlily commented Jul 31, 2023

Hi!

i am using dita-example-schema-bundle to init a new instance and trying to get it run. However my usecase is a bit different, I was required to put the "dita-example-sx-" folders under a shells subfolder under packages.

What did I do:

  1. I clone this package, and modify the fonto.json file in the root, change the pakcageName to a new path, i.e. "packageName": "shells/dita-example-sx-shells-concept"
  2. Then I ran fdt init in the command line, the package folder and its subfolder shells are generated.'

The packages folder structure is roughly like this:

dita-example-schema-bundle/
  packages/
    shells/
      dita-example-sx-shells-basemap/
      dita-example-sx-module-basemap/
      .......
  1. Then I ran fdt editor run in the command line, then I got the below error:
ERROR in ./templates/generated?type=configureSxModule 38:13
Module parse failed: Unexpected token (38:13)
File was processed with these loaders:
 * ./webpackLoaders/generatedLoader.cjs
You may need an additional loader to handle the result of these loaders.
| import fontoxmlPlatformBaseConfiguresxmodule from 'fontoxml-platform-base/src/configureSxModule';
| import editorClipboardConfigurationConfiguresxmodule from 'editor-clipboard-configuration/src/configureSxModule';
> import shells/ditaExampleSxModuleBasemapConfiguresxmodule from 'shells/dita-example-sx-module-basemap/src/configureSxModule';
| import shells/ditaExampleSxModuleBasetopicConfiguresxmodule from 'shells/dita-example-sx-module-basetopic/src/configureSxModule';
| import shells/ditaExampleSxModuleConceptConfiguresxmodule from 'shells/dita-example-sx-module-concept/src/configureSxModule';
 @ ./templates/app-entry.ts 22:10-54

ERROR in ./templates/generated?type=install 86:13
Module parse failed: Unexpected token (86:13)
File was processed with these loaders:
 * ./webpackLoaders/generatedLoader.cjs
You may need an additional loader to handle the result of these loaders.
| import fontoxmlDocumentFromTemplateInstall from 'fontoxml-document-from-template/src/install';
| import editorMastheadInstall from 'editor-masthead/src/install';
> import shells/ditaExampleSxModuleBasetopicInstall from 'shells/dita-example-sx-module-basetopic/src/install';
| import shells/ditaExampleSxModuleConceptInstall from 'shells/dita-example-sx-module-concept/src/install';
| import namespaceMmlSxModuleInstall from 'namespace-mml-sx-module/src/install';
 @ ./templates/app-entry.ts 25:10-44

  Build done at 12:27:25 AM in 313ms, with errors.

I don't understand this error message and I don't know where I should load the loader...What do I need to change to make this work?

Environment:
fdt version 8.4.1

@wvbe
Copy link
Contributor

wvbe commented Aug 1, 2023

Hey @chariotlily, the error "Unexpected token" means that your file is invalid JavaScript/TypeScript.

It looks like you're trying to import something as an invalid JS name, eg. shells/ditaExampleSxModuleBasetopicInstall. Variable names cannot contain slashes (or most other special characters, or start with a number, etc.)

import shells/ditaExampleSxModuleBasetopicInstall from 'shells/dita-example-sx-module-basetopic/src/install';

Hopefully fixing that line and similar ones disappears the error you're seeing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants