mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-21 09:18:45 +00:00
* relocate .vscode
* Switch to transloadit linter
* Update .eslintrc.json
* autofix code
* unlink and install eslint-config-transloadit@1.1.1
* Change 0 to "off"
* Don't change 'use strict'
* Do not vertically align
* disable key-spacing
* add import/no-extraneous-dependencies per package
* add more react/a11y warnings
* Revert "autofix code"
This reverts commit 14c8a8cde8.
* add import/no-extraneous-dependencies per example and main package
* autofix code (2)
* Allow devDependencies in ./bin
* Change import/no-extraneous-dependencies to warn again
* upgrade linter
* Set import/no-extraneous-dependencies to warn
30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Lerna installs all the example dependencies into the root `node_modules`.
|
|
* To run the examples they need to have access to executables from npm dependencies in their $PATH.
|
|
* If you run `npm start` in a dependency folder, the root `node_modules/.bin` is not in the $PATH.
|
|
*
|
|
* This proxy executable can be run from the repository root using `npm run example`, so the root
|
|
* `node_modules/.bin` will be in the $PATH. It then runs `npm start` in the specific example folder,
|
|
* which will inherit the $PATH, so the example has access to executables from npm dependencies in both
|
|
* its own and in the root `node_modules`.
|
|
*/
|
|
|
|
const path = require('path')
|
|
const { execSync } = require('child_process')
|
|
|
|
const exampleName = process.argv[2]
|
|
|
|
if (!exampleName) {
|
|
console.error('Usage: npm run example "name-of-example"')
|
|
process.exit(1)
|
|
}
|
|
|
|
const exampleDir = path.join(__dirname, '../examples', exampleName)
|
|
const pkg = require(path.join(exampleDir, 'package.json'))
|
|
if (pkg.scripts && pkg.scripts.build) {
|
|
execSync('npm run build', { cwd: exampleDir, stdio: 'inherit' })
|
|
}
|
|
|
|
execSync('npm start', { cwd: exampleDir, stdio: 'inherit' })
|