handoff-app 1.2.2-2 → 1.2.2-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.
@@ -18,9 +18,9 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
18
18
  const path_1 = __importDefault(require("path"));
19
19
  const components_1 = require("../pipeline/components");
20
20
  const patterns_1 = require("../pipeline/patterns");
21
+ const builder_1 = __importDefault(require("../transformers/preview/component/builder"));
21
22
  const css_1 = require("../transformers/preview/component/css");
22
23
  const javascript_1 = require("../transformers/preview/component/javascript");
23
- const builder_1 = __importDefault(require("../transformers/preview/component/builder"));
24
24
  const logger_1 = require("../utils/logger");
25
25
  const client_config_1 = require("./client-config");
26
26
  const paths_1 = require("./paths");
@@ -54,11 +54,15 @@ const initializeProjectApp = (handoff) => __awaiter(void 0, void 0, void 0, func
54
54
  yield (0, paths_1.syncPublicFiles)(handoff);
55
55
  // Copy custom theme CSS if it exists in the user's project
56
56
  const customThemePath = path_1.default.resolve(handoff.workingPath, 'theme.css');
57
+ const destPath = path_1.default.resolve(appPath, 'css', 'theme.css');
57
58
  if (fs_extra_1.default.existsSync(customThemePath)) {
58
- const destPath = path_1.default.resolve(appPath, 'css', 'theme.css');
59
59
  yield fs_extra_1.default.copy(customThemePath, destPath, { overwrite: true });
60
60
  logger_1.Logger.success(`Custom theme.css loaded`);
61
61
  }
62
+ else {
63
+ // create a empty theme.css file
64
+ yield fs_extra_1.default.writeFile(destPath, '');
65
+ }
62
66
  // Prepare project app configuration using stable placeholder replacement.
63
67
  const handoffProjectId = handoff.getProjectId();
64
68
  const handoffAppBasePath = (_a = handoff.config.app.base_path) !== null && _a !== void 0 ? _a : '';
package/dist/cli.js CHANGED
File without changes
package/handoff.config.js CHANGED
@@ -56,8 +56,8 @@ module.exports = {
56
56
  scss: './sass/main.scss',
57
57
  js: './js/main.js',
58
58
  bundle: './js/main.js',
59
- components: ['./test_components'],
60
- patterns: ['./test_patterns'],
59
+ //components: ['./test_components'],
60
+ //patterns: ['./test_patterns'],
61
61
  },
62
62
  // These are the asset zip file download links
63
63
  assets_zip_links: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handoff-app",
3
- "version": "1.2.2-2",
3
+ "version": "1.2.2-4",
4
4
  "description": "Automated documentation toolchain for building client side documentation from figma",
5
5
  "author ": {
6
6
  "name": "Convertiv",
@@ -0,0 +1 @@
1
+ declare module '*.css' {}
@@ -1,4 +1,6 @@
1
1
  import type { AppProps } from 'next/app';
2
+
3
+ import '../css/index.css';
2
4
  import '../css/theme.css';
3
5
 
4
6
  function MyApp({ Component, pageProps }: AppProps) {
@@ -4,13 +4,23 @@ import path from 'path';
4
4
  import Handoff from '..';
5
5
  import { buildComponents } from '../pipeline/components';
6
6
  import { buildPatterns } from '../pipeline/patterns';
7
+ import processComponents from '../transformers/preview/component/builder';
7
8
  import { buildMainCss } from '../transformers/preview/component/css';
8
9
  import { buildMainJS } from '../transformers/preview/component/javascript';
9
- import processComponents from '../transformers/preview/component/builder';
10
10
  import { Logger } from '../utils/logger';
11
11
  import { generateTokensApi, persistClientConfig } from './client-config';
12
12
  import { getAppPath, syncPublicFiles } from './paths';
13
- import { WatcherState, getRuntimeComponentsPathsToWatch, watchAppSource, watchComponentDirectories, watchGlobalEntries, watchPages, watchPublicDirectory, watchRuntimeComponents, watchRuntimeConfiguration } from './watchers';
13
+ import {
14
+ WatcherState,
15
+ getRuntimeComponentsPathsToWatch,
16
+ watchAppSource,
17
+ watchComponentDirectories,
18
+ watchGlobalEntries,
19
+ watchPages,
20
+ watchPublicDirectory,
21
+ watchRuntimeComponents,
22
+ watchRuntimeConfiguration,
23
+ } from './watchers';
14
24
  import { createWebSocketServer } from './websocket';
15
25
 
16
26
  const escapeForSingleQuotedJsString = (value: string): string => value.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
@@ -46,10 +56,13 @@ const initializeProjectApp = async (handoff: Handoff): Promise<string> => {
46
56
 
47
57
  // Copy custom theme CSS if it exists in the user's project
48
58
  const customThemePath = path.resolve(handoff.workingPath, 'theme.css');
59
+ const destPath = path.resolve(appPath, 'css', 'theme.css');
49
60
  if (fs.existsSync(customThemePath)) {
50
- const destPath = path.resolve(appPath, 'css', 'theme.css');
51
61
  await fs.copy(customThemePath, destPath, { overwrite: true });
52
62
  Logger.success(`Custom theme.css loaded`);
63
+ } else {
64
+ // create a empty theme.css file
65
+ await fs.writeFile(destPath, '');
53
66
  }
54
67
 
55
68
  // Prepare project app configuration using stable placeholder replacement.