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

FEATURE - Reuse library writer #1006

Open
2 of 6 tasks
cianmSAP opened this issue May 8, 2023 · 8 comments
Open
2 of 6 tasks

FEATURE - Reuse library writer #1006

cianmSAP opened this issue May 8, 2023 · 8 comments
Assignees
Labels
feature New feature or request ui5-library-writer @sap-ux/ui5-library-writer

Comments

@cianmSAP
Copy link
Contributor

cianmSAP commented May 8, 2023

As an SAPUI5 developer,
I want to be able create a new reuse library,
so that I can share as a reusable component with other applications.

Description

This new writer should allow users to create reuse libraries that can then be used with existing applications.

Technical Design

Creates a new writer @sap-ux/reuse-lib-writer. Based on the exisiting yeoman generator generator-ui5-library.

A single function is exposede (generate) which takes input :

    libraryName: string;
    namespace: string;
    framework: 'SAPUI5' | 'OpenUI5';
    frameworkVersion: 'string';
    author: 'string';
    typescript: boolean;

Current (proposed) lib contents and structure. (only the yo-rc.json is removed currently in comparison with an app generated with generator-ui5-library)

.
├── src
│   └── test
│       └── com
│           └── myUI5Lib
│               ├── Example.js
│               ├── ExampleRenderer.js
│               ├── library.js
│               ├── messagebundle.properties
│               └── themes
│                   ├── base
│                   │   ├── Example.less
│                   │   └── library.source.less
│                   ├── sap_belize
│                   │   └── library.source.less
│                   ├── sap_belize_hcb
│                   │   └── library.source.less
│                   ├── sap_belize_hcw
│                   │   └── library.source.less
│                   ├── sap_belize_plus
│                   │   └── library.source.less
│                   ├── sap_fiori_3
│                   │   └── library.source.less
│                   ├── sap_fiori_3_dark
│                   │   └── library.source.less
│                   ├── sap_fiori_3_hcb
│                   │   └── library.source.less
│                   └── sap_fiori_3_hcw
│                       └── library.source.less
├── test
│   └── test
│       └── com
│           └── myUI5Lib
│               ├── Example.html
│               ├── Example.js
│               └── qunit
│                   ├── Example.qunit.js
│                   ├── testsuite.qunit.html
│                   └── testsuite.qunit.js
├── karma.conf.js
├── package.json
├── readme.md
└── ui5.yaml

Acceptance Criteria

Given I have a Reuse lib configuration
when I pass this config to the Reuse lib writer
then a Reuse lib is generated

Given I create a new Reuse library
when I reference it in a Fiori application
then the application will load the Reuse lib

Given I generate a Reuse library, I can add reference to it in a Fiori application using the Reuse lib reference generator.

Notes

JS Reuse lib to be based on generator-ui5-library. and the TS version to be based on generator-ui5-ts-library

Tasks

  • Create new module @sap-ux/ui5-library-writer
  • Add templates and optional templates for TS
  • Add generate function which takes input and generates the Reuse lib
  • Unit Tests added
  • Test Cases defined

Additional Tasks

  • Update writer to use @sap-ux/ui5-proxy-middleware

FYI @tobiasqueck @devinea @docirl

@cianmSAP
Copy link
Contributor Author

cianmSAP commented May 8, 2023

@cianmSAP cianmSAP self-assigned this May 8, 2023
@cianmSAP cianmSAP added the ui5-library-writer @sap-ux/ui5-library-writer label May 8, 2023
@devinea
Copy link
Member

devinea commented Jun 16, 2023

@cianmSAP I think this still needs to be addressed ?
#1008 (comment)

@cianmSAP
Copy link
Contributor Author

@cianmSAP I think this still needs to be addressed ? #1008 (comment)

I'll look into this, thanks @devinea

@tobiasqueck
Copy link
Contributor

@cianmSAP @devinea what is the current state of this one?

@tobiasqueck tobiasqueck added the feature New feature or request label Aug 8, 2023
@cianmSAP
Copy link
Contributor Author

cianmSAP commented Aug 8, 2023

@cianmSAP @devinea what is the current state of this one?

While this fix went in #1054

It does not seem to be consumed by ui5-tooling? I still see this error

Error Message: Error reading manifest.json from 'com.myorg.library1/webapp/manifest.json'. Error was : 'ENOENT: no such file or directory, open 'com.myorg.library1/webapp/manifest.json''.

@tobiasqueck

@tobiasqueck
Copy link
Contributor

@cianmSAP I noticed the same issue in a different test. @zdravko-georgiev do you know why it isn't consumed yet?

@zdravko-georgiev
Copy link
Contributor

@tobiasqueck Fixes for ui5-tooling are prepared and in code review. Hopefully the fixes will be submitted soon.

@zdravko-georgiev
Copy link
Contributor

Fixes submitted in @sap/ux-ui5-tooling. Should be in with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request ui5-library-writer @sap-ux/ui5-library-writer
Projects
None yet
Development

No branches or pull requests

4 participants