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
  • !2629

Update template and dependencies for ServiceMax

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/ServiceMax-Engineering/svmx into master 8 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 40

Created by: ericsvmx

This PR is to implement a "hello world" template with extra libraries and conventions for ServiceMax. Goal is to show how these conventions work in practice. In addition to the basic create-react-app template:

  • Redux
  • SASS
  • React Router
Compare
  • master (base)

and
  • latest version
    d3ee3b4b
    1 commit, 2 years ago

40 files
+ 8431
- 1948

    Preferences

    File browser
    Compare changes
packages/re‎act-scripts‎
con‎fig‎
je‎st‎
babelTra‎nsform.js‎ +5 -0
webpack.co‎nfig.dev.js‎ +8 -1
webpack.con‎fig.prod.js‎ +13 -1
scr‎ipts‎
ini‎t.js‎ +7 -3
temp‎late‎
pub‎lic‎
index‎.html‎ +1 -1
manife‎st.json‎ +2 -2
s‎rc‎
act‎ions‎
hell‎o.js‎ +29 -0
hello.‎test.js‎ +26 -0
compo‎nents‎
He‎llo‎
Hell‎o.js‎ +39 -0
Hello‎.scss‎ +17 -0
Hello.‎test.js‎ +35 -0
inde‎x.js‎ +1 -0
a‎pp‎
App‎.js‎ +34 -0
App.‎scss‎ +0 -0
App.t‎est.js‎ +3 -2
inde‎x.js‎ +1 -0
logo‎.svg‎ +0 -0
conta‎iners‎
AppCont‎ainer.js‎ +31 -0
AppContain‎er.test.js‎ +17 -0
serv‎ices‎
hell‎o.js‎ +3 -0
hello.‎test.js‎ +15 -0
st‎ore‎
inde‎x.js‎ +7 -0
loadi‎ng.js‎ +58 -0
loading‎.test.js‎ +156 -0
middle‎ware.js‎ +21 -0
middlewar‎e.test.js‎ +14 -0
reduc‎er.js‎ +11 -0
reducer‎.test.js‎ +8 -0
te‎st‎
mock-s‎tore.js‎ +6 -0
th‎eme‎
index‎.scss‎ +1 -0
ut‎ils‎
inde‎x.js‎ +3 -0
index.‎test.js‎ +8 -0
inde‎x.js‎ +15 -5
registerServ‎iceWorker.js‎ +0 -51
.eslint‎rc.json‎ +34 -0
.flow‎config‎ +9 -0
.template.dep‎endencies.json‎ +13 -0
READ‎ME.md‎ +36 -1870
package-‎lock.json‎ +7723 -0
packag‎e.json‎ +21 -12
packages/react-scripts/config/jest/babelTransform.js
+ 5
- 0
  • View file @ d3ee3b4b


@@ -13,4 +13,9 @@ const babelJest = require('babel-jest');
module.exports = babelJest.createTransformer({
presets: [require.resolve('babel-preset-react-app')],
babelrc: false,
plugins: [
['module-resolver', {
root: ['./src']
}]
],
});
packages/react-scripts/config/webpack.config.dev.js
+ 8
- 1
  • View file @ d3ee3b4b


@@ -166,6 +166,7 @@ module.exports = {
/\.gif$/,
/\.jpe?g$/,
/\.png$/,
/\.scss$/,
],
loader: require.resolve('file-loader'),
options: {
@@ -192,6 +193,11 @@ module.exports = {
// @remove-on-eject-begin
babelrc: false,
presets: [require.resolve('babel-preset-react-app')],
plugins: [
['module-resolver', {
root: ['./src']
}]
],
// @remove-on-eject-end
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
@@ -205,7 +211,7 @@ module.exports = {
// In production, we use a plugin to extract that CSS to a file, but
// in development "style" loader enables hot editing of CSS.
{
test: /\.css$/,
test: /\.scss$/,
use: [
require.resolve('style-loader'),
{
@@ -214,6 +220,7 @@ module.exports = {
importLoaders: 1,
},
},
require.resolve('sass-loader'),
{
loader: require.resolve('postcss-loader'),
options: {
packages/react-scripts/config/webpack.config.prod.js
+ 13
- 1
  • View file @ d3ee3b4b


@@ -165,6 +165,7 @@ module.exports = {
/\.gif$/,
/\.jpe?g$/,
/\.png$/,
/\.scss$/,
],
loader: require.resolve('file-loader'),
options: {
@@ -190,6 +191,11 @@ module.exports = {
options: {
babelrc: false,
presets: [require.resolve('babel-preset-react-app')],
plugins: [
['module-resolver', {
root: ['./src']
}]
],
},
// @remove-on-eject-end
},
@@ -206,7 +212,7 @@ module.exports = {
// use the "style" loader inside the async code so CSS from them won't be
// in the main CSS file.
{
test: /\.css$/,
test: /\.scss$/,
loader: ExtractTextPlugin.extract(
Object.assign(
{
@@ -220,6 +226,12 @@ module.exports = {
sourceMap: true,
},
},
{
loader: require.resolve('sass-loader'),
options: {
sourceMap: true,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
packages/react-scripts/scripts/init.js
+ 7
- 3
  • View file @ d3ee3b4b


@@ -35,7 +35,8 @@ module.exports = function(
)).name;
const ownPath = path.join(appPath, 'node_modules', ownPackageName);
const appPackage = require(path.join(appPath, 'package.json'));
const useYarn = fs.existsSync(path.join(appPath, 'yarn.lock'));
// ServiceMax Note: we prefer npm, for now
const useYarn = false; //fs.existsSync(path.join(appPath, 'yarn.lock'));
// Copy over some of the devDependencies
appPackage.dependencies = appPackage.dependencies || {};
@@ -47,6 +48,8 @@ module.exports = function(
build: 'react-scripts build',
test: 'react-scripts test --env=jsdom',
eject: 'react-scripts eject',
lint: 'NODE_ENV=development eslint js test *.js',
prettier: 'NODE_ENV=development prettier-eslint --write \"src/**/*.js\"',
};
fs.writeFileSync(
@@ -125,8 +128,9 @@ module.exports = function(
// Install react and react-dom for backward compatibility with old CRA cli
// which doesn't install react and react-dom along with react-scripts
// or template is presetend (via --internal-testing-template)
if (!isReactInstalled(appPackage) || template) {
console.log(`Installing react and react-dom using ${command}...`);
// ServiceMax Note: always do this because we need template dependencies
if (true || !isReactInstalled(appPackage) || template) {
console.log(`Installing template dependencies using ${command}...`);
console.log();
const proc = spawn.sync(command, args, { stdio: 'inherit' });
packages/react-scripts/template/public/index.html
+ 1
- 1
  • View file @ d3ee3b4b


@@ -19,7 +19,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>ServiceMax</title>
</head>
<body>
<noscript>
0 Assignees
None
Assign to
0 Reviewers
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
Lock merge request
Unlocked
participants
Reference:
Source branch: github/fork/ServiceMax-Engineering/svmx

Menu

Explore Projects Groups Snippets