Skip to content

Commit

Permalink
Update for Elm 0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
xtian committed Aug 26, 2018
1 parent 5f9f1b7 commit 7280900
Show file tree
Hide file tree
Showing 13 changed files with 271 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trim_trailing_whitespace = true
[*.html]
indent_size = 4

[elm-package.json]
[elm.json]
indent_size = 4

[*.md]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Create a new `my-app` folder with files for your future project.
my-app/
├── .gitignore
├── README.md
├── elm-package.json
├── elm.json
├── elm-stuff
├── public
│ ├── favicon.ico
Expand All @@ -65,7 +65,7 @@ my-app/
│ └── registerServiceWorker.js
└── tests
├── Tests.elm
└── elm-package.json
└── elm.json
```

You are ready to employ the full power of Create Elm App!
Expand Down
8 changes: 4 additions & 4 deletions config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ module.exports = {
dotenv: resolveApp('./.env'),
entry: resolveApp('./src/index.js'),
appBuild: resolveApp('./build'),
elmPackageJson: resolveApp('./elm-package.json'),
elmMake: require('elm/platform').executablePaths['elm-make'],
publicUrl: getPublicUrl(resolveApp('elm-package.json')),
servedPath: getServedPath(resolveApp('elm-package.json'))
elmPackageJson: resolveApp('./elm.json'),
elm: '/usr/local/bin/elm',
publicUrl: getPublicUrl(resolveApp('elm.json')),
servedPath: getServedPath(resolveApp('elm.json'))
};
3 changes: 1 addition & 2 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,10 @@ module.exports = {
loader: require.resolve('elm-webpack-loader'),
options: {
verbose: true,
warn: true,
// If ELM_DEBUGGER was set to "false", disable it. Otherwise
// for invalid values, "true" and as a default, enable it
debug: process.env.ELM_DEBUGGER === 'false' ? false : true,
pathToMake: paths.elmMake,
pathToElm: paths.elm,
forceWatch: true
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ module.exports = {
// If ELM_DEBUGGER was set to "true", enable it. Otherwise
// for invalid values, "false" and as a default, disable it
debug: process.env.ELM_DEBUGGER === 'true' ? true : false,
pathToMake: paths.elmMake
pathToElm: paths.elm
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"dotenv": "^5.0.0",
"elm": "^0.18.0",
"elm-hot-loader": "0.5.4",
"elm-test": "^0.18.12",
"elm-webpack-loader": "^4.4.0",
"elm-test": "^0.19.0-beta4",
"elm-webpack-loader": "https://github.com/xtian/elm-webpack-loader.git#0.19",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.6",
"fs-extra": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const measureFileSizesBeforeBuild =
FileSizeReporter.measureFileSizesBeforeBuild;
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;

if (fs.existsSync('elm-package.json') === false) {
if (fs.existsSync('elm.json') === false) {
console.log('Please, run the build script from project root directory');
process.exit(1);
}
Expand Down
9 changes: 4 additions & 5 deletions scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,13 @@ const devDependencies = extendOmittingProps(
const scripts = {
build: 'node scripts/build.js',
start: 'node scripts/start.js',
package: 'elm-package',
make: 'elm-make',
repl: 'elm-repl',
reactor: 'elm-reactor',
make: 'elm make',
repl: 'elm repl',
reactor: 'elm reactor',
test: 'elm-test'
};

if (fs.existsSync('elm-package.json') === false) {
if (fs.existsSync('elm.json') === false) {
console.log('Please, run the eject script from project root directory');
process.exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const createDevServerConfig = require('../config/webpackDevServer.config');
const formatElmCompilerErrors = require('./utils/formatElmCompilerErrors');
const paths = require('../config/paths');

if (fs.existsSync('elm-package.json') === false) {
if (fs.existsSync('elm.json') === false) {
console.log('Please, run the build script from project root directory');
process.exit(0);
}
Expand Down
15 changes: 0 additions & 15 deletions template/elm-package.json

This file was deleted.

18 changes: 18 additions & 0 deletions template/elm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "application",
"source-directories": [
"src"
],
"elm-version": "0.19.0",
"dependencies": {
"elm-lang/core": "6.0.0",
"elm-lang/html": "3.0.0"
},
"test-dependencies": {},
"do-not-edit-this-by-hand": {
"transitive-dependencies": {
"elm-lang/json": "1.0.0",
"elm-lang/virtual-dom": "3.0.0"
}
}
}
9 changes: 4 additions & 5 deletions tests/elm-app.eject.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ describe('Ejecting Elm application. (Please wait...)', () => {
expect(pkgScripts, 'to satisfy', {
build: 'node scripts/build.js',
start: 'node scripts/start.js',
package: 'elm-package',
make: 'elm-make',
repl: 'elm-repl',
reactor: 'elm-reactor'
make: 'elm make',
repl: 'elm repl',
reactor: 'elm reactor'
});
});

Expand All @@ -74,7 +73,7 @@ describe('Ejecting Elm application. (Please wait...)', () => {
expect(same, 'to be', true);
});

it('It should be possible to build ejected applitaction, using npm scripts', () => {
it('It should be possible to build ejected application, using npm scripts', () => {
const { status, output } = spawn.sync('npm', ['run', 'build']);
const outputString = output
.map(out => (out !== null ? out.toString() : ''))
Expand Down
Loading

0 comments on commit 7280900

Please sign in to comment.