()
| 25 | }); |
| 26 | |
| 27 | async function build() { |
| 28 | let publicUrlFlag = process.argv[2] ? `--public-url ${process.argv[2]}` : ''; |
| 29 | // Create a temp directory to build the site in |
| 30 | let dir = tempy.directory(); |
| 31 | console.log(`Building into ${dir}...`); |
| 32 | |
| 33 | // Generate a package.json containing just what we need to build the website |
| 34 | let gitHash = spawnSync('git', ['rev-parse', '--short', 'HEAD']).stdout.toString().trim(); |
| 35 | let pkg = { |
| 36 | name: 'rsp-website', |
| 37 | version: '0.0.0', |
| 38 | private: true, |
| 39 | workspaces: [ |
| 40 | 'packages/@internationalized/string-compiler', |
| 41 | 'packages/dev/*', |
| 42 | 'packages/@adobe/spectrum-css-temp', |
| 43 | 'packages/@adobe/spectrum-css-builder-temp' |
| 44 | ], |
| 45 | packageManager: 'yarn@4.2.2', |
| 46 | devDependencies: Object.fromEntries( |
| 47 | Object.entries(packageJSON.devDependencies).filter( |
| 48 | ([name]) => |
| 49 | name.startsWith('@parcel') || |
| 50 | name === 'parcel' || |
| 51 | name === 'patch-package' || |
| 52 | name.startsWith('@spectrum-css') || |
| 53 | name.startsWith('postcss') || |
| 54 | name === 'sharp' || |
| 55 | name === 'recast' || |
| 56 | name === 'motion' || |
| 57 | name === 'tailwindcss-animate' || |
| 58 | name === 'tailwindcss' || |
| 59 | name === '@tailwindcss/postcss' || |
| 60 | name === 'autoprefixer' || |
| 61 | name === 'lucide-react' || |
| 62 | name === 'tailwind-variants' || |
| 63 | name === 'react' || |
| 64 | name === 'react-dom' || |
| 65 | name === 'typescript' || |
| 66 | name === 'xml' |
| 67 | ) |
| 68 | ), |
| 69 | dependencies: { |
| 70 | '@adobe/react-spectrum': 'latest', |
| 71 | '@react-aria/example-theme': 'latest', |
| 72 | 'react-aria': 'latest', |
| 73 | 'react-stately': 'latest', |
| 74 | 'react-aria-components': 'latest', |
| 75 | 'tailwindcss-react-aria-components': 'latest', |
| 76 | '@spectrum-icons/illustrations': 'latest', |
| 77 | '@react-spectrum/autocomplete': 'latest' |
| 78 | }, |
| 79 | resolutions: packageJSON.resolutions, |
| 80 | browserslist: packageJSON.browserslist, |
| 81 | scripts: { |
| 82 | // Add a public url if provided via arg (for verdaccio prod doc website build since we want a commit hash) |
| 83 | build: `DOCS_ENV=production PARCEL_WORKER_BACKEND=process GIT_HASH=${gitHash} parcel build 'docs/*/*/docs/*.mdx' 'docs/react-aria-components/docs/**/*.mdx' 'packages/dev/docs/pages/**/*.mdx' ${publicUrlFlag}`, |
| 84 | postinstall: 'patch-package', |
no test coverage detected