@shoper/cli 0.7.1-1 → 0.8.1-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +11 -1
  2. package/build/cli/class/errors/http/http_errors_factory.js +1 -1
  3. package/build/cli/core/cli_setup.js +6 -6
  4. package/build/cli/index.js +0 -1
  5. package/build/cli/utilities/features/logger/logs/app_logs_constants.js +1 -2
  6. package/build/index.js +2 -2
  7. package/build/theme/class/archive/theme_archive.js +47 -1
  8. package/build/theme/{features/theme/utils/archive/theme_archive_utils_errors_factory.js → class/archive/theme_archive_errors_factory.js} +1 -1
  9. package/build/theme/class/checksums/theme_checksums.js +11 -51
  10. package/build/theme/commands/pull/theme_pull_command.js +3 -4
  11. package/build/theme/commands/push/theme_push_command.js +8 -17
  12. package/build/theme/commands/theme_commands_constants.js +1 -2
  13. package/build/theme/commands/theme_verify_command.js +3 -3
  14. package/build/theme/commands/ui/theme_error.js +6 -6
  15. package/build/theme/features/theme/actions/theme_actions_constants.js +1 -2
  16. package/build/theme/features/theme/actions/theme_actions_utils.js +17 -61
  17. package/build/theme/features/theme/fetch/service/theme_fetch_service.js +4 -2
  18. package/build/theme/features/theme/init/service/theme_init_service.js +4 -2
  19. package/build/theme/features/theme/merge/service/theme_merge_service.js +2 -2
  20. package/build/theme/features/theme/push/api/theme_push_api.js +2 -2
  21. package/build/theme/features/theme/push/service/theme_push_service.js +33 -93
  22. package/build/theme/features/theme/push/theme_push_utils.js +17 -7
  23. package/build/theme/features/theme/utils/files_structure/theme_file_structure_errors_factory.js +9 -1
  24. package/build/theme/features/theme/utils/{files/theme_files_utils.js → files_structure/theme_files_structure_utils.js} +28 -36
  25. package/build/theme/features/theme/utils/meta_data/theme_meta_data_utils.js +28 -0
  26. package/build/theme/features/theme/verify/verify/theme_verify_service.js +12 -19
  27. package/build/theme/index.js +2 -6
  28. package/build/theme/utils/directory_validator/directory_validator_utils.js +11 -4
  29. package/build/theme/utils/shoperignore/shoperignore_utils.js +36 -0
  30. package/build/ui/ui_dump/ui_dump.js +4 -9
  31. package/build/utils/array_utils.js +0 -3
  32. package/build/utils/fs/fs_utils.js +1 -1
  33. package/package.json +6 -10
  34. package/build/theme/class/browser/browser.js +0 -108
  35. package/build/theme/commands/watch/theme_watch_command.js +0 -88
  36. package/build/theme/commands/watch/theme_watch_constants.js +0 -21
  37. package/build/theme/commands/watch/theme_watch_utils.js +0 -32
  38. package/build/theme/commands/watch/theme_watching_info.js +0 -14
  39. package/build/theme/commands/watch/watch.js +0 -55
  40. package/build/theme/features/theme/push/service/theme_push_service_types.js +0 -1
  41. package/build/theme/features/theme/utils/archive/theme_archive_utils.js +0 -26
  42. package/build/theme/features/theme/utils/files/them_files_constants.js +0 -1
  43. package/build/theme/features/theme/watch/api/theme_watch_api.js +0 -19
  44. package/build/theme/features/theme/watch/service/theme_watch_service.js +0 -167
  45. package/build/theme/features/theme/watch/theme_watch_constants.js +0 -4
  46. package/build/theme/features/theme/watch/theme_watch_initializer.js +0 -22
  47. package/build/ui/command_input/command_input.js +0 -25
  48. package/build/ui/logs/log_entry.js +0 -12
  49. package/build/ui/logs/logs_constants.js +0 -20
  50. package/build/ui/logs/logs_list.js +0 -18
  51. package/build/ui/logs/use_logs.js +0 -23
  52. package/build/utils/fs/fs_constants.js +0 -6
@@ -1,22 +0,0 @@
1
- import { FEATURE_CORES_TYPES, SyncFeatureInitializer } from '@dreamcommerce/star_core';
2
- import { THEME_WATCH_FEATURE_NAME } from './theme_watch_constants.js';
3
- import { ThemeWatchService } from './service/theme_watch_service.js';
4
- import { THEME_PUSH_API_NAME } from '../push/theme_push_constants.js';
5
- import { ThemeWatchApi } from './api/theme_watch_api.js';
6
- import { Browser } from '../../../class/browser/browser.js';
7
- //TODO to pownna byc inicjalizacja w komponencie reaktowym/komendzie watch.tsx
8
- export class ThemeWatchInitializer extends SyncFeatureInitializer {
9
- static featureName = THEME_WATCH_FEATURE_NAME;
10
- init() {
11
- const themePushApi = this.getApiSync(THEME_PUSH_API_NAME);
12
- const service = new ThemeWatchService({ themePushApi, browserClient: Browser });
13
- return {
14
- cores: [
15
- {
16
- type: FEATURE_CORES_TYPES.api,
17
- instance: new ThemeWatchApi(service)
18
- }
19
- ]
20
- };
21
- }
22
- }
@@ -1,25 +0,0 @@
1
- import { Box } from '../box.js';
2
- import { Text } from '../text.js';
3
- import React, { useState } from 'react';
4
- import TextInput from 'ink-text-input';
5
- import { COMMAND_PREFIX } from '../../theme/commands/watch/theme_watch_constants.js';
6
- export const CommandInput = ({ onSubmit, commands = [] }) => {
7
- const [query, setQuery] = useState('');
8
- const showSuggestions = query.startsWith(COMMAND_PREFIX);
9
- const searchTerm = query.substring(1);
10
- const filteredCommands = commands.filter((cmd) => cmd.key.startsWith(searchTerm));
11
- const handleSubmit = (value) => {
12
- onSubmit(value);
13
- setQuery('');
14
- };
15
- return (React.createElement(Box, { flexDirection: "column" },
16
- React.createElement(Box, { borderStyle: "round", borderColor: "blue", paddingX: 1, flexDirection: "row" },
17
- React.createElement(Text, { color: "blue" }, '> '),
18
- React.createElement(TextInput, { value: query, onChange: setQuery, onSubmit: handleSubmit, placeholder: `Type ${COMMAND_PREFIX} to see commands...` })),
19
- showSuggestions ? (React.createElement(Box, { flexDirection: "column", marginTop: 1, marginLeft: 2 },
20
- filteredCommands.map((cmd) => (React.createElement(Box, { key: cmd.key },
21
- React.createElement(Box, { width: 15 },
22
- React.createElement(Text, { color: "cyan", bold: true }, cmd.key)),
23
- React.createElement(Text, { color: "gray" }, cmd.description)))),
24
- filteredCommands.length === 0 && React.createElement(Text, { color: "red" }, "No matching commands found"))) : null));
25
- };
@@ -1,12 +0,0 @@
1
- export class LogEntry {
2
- id;
3
- type;
4
- content;
5
- timestamp;
6
- constructor({ id, type, content, timestamp }) {
7
- this.id = id;
8
- this.type = type;
9
- this.content = content;
10
- this.timestamp = timestamp;
11
- }
12
- }
@@ -1,20 +0,0 @@
1
- import { CSS_TEXT_COLORS } from '../color_constants.js';
2
- export const LOG_TYPES = {
3
- info: 'info',
4
- success: 'success',
5
- error: 'error',
6
- warning: 'warning',
7
- custom: 'custom'
8
- };
9
- export const MAP_LOG_TYPE_TO_TEXT_COLOR = {
10
- [LOG_TYPES.info]: CSS_TEXT_COLORS.info,
11
- [LOG_TYPES.success]: CSS_TEXT_COLORS.success,
12
- [LOG_TYPES.error]: CSS_TEXT_COLORS.danger,
13
- [LOG_TYPES.warning]: CSS_TEXT_COLORS.warning
14
- };
15
- export const MAP_LOG_TYPE_TO_LABEL = {
16
- [LOG_TYPES.info]: 'INFO',
17
- [LOG_TYPES.success]: 'SUCCESS',
18
- [LOG_TYPES.error]: 'ERROR',
19
- [LOG_TYPES.warning]: 'WARNING'
20
- };
@@ -1,18 +0,0 @@
1
- import { Box } from '../box.js';
2
- import { Text } from '../text.js';
3
- import React from 'react';
4
- import { LOG_TYPES, MAP_LOG_TYPE_TO_LABEL, MAP_LOG_TYPE_TO_TEXT_COLOR } from './logs_constants.js';
5
- export const LogsList = ({ logs }) => {
6
- return (React.createElement(Box, { flexDirection: "column", marginBottom: 1, width: "100%" }, logs.map((log) => {
7
- if (log.type === LOG_TYPES.custom)
8
- return React.createElement(Box, { key: log.id }, log.content);
9
- const logLabel = MAP_LOG_TYPE_TO_LABEL[log.type];
10
- const logColor = MAP_LOG_TYPE_TO_TEXT_COLOR[log.type];
11
- return typeof log.content === 'string' ? (React.createElement(Text, { key: log.id },
12
- React.createElement(Text, { color: logColor },
13
- "[",
14
- logLabel,
15
- "] "),
16
- log.content)) : (log.content);
17
- })));
18
- };
@@ -1,23 +0,0 @@
1
- import { useState } from 'react';
2
- import { LOG_TYPES } from './logs_constants.js';
3
- import { LogEntry } from './log_entry.js';
4
- import { v4 as uuid } from 'uuid';
5
- export const useLogs = (maxLogs) => {
6
- const [logs, setLogs] = useState([]);
7
- const addLog = (content, type = LOG_TYPES.info) => {
8
- setLogs((prev) => {
9
- const newLogs = [
10
- ...prev,
11
- new LogEntry({
12
- id: uuid(),
13
- type,
14
- content,
15
- timestamp: Date.now()
16
- })
17
- ];
18
- return newLogs.slice(-maxLogs);
19
- });
20
- };
21
- const clearLogs = () => setLogs([]);
22
- return { logs, addLog, clearLogs };
23
- };
@@ -1,6 +0,0 @@
1
- export const FILE_STATES = {
2
- created: 'created',
3
- modified: 'modified',
4
- deleted: 'deleted',
5
- unchanged: 'unchanged'
6
- };