@youcan/cli 1.1.0-beta.0 → 1.1.0-beta.10

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 (72) hide show
  1. package/bin/exec.cmd +3 -0
  2. package/bin/exec.js +8 -0
  3. package/dist/cli/commands/auth/login.d.ts +4 -2
  4. package/dist/cli/commands/auth/login.js +7 -85
  5. package/dist/cli/commands/auth/logout.d.ts +4 -2
  6. package/dist/cli/commands/auth/logout.js +9 -18
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.js +20 -2
  9. package/package.json +55 -40
  10. package/bin/index.js +0 -2
  11. package/dist/cli/commands/apps/create.d.ts +0 -2
  12. package/dist/cli/commands/apps/create.js +0 -65
  13. package/dist/cli/commands/apps/install.d.ts +0 -2
  14. package/dist/cli/commands/apps/install.js +0 -28
  15. package/dist/cli/commands/auth/types.d.ts +0 -6
  16. package/dist/cli/commands/index.d.ts +0 -12
  17. package/dist/cli/commands/index.js +0 -14
  18. package/dist/cli/commands/store/info.d.ts +0 -2
  19. package/dist/cli/commands/store/info.js +0 -29
  20. package/dist/cli/commands/store/switch.d.ts +0 -2
  21. package/dist/cli/commands/store/switch.js +0 -59
  22. package/dist/cli/commands/store/types.d.ts +0 -4
  23. package/dist/cli/commands/theme/delete.d.ts +0 -2
  24. package/dist/cli/commands/theme/delete.js +0 -46
  25. package/dist/cli/commands/theme/dev.d.ts +0 -2
  26. package/dist/cli/commands/theme/dev.js +0 -199
  27. package/dist/cli/commands/theme/init.d.ts +0 -2
  28. package/dist/cli/commands/theme/init.js +0 -86
  29. package/dist/cli/commands/theme/list.d.ts +0 -2
  30. package/dist/cli/commands/theme/list.js +0 -35
  31. package/dist/cli/commands/theme/pack.d.ts +0 -2
  32. package/dist/cli/commands/theme/pack.js +0 -31
  33. package/dist/cli/commands/theme/pull.d.ts +0 -2
  34. package/dist/cli/commands/theme/pull.js +0 -56
  35. package/dist/cli/commands/theme/types.d.ts +0 -17
  36. package/dist/cli/commands/types.d.ts +0 -22
  37. package/dist/cli/index.d.ts +0 -12
  38. package/dist/cli/index.js +0 -53
  39. package/dist/config/index.d.ts +0 -21
  40. package/dist/config/index.js +0 -25
  41. package/dist/config/messages.d.ts +0 -36
  42. package/dist/config/messages.js +0 -37
  43. package/dist/core/client/client.d.ts +0 -23
  44. package/dist/core/client/client.js +0 -83
  45. package/dist/core/client/types.d.ts +0 -80
  46. package/dist/core/themes/preview.d.ts +0 -1
  47. package/dist/core/themes/preview.js +0 -37
  48. package/dist/utils/common.d.ts +0 -22
  49. package/dist/utils/common.js +0 -67
  50. package/dist/utils/git/cloneRepository.d.ts +0 -6
  51. package/dist/utils/git/cloneRepository.js +0 -18
  52. package/dist/utils/helpers.d.ts +0 -3
  53. package/dist/utils/helpers.js +0 -35
  54. package/dist/utils/http.d.ts +0 -11
  55. package/dist/utils/http.js +0 -26
  56. package/dist/utils/network.d.ts +0 -2
  57. package/dist/utils/network.js +0 -81
  58. package/dist/utils/system/deleteFile.d.ts +0 -5
  59. package/dist/utils/system/deleteFile.js +0 -13
  60. package/dist/utils/system/ls.d.ts +0 -1
  61. package/dist/utils/system/ls.js +0 -9
  62. package/dist/utils/system/openLink.d.ts +0 -1
  63. package/dist/utils/system/saveFile.d.ts +0 -1
  64. package/dist/utils/system/saveFile.js +0 -9
  65. package/dist/utils/system/stdout.d.ts +0 -17
  66. package/dist/utils/system/stdout.js +0 -35
  67. package/dist/utils/system/writeToFile.d.ts +0 -1
  68. package/dist/utils/system/writeToFile.js +0 -7
  69. package/dist/utils/system/zipFolder.d.ts +0 -5
  70. package/dist/utils/system/zipFolder.js +0 -57
  71. package/dist/utils/system.d.ts +0 -1
  72. package/dist/utils/system.js +0 -18
@@ -1,199 +0,0 @@
1
- import { cwd } from 'node:process';
2
- import { clear } from 'node:console';
3
- import { readdirSync, existsSync, readFileSync } from 'node:fs';
4
- import crypto from 'node:crypto';
5
- import chokidar from 'chokidar';
6
- import kleur from 'kleur';
7
- import { fileFromPathSync } from 'formdata-node/file-from-path';
8
- import io from 'socket.io-client';
9
- import stdout from '../../../utils/system/stdout.js';
10
- import { getCurrentThemeId, LoadingSpinner } from '../../../utils/common.js';
11
- import config from '../../../config/index.js';
12
- import previewTheme from '../../../core/themes/preview.js';
13
- import messages from '../../../config/messages.js';
14
-
15
- const sizeFormatter = Intl.NumberFormat('en', {
16
- notation: 'compact',
17
- style: 'unit',
18
- unit: 'byte',
19
- unitDisplay: 'narrow',
20
- });
21
- const eventLogTagMap = {
22
- error: () => kleur.bold().red('[error]'),
23
- add: () => kleur.bold().green('[created]'),
24
- change: () => kleur.bold().blue('[updated]'),
25
- unlink: () => kleur.bold().yellow('[deleted]'),
26
- };
27
- function logFileEvent(options) {
28
- const tag = eventLogTagMap[options.event]();
29
- return stdout.log(`${tag} ${kleur.underline().white(options.path)} - ${sizeFormatter.format(options.size)} | ${options.roundtrip}ms \n`);
30
- }
31
- function connectPreviewServer() {
32
- const socket = io(`ws://localhost:${config.PREVIEW_SERVER_PORT}`);
33
- socket.on('connect', () => {
34
- stdout.log(messages.DEV_PREVIEW_SERVER_CONNECTED);
35
- });
36
- return socket;
37
- }
38
- async function syncChanges(cli, themeId) {
39
- const meta = await cli.client.getThemeMeta(themeId);
40
- for (const fileType of config.THEME_FILE_TYPES) {
41
- const files = meta[fileType];
42
- const dirFiles = readdirSync(`./${fileType}`);
43
- // save schema before data
44
- if (fileType === 'config') {
45
- const fileOrder = ['settings_schema.json', 'settings_data.json'];
46
- files.sort((a, b) => fileOrder.indexOf(a.file_name) - fileOrder.indexOf(b.file_name));
47
- }
48
- // add newly created files
49
- if (dirFiles.length > 0) {
50
- const newFiles = dirFiles.filter(file => !files.find(f => f.file_name === file));
51
- for (const file of newFiles) {
52
- try {
53
- const fileData = fileFromPathSync(`./${fileType}/${file}`);
54
- await cli.client.updateFile(themeId, {
55
- file_type: fileType,
56
- file_name: file,
57
- file_operation: 'save',
58
- file_content: fileData,
59
- });
60
- }
61
- catch (err) {
62
- if (err instanceof Error) {
63
- stdout.error(`[error] ${file}: ${err.message}`);
64
- }
65
- }
66
- }
67
- }
68
- // update remote with local changes
69
- for (const file of files) {
70
- const filePath = `${file.type}/${file.file_name}`;
71
- if (!existsSync(filePath)) {
72
- try {
73
- await cli.client.deleteFile(themeId, {
74
- file_type: file.type,
75
- file_name: file.file_name,
76
- file_operation: 'delete',
77
- });
78
- }
79
- catch (err) {
80
- if (err instanceof Error) {
81
- stdout.error(`[error] ${file.file_name}: ${err.message}`);
82
- }
83
- }
84
- continue;
85
- }
86
- const fileStream = readFileSync(filePath);
87
- const localHash = crypto.createHash('sha1');
88
- localHash.update(fileStream);
89
- if (localHash.digest('hex') !== file.hash) {
90
- try {
91
- await cli.client.updateFile(themeId, {
92
- file_type: file.type,
93
- file_name: file.file_name,
94
- file_operation: 'save',
95
- file_content: fileFromPathSync(filePath),
96
- });
97
- }
98
- catch (err) {
99
- if (err instanceof Error) {
100
- stdout.error(`[error] ${file.file_name}: ${err.message}`);
101
- }
102
- }
103
- }
104
- }
105
- }
106
- }
107
- function command(cli) {
108
- return {
109
- name: 'theme:dev',
110
- group: 'theme',
111
- description: 'starts a dev server and watches over the current directory',
112
- options: [
113
- { name: '-p, --preview', description: 'opens a preview window' },
114
- { name: '-d, --disable-hardware-acceleration', description: 'disable hardware acceleration' },
115
- ],
116
- action: async (options) => {
117
- let socket;
118
- if (!cli.client.isAuthenticated()) {
119
- return stdout.error(messages.AUTH_USER_NOT_LOGGED_IN);
120
- }
121
- const themeId = await getCurrentThemeId(cwd());
122
- if (!themeId) {
123
- return stdout.error(messages.DEV_NO_THEME_DETECTED);
124
- }
125
- const { domain } = await cli.client.getStoreInfo();
126
- clear();
127
- const loadingSpinner = new LoadingSpinner('Syncing changes...');
128
- loadingSpinner.start();
129
- await syncChanges(cli, themeId);
130
- loadingSpinner.stop();
131
- if (options.preview) {
132
- socket = connectPreviewServer();
133
- socket.emit('theme:dev', { themeId });
134
- previewTheme(`https://${domain}/themes/${themeId}/preview`, options);
135
- }
136
- stdout.info(`Watching for changes in ${kleur.bold().white(cwd())}...`);
137
- chokidar
138
- .watch(config.THEME_FILE_TYPES, {
139
- persistent: true,
140
- ignoreInitial: true,
141
- awaitWriteFinish: {
142
- stabilityThreshold: 50,
143
- },
144
- })
145
- .on('all', async (event, path, stats) => {
146
- const start = new Date().getTime();
147
- try {
148
- const [filetype, filename] = path.split('/', 2);
149
- if (!config.THEME_FILE_TYPES.includes(filetype)) {
150
- return;
151
- }
152
- if (!['add', 'change', 'unlink'].includes(event)) {
153
- return;
154
- }
155
- switch (event) {
156
- case 'add':
157
- case 'change':
158
- await cli.client.updateFile(themeId, {
159
- file_type: filetype,
160
- file_name: filename,
161
- file_operation: 'save',
162
- file_content: fileFromPathSync(path),
163
- });
164
- break;
165
- case 'unlink':
166
- await cli.client.deleteFile(themeId, {
167
- file_type: filetype,
168
- file_name: filename,
169
- file_operation: 'delete',
170
- });
171
- break;
172
- }
173
- if (socket) {
174
- socket.emit('theme:update', { themeId });
175
- }
176
- logFileEvent({
177
- path,
178
- event,
179
- size: stats?.size ?? 0,
180
- roundtrip: new Date().getTime() - start,
181
- });
182
- }
183
- catch (err) {
184
- logFileEvent({
185
- path,
186
- event: 'error',
187
- size: stats?.size ?? 0,
188
- roundtrip: new Date().getTime() - start,
189
- });
190
- if (err instanceof Error) {
191
- stdout.info(`message: ${err.message}`);
192
- }
193
- }
194
- });
195
- },
196
- };
197
- }
198
-
199
- export { command as default };
@@ -1,2 +0,0 @@
1
- import type { CLI, CommandDefinition } from '@/cli/commands/types';
2
- export default function command(cli: CLI): CommandDefinition;
@@ -1,86 +0,0 @@
1
- import { cwd } from 'node:process';
2
- import path from 'node:path';
3
- import prompts from 'prompts';
4
- import { fileFromPath } from 'formdata-node/file-from-path';
5
- import config from '../../../config/index.js';
6
- import cloneRepository from '../../../utils/git/cloneRepository.js';
7
- import stdout from '../../../utils/system/stdout.js';
8
- import { zipFolder } from '../../../utils/system/zipFolder.js';
9
- import writeToFile from '../../../utils/system/writeToFile.js';
10
- import deleteFile from '../../../utils/system/deleteFile.js';
11
- import messages from '../../../config/messages.js';
12
-
13
- const inquiries = [
14
- {
15
- type: 'text',
16
- name: 'theme_name',
17
- message: 'The theme\'s name, used for display purposes.',
18
- initial: 'Starter',
19
- },
20
- {
21
- type: 'text',
22
- name: 'theme_author',
23
- message: 'The theme\'s author',
24
- initial: 'YouCan',
25
- },
26
- {
27
- type: 'text',
28
- name: 'theme_version',
29
- message: 'The theme\'s current version',
30
- initial: '1.0.0',
31
- },
32
- {
33
- type: 'text',
34
- name: 'theme_support_url',
35
- message: 'A support URL for this theme.',
36
- initial: 'https://developer.youcan.shop',
37
- },
38
- {
39
- type: 'text',
40
- name: 'theme_documentation_url',
41
- message: 'A documentation URL for this theme.',
42
- initial: 'https://developer.youcan.shop',
43
- },
44
- ];
45
- const defaultInquiries = {
46
- theme_name: 'Starter',
47
- theme_author: 'YouCan',
48
- theme_version: '1.0.0',
49
- theme_support_url: 'https://developer.youcan.shop',
50
- theme_documentation_url: 'https://developer.youcan.shop',
51
- };
52
- function getSelectedTheme(optionTheme) {
53
- const selectedTheme = config.AVAILABLE_THEMES.find(theme => theme.name === optionTheme?.toLocaleLowerCase().trim())?.repository;
54
- if (selectedTheme) {
55
- return selectedTheme;
56
- }
57
- return config.STARTER_THEME_GIT_REPOSITORY;
58
- }
59
- function command(cli) {
60
- return {
61
- name: 'theme:init',
62
- group: 'theme',
63
- description: 'Create a new theme or clone existing one.',
64
- options: [
65
- { name: '-t, --theme <theme>', description: 'Specify a theme name e.g. cod-theme' },
66
- { name: '-d, --default', description: 'Use default values for theme name, author, version, support url and documentation url.' },
67
- ],
68
- action: async (options) => {
69
- if (!cli.client.isAuthenticated()) {
70
- return stdout.error(messages.AUTH_USER_NOT_LOGGED_IN);
71
- }
72
- const info = options.default ? defaultInquiries : await prompts(inquiries);
73
- stdout.info(messages.INIT_CLONE_START);
74
- const themeRepository = getSelectedTheme(options.theme);
75
- cloneRepository(themeRepository, info.theme_name);
76
- const zippedTheme = await zipFolder(cwd(), info.theme_name);
77
- const themeFolderRs = await fileFromPath(zippedTheme);
78
- const id = await cli.client.initTheme({ ...info, archive: themeFolderRs });
79
- writeToFile(path.resolve(cwd(), info.theme_name, '.youcan'), JSON.stringify({ theme_id: id }));
80
- deleteFile(zippedTheme);
81
- stdout.info(`${messages.INIT_SUCCESS}${id}`);
82
- },
83
- };
84
- }
85
-
86
- export { command as default };
@@ -1,2 +0,0 @@
1
- import type { CLI, CommandDefinition } from '@/cli/commands/types';
2
- export default function command(cli: CLI): CommandDefinition;
@@ -1,35 +0,0 @@
1
- import messages from '../../../config/messages.js';
2
- import stdout from '../../../utils/system/stdout.js';
3
- import { LoadingSpinner } from '../../../utils/common.js';
4
-
5
- function command(cli) {
6
- return {
7
- name: 'theme:list',
8
- group: 'theme',
9
- description: 'List my development themes',
10
- options: [],
11
- action: async () => {
12
- if (!cli.client.isAuthenticated()) {
13
- return stdout.error(messages.AUTH_USER_NOT_LOGGED_IN);
14
- }
15
- await LoadingSpinner.exec(`${messages.FETCHING_DEV_THEMES}..`, async (spinner) => {
16
- try {
17
- const devThemes = await cli.client.listThemes();
18
- spinner.stop();
19
- if (!devThemes.dev.length) {
20
- return stdout.error(messages.NO_REMOTE_THEMES);
21
- }
22
- stdout.table(devThemes.dev.map((theme) => ({
23
- Name: theme.name,
24
- Size: theme.size,
25
- })));
26
- }
27
- catch (err) {
28
- spinner.error(messages.ERROR_WHILE_FETCHING_DEV_THEMES);
29
- }
30
- });
31
- },
32
- };
33
- }
34
-
35
- export { command as default };
@@ -1,2 +0,0 @@
1
- import type { CLI, CommandDefinition } from '../types';
2
- export default function command(cli: CLI): CommandDefinition;
@@ -1,31 +0,0 @@
1
- import { cwd } from 'node:process';
2
- import stdout from '../../../utils/system/stdout.js';
3
- import { getCurrentThemeId, getCurrentDate, LoadingSpinner } from '../../../utils/common.js';
4
- import messages from '../../../config/messages.js';
5
- import { zipDirectory } from '../../../utils/system/zipFolder.js';
6
- import config from '../../../config/index.js';
7
-
8
- function command(cli) {
9
- return {
10
- name: 'theme:pack',
11
- group: 'theme',
12
- description: 'Package a theme',
13
- options: [],
14
- action: async () => {
15
- if (!cli.client.isAuthenticated()) {
16
- return stdout.error(messages.AUTH_USER_NOT_LOGGED_IN);
17
- }
18
- if (!await getCurrentThemeId(cwd())) {
19
- return stdout.error('No theme found in the current directory');
20
- }
21
- const loading = new LoadingSpinner('📦 Packaging your theme');
22
- loading.start();
23
- const exportFolder = `theme_${getCurrentDate()}`;
24
- await zipDirectory(cwd(), exportFolder, config.THEME_FILE_TYPES);
25
- loading.stop();
26
- return stdout.info(`your theme was successfully packaged to ${exportFolder}`);
27
- },
28
- };
29
- }
30
-
31
- export { command as default };
@@ -1,2 +0,0 @@
1
- import type { CLI, CommandDefinition } from '../types';
2
- export default function command(cli: CLI): CommandDefinition;
@@ -1,56 +0,0 @@
1
- import { cwd } from 'node:process';
2
- import prompts from 'prompts';
3
- import decompress from 'decompress';
4
- import stdout from '../../../utils/system/stdout.js';
5
- import { saveHttpFile } from '../../../utils/system/saveFile.js';
6
- import { getCurrentThemeId } from '../../../utils/common.js';
7
- import writeToFile from '../../../utils/system/writeToFile.js';
8
- import deleteFile from '../../../utils/system/deleteFile.js';
9
- import messages from '../../../config/messages.js';
10
-
11
- function command(cli) {
12
- return {
13
- name: 'theme:pull',
14
- group: 'theme',
15
- description: 'Pull a theme',
16
- options: [],
17
- action: async () => {
18
- if (!cli.client.isAuthenticated()) {
19
- return stdout.error(messages.AUTH_USER_NOT_LOGGED_IN);
20
- }
21
- const { dev } = await cli.client.listThemes();
22
- const choices = dev.map(theme => ({
23
- title: theme.name,
24
- value: theme.id,
25
- }));
26
- let themeId;
27
- const cwdThemeId = await getCurrentThemeId(cwd());
28
- if (!cwdThemeId) {
29
- const promt = await prompts({
30
- type: 'select',
31
- name: 'themeId',
32
- message: 'Select a theme to pull',
33
- choices,
34
- });
35
- themeId = promt.themeId;
36
- }
37
- themeId = themeId || cwdThemeId;
38
- if (!themeId) {
39
- return stdout.error(messages.PULL_NO_THEME_FOUND);
40
- }
41
- const fileName = `${themeId}`;
42
- const fileNameZip = `${fileName}.zip`;
43
- stdout.info(messages.PULL_PULLING_THEME);
44
- const response = await cli.client.pullTheme(themeId);
45
- await saveHttpFile(response, fileNameZip);
46
- stdout.info(messages.PULL_UNPACKING_THEME);
47
- const unpackingFolder = cwdThemeId ? cwd() : `${cwd()}/${fileName}`;
48
- await decompress(fileNameZip, unpackingFolder);
49
- deleteFile(fileNameZip);
50
- writeToFile(`${unpackingFolder}/.youcan`, JSON.stringify({ theme_id: themeId }));
51
- stdout.info(`${messages.PULL_THEME_PULLED} ${fileName}`);
52
- },
53
- };
54
- }
55
-
56
- export { command as default };
@@ -1,17 +0,0 @@
1
- export interface FileEventOptions {
2
- path: string;
3
- size: number;
4
- roundtrip: number;
5
- event: string;
6
- }
7
- export interface ThemeMetaData {
8
- id: string;
9
- name: string;
10
- size: number;
11
- version: string;
12
- live: boolean;
13
- }
14
- export interface listThemesResponse {
15
- dev: ThemeMetaData[];
16
- published: ThemeMetaData[];
17
- }
@@ -1,22 +0,0 @@
1
- import type { CAC } from 'cac';
2
- import type Client from '@/core/client/client';
3
- export interface CommandOptionDefinition {
4
- name: string;
5
- description: string;
6
- config?: {
7
- default?: any;
8
- type?: any[];
9
- };
10
- }
11
- export interface CommandDefinition {
12
- name: string;
13
- group: string;
14
- aliases?: string[];
15
- description: string;
16
- action: ReturnType<any>;
17
- options?: CommandOptionDefinition[];
18
- }
19
- export interface CLI {
20
- handler: CAC;
21
- client: Client;
22
- }
@@ -1,12 +0,0 @@
1
- import * as commands from './commands';
2
- import type { CLI, CommandDefinition } from './commands/types';
3
- import Client from '@/core/client/client';
4
- declare const cli: {
5
- client: Client;
6
- handler: import("cac").CAC;
7
- registerCommand(command: (cli: CLI) => CommandDefinition): void;
8
- getAvailableCommands(): (typeof commands.LoginCommand | typeof commands.LogoutCommand | typeof commands.ThemeInitCommand | typeof commands.ThemeListCommand | typeof commands.ThemeDevCommand | typeof commands.ThemeDeleteCommand | typeof commands.ThemePullCommand | typeof commands.ThemePackCommand | typeof commands.StoreInfoCommand | typeof commands.StoreSwitchCommand | typeof commands.CreateAppCommand | typeof commands.InstallAppCommand)[];
9
- init(): Promise<void>;
10
- prepareClient(): Promise<void>;
11
- };
12
- export default cli;
package/dist/cli/index.js DELETED
@@ -1,53 +0,0 @@
1
- import { existsSync, promises } from 'node:fs';
2
- import { cac } from 'cac';
3
- import * as index from './commands/index.js';
4
- import Client from '../core/client/client.js';
5
- import config from '../config/index.js';
6
-
7
- const cli = {
8
- client: new Client(),
9
- handler: cac('youcan'),
10
- registerCommand(command) {
11
- const definition = command(this);
12
- const instance = this.handler
13
- .command(definition.name, definition.description)
14
- .action(definition.action);
15
- definition.aliases?.forEach(a => instance.alias(a));
16
- definition.options?.forEach(o => instance.option(o.name, o.description, o.config));
17
- },
18
- getAvailableCommands() {
19
- return Object.values(index);
20
- },
21
- async init() {
22
- await this.prepareClient();
23
- Object.values(index).forEach(command => this.registerCommand(command));
24
- this.handler.on('command:*', () => {
25
- this.handler.outputHelp();
26
- });
27
- this.handler.help();
28
- this.handler.parse();
29
- },
30
- async prepareClient() {
31
- if (!existsSync(config.CLI_GLOBAL_CONFIG_DIR)) {
32
- await promises.mkdir(config.CLI_GLOBAL_CONFIG_DIR);
33
- }
34
- if (!existsSync(config.CLI_GLOBAL_CONFIG_PATH)) {
35
- return await promises.writeFile(config.CLI_GLOBAL_CONFIG_PATH, '', { flag: 'wx', encoding: 'utf-8' });
36
- }
37
- const data = await promises
38
- .readFile(config.CLI_GLOBAL_CONFIG_PATH, 'utf-8')
39
- .then((b) => {
40
- try {
41
- return JSON.parse(b);
42
- }
43
- catch {
44
- return {};
45
- }
46
- });
47
- if ('access_token' in data) {
48
- this.client.setAccessToken(data.access_token);
49
- }
50
- },
51
- };
52
-
53
- export { cli as default };
@@ -1,21 +0,0 @@
1
- declare const _default: {
2
- OAUTH_CLIENT_ID: number;
3
- OAUTH_CALLBACK_PORT: number;
4
- OAUTH_CALLBACK_SERVER_TIMEOUT: number;
5
- OAUTH_CALLBACK_URL: string;
6
- OAUTH_CLIENT_SECRET: string;
7
- OAUTH_AUTH_CODE_URL: string;
8
- OAUTH_ACCESS_TOKEN_URL: string;
9
- SELLER_AREA_API_BASE_URI: string;
10
- SELLER_AREA_WEB_BASE_URI: string;
11
- STARTER_THEME_GIT_REPOSITORY: string;
12
- AVAILABLE_THEMES: {
13
- name: string;
14
- repository: string;
15
- }[];
16
- CLI_GLOBAL_CONFIG_DIR: string;
17
- CLI_GLOBAL_CONFIG_PATH: string;
18
- THEME_FILE_TYPES: string[];
19
- PREVIEW_SERVER_PORT: number;
20
- };
21
- export default _default;
@@ -1,25 +0,0 @@
1
- import { homedir } from 'node:os';
2
- import path from 'node:path';
3
-
4
- var config = {
5
- OAUTH_CLIENT_ID: 8,
6
- OAUTH_CALLBACK_PORT: 3_000,
7
- OAUTH_CALLBACK_SERVER_TIMEOUT: 5 * 60 * 100,
8
- OAUTH_CALLBACK_URL: 'http://localhost:3000/',
9
- OAUTH_CLIENT_SECRET: 'lvUw2mQ7nXp4WqZ9CZlURMgRGAra3KuOrYhFlU7X',
10
- OAUTH_AUTH_CODE_URL: 'https://seller-area.youcan.shop/admin/oauth/authorize?response_type=code&client_id=8&redirect_url=http://localhost:3000/&state=',
11
- OAUTH_ACCESS_TOKEN_URL: 'https://seller-area.youcan.shop/admin/oauth/token',
12
- SELLER_AREA_API_BASE_URI: 'https://api.youcan.shop',
13
- SELLER_AREA_WEB_BASE_URI: 'https://seller-area.youcan.shop',
14
- STARTER_THEME_GIT_REPOSITORY: 'https://github.com/youcan-shop/light-theme.git',
15
- AVAILABLE_THEMES: [
16
- { name: 'default', repository: 'https://github.com/youcan-shop/light-theme.git' },
17
- { name: 'cod-theme', repository: 'https://github.com/youcan-shop/cod-theme.git' },
18
- ],
19
- CLI_GLOBAL_CONFIG_DIR: path.resolve(homedir(), '.youcan'),
20
- CLI_GLOBAL_CONFIG_PATH: path.resolve(homedir(), '.youcan', 'config.json'),
21
- THEME_FILE_TYPES: ['layouts', 'sections', 'locales', 'assets', 'snippets', 'config', 'templates'],
22
- PREVIEW_SERVER_PORT: 7565,
23
- };
24
-
25
- export { config as default };
@@ -1,36 +0,0 @@
1
- declare const _default: {
2
- LOGIN_OPEN_LINK: string;
3
- LOGIN_SUCCESS: string;
4
- FETCHING_CURRENT_STORE_INFO: string;
5
- CURRENT_DEVELOPMENT_STORE: string;
6
- ERROR_WHILE_FETCHING_CURRENT_STORE_INFO: string;
7
- SELECT_STORE: string;
8
- NO_STORE_FOUND: string;
9
- NO_STORE_SELECTED: string;
10
- SELECT_STORE_IN_PROGRESS: string;
11
- CANNOT_SELECT_STORE: string;
12
- STORE_SELECTED: string;
13
- FETCHING_DEV_THEMES: string;
14
- ERROR_WHILE_FETCHING_DEV_THEMES: string;
15
- INIT_SUCCESS: string;
16
- INIT_CLONE_START: string;
17
- AUTH_USER_NOT_LOGGED_IN: string;
18
- AUTH_USER_LOGGED_OUT: string;
19
- DELETE_NO_THEME_SELECTED: string;
20
- DELETE_THEME_DELETED: string;
21
- NO_REMOTE_THEMES: string;
22
- DELETE_SELECT_THEME: string;
23
- DELETE_IN_PROGRESS: string;
24
- DELETE_ERROR: string;
25
- DEV_PREVIEW_SERVER_CONNECTED: string;
26
- DEV_WATCHING_FILES: string;
27
- DEV_NO_THEME_DETECTED: string;
28
- PULL_NO_THEME_FOUND: string;
29
- PULL_PULLING_THEME: string;
30
- PULL_UNPACKING_THEME: string;
31
- PULL_THEME_PULLED: string;
32
- PREVIEW_BROWSER_CLOSED: string;
33
- PREVIEW_THEME_UPDATED: string;
34
- PREVIEW_RELOADED: string;
35
- };
36
- export default _default;
@@ -1,37 +0,0 @@
1
- var messages = {
2
- LOGIN_OPEN_LINK: 'Open this link in your browser to continue authentication:',
3
- LOGIN_SUCCESS: 'You have been successfully logged in.',
4
- FETCHING_CURRENT_STORE_INFO: 'Fetching current store info',
5
- CURRENT_DEVELOPMENT_STORE: 'Current development store',
6
- ERROR_WHILE_FETCHING_CURRENT_STORE_INFO: 'Error while fetching current store info',
7
- SELECT_STORE: 'Which development store you would like to use?',
8
- NO_STORE_FOUND: 'No development store found!',
9
- NO_STORE_SELECTED: 'No development store selected.',
10
- SELECT_STORE_IN_PROGRESS: 'Selecting store in progress',
11
- CANNOT_SELECT_STORE: 'Could not select the development store.',
12
- STORE_SELECTED: 'Store selected',
13
- FETCHING_DEV_THEMES: 'Fetching current development themes',
14
- ERROR_WHILE_FETCHING_DEV_THEMES: 'Error while fetching current development themes',
15
- INIT_SUCCESS: 'The theme has been initiated with id: ',
16
- INIT_CLONE_START: 'Cloning your theme from github',
17
- AUTH_USER_NOT_LOGGED_IN: 'You are not currently logged into any store.',
18
- AUTH_USER_LOGGED_OUT: 'You have been successfully logged out.',
19
- DELETE_NO_THEME_SELECTED: 'No theme selected.',
20
- DELETE_THEME_DELETED: 'Theme deleted successfully.',
21
- NO_REMOTE_THEMES: 'This store does not have any development themes.',
22
- DELETE_SELECT_THEME: 'Which remote development theme would you like to delete?',
23
- DELETE_IN_PROGRESS: 'Deleting theme',
24
- DELETE_ERROR: 'Could not delete remote development theme.',
25
- DEV_PREVIEW_SERVER_CONNECTED: 'Connected to preview server',
26
- DEV_WATCHING_FILES: 'Watching theme files for changes...',
27
- DEV_NO_THEME_DETECTED: 'No theme detected in the current directory.',
28
- PULL_NO_THEME_FOUND: 'No theme found',
29
- PULL_PULLING_THEME: 'Pulling your theme...',
30
- PULL_UNPACKING_THEME: 'Unpacking...',
31
- PULL_THEME_PULLED: 'Theme has been pulled to ',
32
- PREVIEW_BROWSER_CLOSED: 'Browser closed',
33
- PREVIEW_THEME_UPDATED: 'Theme change detected, reloading...',
34
- PREVIEW_RELOADED: 'Reloaded in ',
35
- };
36
-
37
- export { messages as default };