@faststore/cli 3.99.1 → 4.0.0-dev.4

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 (96) hide show
  1. package/README.md +48 -39
  2. package/bin/dev.cmd +1 -1
  3. package/bin/dev.js +5 -0
  4. package/bin/run.js +5 -0
  5. package/dist/index.js +2252 -19
  6. package/dist/index.js.map +1 -1
  7. package/package.json +46 -27
  8. package/bin/dev +0 -17
  9. package/bin/run +0 -5
  10. package/dist/__mocks__/hcms.d.ts +0 -62
  11. package/dist/__mocks__/hcms.d.ts.map +0 -1
  12. package/dist/__mocks__/hcms.js +0 -184
  13. package/dist/__mocks__/hcms.js.map +0 -1
  14. package/dist/commands/build.d.ts +0 -12
  15. package/dist/commands/build.d.ts.map +0 -1
  16. package/dist/commands/build.js +0 -118
  17. package/dist/commands/build.js.map +0 -1
  18. package/dist/commands/cms-sync.d.ts +0 -13
  19. package/dist/commands/cms-sync.d.ts.map +0 -1
  20. package/dist/commands/cms-sync.js +0 -39
  21. package/dist/commands/cms-sync.js.map +0 -1
  22. package/dist/commands/create.d.ts +0 -11
  23. package/dist/commands/create.d.ts.map +0 -1
  24. package/dist/commands/create.js +0 -38
  25. package/dist/commands/create.js.map +0 -1
  26. package/dist/commands/dev.d.ts +0 -12
  27. package/dist/commands/dev.d.ts.map +0 -1
  28. package/dist/commands/dev.js +0 -164
  29. package/dist/commands/dev.js.map +0 -1
  30. package/dist/commands/generate-graphql.d.ts +0 -12
  31. package/dist/commands/generate-graphql.d.ts.map +0 -1
  32. package/dist/commands/generate-graphql.js +0 -60
  33. package/dist/commands/generate-graphql.js.map +0 -1
  34. package/dist/commands/start.d.ts +0 -10
  35. package/dist/commands/start.d.ts.map +0 -1
  36. package/dist/commands/start.js +0 -40
  37. package/dist/commands/start.js.map +0 -1
  38. package/dist/commands/test.d.ts +0 -9
  39. package/dist/commands/test.d.ts.map +0 -1
  40. package/dist/commands/test.js +0 -79
  41. package/dist/commands/test.js.map +0 -1
  42. package/dist/index.d.ts +0 -16
  43. package/dist/index.d.ts.map +0 -1
  44. package/dist/utils/commands.d.ts +0 -2
  45. package/dist/utils/commands.d.ts.map +0 -1
  46. package/dist/utils/commands.js +0 -16
  47. package/dist/utils/commands.js.map +0 -1
  48. package/dist/utils/createNextjsPages.d.ts +0 -2
  49. package/dist/utils/createNextjsPages.d.ts.map +0 -1
  50. package/dist/utils/createNextjsPages.js +0 -83
  51. package/dist/utils/createNextjsPages.js.map +0 -1
  52. package/dist/utils/dependencies.d.ts +0 -8
  53. package/dist/utils/dependencies.d.ts.map +0 -1
  54. package/dist/utils/dependencies.js +0 -17
  55. package/dist/utils/dependencies.js.map +0 -1
  56. package/dist/utils/deprecations.d.ts +0 -7
  57. package/dist/utils/deprecations.d.ts.map +0 -1
  58. package/dist/utils/deprecations.js +0 -32
  59. package/dist/utils/deprecations.js.map +0 -1
  60. package/dist/utils/directory.d.ts +0 -26
  61. package/dist/utils/directory.d.ts.map +0 -1
  62. package/dist/utils/directory.js +0 -68
  63. package/dist/utils/directory.js.map +0 -1
  64. package/dist/utils/directory.test.d.ts +0 -2
  65. package/dist/utils/directory.test.d.ts.map +0 -1
  66. package/dist/utils/directory.test.js +0 -175
  67. package/dist/utils/directory.test.js.map +0 -1
  68. package/dist/utils/generate.d.ts +0 -7
  69. package/dist/utils/generate.d.ts.map +0 -1
  70. package/dist/utils/generate.js +0 -387
  71. package/dist/utils/generate.js.map +0 -1
  72. package/dist/utils/hcms.d.ts +0 -25
  73. package/dist/utils/hcms.d.ts.map +0 -1
  74. package/dist/utils/hcms.js +0 -118
  75. package/dist/utils/hcms.js.map +0 -1
  76. package/dist/utils/hcms.test.d.ts +0 -2
  77. package/dist/utils/hcms.test.d.ts.map +0 -1
  78. package/dist/utils/hcms.test.js +0 -189
  79. package/dist/utils/hcms.test.js.map +0 -1
  80. package/dist/utils/logger.d.ts +0 -2
  81. package/dist/utils/logger.d.ts.map +0 -1
  82. package/dist/utils/logger.js +0 -16
  83. package/dist/utils/logger.js.map +0 -1
  84. package/dist/utils/plugins.d.ts +0 -25
  85. package/dist/utils/plugins.d.ts.map +0 -1
  86. package/dist/utils/plugins.js +0 -235
  87. package/dist/utils/plugins.js.map +0 -1
  88. package/dist/utils/runCommandSync.d.ts +0 -7
  89. package/dist/utils/runCommandSync.d.ts.map +0 -1
  90. package/dist/utils/runCommandSync.js +0 -45
  91. package/dist/utils/runCommandSync.js.map +0 -1
  92. package/dist/utils/templates/myAccountPage.d.ts +0 -2
  93. package/dist/utils/templates/myAccountPage.d.ts.map +0 -1
  94. package/dist/utils/templates/myAccountPage.js +0 -49
  95. package/dist/utils/templates/myAccountPage.js.map +0 -1
  96. package/oclif.manifest.json +0 -1
@@ -1,7 +0,0 @@
1
- export declare const runCommandSync: ({ cmd, errorMessage, throws, cwd, }: {
2
- cmd: string;
3
- errorMessage: string;
4
- throws: 'warning' | 'error';
5
- cwd?: string | undefined;
6
- }) => void;
7
- //# sourceMappingURL=runCommandSync.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runCommandSync.d.ts","sourceRoot":"","sources":["../../src/utils/runCommandSync.ts"],"names":[],"mappings":"AA2CA,eAAO,MAAM,cAAc;SAMpB,MAAM;kBACG,MAAM;YACZ,SAAS,GAAG,OAAO;;UA0B5B,CAAA"}
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runCommandSync = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const child_process_1 = require("child_process");
7
- const logger_1 = require("./logger");
8
- const showError = ({ message, cmd, error, }) => {
9
- logger_1.logger.error(`${chalk_1.default.red('error')} - ${message}`);
10
- if (cmd && error) {
11
- logger_1.logger.log(`${chalk_1.default.magenta('DEBUG')} - $ ${cmd} error root ↓`);
12
- logger_1.logger.log(error.stdout?.toString());
13
- }
14
- process.exit(1);
15
- };
16
- const showWarning = ({ message, cmd, error, }) => {
17
- logger_1.logger.warn(`${chalk_1.default.yellow('warn')} - ${message}`);
18
- if (cmd && error) {
19
- logger_1.logger.log(`${chalk_1.default.magenta('DEBUG')} - $ ${cmd} warn root ↓`);
20
- logger_1.logger.log(error.stdout?.toString());
21
- }
22
- };
23
- const runCommandSync = ({ cmd, errorMessage, throws, cwd, }) => {
24
- const debug = process.env.DISCOVERY_DEBUG === 'true' ? true : false;
25
- try {
26
- logger_1.logger.log(`[STARTED] ${cmd}`);
27
- const res = (0, child_process_1.execSync)(debug ? `${cmd} --debug --verbose 2>&1` : `${cmd} 2>&1`, {
28
- stdio: 'pipe',
29
- cwd,
30
- });
31
- logger_1.logger.log(`[STATUS] ${res.toString()}`);
32
- logger_1.logger.log(`[FINISHED] ${cmd}`);
33
- }
34
- catch (error) {
35
- const sanitizedError = debug ? error : undefined;
36
- if (throws === 'warning') {
37
- showWarning({ message: errorMessage, cmd, error: sanitizedError });
38
- }
39
- else {
40
- showError({ message: errorMessage, cmd, error: sanitizedError });
41
- }
42
- }
43
- };
44
- exports.runCommandSync = runCommandSync;
45
- //# sourceMappingURL=runCommandSync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runCommandSync.js","sourceRoot":"","sources":["../../src/utils/runCommandSync.ts"],"names":[],"mappings":";;;;AAAA,0DAAyB;AAEzB,iDAAwC;AACxC,qCAAiC;AAIjC,MAAM,SAAS,GAAG,CAAC,EACjB,OAAO,EACP,GAAG,EACH,KAAK,GAKN,EAAE,EAAE;IACH,eAAM,CAAC,KAAK,CAAC,GAAG,eAAK,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,OAAO,EAAE,CAAC,CAAA;IAElD,IAAI,GAAG,IAAI,KAAK,EAAE,CAAC;QACjB,eAAM,CAAC,GAAG,CAAC,GAAG,eAAK,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAC,CAAA;QAC/D,eAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,Q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AAC,CAAE,KAAuB,CAAC,CAAC,CAAC,SAAS,CAAA;QAEnE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,WAAW,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAA;QACpE,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAA;QAClE,CAAC;IACH,CAAC;AACH,CAAC,CAAA;AAlCY,QAAA,cAAc,kBAkC1B"}
@@ -1,2 +0,0 @@
1
- export declare const myAccountPageTemplate: (pagePath: string) => string;
2
- //# sourceMappingURL=myAccountPage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"myAccountPage.d.ts","sourceRoot":"","sources":["../../../src/utils/templates/myAccountPage.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB,aAAc,MAAM,WAsCrD,CAAA"}
@@ -1,49 +0,0 @@
1
- "use strict";
2
- /*
3
- TODO: Code in a template string is not a good practice because it becomes very difficult to maintain.
4
- There will be a component called MyAccountLayout that will wrap the entire MyAccount Layout, including the global sections, menu, etc.
5
- This will reduce the amount of code inside the template string.
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.myAccountPageTemplate = void 0;
9
- const myAccountPageTemplate = (pagePath) => `
10
- import type { ComponentType } from 'react'
11
- import RenderSections from 'src/components/cms/RenderSections'
12
- import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
13
- import CUSTOM_COMPONENTS from 'src/customizations/src/components'
14
- import { MyAccountLayout } from 'src/components/account'
15
- import {
16
- getServerSideProps,
17
- type MyAccountProps,
18
- } from 'src/experimental/myAccountServerSideProps'
19
- import DynamicPage from '${pagePath}';
20
- import PageProvider from 'src/sdk/overrides/PageProvider'
21
- /* A list of components that can be used in the CMS. */
22
- const COMPONENTS: Record<string, ComponentType<any>> = {
23
- ...GLOBAL_COMPONENTS,
24
- ...CUSTOM_COMPONENTS,
25
- }
26
-
27
- function Page({ globalSections: globalSectionsProp, accountName, isRepresentative }: MyAccountProps) {
28
- const { sections: globalSections, settings: globalSettings } = globalSectionsProp ?? {}
29
-
30
- return (
31
- <PageProvider context={{ globalSettings }}>
32
- <RenderSections
33
- globalSections={globalSections}
34
- components={COMPONENTS}
35
- >
36
- <MyAccountLayout accountName={accountName} isRepresentative={isRepresentative}>
37
- <DynamicPage />
38
- </MyAccountLayout>
39
- </RenderSections>
40
- </PageProvider>
41
- )
42
- }
43
-
44
- export { getServerSideProps }
45
-
46
- export default Page
47
- `;
48
- exports.myAccountPageTemplate = myAccountPageTemplate;
49
- //# sourceMappingURL=myAccountPage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"myAccountPage.js","sourceRoot":"","sources":["../../../src/utils/templates/myAccountPage.ts"],"names":[],"mappings":";AAAA;;;;EAIE;;;AAEK,MAAM,qBAAqB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC;;;;;;;;;;6BAU9B,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BpC,CAAA;AAtCY,QAAA,qBAAqB,yBAsCjC"}
@@ -1 +0,0 @@
1
- {"version":"3.99.1","commands":{"build":{"id":"build","strict":true,"pluginName":"@faststore/cli","pluginAlias":"@faststore/cli","pluginType":"core","aliases":[],"flags":{"no-verify":{"name":"no-verify","type":"boolean","description":"Skips verification of faststore dependencies version string to prevent usage of packages outside npm registry.","allowNo":false}},"args":[{"name":"account","description":"The account for which the Discovery is running. Currently noop."},{"name":"path","description":"The path where the FastStore being built is. Defaults to cwd."}]},"cms-sync":{"id":"cms-sync","strict":true,"pluginName":"@faststore/cli","pluginAlias":"@faststore/cli","pluginType":"core","aliases":[],"flags":{"dry-run":{"name":"dry-run","type":"boolean","char":"d","allowNo":false}},"args":[{"name":"path","description":"The path where the FastStore being synched with the CMS is. Defaults to cwd."}]},"create":{"id":"create","description":"Creates a discovery folder based on the starter.store template.","strict":true,"pluginName":"@faststore/cli","pluginAlias":"@faststore/cli","pluginType":"core","aliases":[],"examples":["$ yarn faststore create discovery"],"flags":{},"args":[{"name":"path","description":"The path where the Discovery folder will be created. Defaults to ./discovery."}]},"dev":{"id":"dev","strict":true,"pluginName":"@faststore/cli","pluginAlias":"@faststore/cli","pluginType":"core","aliases":[],"flags":{"watch-plugins":{"name":"watch-plugins","type":"boolean","description":"Enable watching for plugin changes","allowNo":false}},"args":[{"name":"account","description":"The account for which the Discovery is running. Currently noop."},{"name":"path","description":"The path where the FastStore being run is. Defaults to cwd."},{"name":"port","description":"The port where FastStore should run. Defaults to 3000."}]},"generate-graphql":{"id":"generate-graphql","strict":true,"pluginName":"@faststore/cli","pluginAlias":"@faststore/cli","pluginType":"core","aliases":[],"flags":{"core":{"name":"core","type":"boolean","char":"c","hidden":true,"allowNo":false}},"args":[{"name":"path","description":"The path where the FastStore GraphQL customization is. Defaults to cwd."}]},"start":{"id":"start","strict":true,"pluginName":"@faststore/cli","pluginAlias":"@faststore/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"account","description":"The account for which the Discovery is running. Currently noop."},{"name":"path","description":"The path where the FastStore being run is. Defaults to cwd."},{"name":"port","description":"The port where FastStore should run. Defaults to 3000."}]},"test":{"id":"test","strict":true,"pluginName":"@faststore/cli","pluginAlias":"@faststore/cli","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"The path where the FastStore being tested is. Defaults to cwd."}]}}}