github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/web/storybook.tiltfile (about)

     1  # Enforce versioning so that labels are supported
     2  version_settings(constraint='>=0.22.1')
     3  
     4  # Uncomment to try the cancel button extension
     5  #v1alpha1.extension_repo(name='default', url='file:///home/nick/src/tilt-extensions')
     6  #v1alpha1.extension(name='cancel', repo_name='default', repo_path='cancel')
     7  
     8  load("ext://uibutton", "cmd_button", "location")
     9  
    10  enable_feature("offline_snapshot_creation")
    11  
    12  local_resource(
    13    'install',
    14    'yarn install')
    15  
    16  local_resource(
    17    'storybook',
    18    serve_cmd='yarn run storybook -- --ci',
    19    links=['http://localhost:9009/'],
    20    readiness_probe=probe(http_get=http_get_action(port=9009)),
    21    labels=["frontend"],
    22    resource_deps=['install'])
    23  
    24  local_resource(
    25    'check:prettier',
    26    'cd .. && make prettier',
    27    auto_init=False,
    28    trigger_mode=TRIGGER_MODE_MANUAL,
    29    labels=["lint"],
    30    resource_deps=['install'])
    31  
    32  local_resource(
    33    'watch:tsc',
    34    serve_cmd='yarn tsc -w',
    35    auto_init=False,
    36    allow_parallel=True,
    37    labels=["lint"],
    38    resource_deps=['install'])
    39  
    40  local_resource(
    41    'check:check-js',
    42    'cd .. && make check-js',
    43    auto_init=False,
    44    trigger_mode=TRIGGER_MODE_MANUAL,
    45    allow_parallel=True,
    46    labels=["lint"],
    47    resource_deps=['install'])
    48  
    49  local_resource(
    50    'test:test-js',
    51    'cd .. && make test-js',
    52    auto_init=False,
    53    trigger_mode=TRIGGER_MODE_MANUAL,
    54    labels=["test"],
    55    allow_parallel=True,
    56    resource_deps=['install'])
    57  
    58  local_resource(
    59    'test:update-snapshots',
    60    'CI=true yarn test -u',
    61    auto_init=False,
    62    trigger_mode=TRIGGER_MODE_MANUAL,
    63    labels=["test"],
    64    resource_deps=['install'])
    65  
    66  # Add button versions for the local resources on Storybook resource
    67  
    68  cmd_button(
    69    name='2prettier',
    70    resource='storybook',
    71    argv=['sh', '-c', 'tilt trigger check:prettier'],
    72    text='Run prettier',
    73    location=location.RESOURCE,
    74    icon_name='cleaning_services',
    75  )
    76  
    77  cmd_button(
    78    name='1ts-compile',
    79    resource='storybook',
    80    argv=['sh', '-c', 'tilt trigger check:tsc'],
    81    text='Verify compile',
    82    location=location.RESOURCE,
    83    icon_name='handyman',
    84  )
    85  
    86  cmd_button(
    87    name='3check-js',
    88    resource='storybook',
    89    argv=['sh', '-c', 'tilt trigger check:check-js'],
    90    text='Check lint + compile',
    91    location=location.RESOURCE,
    92    icon_name='card_giftcard',
    93  )