{"id":15163208,"url":"https://github.com/iamssen/rocket-scripts","last_synced_at":"2025-09-30T17:31:16.237Z","repository":{"id":47608928,"uuid":"164979304","full_name":"iamssen/rocket-scripts","owner":"iamssen","description":"🛠 React development scripts for web apps and electron apps (similar to react-scripts)","archived":true,"fork":false,"pushed_at":"2021-11-01T08:56:46.000Z","size":184928,"stargazers_count":27,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-18T04:22:16.083Z","etag":null,"topics":["0cjs","react","rocket-scripts","webpack","zeroconfig"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@rocket-scripts/web","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamssen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-10T03:01:34.000Z","updated_at":"2024-07-24T05:57:59.000Z","dependencies_parsed_at":"2022-09-12T15:03:37.658Z","dependency_job_id":null,"html_url":"https://github.com/iamssen/rocket-scripts","commit_stats":null,"previous_names":["react-zeroconfig/react-zeroconfig","iamssen/rocket-scripts","rocket-hangar/rocket-scripts","iamssen/react-zeroconfig"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/iamssen/rocket-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamssen%2Frocket-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamssen%2Frocket-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamssen%2Frocket-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamssen%2Frocket-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamssen","download_url":"https://codeload.github.com/iamssen/rocket-scripts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamssen%2Frocket-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277318925,"owners_count":25798230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-28T02:00:08.834Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["0cjs","react","rocket-scripts","webpack","zeroconfig"],"created_at":"2024-09-27T02:21:07.751Z","updated_at":"2025-09-30T17:31:15.700Z","avatar_url":"https://github.com/iamssen.png","language":"TypeScript","readme":"# 🚀 Rocket Scripts\n\n[![NPM](https://img.shields.io/npm/v/@rocket-scripts/web.svg)](https://www.npmjs.com/package/@rocket-scripts/web)\n[![NPM](https://img.shields.io/npm/v/@rocket-scripts/electron.svg)](https://www.npmjs.com/package/@rocket-scripts/electron)\n[![TEST](https://github.com/rocket-hangar/rocket-scripts/workflows/TEST/badge.svg)](https://github.com/rocket-hangar/rocket-scripts/actions?query=workflow%3ATEST)\n[![E2E](https://github.com/rocket-hangar/rocket-scripts/workflows/E2E/badge.svg)](https://github.com/rocket-hangar/rocket-scripts/actions?query=workflow%3AE2E)\n[![codecov](https://codecov.io/gh/rocket-hangar/rocket-scripts/branch/master/graph/badge.svg)](https://codecov.io/gh/rocket-hangar/rocket-scripts)\n\n🚀 Rocket Scripts are development scripts for React web apps and React electron apps.\n\nThese scripts are not support CLI for easy usage.\n\nBut, you can easy combine the many other environments (e.g. Back-End API Server, Puppeteer...) in API usage.\n\nFor example, you can available like below.\n\n\u003chttps://github.com/rocket-hangar/rocket-scripts-templates/blob/master/examples/web-with-backend/scripts/start.ts\u003e\n\n```ts\n// 1. Start Back-End API Server\n// 2. Start Front-End Development Server\n// 3. Start Chromium Browser with Puppeteer\nimport { serverStart } from '@myorg/api-server';\nimport { start } from '@rocket-scripts/web';\nimport puppeteer from 'puppeteer';\n\n(async () =\u003e {\n  const remoteDebuggingPort: number = +(process.env.INSPECT_CHROME ?? 9222);\n  const serverPort: number = +(process.env.API_SERVER_PORT ?? 9455);\n\n  // start back-end server\n  await serverStart({ port: serverPort });\n\n  // start front-end dev server\n  const { port } = await start({\n    app: 'client',\n    webpackDevServerConfig: {\n      // bind proxy `\u003cback-end\u003e/*` -\u003e `\u003cfront-end\u003e/api/*`\n      proxy: {\n        '/api': {\n          target: `http://localhost:${serverPort}`,\n          changeOrigin: true,\n          logLevel: 'debug',\n          pathRewrite: {\n            '^/api': '',\n          },\n        },\n      },\n    },\n  });\n\n  // start puppeteer\n  const browser = await puppeteer.launch({\n    //userDataDir: process.env.CHROMIUM_USER_DATA_DEBUG,\n    headless: false,\n    args: [\n      '--start-fullscreen',\n      `--remote-debugging-port=${remoteDebuggingPort}`,\n    ],\n    devtools: true,\n  });\n\n  const [page] = await browser.pages();\n  await page.goto(`http://localhost:${port}`);\n\n  await page.waitForFunction(\n    `document.querySelector('#app h1').innerHTML === 'Hello World!'`,\n    {\n      timeout: 1000 * 60,\n      polling: 1000 * 3,\n    },\n  );\n})();\n```\n\n\u003chttps://github.com/rocket-hangar/rocket-scripts-templates/blob/master/examples/repeat-profiling/scripts/start.tsx\u003e\n\n```tsx\n// 1. Start Front-End development server\n// 2. Start Chromium Broser with Puppeteer\n// 3. Start performance profiling with shortcut on Interactive CLI\nimport { start } from '@rocket-scripts/web';\nimport { Divider } from '@ssen/dev-server-components';\nimport chokidar from 'chokidar';\nimport { format } from 'date-fns';\nimport { FSWatcher } from 'fs';\nimport fs from 'fs-extra';\nimport { Text, useInput } from 'ink';\nimport path from 'path';\nimport puppeteer, { Browser } from 'puppeteer';\nimport React, { useCallback, useEffect, useState } from 'react';\n\nconst profileStore: string = path.join(process.cwd(), 'profiles');\n\nfunction ProfileRepeater({\n  browser,\n  pageUrl,\n  shortcuts,\n}: {\n  browser: Browser;\n  pageUrl: string;\n  shortcuts: {\n    record: string;\n    clean: string;\n  };\n}) {\n  const [profiles, setProfiles] = useState\u003cstring[]\u003e([]);\n\n  const run = useCallback(async () =\u003e {\n    const page = await browser.newPage();\n\n    const profile: string = path.join(\n      profileStore,\n      `animate-${format(new Date(), 'yyyy-MM-dd-hhmmss')}.json`,\n    );\n\n    await page.tracing.start({\n      path: profile,\n      screenshots: true,\n      // @see ~/tracing.categories.json\n      // const cdp: CDPSession = await page._client;\n      // const categories = await cdp.send('Tracing.getCategories');\n      categories: [\n        'devtools.timeline',\n        'disabled-by-default-devtools.timeline',\n        'disabled-by-default-devtools.timeline.frame',\n        'disabled-by-default-devtools.timeline.stack',\n        'disabled-by-default-v8.cpu_profiler',\n        'disabled-by-default-v8.cpu_profiler.hires',\n        'memory',\n      ],\n    });\n\n    await page.goto(pageUrl);\n\n    await page.waitFor(4000);\n\n    await page.tracing.stop();\n\n    await page.close();\n  }, [browser, pageUrl]);\n\n  useEffect(() =\u003e {\n    function update() {\n      setProfiles(\n        fs.readdirSync(profileStore).filter((file) =\u003e /^animate-/.test(file)),\n      );\n    }\n\n    const watcher: FSWatcher = chokidar\n      .watch([`${profileStore}/*.json`])\n      .on('add', update)\n      .on('unlink', update);\n\n    return () =\u003e {\n      watcher.close();\n    };\n  }, []);\n\n  useInput((input) =\u003e {\n    switch (input) {\n      case shortcuts.record:\n        run();\n        break;\n      case shortcuts.clean:\n        for (const file of fs.readdirSync(profileStore)) {\n          if (/[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}\\.json$/.test(file)) {\n            fs.removeSync(path.join(profileStore, file));\n          }\n        }\n        break;\n    }\n  });\n\n  return (\n    \u003c\u003e\n      \u003cDivider bold\u003e\n        {`Profiles (${shortcuts.record}) Create a new profile (${shortcuts.clean}) Clean temp profiles`}\n      \u003c/Divider\u003e\n      {profiles.map((file) =\u003e (\n        \u003cText key={file}\u003e{file}\u003c/Text\u003e\n      ))}\n    \u003c/\u003e\n  );\n}\n\n(async () =\u003e {\n  const remoteDebuggingPort: number = +(process.env.INSPECT_CHROME ?? 9222);\n  const webPort: number = +(process.env.DEV_SERVER_PORT ?? 9633);\n\n  await fs.mkdirp(profileStore);\n\n  const browser = await puppeteer.launch({\n    userDataDir: process.env.CHROMIUM_USER_DATA_DEBUG,\n    headless: false,\n    args: [\n      '--start-fullscreen',\n      `--remote-debugging-port=${remoteDebuggingPort}`,\n    ],\n    devtools: true,\n  });\n\n  await start({\n    app: 'app',\n    port: webPort,\n    children: (\n      \u003cProfileRepeater\n        browser={browser}\n        pageUrl={`http://localhost:${webPort}`}\n        shortcuts={{ record: 'x', clean: 'c' }}\n      /\u003e\n    ),\n  });\n})();\n```\n\n# Quick start React Web app development\n\n\u003chttps://github.com/rocket-hangar/rocket-scripts-templates/blob/master/templates/web/README.md\u003e\n\n```sh\n# create a workspace directory\nnpx generate-github-directory https://github.com/rocket-hangar/workspace-template my-project\ncd my-project\n\n# create an app\nnpx generate-github-directory https://github.com/rocket-hangar/rocket-scripts-templates/tree/master/templates/web my-app\n\n# add \"my-app\" to workspaces of package.json\n\n# install\nyarn\n\n# start\ncd my-app\n\n# start\nyarn run start\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eFish shell function\u003c/summary\u003e\n\n```fish\n# add ~/.config/fish/config.fish\nfunction generate-web-project\n  set project $argv[1]\n  set app $argv[2]\n\n  if [ -z $project ] || [ -z $app ]\n    echo \"Undefined arguments $project $app : generate-web-project project app\"\n  else\n    # create a workspace directory\n    generate-github-directory https://github.com/rocket-hangar/workspace-template $project\n    cd $project\n\n    # create an app\n    generate-github-directory https://github.com/rocket-hangar/rocket-scripts-templates/tree/master/templates/web $app\n    cd $app\n\n    cd ..\n\n    echo \"👍 Generated! follow next steps\"\n    echo \"Add $app to workspaces of package.json\"\n    echo \"And, yarn install\"\n\n    # open project in your IDE\n    # webstorm .\n    # code .\n  end\nend\n```\n\n\u003c/details\u003e\n\n# Quick start React Electron app development\n\n\u003chttps://github.com/rocket-hangar/rocket-scripts-templates/tree/master/templates/electron\u003e\n\n```sh\n# create a workspace directory\nnpx generate-github-directory https://github.com/rocket-hangar/workspace-template my-project\ncd my-project\n\n# create an app\nnpx generate-github-directory https://github.com/rocket-hangar/rocket-scripts-templates/tree/master/templates/electron my-app\n\n# add \"my-app\" to workspaces of package.json\n\n# install\nyarn\n\n# directory\ncd my-app\n\n# start\nyarn run start\n```\n\n# More repositories for reference\n\n- \u003chttps://github.com/rocket-hangar/rocket-scripts-templates\u003e\n\n# Related Projects\n\n- \u003chttps://github.com/rocket-hangar/rocket-punch\u003e\n- \u003chttps://github.com/rocket-hangar/rocket-scripts\u003e\n- \u003chttps://github.com/rocket-hangar/handbook\u003e\n- \u003chttps://github.com/rocket-hangar/generate-github-directory\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamssen%2Frocket-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamssen%2Frocket-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamssen%2Frocket-scripts/lists"}