Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !2766

Merge facebook/1.0.10

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/wmonk/facebook-1.0.10 into master 8 years ago
  • Overview 0
  • Commits 247
  • Pipelines 0
  • Changes 67

Created by: wmonk

Compare
  • master (base)

and
  • latest version
    74191385
    247 commits, 2 years ago

67 files
+ 794
- 710

    Preferences

    File browser
    Compare changes
pack‎ages‎
create-r‎eact-app‎
createRe‎actApp.js‎ +13 -33
eslint-conf‎ig-react-app‎
inde‎x.js‎ +1 -2
react-d‎ev-utils‎
FileSizeR‎eporter.js‎ +9 -6
ModuleScop‎ePlugin.js‎ +4 -15
WebpackDevSe‎rverUtils.js‎ +48 -53
ansiH‎TML.js‎ +1 -2
eslintFor‎matter.js‎ +1 -2
launchE‎ditor.js‎ +3 -6
openBro‎wser.js‎ +1 -2
printHostingI‎nstructions.js‎ +10 -30
prom‎pt.js‎ +44 -0
webpackHotD‎evClient.js‎ +3 -6
react-error‎-overlay/src‎
__te‎sts__‎
mapp‎er.js‎ +3 -6
compo‎nents‎
fram‎e.js‎ +6 -8
overl‎ay.js‎ +3 -2
ut‎ils‎
isIntern‎alFile.js‎ +2 -4
unmap‎per.js‎ +1 -2
react-‎scripts‎
b‎in‎
react-scr‎ipts-ts.js‎ +1 -4
con‎fig‎
je‎st‎
babelTra‎nsform.js‎ +0 -16
typescriptT‎ransform.js‎ +66 -0
env‎.js‎ +7 -4
path‎s.js‎ +9 -10
webpack.co‎nfig.dev.js‎ +32 -34
webpack.con‎fig.prod.js‎ +25 -32
webpackDevSer‎ver.config.js‎ +2 -2
fixtures/k‎itchensink‎
integ‎ration‎
env.t‎est.js‎ +3 -4
initD‎OM.js‎ +23 -25
s‎rc‎
feat‎ures‎
e‎nv‎
FileEnvVa‎riables.js‎ +3 -2
NodeP‎ath.js‎ +2 -2
Public‎Url.js‎ +3 -2
ShellEnvVa‎riables.js‎ +3 -2
syn‎tax‎
ArraySp‎read.js‎ +2 -2
AsyncA‎wait.js‎ +2 -2
ClassProp‎erties.js‎ +2 -2
ComputedPr‎operties.js‎ +2 -2
CustomInter‎polation.js‎ +2 -2
DefaultPar‎ameters.js‎ +2 -2
Destructurin‎gAndAwait.js‎ +2 -2
Genera‎tors.js‎ +2 -2
ObjectS‎pread.js‎ +2 -2
Promi‎ses.js‎ +2 -2
RestAndD‎efault.js‎ +2 -2
RestPara‎meters.js‎ +2 -2
TemplateInte‎rpolation.js‎ +2 -2
web‎pack‎
ImageInc‎lusion.js‎ +3 -2
JsonIncl‎usion.js‎ +3 -2
NoExtInc‎lusion.js‎ +3 -2
UnknownExtI‎nclusion.js‎ +3 -2
App‎.js‎ +39 -57
scr‎ipts‎
ut‎ils‎
createJes‎tConfig.js‎ +12 -10
buil‎d.js‎ +1 -2
ejec‎t.js‎ +26 -26
ini‎t.js‎ +32 -12
temp‎late‎
s‎rc‎
App.te‎st.tsx‎ +2 -2
App‎.tsx‎ +5 -4
inde‎x.tsx‎ +11 -0
registerServ‎iceWorker.ts‎ +0 -0
tsconf‎ig.json‎ +32 -0
tslin‎t.json‎ +99 -0
esli‎ntrc‎ +3 -0
packag‎e.json‎ +34 -5
ta‎sks‎
e2e-si‎mple.sh‎ +7 -6
.giti‎gnore‎ +1 -0
.trav‎is.yml‎ +1 -8
ISSUE_TE‎MPLATE.md‎ +59 -0
READ‎ME.md‎ +56 -226
packag‎e.json‎ +4 -0
packages/create-react-app/createReactApp.js
+ 13
- 33
  • View file @ 74191385


@@ -74,14 +74,10 @@ const program = new commander.Command(packageJson.name)
);
console.log(` - a specific npm version: ${chalk.green('0.8.2')}`);
console.log(
` - a custom fork published on npm: ${chalk.green(
'my-react-scripts'
)}`
` - a custom fork published on npm: ${chalk.green('my-react-scripts')}`
);
console.log(
` - a .tgz archive: ${chalk.green(
'https://mysite.com/my-react-scripts-0.8.2.tgz'
)}`
` - a .tgz archive: ${chalk.green('https://mysite.com/my-react-scripts-0.8.2.tgz')}`
);
console.log(
` It is not needed unless you specifically want to use a fork.`
@@ -91,9 +87,7 @@ const program = new commander.Command(packageJson.name)
` If you have any problems, do not hesitate to file an issue:`
);
console.log(
` ${chalk.cyan(
'https://github.com/facebookincubator/create-react-app/issues/new'
)}`
` ${chalk.cyan('https://github.com/facebookincubator/create-react-app/issues/new')}`
);
console.log();
})
@@ -264,19 +258,15 @@ function run(
console.log('Installing packages. This might take a couple of minutes.');
getPackageName(packageToInstall)
.then(packageName =>
checkIfOnline(useYarn).then(isOnline => ({
isOnline: isOnline,
packageName: packageName,
}))
)
.then(packageName => checkIfOnline(useYarn).then(isOnline => ({
isOnline: isOnline,
packageName: packageName,
})))
.then(info => {
const isOnline = info.isOnline;
const packageName = info.packageName;
console.log(
`Installing ${chalk.cyan('react')}, ${chalk.cyan(
'react-dom'
)}, and ${chalk.cyan(packageName)}...`
`Installing ${chalk.cyan('react')}, ${chalk.cyan('react-dom')}, and ${chalk.cyan(packageName)}...`
);
console.log();
@@ -344,9 +334,7 @@ function run(
if (!remainingFiles.length) {
// Delete target folder if empty
console.log(
`Deleting ${chalk.cyan(`${appName} /`)} from ${chalk.cyan(
path.resolve(root, '..')
)}`
`Deleting ${chalk.cyan(`${appName} /`)} from ${chalk.cyan(path.resolve(root, '..'))}`
);
process.chdir(path.resolve(root, '..'));
fs.removeSync(path.join(root));
@@ -434,9 +422,7 @@ function getPackageName(installPackage) {
/^.+\/(.+?)(?:-\d+.+)?\.tgz$/
)[1];
console.log(
`Based on the filename, assuming it is "${chalk.cyan(
assumedProjectName
)}"`
`Based on the filename, assuming it is "${chalk.cyan(assumedProjectName)}"`
);
return Promise.resolve(assumedProjectName);
});
@@ -499,9 +485,7 @@ function checkAppName(appName) {
const validationResult = validateProjectName(appName);
if (!validationResult.validForNewPackages) {
console.error(
`Could not create a project called ${chalk.red(
`"${appName}"`
)} because of npm naming restrictions:`
`Could not create a project called ${chalk.red(`"${appName}"`)} because of npm naming restrictions:`
);
printValidationResults(validationResult.errors);
printValidationResults(validationResult.warnings);
@@ -513,9 +497,7 @@ function checkAppName(appName) {
if (dependencies.indexOf(appName) >= 0) {
console.error(
chalk.red(
`We cannot create a project called ${chalk.green(
appName
)} because a dependency with the same name exists.\n` +
`We cannot create a project called ${chalk.green(appName)} because a dependency with the same name exists.\n` +
`Due to the way npm works, the following names are not allowed:\n\n`
) +
chalk.cyan(dependencies.map(depName => ` ${depName}`).join('\n')) +
@@ -537,9 +519,7 @@ function makeCaretRange(dependencies, name) {
if (!semver.validRange(patchedVersion)) {
console.error(
`Unable to patch ${name} dependency version because version ${chalk.red(
version
)} will become invalid ${chalk.red(patchedVersion)}`
`Unable to patch ${name} dependency version because version ${chalk.red(version)} will become invalid ${chalk.red(patchedVersion)}`
);
patchedVersion = version;
}
packages/eslint-config-react-app/index.js
+ 1
- 2
  • View file @ 74191385


@@ -236,8 +236,7 @@ module.exports = {
{
object: 'System',
property: 'import',
message:
'Please use import() instead. More info: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#code-splitting',
message: 'Please use import() instead. More info: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#code-splitting',
},
],
packages/react-dev-utils/FileSizeReporter.js
+ 9
- 6
  • View file @ 74191385


@@ -119,12 +119,15 @@ function measureFileSizesBeforeBuild(buildFolder) {
if (!err && fileNames) {
sizes = fileNames
.filter(fileName => /\.(js|css)$/.test(fileName))
.reduce((memo, fileName) => {
var contents = fs.readFileSync(fileName);
var key = removeFileNameHash(buildFolder, fileName);
memo[key] = gzipSize(contents);
return memo;
}, {});
.reduce(
(memo, fileName) => {
var contents = fs.readFileSync(fileName);
var key = removeFileNameHash(buildFolder, fileName);
memo[key] = gzipSize(contents);
return memo;
},
{}
);
}
resolve({
root: buildFolder,
packages/react-dev-utils/ModuleScopePlugin.js
+ 4
- 15
  • View file @ 74191385


@@ -50,24 +50,13 @@ class ModuleScopePlugin {
);
// Error if in a parent directory of src/
if (
requestRelative.startsWith('../') ||
requestRelative.startsWith('..\\')
requestRelative.startsWith('../') || requestRelative.startsWith('..\\')
) {
callback(
new Error(
`You attempted to import ${chalk.cyan(
request.__innerRequest_request
)} which falls outside of the project ${chalk.cyan(
'src/'
)} directory. ` +
`Relative imports outside of ${chalk.cyan(
'src/'
)} are not supported. ` +
`You can either move it inside ${chalk.cyan(
'src/'
)}, or add a symlink to it from project's ${chalk.cyan(
'node_modules/'
)}.`
`You attempted to import ${chalk.cyan(request.__innerRequest_request)} which falls outside of the project ${chalk.cyan('src/')} directory. ` +
`Relative imports outside of ${chalk.cyan('src/')} are not supported. ` +
`You can either move it inside ${chalk.cyan('src/')}, or add a symlink to it from project's ${chalk.cyan('node_modules/')}.`
),
request
);
packages/react-dev-utils/WebpackDevServerUtils.js
+ 48
- 53
  • View file @ 74191385


@@ -37,20 +37,18 @@ if (isSmokeTest) {
}
function prepareUrls(protocol, host, port) {
const formatUrl = hostname =>
url.format({
protocol,
hostname,
port,
pathname: '/',
});
const prettyPrintUrl = hostname =>
url.format({
protocol,
hostname,
port: chalk.bold(port),
pathname: '/',
});
const formatUrl = hostname => url.format({
protocol,
hostname,
port,
pathname: '/',
});
const prettyPrintUrl = hostname => url.format({
protocol,
hostname,
port: chalk.bold(port),
pathname: '/',
});
const isUnspecifiedHost = host === '0.0.0.0' || host === '::';
let prettyHost, lanUrlForConfig, lanUrlForTerminal;
@@ -182,7 +180,7 @@ function createCompiler(webpack, config, appName, urls, useYarn) {
);
console.log(
'To ignore, add ' +
chalk.cyan('// eslint-disable-next-line') +
chalk.cyan('// tslint:disable-next-line') +
' to the line before.\n'
);
}
@@ -319,11 +317,9 @@ function prepareProxy(proxy, appPublicFolder) {
// However API calls like `fetch()` won’t generally accept text/html.
// If this heuristic doesn’t work well for you, use a custom `proxy` object.
context: function(pathname, req) {
return (
mayProxy(pathname) &&
return mayProxy(pathname) &&
req.headers.accept &&
req.headers.accept.indexOf('text/html') === -1
);
req.headers.accept.indexOf('text/html') === -1;
},
onProxyReq: proxyReq => {
// Browers may send Origin headers even with same-origin
@@ -379,40 +375,39 @@ function prepareProxy(proxy, appPublicFolder) {
function choosePort(host, defaultPort) {
return detect(defaultPort, host).then(
port =>
new Promise(resolve => {
if (port === defaultPort) {
return resolve(port);
}
const message =
process.platform !== 'win32' && defaultPort < 1024 && !isRoot()
? `Admin permissions are required to run a server on a port below 1024.`
: `Something is already running on port ${defaultPort}.`;
if (isInteractive) {
clearConsole();
const existingProcess = getProcessForPort(defaultPort);
const question = {
type: 'confirm',
name: 'shouldChangePort',
message:
chalk.yellow(
message +
`${existingProcess ? ` Probably:\n ${existingProcess}` : ''}`
) + '\n\nWould you like to run the app on another port instead?',
default: true,
};
inquirer.prompt(question).then(answer => {
if (answer.shouldChangePort) {
resolve(port);
} else {
resolve(null);
}
});
} else {
console.log(chalk.red(message));
resolve(null);
}
}),
port => new Promise(resolve => {
if (port === defaultPort) {
return resolve(port);
}
const message = process.platform !== 'win32' &&
defaultPort < 1024 &&
!isRoot()
? `Admin permissions are required to run a server on a port below 1024.`
: `Something is already running on port ${defaultPort}.`;
if (isInteractive) {
clearConsole();
const existingProcess = getProcessForPort(defaultPort);
const question = {
type: 'confirm',
name: 'shouldChangePort',
message: chalk.yellow(
message +
`${existingProcess ? ` Probably:\n ${existingProcess}` : ''}`
) + '\n\nWould you like to run the app on another port instead?',
default: true,
};
inquirer.prompt(question).then(answer => {
if (answer.shouldChangePort) {
resolve(port);
} else {
resolve(null);
}
});
} else {
console.log(chalk.red(message));
resolve(null);
}
}),
err => {
throw new Error(
chalk.red(`Could not find an open port at ${chalk.bold(host)}.`) +
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
1
CLA Signed
1
CLA Signed
    Assign labels
  • Manage project labels

Milestone
2.0
2.0 (expired)
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: facebook/create-react-app!3833
Source branch: github/fork/wmonk/facebook-1.0.10

Menu

Explore Projects Groups Snippets