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

feat: Add prompting code of Adaptation Project generator #2169

Open
wants to merge 187 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 175 commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
7c53a5f
feat: start work on moving the basic prompts
nikmace Jul 16, 2024
48e7722
refactor: remove unused code
nikmace Jul 16, 2024
43f5df9
feat: partially add system and client prompts
nikmace Jul 17, 2024
4e96ffd
feat: start work on validate business logic
nikmace Jul 17, 2024
566c242
feat: add ui flex service
nikmace Jul 19, 2024
d25df31
Merge remote-tracking branch 'origin/main' into feat/2162/move-adp-pr…
nikmace Jul 19, 2024
de678c9
feat: add needed requests for system and apps logic
nikmace Jul 23, 2024
8ed828c
feat: add ui5 validators
nikmace Jul 23, 2024
2631b79
feat: add manifest fetching logic
nikmace Jul 23, 2024
7f8353e
feat: add missing prompts
nikmace Jul 24, 2024
26eb7c3
refactor: extract methods in class and cleanup
nikmace Jul 24, 2024
ae3f4b3
refactor: improve methods, add jsdocs
nikmace Jul 24, 2024
55d00f2
feat: make endpoint service, improve code
nikmace Jul 24, 2024
861d76e
feat: add flp config prompts
GDamyanov Jul 24, 2024
f17f71d
feat: add flo config prompts
GDamyanov Jul 24, 2024
21d81ae
merge
GDamyanov Jul 24, 2024
351631d
fix: merge errors
nikmace Jul 25, 2024
e3772cd
refactor: move func to helpers
nikmace Jul 25, 2024
582faff
Merge remote-tracking branch 'origin/main' into feat/2162/move-adp-pr…
nikmace Jul 25, 2024
c5591e2
fix: merge error
nikmace Jul 25, 2024
10ad561
feat: remove cf
nikmace Jul 25, 2024
b9a3fbd
feat: start adding deploy config prompts
GDamyanov Jul 25, 2024
3d07751
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Jul 25, 2024
a628858
fix: fix build
GDamyanov Jul 25, 2024
0c87dd5
feat: extract manifest service
nikmace Jul 26, 2024
384c2d8
feat: enhance manifest service with caching
nikmace Jul 26, 2024
18ad940
feat: add cache reset on system switch
nikmace Jul 29, 2024
17d4002
feat: add ext proj confirm prompt
nikmace Jul 29, 2024
273d806
feat: add flp prompting
GDamyanov Jul 29, 2024
c05eb46
merge conflicts
GDamyanov Jul 29, 2024
b375416
feat: remove unused code
nikmace Jul 29, 2024
e2c243d
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Jul 29, 2024
01d24e4
fix: merge error
nikmace Jul 29, 2024
e68f15f
fix: provider client empty error
nikmace Jul 30, 2024
f44b01c
feat: add application and provider services
nikmace Jul 30, 2024
9dba1a8
refactor: slight improvements
nikmace Jul 30, 2024
e00f013
feat: add deploy config prompts
GDamyanov Jul 30, 2024
c228f1e
merge conflicts
GDamyanov Jul 30, 2024
8acabab
feat: finish deploy config prompts
GDamyanov Jul 31, 2024
0c2bc09
poc: breadcrumbs and additional messages
nikmace Jul 31, 2024
7f8afd4
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Jul 31, 2024
cadf010
fix: fix loading apps
GDamyanov Jul 31, 2024
d037b73
refactor: extract basic info prompts
nikmace Jul 31, 2024
e725dff
refactor: extract label prompts into additional messages
nikmace Aug 1, 2024
4c5629e
feat: export services from adp-tooling
GDamyanov Aug 1, 2024
a058d36
refactor: improve code
nikmace Aug 2, 2024
53c7f19
feat: move glue logic
nikmace Aug 2, 2024
8f7e944
feat: further improve code and finish moving glue logic
nikmace Aug 5, 2024
844e3ce
refactor: split prompts into individual files
nikmace Aug 6, 2024
5b6c824
refactor: remove deploy prompts from project prompter
nikmace Aug 6, 2024
5ccf5dd
refactor: improve code and add jsdocs
nikmace Aug 7, 2024
4604ccf
chore: add changeset
nikmace Aug 7, 2024
84fe3b2
refactor: improve code and add jsdocs
nikmace Aug 7, 2024
0b33679
Merge remote-tracking branch 'origin/main' into feat/2162/move-adp-pr…
nikmace Aug 7, 2024
183376c
feat: add prompting or cli command
nikmace Aug 7, 2024
c677af6
refactor: improve template config
nikmace Aug 7, 2024
c4bf889
fix: incorrect translations and breadcrumbs
nikmace Aug 7, 2024
cef3b98
feat: add logging for prompts and services
nikmace Aug 8, 2024
b316e54
feat: expose adtCategoryService
GDamyanov Aug 8, 2024
72af7d4
merge conflicts
GDamyanov Aug 8, 2024
fb52097
fix: fix build after merge
GDamyanov Aug 8, 2024
08efa2b
fix: handle flex system via provider direct
GDamyanov Aug 8, 2024
3533cb3
fix: system additional messages depending on project type
nikmace Aug 9, 2024
758599f
refactor: rename breadcrumbs
nikmace Aug 9, 2024
536b854
refactor: remove unused code
nikmace Aug 9, 2024
8339ccb
refactor: remove unused code
nikmace Aug 9, 2024
cd3d943
Merge remote-tracking branch 'origin/main' into feat/2162/move-adp-pr…
nikmace Aug 9, 2024
18e7b64
refactor: improve imports and exports
nikmace Aug 9, 2024
82ac91a
fix: system details retrieval for cloud systems
nikmace Aug 12, 2024
661f847
feat: add types
GDamyanov Aug 12, 2024
d0ae2e4
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 12, 2024
8b1d3dc
Merge remote-tracking branch 'origin/main' into feat/2162/move-adp-pr…
nikmace Aug 12, 2024
d57e858
Merge remote-tracking branch 'origin/main' into feat/2162/move-adp-pr…
nikmace Aug 12, 2024
d4c0857
fix: mandatory props for cli
nikmace Aug 12, 2024
198898a
refactor: move flp parameters
GDamyanov Aug 12, 2024
00fbe30
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 12, 2024
3106637
fix: remove unnecessary async
GDamyanov Aug 12, 2024
b990f69
refactor: add type
GDamyanov Aug 12, 2024
bdb4674
feat: move prompting logic to generate
nikmace Aug 12, 2024
6529e7d
refactor: refactor function
GDamyanov Aug 12, 2024
7af2f92
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 12, 2024
dd63a53
fix: incorrect app descriptor template output
nikmace Aug 13, 2024
d944fb4
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 13, 2024
444446c
refactor: add typing
GDamyanov Aug 13, 2024
f0e033b
feat: improve code and add jsdocs
nikmace Aug 13, 2024
e0ea24e
fix: add mandatory
GDamyanov Aug 13, 2024
eae50c2
chore: update cset
nikmace Aug 13, 2024
da453ce
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 13, 2024
bab0ef6
refactor: remove prompt.ts
nikmace Aug 13, 2024
071fb8b
refactor: slight adjustments
nikmace Aug 13, 2024
1a37d4b
refactor: move enum to types
nikmace Aug 13, 2024
fc6dc93
test: temporarily comment out tests
nikmace Aug 13, 2024
a2b45e2
test: fix tests
GDamyanov Aug 13, 2024
8c05c32
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 13, 2024
1a5b76e
test: temporarily comment out tests
nikmace Aug 13, 2024
baeb2ea
fix: fix lint errors
GDamyanov Aug 13, 2024
8bb6580
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 13, 2024
170299b
fix: fix lint errors
GDamyanov Aug 13, 2024
68e78c5
fix: add jdocs for validators
nikmace Aug 14, 2024
a673938
fix: add jdocs for config questions
nikmace Aug 14, 2024
2d01ee1
fix: most of the lint errors
nikmace Aug 14, 2024
aca213d
fix: file system sonar errors
nikmace Aug 14, 2024
8db1f16
test: remove test for testing purpose
GDamyanov Aug 14, 2024
e5894d0
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 14, 2024
b87f306
fix: lint errors
nikmace Aug 14, 2024
d4ad220
test: add partial tests for base module
nikmace Aug 14, 2024
a2c8f0c
fix: sonar issues
GDamyanov Aug 14, 2024
49352f6
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 14, 2024
99dc50c
fix: lint errors
GDamyanov Aug 14, 2024
d363a40
test: add test suite
nikmace Aug 14, 2024
9c3ca79
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 14, 2024
8347bad
Linting auto fix commit
github-actions[bot] Aug 14, 2024
cd43351
fix: sonar issues
GDamyanov Aug 14, 2024
0d51cb8
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 14, 2024
bab08bd
fix: sonar issues
GDamyanov Aug 14, 2024
4455a55
fix: sonar issues
GDamyanov Aug 14, 2024
81a3b13
fix: sonar issues
GDamyanov Aug 14, 2024
efb3d61
Merge branch 'main' into feat/2162/move-adp-prompting
GDamyanov Aug 15, 2024
754ae87
test: add tests
GDamyanov Aug 15, 2024
dccd4b8
test: add ui5 service test suite
nikmace Aug 15, 2024
61e0ea0
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 15, 2024
a5f6cd3
test: add tests
GDamyanov Aug 15, 2024
8c0d82c
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 15, 2024
daacc30
fix: lint error
GDamyanov Aug 15, 2024
ce36968
Merge branch 'main' into feat/2162/move-adp-prompting
GDamyanov Aug 15, 2024
92bb375
test: add application service test suite
nikmace Aug 15, 2024
3a4817f
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 15, 2024
d34953c
Linting auto fix commit
github-actions[bot] Aug 15, 2024
3149681
test: add app identifier test suite
nikmace Aug 16, 2024
4f9a334
Linting auto fix commit
github-actions[bot] Aug 16, 2024
752ea24
test: add template model config test suite
nikmace Aug 16, 2024
58bdec1
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 16, 2024
56755a5
fix: test lint errors
nikmace Aug 16, 2024
3c61e88
test: add i18n content test suite
nikmace Aug 16, 2024
46b0413
test: add manifest content test suite
nikmace Aug 16, 2024
d562382
test: add missing tests
nikmace Aug 16, 2024
bdcb90f
refactor: move and rename files and folders
nikmace Aug 19, 2024
0bd8b36
Linting auto fix commit
github-actions[bot] Aug 19, 2024
c443c79
refactor: move and rename files and folders
nikmace Aug 19, 2024
e1cc7c4
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 19, 2024
6f2bf49
refactor: move and rename files and folders
nikmace Aug 19, 2024
da6d381
refactor: move and rename files and folders
nikmace Aug 19, 2024
de37906
refactor: create endpoinst-manager singleton
GDamyanov Aug 19, 2024
36742d9
refactor: split code into smaller methods
nikmace Aug 19, 2024
4c1ec87
refactor: move whens into conditions
nikmace Aug 20, 2024
687b40a
fix: lint errors
nikmace Aug 20, 2024
c2f5292
refactor: extract validation functions in validation module
GDamyanov Aug 20, 2024
1337111
fix merge conflicts
GDamyanov Aug 20, 2024
21331b9
fix: tests and lint errors
nikmace Aug 20, 2024
c242c4b
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 20, 2024
06ddaed
refactor: extract validation
GDamyanov Aug 20, 2024
f23602b
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 20, 2024
5c81508
fix: build
nikmace Aug 20, 2024
b2a38d1
refactor: rename method
GDamyanov Aug 20, 2024
f66270b
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 20, 2024
26c0ec1
fix: tests
GDamyanov Aug 20, 2024
6ca425d
fix: build
GDamyanov Aug 20, 2024
92606e0
test: add test suites for helpers
nikmace Aug 20, 2024
059a9bc
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 20, 2024
57080dc
Merge branch 'main' into feat/2162/move-adp-prompting
GDamyanov Aug 20, 2024
df553b6
Linting auto fix commit
github-actions[bot] Aug 20, 2024
e251248
fix: tests
GDamyanov Aug 20, 2024
125a664
Merge branch 'main' into feat/2162/move-adp-prompting
GDamyanov Aug 20, 2024
10edf5e
test: add test suites for helpers
nikmace Aug 21, 2024
1ff4297
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 21, 2024
45b4b75
refactor: extract flp and config questions parts into helpers
GDamyanov Aug 21, 2024
761f9d8
test: add test suites and fix existing ones
nikmace Aug 21, 2024
c2eee9a
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 21, 2024
e0ad87e
Merge branch 'main' into feat/2162/move-adp-prompting
GDamyanov Aug 22, 2024
257741d
refactor: extract all requests in config questions into config-client
GDamyanov Aug 22, 2024
91681e7
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 22, 2024
2e3965a
refactor: extract all requests to Abap system in abap-client
GDamyanov Aug 22, 2024
722f4f7
refactor: extract more complex validations into seperate file
GDamyanov Aug 22, 2024
7e33d32
refactor: order of imports
nikmace Aug 23, 2024
9430aee
Merge branch 'main' into feat/2162/move-adp-prompting
GDamyanov Aug 23, 2024
6d395b6
refactor: improve jsdoc
nikmace Aug 23, 2024
ea69c9e
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 23, 2024
71974e7
Merge branch 'main' into feat/2162/move-adp-prompting
GDamyanov Aug 23, 2024
d4795dc
refactor: update method and variable names
GDamyanov Aug 26, 2024
ad544c4
feat: show system list prompt only in case that there are set systems
GDamyanov Aug 26, 2024
3bb3bc6
refactor: improve code
nikmace Aug 26, 2024
c0cd3f9
test: adjust tests
nikmace Aug 26, 2024
895cc1d
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
nikmace Aug 26, 2024
ddb2120
fix: manifest validation bug
nikmace Aug 26, 2024
1cc9eb5
test: deploy prompts tests start
GDamyanov Aug 26, 2024
d7ebb30
Merge branch 'feat/2162/move-adp-prompting' of https://github.com/SAP…
GDamyanov Aug 26, 2024
eb5f8a2
Merge branch 'main' into feat/2162/move-adp-prompting
GDamyanov Aug 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/khaki-panthers-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@sap-ux/environment-check': minor
'@sap-ux/axios-extension': minor
'@sap-ux/adp-tooling': minor
'@sap-ux/create': minor
---

feat: Add prompting code of Adaptation Project generator
3 changes: 3 additions & 0 deletions packages/adp-tooling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"@sap-ux/project-input-validator": "workspace:*",
"@sap-ux/system-access": "workspace:*",
"@sap-ux/ui5-config": "workspace:*",
"@sap-ux/environment-check": "workspace:*",
"@sap-ux/store": "workspace:*",
"adm-zip": "0.5.10",
"ejs": "3.1.10",
"i18next": "23.11.2",
Expand All @@ -55,6 +57,7 @@
},
"devDependencies": {
"@sap-ux/store": "workspace:*",
"@sap-devx/yeoman-ui-types": "1.14.4",
"@types/adm-zip": "0.5.5",
"@types/ejs": "3.1.2",
"@types/express": "4.17.21",
Expand Down
7 changes: 4 additions & 3 deletions packages/adp-tooling/src/base/abap.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { Manifest, ManifestNamespace } from '@sap-ux/project-access';
import type { ToolsLogger } from '@sap-ux/logger';
import type { AdpPreviewConfig } from '../types';
import { createAbapServiceProvider } from '@sap-ux/system-access';
import { isAxiosError } from '@sap-ux/axios-extension';
import { createAbapServiceProvider } from '@sap-ux/system-access';
import type { Manifest, ManifestNamespace } from '@sap-ux/project-access';

import type { AdpPreviewConfig } from '../types';

/**
* Get the application manifest.
Expand Down
36 changes: 36 additions & 0 deletions packages/adp-tooling/src/base/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export const UI5_CDN_URL = 'https://ui5.sap.com';
export const UI5_VERSIONS_CDN_URL = 'https://sapui5.hana.ondemand.com/version.json';
export const UI5_VERSIONS_NEO_CDN_URL = 'https://ui5.sap.com/neo-app.json';
export const SNAPSHOT_CDN_URL = 'https://sapui5preview-sapui5.dispatcher.int.sap.eu2.hana.ondemand.com:443';

export const CURRENT_SYSTEM_VERSION = '(system version)';
export const LATEST_VERSION = '(latest)';
export const SNAPSHOT_VERSION = 'snapshot';
export const SNAPSHOT_UNTESTED_VERSION = 'snapshot-untested';

export const RESOURCE_BUNDLE_TEXT = '\n\n# This is the resource bundle for ';
export const TRANSLATION_UUID_TEXT = '\n#__ldi.translation.uuid=';
export const PROPERTIES_TEXT = '.properties';
export const MAIN_I18N_PATH = 'i18n/i18n.properties';

export const S4HANA_APPS_PARAMS = {
'sap.app/type': 'application',
'sap.fiori/cloudDevAdaptationStatus': 'released',
'fields':
'sap.app/id,repoName,sap.fiori/cloudDevAdaptationStatus,sap.app/ach,sap.fiori/registrationIds,sap.app/title,url,fileType'
};

export const ABAP_APPS_PARAMS = {
'fields': 'sap.app/id,sap.app/ach,sap.fiori/registrationIds,sap.app/title,url,fileType,repoName',
'sap.ui/technology': 'UI5',
'sap.app/type': 'application',
'fileType': 'appdescr'
};

export const ABAP_VARIANT_APPS_PARAMS = {
'fields': 'sap.app/id,sap.app/ach,sap.fiori/registrationIds,sap.app/title,url,fileType,repoName',
'sap.ui/technology': 'UI5',
'sap.app/type': 'application',
'fileType': 'appdescr_variant',
'originLayer': 'VENDOR'
};
2 changes: 2 additions & 0 deletions packages/adp-tooling/src/base/helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { readFileSync } from 'fs';
import { join, isAbsolute } from 'path';

import { UI5Config } from '@sap-ux/ui5-config';

import type { DescriptorVariant, AdpPreviewConfig } from '../types';

/**
Expand Down
6 changes: 6 additions & 0 deletions packages/adp-tooling/src/base/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export * from './constants';
export * from './node-generator-resolver';
export * from './helper';
export * from './change-utils';
export * from './abap';
export * from './cf';
28 changes: 28 additions & 0 deletions packages/adp-tooling/src/base/node-generator-resolver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { resolve } from 'path';

/**
* Attempts to resolve the path to a specific node module generator from the NODE_PATH environment variable.
*
* @returns {string | undefined} The resolved path to the generator module if found, or undefined if not found.
*/
export function resolveNodeModuleGenerator(): string | undefined {
tobiasqueck marked this conversation as resolved.
Show resolved Hide resolved
const nodePath = process.env['NODE_PATH'];
const nodePaths = nodePath?.split(':') ?? [];

let generator: string | undefined;
for (const path of nodePaths) {
try {
generator = require.resolve(resolve(path, '@bas-dev/generator-extensibility-sub/generators/app'));
} catch (e) {
/**
* We don't care if there's an error while resolving the module, continue with the next node_module path
*/
}

if (generator !== undefined) {
break;
}
}

return generator;
}
214 changes: 0 additions & 214 deletions packages/adp-tooling/src/base/prompt.ts

This file was deleted.

Loading
Loading