Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
90ce8abf
Commit
90ce8abf
authored
8 years ago
by
James Danger Hycner
Committed by
Dan Abramov
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
#765
- Work on removing publish feature flags. Removing copying files in cra.sh & release.sh (#861)
parent
ad57c457
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
packages/react-scripts/config/paths.js
+15
-14
packages/react-scripts/config/paths.js
tasks/cra.sh
+3
-29
tasks/cra.sh
tasks/release.sh
+2
-26
tasks/release.sh
with
20 additions
and
69 deletions
+20
-69
packages/react-scripts/config/paths.js
+
15
-
14
View file @
90ce8abf
...
...
@@ -70,17 +70,18 @@ module.exports = {
};
// @remove-on-eject-end
// @remove-on-publish-begin
module
.
exports
=
{
appBuild
:
resolveOwn
(
'
../../../build
'
),
appPublic
:
resolveOwn
(
'
../template/public
'
),
appHtml
:
resolveOwn
(
'
../template/public/index.html
'
),
appIndexJs
:
resolveOwn
(
'
../template/src/index.js
'
),
appPackageJson
:
resolveOwn
(
'
../package.json
'
),
appSrc
:
resolveOwn
(
'
../template/src
'
),
testsSetup
:
resolveOwn
(
'
../template/src/setupTests.js
'
),
appNodeModules
:
resolveOwn
(
'
../node_modules
'
),
ownNodeModules
:
resolveOwn
(
'
../node_modules
'
),
nodePaths
:
nodePaths
};
// @remove-on-publish-end
// config before publish: we're in ./packages/react-scripts/config/
if
(
__dirname
.
indexOf
(
path
.
join
(
'
packages
'
,
'
react-scripts
'
,
'
config
'
))
!==
-
1
)
{
module
.
exports
=
{
appBuild
:
resolveOwn
(
'
../../../build
'
),
appPublic
:
resolveOwn
(
'
../template/public
'
),
appHtml
:
resolveOwn
(
'
../template/public/index.html
'
),
appIndexJs
:
resolveOwn
(
'
../template/src/index.js
'
),
appPackageJson
:
resolveOwn
(
'
../package.json
'
),
appSrc
:
resolveOwn
(
'
../template/src
'
),
testsSetup
:
resolveOwn
(
'
../template/src/setupTests.js
'
),
appNodeModules
:
resolveOwn
(
'
../node_modules
'
),
ownNodeModules
:
resolveOwn
(
'
../node_modules
'
),
nodePaths
:
nodePaths
};
}
This diff is collapsed.
Click to expand it.
tasks/cra.sh
+
3
-
29
View file @
90ce8abf
...
...
@@ -16,10 +16,8 @@ cd "$(dirname "$0")"
function
cleanup
{
echo
'Cleaning up.'
cd
$root_path
# Uncomment when snapshot testing is enabled by default:
# rm ./template/src/__snapshots__/App.test.js.snap
rm
-rf
$clean_path
}
# Error messages are redirected to stderr
...
...
@@ -53,41 +51,17 @@ root_path=$PWD
# Pack react-scripts so we can verify they work.
# ******************************************************************************
# Packing react-scripts takes some work because we want to clean it up first.
# Create a temporary clean folder that contains production only code.
# Do not overwrite any files in the current folder.
clean_path
=
`
mktemp
-d
2>/dev/null
||
mktemp
-d
-t
'clean_path'
`
# Copy some of the react-scripts project files to the temporary folder.
# Exclude folders that definitely won’t be part of the package from processing.
# We will strip the dev-only code there, `npm pack`, and copy the package back.
cd
$root_path
rsync
-av
--exclude
=
'.git'
--exclude
=
$clean_path
\
--exclude
=
'node_modules'
--exclude
=
'build'
\
'./'
$clean_path
>
/dev/null
# Open the clean folder
cd
$clean_path
/packages/react-scripts
# Now remove all the code relevant to development of Create React App.
files
=
"
$(
find
-L
.
-name
"*.js"
-type
f
)
"
for
file
in
$files
;
do
sed
-i
.bak
'/\/\/ @remove-on-publish-begin/,/\/\/ @remove-on-publish-end/d'
$file
rm
$file
.bak
done
# Install all our packages
cd
$clean_path
$root_path
/node_modules/.bin/lerna bootstrap
cd
$clean_path
/
packages/react-scripts
cd
packages/react-scripts
# Like bundle-deps, this script modifies packages/react-scripts/package.json,
# copying own dependencies (those in the `packages` dir) to bundledDependencies
node
$
clean
_path
/tasks/bundle-own-deps.js
node
$
root
_path
/tasks/bundle-own-deps.js
# Finally, pack react-scripts
scripts_path
=
$
clean
_path
/packages/react-scripts/
`
npm pack
`
scripts_path
=
$
root
_path
/packages/react-scripts/
`
npm pack
`
# ******************************************************************************
# Now that we have packed them, call the global CLI.
...
...
This diff is collapsed.
Click to expand it.
tasks/release.sh
+
2
-
26
View file @
90ce8abf
...
...
@@ -39,25 +39,6 @@ if [ -n "$(git status --porcelain)" ]; then
exit
1
;
fi
# Create a temporary clean folder that contains production only code.
# Do not overwrite any files in the current folder.
clean_path
=
`
mktemp
-d
2>/dev/null
||
mktemp
-d
-t
'clean_path'
`
# Copy some of the project files to the temporary folder.
# Exclude folders that definitely won’t be part of the package from processing.
# We will strip the dev-only code there, and publish from it.
rsync
-av
--exclude
=
$clean_path
\
--exclude
=
'node_modules'
--exclude
=
'build'
\
'./'
$clean_path
>
/dev/null
cd
$clean_path
# Now remove all the code relevant to development of Create React App.
files
=
"
$(
find
-L
.
-name
"*.js"
-type
f
)
"
for
file
in
$files
;
do
sed
-i
.bak
'/\/\/ @remove-on-publish-begin/,/\/\/ @remove-on-publish-end/d'
$file
rm
$file
.bak
done
# Update deps
rm
-rf
node_modules
rm
-rf
~/.npm
...
...
@@ -72,14 +53,9 @@ npm dedupe
# Since it's in optionalDependencies, it will attempt install outside bundle
rm
-rf
node_modules/fsevents
# This modifies
$clean_path/
package.json to copy all dependencies to bundledDependencies
# This modifies package.json to copy all dependencies to bundledDependencies
node ./node_modules/.bin/bundle-deps
cd
$clean_path
cd
$root_path
# Go!
./node_modules/.bin/lerna publish
--independent
"
$@
"
# cleanup
cd
..
rm
-rf
$clean_path
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets