MCPcopy Index your code
hub / github.com/adobe/react-spectrum / build

Function build

scripts/buildPublishedAPI.js:46–287  ·  view source on GitHub ↗

* Building this will run the docs builder using the apiCheck pipeline in .parcelrc This will * generate json containing the visible (API/exposed) type definitions for each package This is run * against a downloaded copy of the last published version of each package into a temporary * directory an

()

Source from the content-addressed store, hash-verified

44 * directory and build there.
45 */
46async function build() {
47 let distDir =
48 args.values.output ?? path.join(__dirname, '..', 'dist', args.values.output ?? 'base-api');
49 // if we already have a directory with a built dist, remove it so we can write cleanly into it at the end
50 fs.rmSync(distDir, {recursive: true, force: true});
51 // Create a temp directory to build the site in
52 let dir = tempy.directory();
53 console.log(`Building published api into ${dir}...`);
54
55 // Generate a package.json containing just what we need to build the website
56 let pkg = {
57 name: 'react-spectrum-monorepo',
58 version: '0.0.0',
59 packageManager: 'yarn@4.2.2',
60 private: true,
61 workspaces: ['packages/*/*'],
62 devDependencies: Object.fromEntries(
63 Object.entries(packageJSON.devDependencies).filter(
64 ([name]) =>
65 name.startsWith('@parcel') ||
66 name === 'parcel' ||
67 name === 'patch-package' ||
68 name.startsWith('@spectrum-css') ||
69 name.startsWith('postcss') ||
70 name.startsWith('@adobe') ||
71 name === 'react' ||
72 name === 'react-dom' ||
73 name === 'tailwindcss' ||
74 name === 'typescript'
75 )
76 ),
77 dependencies: {},
78 resolutions: packageJSON.resolutions,
79 browserslist: packageJSON.browserslist,
80 scripts: {
81 build: 'yarn parcel build packages/@react-spectrum/actiongroup',
82 postinstall: 'patch-package'
83 },
84 '@parcel/resolver-default': {
85 packageExports: true
86 }
87 };
88
89 // create a package.json without any of our packages as dependencies, so they
90 // aren't reinstalled
91 let cleanPkg = {
92 name: 'react-spectrum-monorepo',
93 version: '0.0.0',
94 packageManager: 'yarn@4.2.2',
95 private: true,
96 workspaces: ['packages/*/*'],
97 devDependencies: Object.fromEntries(
98 Object.entries(packageJSON.devDependencies).filter(
99 ([name]) =>
100 name.startsWith('@parcel') ||
101 name === 'parcel' ||
102 name === 'patch-package' ||
103 name.startsWith('@spectrum-css') ||

Callers 1

Calls 4

addDepsFunction · 0.85
runFunction · 0.70
filterMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected