Commit Graph

985 Commits

Author SHA1 Message Date
Dillon Kearns
423e6de328 Wire in all Routes in SiteConfig. 2021-04-13 18:43:31 -07:00
Dillon Kearns
713ff07634 Write generated files to a temporary folder and serve them in dev server. 2021-04-13 15:33:31 -07:00
Dillon Kearns
2a5ef63ae2 Generate manifest.json as a plain-old file generator. 2021-04-13 13:46:48 -07:00
Dillon Kearns
4744844dd1 Wire in manifest generator as just another file generator, but specified in the generated code. 2021-04-13 13:28:58 -07:00
Dillon Kearns
64e1baf0b2 Use replaceAll in generator command. 2021-04-13 13:11:34 -07:00
Dillon Kearns
2b63ac8459 Update generator. 2021-04-13 13:05:18 -07:00
Dillon Kearns
e8f0ffe7b6 Add watchers when file reads and globs are encountered in the renderer. 2021-04-12 21:44:57 -07:00
Dillon Kearns
fcada0839e Watch elm source dirs and rewatch on elm.json change. For now, don't watch content/ folder, in preparation for watching on-demand based on globs and file reads from data sources. 2021-04-12 21:26:14 -07:00
Dillon Kearns
89cfd0904c Add debug output. 2021-04-12 20:30:20 -07:00
Dillon Kearns
a403f90049 Run cli in debug mode. 2021-04-12 20:29:59 -07:00
Dillon Kearns
ce039cf207 Generate separate Route module. 2021-04-12 17:34:23 -07:00
Dillon Kearns
06a9883c15 Remove references to Shared.PageView. 2021-04-12 16:54:08 -07:00
Dillon Kearns
0434c7ebec Use map function from Document. 2021-04-12 16:50:23 -07:00
Dillon Kearns
3dee1adf04 Generate RouteParams in generator. 2021-04-12 16:45:25 -07:00
Dillon Kearns
02b97e7b16 Clean up dev server logging output. 2021-04-12 15:32:42 -07:00
Dillon Kearns
450c53536a Clear cache entry for file in dev server on file change. 2021-04-12 15:16:30 -07:00
Dillon Kearns
57935a19dd Handle multiple EventStream connections, and socket close event. 2021-04-12 13:53:13 -07:00
Dillon Kearns
0a33c6e572 Add some type annotations. 2021-04-11 21:06:31 -07:00
Dillon Kearns
a2df8d665d Add return to prevent incorrect runningElmMake state. 2021-04-11 20:07:19 -07:00
Dillon Kearns
cfee49f0dd Remove unused import. 2021-04-11 20:06:58 -07:00
Dillon Kearns
71d4366fbe Set elm make running to true on dev server start. 2021-04-11 16:17:04 -07:00
Dillon Kearns
7a019036ec Use module.hot.apply API to update content json when the new app is ready to receive ports. 2021-04-11 15:35:02 -07:00
Dillon Kearns
52fd8cc1b7 Use non-blocking IO in Elm ports for renderer. 2021-04-11 14:38:14 -07:00
Dillon Kearns
75fec75d61 Performance tuning for compiling elm client. And make sure to set elmMakeRunning to false after initial compilation. 2021-04-11 14:37:39 -07:00
Dillon Kearns
c154c2bb65 Only rerun codegen when Template module files are added or removed, since that's all the information they depend on. And don't rerun multiple elm make tasks while one is in progress to debounce. 2021-04-11 12:28:55 -07:00
Dillon Kearns
00f551e4d7 Print out time to run elm make. 2021-04-10 19:52:43 -07:00
Dillon Kearns
4b23287b4d Update codegen globals. 2021-04-10 16:47:48 -07:00
Dillon Kearns
edbadddf7f Remove obsolete images folder in favor of just static folder. 2021-04-10 14:06:48 -07:00
Dillon Kearns
cf1d03a2bb Remove more instances of pathkey. 2021-04-10 13:51:39 -07:00
Dillon Kearns
03e81639f6 Remove remaining references to NoMetadata. 2021-04-10 13:34:04 -07:00
Dillon Kearns
81c523bad6 Remove more references to NoMetadata. 2021-04-10 13:26:19 -07:00
Dillon Kearns
e06cdda113 Remove unused code. 2021-04-10 13:14:13 -07:00
Dillon Kearns
16d838a6a7 Remove dependency on Pages module in connector module. 2021-04-10 13:12:04 -07:00
Dillon Kearns
776bc3317d Remove Pages.pages, Pages.images, etc. 2021-04-10 13:05:23 -07:00
Dillon Kearns
da14d2e88f Goodbye PathKey! 👋 2021-04-10 13:00:26 -07:00
Dillon Kearns
31a5f2d8f6 Remove more references to Pages module. 2021-04-10 12:37:06 -07:00
Dillon Kearns
2722df72f7 Add starting design for separate routes module. 2021-04-10 10:47:25 -07:00
Dillon Kearns
8c4990551c Remove more pathkey stuff. 2021-04-10 10:35:37 -07:00
Dillon Kearns
12b36d964f No more PathKey for PagePath! 2021-04-10 10:33:26 -07:00
Dillon Kearns
6812367ab2 Use hardcoded () for pathkey. 2021-04-10 10:09:32 -07:00
Dillon Kearns
379817e51e Remove copy commands for beta-index.js and beta-style.css since they're now just assets. 2021-04-10 10:09:12 -07:00
Dillon Kearns
a0622db69d Move hmr loading indicator code into hmr.js and out of Elm code. 2021-04-09 16:36:18 -07:00
Dillon Kearns
ebb78e541a Retain staticHttp cache in dev server. 2021-04-09 13:22:12 -07:00
Dillon Kearns
b23c774b68 Print out timing of render function in logs. 2021-04-09 12:20:28 -07:00
Dillon Kearns
dc5178e861 Remove unused code. 2021-04-09 12:01:28 -07:00
Dillon Kearns
a6514b844f Serve assets with npm package that does streaming and mime type handling. Serve up some files from the file system for simlicity. 2021-04-09 12:00:24 -07:00
Dillon Kearns
bd1170083f Display request timing in dev server logs, and prevent some errors being logged by avoiding trying to read files for navigation requests. 2021-04-09 10:56:13 -07:00
Dillon Kearns
d9391cee53 Only apply HMR updates when content.json is free of errors. 2021-04-08 18:42:05 -07:00
Dillon Kearns
16689b7e85 Bust require cache when reloading Elm renderer function, re-run codegen step before running CLI Elm compilation, and await pending CLI compilation before responding to content.json requests. 2021-04-08 16:01:39 -07:00
Dillon Kearns
29c61434f2 Wire in elm-pages data source errors to error overlay. 2021-04-08 06:38:29 -07:00
Dillon Kearns
5d8680bc4f Remove commented code. 2021-04-07 17:38:07 -07:00
Dillon Kearns
3e2b699c1f Send elm compiler errors as JSON. 2021-04-07 17:37:49 -07:00
Dillon Kearns
451534addf Performance: tell client to hot reload elm before compiling, wait to give requested elm.js after compilation is done. 2021-04-07 13:38:59 -07:00
Dillon Kearns
c12d562834 No more express! 🎉 2021-04-07 13:15:33 -07:00
Dillon Kearns
0a0ea64a1f Compile Elm in dev server. 2021-04-07 12:17:09 -07:00
Dillon Kearns
4e87def89e Remove log and set explicit content-type. 2021-04-07 08:35:51 -07:00
Dillon Kearns
978305765e Hot reloads for content.json. 2021-04-07 08:22:46 -07:00
Dillon Kearns
80a2ea26b6 Wire in initial HMR for elm.js code. 2021-04-06 18:26:24 -07:00
Dillon Kearns
37d19c84d8 Stop converting compiled Elm to ESM. 2021-04-06 13:09:00 -07:00
Dillon Kearns
a30cb4c20c Update generator. 2021-04-06 12:25:50 -07:00
Dillon Kearns
06301c7712 Add starting point for dev server. 2021-04-06 08:21:22 -07:00
Dillon Kearns
5f27593904 Add readfile and glob handlers in render function. 2021-04-06 06:13:33 -07:00
Dillon Kearns
f33eb9b094 Set process.exitCode instead of doing unsafe process.exit operation. 2021-04-06 06:12:20 -07:00
Dillon Kearns
745d714a44 Add render function to StaticResponses module. 2021-04-05 20:58:28 -07:00
Dillon Kearns
89650a4eb1 Merge branch 'serverless' into static-files
# Conflicts:
#	examples/docs/package-lock.json
#	examples/docs/src/Template/BlogIndex.elm
#	examples/docs/src/Template/Page.elm
#	generator/src/cli.js
#	netlify.toml
#	package-lock.json
#	package.json
#	src/Pages/Internal/Platform/Cli.elm
#	tests/BetaStaticHttpRequestsTests.elm
#	tests/StaticHttpRequestsTests.elm
2021-04-05 19:49:08 -07:00
Dillon Kearns
6482a46a08 Handle Index.elm path. 2021-04-05 16:58:13 -07:00
Dillon Kearns
5e8a07aad6 Remove hardcoding. 2021-04-05 16:50:22 -07:00
Dillon Kearns
cbc232b8ce Remove unused body field. 2021-04-05 16:31:59 -07:00
Dillon Kearns
e8f9b2cfa5 Remove unused. 2021-04-05 16:23:20 -07:00
Dillon Kearns
6a1bac4ec7 Remove unused code. 2021-04-05 16:11:12 -07:00
Dillon Kearns
ca9765b62a Remove more webpack-related files. 2021-04-05 15:09:34 -07:00
Dillon Kearns
a6730d9535 Remove some debugging settings. 2021-04-05 14:48:22 -07:00
Dillon Kearns
c9c63b8a3b Remove webpack dependencies! 🎉 2021-04-05 14:44:43 -07:00
Dillon Kearns
c581591114 Remove webpack-related files. 2021-04-05 14:29:27 -07:00
Dillon Kearns
6bc4c8aab0 Remove unused code. 2021-04-05 14:25:37 -07:00
Dillon Kearns
9f6d953f1c Remove some webpack-related files. 2021-04-05 14:12:05 -07:00
Dillon Kearns
c6e1245c99 Delete unused module. 2021-04-05 14:03:08 -07:00
Dillon Kearns
5d496c3834 Run entrypoint directly with generated code instead of wiring it in with a Main.elm. 2021-04-05 13:59:21 -07:00
Dillon Kearns
565c62bccb Wire in RouteParams to static payload. 2021-04-05 07:48:26 -07:00
Dillon Kearns
5532a7c29c Generalize generated routes with route params. 2021-04-05 07:20:12 -07:00
Dillon Kearns
1f7bb61452 Remove some hardcoding in the generated code. 2021-04-05 06:35:51 -07:00
Dillon Kearns
c77f9caceb Handle nested routes in generator script. 2021-04-05 06:35:23 -07:00
Dillon Kearns
a74254773f Wire in route to staticData. 2021-04-04 20:47:25 -07:00
Dillon Kearns
02c9c16cf3 Remove log statement. 2021-04-04 19:29:29 -07:00
Dillon Kearns
90d39610d3 Handle a nested Page Template route with some hardcoding. 2021-04-04 18:23:48 -07:00
Dillon Kearns
0952b45592 Update scaffolding function. 2021-04-03 21:20:50 -07:00
Dillon Kearns
6ef3000011 Handle initial StaticHttp requests to get routes. 2021-04-03 13:08:02 -07:00
Dillon Kearns
66d407b5c8 Add hardcoded fetch for static routes. 2021-04-03 09:53:42 -07:00
Dillon Kearns
a149c02df3 Remove unused Content data. 2021-04-02 20:28:31 -07:00
Dillon Kearns
3372c04e0d Remove TemplateType. 2021-04-02 15:29:59 -07:00
Dillon Kearns
1bc22f10b3 Remove RenderedBody references. 2021-04-02 15:21:17 -07:00
Dillon Kearns
2d3cf86a0c Remove Documents module. 2021-04-02 15:07:14 -07:00
Dillon Kearns
c13fa23e12 Wire in urlToRoute. 2021-04-02 13:36:11 -07:00
Dillon Kearns
b244a70e44 Wire through route type. 2021-04-01 21:23:55 -07:00
Dillon Kearns
dd81c22ec4 Add starting point for generated url parser, remove unused argument. 2021-04-01 14:10:01 -07:00
Dillon Kearns
abcae65b36 Remove all references to Metadata. 2021-04-01 12:56:33 -07:00
Dillon Kearns
1e5d6b8a0e Add file path and glob handlers. 2021-03-31 19:55:28 -07:00
Dillon Kearns
ec2247cdad Include content.json in pre-rendered HTML instead of having a fetch hint for content.json. 2021-03-29 09:15:54 -07:00
Dillon Kearns
11835f155f Handle incoming content.json requests in render serverless function. 2021-03-29 08:59:53 -07:00
Dillon Kearns
0c564bc5fe Clean up serverless render adapter code and return HTML error code. 2021-03-28 19:30:55 -07:00
Dillon Kearns
650a3e9cee Don't load content.json if it's there in the rendered page. 2021-03-25 10:21:01 -07:00
Dillon Kearns
ec7ba930b9 Run renderer for the specific page being requested only, not all pages. 2021-03-25 08:04:59 -07:00
Dillon Kearns
ee58c3f20c Prettier formatting. 2021-03-25 08:00:36 -07:00
Dillon Kearns
6c2c749ac5 Remove unused code. 2021-03-23 22:36:15 -07:00
Dillon Kearns
d63ce72018 Use __dirname to resolve path. 2021-03-23 22:28:00 -07:00
Dillon Kearns
cf78609367 Copy elm-pages CLI compiled Elm code to functions folder for renderer. 2021-03-23 22:19:58 -07:00
Dillon Kearns
05e220b51d Update directory context in renderer function. 2021-03-23 21:03:10 -07:00
Dillon Kearns
418c7396cd Remove unused renderer code. 2021-03-23 20:46:28 -07:00
Dillon Kearns
71b32795e5 Add initial hardcoded serverless render prototype. 2021-03-23 19:34:12 -07:00
Dillon Kearns
2b14d6e7af Update template modules template. 2021-03-01 10:16:46 -08:00
Dillon Kearns
5d44cadbff Include shared model in local state template modules. 2021-02-27 08:35:06 -08:00
Y0hy0h
afe554e1be Remove unused shellCommand() and its imports 2021-02-16 12:15:36 +01:00
Y0hy0h
0e7f65e9a6 Use cross-spawn instead of child_process 2021-02-16 12:14:41 +01:00
Dillon Kearns
4a93623b7a Add conditionals in preparation for beta build CLI flag for beta (currently hardcoded to false). 2021-02-06 08:36:45 -08:00
Dillon Kearns
d702764be2 Run terser inline instead of through npx in elm-pages-beta build command. 2021-01-09 10:55:11 -08:00
Dillon Kearns
cc4a07605d Generate template modules file. 2020-10-30 10:32:52 -07:00
Dillon Kearns
ec88c4fa78 Use template modules file plus pages.elm file for fingerprint. 2020-10-30 10:30:24 -07:00
Dillon Kearns
1a183799a4 Only copy Template.elm module once. 2020-10-30 10:27:33 -07:00
Dillon Kearns
168c3a9384 Back to webpack dev server with no template modules codegen. 2020-10-30 10:11:34 -07:00
Dillon Kearns
5938b5d7d9 Fix dev server infinite re-building, and fix the double compilation for dev server. 2020-10-29 10:27:27 -07:00
Dillon Kearns
725101fec9 Fix infinite looping in elm-pages develop from the new generated module. 2020-10-28 07:46:55 -07:00
Dillon Kearns
27fb6a4f82 Make cli script executable. 2020-10-26 20:36:05 -07:00
Dillon Kearns
04792c15d6 Ensure slash separator for content.json fetch. 2020-10-26 20:35:42 -07:00
Dillon Kearns
634f269801 Add closing head tag. 2020-10-26 19:09:45 -07:00
Dillon Kearns
b26d05b88c Generate Template.elm module. 2020-10-26 11:03:43 -07:00
Dillon Kearns
3aa978578b Update template modules file name. 2020-10-26 10:50:11 -07:00
Dillon Kearns
7478642190 Wire in OnPageChange to shared. 2020-10-25 12:06:08 -07:00
Dillon Kearns
3964dc43b6 Use Maybe instead of NoOp for SharedMsg's. 2020-10-25 11:24:52 -07:00
Dillon Kearns
75cca61597 Add a generator for the template modules beta. 2020-10-25 09:15:17 -07:00
Dillon Kearns
3aaf631c62 Generate template modules file in beta build. 2020-10-24 16:35:54 -07:00
Dillon Kearns
12d9decf04 Fix type variables in template modules. 2020-10-24 15:46:01 -07:00
Dillon Kearns
3442cf02a8 Merge branch 'master' into template-modules
# Conflicts:
#	.gitignore
#	examples/docs/src/Main.elm
2020-10-24 13:02:17 -07:00
Dillon Kearns
938692b518 Rename some files in dist and add some preload tags. 2020-10-23 15:56:39 -07:00
Dillon Kearns
61686bd3f7 Make sure elm-optimize-level-2 was successful or else fail beta build. 2020-10-23 15:42:40 -07:00
Dillon Kearns
4ecad413d9 Add generator version. 2020-10-21 10:14:00 -07:00
Dillon Kearns
1d71e5433d Copy style entrypoint from beta-style.css. 2020-10-20 20:55:30 -07:00
Dillon Kearns
2dad51714f Rename entry point to beta-index. 2020-10-20 20:52:36 -07:00
Dillon Kearns
48c31bcca2 Get docs site compiling with elm-pages build/develop. 2020-10-20 19:30:52 -07:00
Dillon Kearns
7376288e88 Pass through title to cli, add icon meta tags, fix external image url to not prepend canonical url. 2020-10-20 19:11:58 -07:00
Dillon Kearns
61a46aef91 Add icons to manifest config. 2020-10-20 16:41:00 -07:00
Dillon Kearns
a4a34f893d Add shebang line for beta cli. 2020-10-19 22:42:26 -07:00
Dillon Kearns
c7af54bbe8 Move file. 2020-10-19 22:30:47 -07:00
Dillon Kearns
e4bcf3f00c Clear service worker registrations. 2020-10-19 21:55:40 -07:00
Dillon Kearns
a9e2ece36d Try creating directory before generating file. 2020-10-19 19:02:50 -07:00
Dillon Kearns
6966d5d5f3 Await mkdir to ensure directory exists before continuing. 2020-10-19 18:45:20 -07:00
Dillon Kearns
dc6c9e9692 Fix head tag renderer. 2020-10-18 19:19:37 -07:00
Dillon Kearns
6910f32c42 Exit with non-zero status code when error is present. 2020-10-17 21:15:56 -07:00
Dillon Kearns
299ebd0edc Use codecs to send out ports to JS. 2020-10-17 18:58:17 -07:00
Dillon Kearns
5a7374114a Copy image directory to dist. 2020-10-16 18:51:29 -07:00
Dillon Kearns
c960dffdca Make sure files exist before trying to mkdir. 2020-10-16 18:41:13 -07:00
Dillon Kearns
1f76899971 Copy nested directory for images folder. 2020-10-16 18:21:28 -07:00
Dillon Kearns
129e9360b1 Move static and image folder contents into dist dir. 2020-10-16 18:00:27 -07:00
Dillon Kearns
22d66c4760 Copy index template in build step. 2020-10-16 16:30:10 -07:00
Dillon Kearns
17aa244fc6 Run terser with npx. 2020-10-16 15:59:43 -07:00
Dillon Kearns
9faaa69e11 Use util.promisfy to ensure compatibility with Node 12. 2020-10-16 15:43:11 -07:00
Dillon Kearns
b8a7b95698 Generate files. 2020-10-16 15:33:51 -07:00
Dillon Kearns
3643f5666d Write out manifest.json file. 2020-10-16 15:19:46 -07:00
Dillon Kearns
8c3e27b3ff Add generate-manifest js function. 2020-10-16 10:36:25 -07:00
Dillon Kearns
4137773928 Import user-index in example. 2020-10-16 10:36:12 -07:00
Dillon Kearns
cc78cb40c5 Add data-url div to example boilerplate. 2020-10-15 20:41:35 -07:00
Dillon Kearns
6c1781b154 Remove hardcoding of raw body in content.json. 2020-10-15 06:33:16 -07:00
Dillon Kearns
3e4ce8dc29 Extract constant. 2020-10-15 06:17:32 -07:00
Dillon Kearns
0b168e5e25 Clean up some async cli code. 2020-10-15 06:10:24 -07:00
Dillon Kearns
9c117fa854 Copy stylesheet and js entrypoint in async function. 2020-10-14 13:21:02 -07:00
Dillon Kearns
3785838fd9 Copy stylesheet and include it. 2020-10-14 12:59:31 -07:00
Dillon Kearns
81df8b7094 Log after pre-rendering each route. 2020-10-13 21:54:23 -07:00
Dillon Kearns
ad0059037a Log http requests with port. 2020-10-13 21:18:15 -07:00
Dillon Kearns
2f6a773b0c Run code generation in beta cli. 2020-10-13 10:03:36 -07:00
Dillon Kearns
eb9c339dcd Run terser. 2020-10-12 18:30:50 -07:00
Dillon Kearns
df3213148f Refactor duplicate shell execution code. 2020-10-12 17:54:05 -07:00
Dillon Kearns
ef952f6acb Add some type annotations. 2020-10-12 17:20:34 -07:00
Dillon Kearns
6a32b0ca5c Include logic for base routes. 2020-10-12 17:03:35 -07:00
Dillon Kearns
a0e3fa0043 Fix issue with importing index.js in beta. 2020-10-12 16:05:46 -07:00
Dillon Kearns
5d6d555849 Run terser on output. 2020-10-11 22:22:58 -07:00
Dillon Kearns
802f43cfb5 Import elm code as an es6 module. 2020-10-11 22:18:33 -07:00
Dillon Kearns
86ea65a3ba Generate multiple pages, and show error messages. 2020-10-11 21:21:34 -07:00
Dillon Kearns
40c3f5a16c Render head tags in beta pre-renderer. 2020-10-11 08:43:38 -07:00
Dillon Kearns
7beaf5ddaf Set up proof of concept for webpack-free build. 2020-10-10 18:07:36 -07:00
Dillon Kearns
707e4837e1 Extract shared template function to collect functions in a single entrypoint. 2020-10-04 13:35:33 -07:00
Dillon Kearns
6b5b21e709 Update Template types. 2020-09-30 13:05:35 -07:00
Dillon Kearns
dd3f824e4e Remove DynamicPayload type and update TemplateType wiring. 2020-09-16 21:08:12 -07:00
Dillon Kearns
fce79cdaf6 Rename GlobalMetadata to TemplateType. 2020-09-16 19:18:25 -07:00
Dillon Kearns
e71e90172a Wire in subscriptions for templates. 2020-09-14 22:05:36 -07:00
Dillon Kearns
55f2a4bcd4 Wire in DynamicPayload for Template modules' update. 2020-09-13 16:38:57 -07:00
Dillon Kearns
785d6ae85a Use site config module. 2020-09-13 07:19:09 -07:00
Dillon Kearns
a9db326fa4 Rename some global things to shared. 2020-09-12 09:16:56 -07:00
Dillon Kearns
6214964257 Rename global to shared. 2020-09-12 09:15:24 -07:00
Dillon Kearns
b762c655a4 Rename module. 2020-09-06 13:37:24 -07:00
Dillon Kearns
9a4fd9a3f3 Remove unused import. 2020-09-06 13:12:55 -07:00
Dillon Kearns
d6790c479c Use static payload for head function. 2020-09-06 12:42:05 -07:00
Dillon Kearns
40614be38f Pass in global static in static bundle. 2020-09-06 12:29:46 -07:00
Dillon Kearns
651de61146 Change Template signatures and use Template alias instead of TemplateDocument module. 2020-09-06 08:41:24 -07:00
Dillon Kearns
eb8c0ffabc Remove save hook. 2020-09-05 22:17:28 -07:00
Dillon Kearns
57310bacd8 Wire in global model to view. 2020-09-05 21:31:14 -07:00
Dillon Kearns
87eb2408cc Stop generating save function. 2020-09-05 21:13:38 -07:00
Dillon Kearns
b66b0ba45c Wire up new shared update msg. 2020-09-05 21:02:05 -07:00
Dillon Kearns
e4a703b8d4 Wire in load function on global msgs. 2020-09-02 07:57:33 -07:00
Dillon Kearns
dc9e34207a Init local model with load from global model. 2020-09-01 23:49:23 -07:00
Dillon Kearns
6bebe4f32c Persist global state. 2020-09-01 23:03:50 -07:00
Dillon Kearns
9e8659b305 Remove toMsg and toGlobalMsg and change msg type for rendered document. 2020-09-01 22:38:57 -07:00
Dillon Kearns
3a0196b69d Use save function on template model updates. 2020-09-01 17:39:05 -07:00
Dillon Kearns
7a6e9b77f2 Rename function. 2020-08-26 22:05:12 -07:00
Dillon Kearns
307f1bdf25 Wire in toMsg and toGlobalMsg. 2020-08-24 22:13:14 -07:00
Dillon Kearns
dc4ba8105d Remove Debug.todo. 2020-08-23 21:27:51 -07:00
Dillon Kearns
d98d94747a Remove coupling to elm-ui and elm-markdown packages in generated template connector. 2020-08-23 13:15:31 -07:00
Dillon Kearns
959130aae0 Pass in subscriptions explicitly to template builder, and let caller pipe through toProgram. 2020-08-23 10:44:00 -07:00
Dillon Kearns
0ac6caaf0b Implement update wiring in Template Connector. 2020-08-23 10:39:51 -07:00
Dillon Kearns
375006e342 Escape literal backslashes and wire in code generation. 2020-08-23 08:00:49 -07:00
Dillon Kearns
6de2a556eb Remove unused argument. 2020-08-23 07:35:03 -07:00
Dillon Kearns
0ce57d2750 Use wildcard for update function for now. 2020-08-23 07:34:09 -07:00
Dillon Kearns
56028a1d41 Remove hardcoding of init function. 2020-08-23 07:21:40 -07:00
Dillon Kearns
15a8881eec Remove more hardcoding. 2020-08-22 22:35:39 -07:00
Dillon Kearns
8978187ca6 Remove some more hardcoding. 2020-08-22 22:25:58 -07:00
Dillon Kearns
3983c06006 Remove some hardcoding. 2020-08-22 22:17:02 -07:00
Dillon Kearns
493f8d3634 Add hardcoded generate file function to seed snapshot. 2020-08-22 21:34:47 -07:00
Dillon Kearns
3bee40a7bc
Merge pull request #123 from sparksp/generate-command
Generate without full build
2020-08-17 19:41:30 -07:00
Dillon Kearns
646ebc42b2 Set headers to turn off caching in dev server so Safari doesn't load stale data. 2020-08-17 19:37:29 -07:00
Phill Sparks
8b4d92d4ca
Use build --skip-dist instead of generate 2020-07-14 21:57:18 +01:00
Phill Sparks
4da355b17e
Generate without full build
Adds `elm-pages generate` command which only builds `gen/Pages.elm`.

Fixes #112
2020-07-14 21:57:18 +01:00
Dillon Kearns
ebd348d3f6
Merge pull request #110 from Y0hy0h/image-dimensions
Provide image dimensions
2020-06-16 20:54:51 -07:00
Dillon Kearns
aaaf75e366
Merge pull request #121 from dillonkearns/non-zero-exit-on-error
Non zero exit on errors
2020-06-16 08:26:11 -07:00
Dillon Kearns
e734f76576 Make sure webpack exits with non-zero status when there are errors. Fixes #115. 2020-06-16 08:22:58 -07:00
Johannes Maas
e34c7ca438 Fix static folder destination on Windows
On Windows, a file in static/file.txt was put into dist/static/file.txt instead of dist/file.txt.

This was because we cut off everything before the first "/" in the target path string, but Windows separates folders with "\".

Instead, we can use the somewhat hidden context feature from the CopyPlugin to get rid of the static/ prefix. See https://webpack.js.org/plugins/copy-webpack-plugin/#from-is-a-glob
2020-06-12 12:20:22 +02:00
Johannes Maas
0ede0c8a3b Fix infinite recompilation loop
The images were sorted differently in the resulting Pages.elm file, triggering constant recompilations because the files were considered different.

The random order is probably due to the introduced async operations.
2020-05-23 23:04:40 +02:00
Johannes Maas
e4a9c84cf5 Propagate the promise handling 2020-05-17 21:21:55 +02:00
Johannes Maas
b23915eac1 Pass images their dimensions 2020-05-17 21:21:29 +02:00
Johannes Maas
0ea9c78e51 Add dimensions to buildImage 2020-05-17 21:20:03 +02:00
Johannes Maas
ef9108924b Merge remote-tracking branch 'upstream/master' into image-dimensions 2020-05-17 19:54:21 +02:00
Dillon Kearns
84fd44b922 Address some typescript warnings. 2020-05-17 10:48:52 -07:00
Dillon Kearns
39bf0ca62a Address some typescript warnings. 2020-05-17 10:23:36 -07:00
Johannes Maas
7be88793fe Refactor generation code 2020-05-17 18:34:53 +02:00
Dillon Kearns
1684c45ca3 Use async plugin for generating files. 2020-05-17 09:12:06 -07:00
Johannes Maas
6173268185 Factor out common funcs in image asset processing 2020-05-17 15:36:19 +02:00
Dillon Kearns
7d340065bb Make sure to fail on build errors for elm-pages build. 2020-05-11 16:29:40 -07:00
Dillon Kearns
f481a6bf77
Merge pull request #90 from Y0hy0h/terser
Replace Google Closure minifier with Terser
2020-05-11 16:09:34 -07:00
Dillon Kearns
9a8698d70b Add some more terser options. 2020-05-11 16:03:55 -07:00
Dillon Kearns
8f7bbc80b4 Restore elm optimizations for terser. 2020-05-11 15:22:28 -07:00
Dillon Kearns
29719cc428 Merge branch 'master' into pr/90 2020-05-11 12:05:38 -07:00
Dillon Kearns
3a61933d81 Merge branch 'master' into phantom-builder 2020-05-11 10:40:58 -07:00
Dillon Kearns
df5b36d7fb Render loading indicator off to the side of the elm debugger panel. 2020-05-09 20:33:32 -07:00
Dillon Kearns
87d810790f Move more of loading indicator style into Elm. 2020-05-08 07:13:16 -07:00
Dillon Kearns
e62d61fbab Generate manifest config for initial run. 2020-05-06 19:00:11 -07:00
Dillon Kearns
414f7ab1f8 Rename parameter. 2020-05-05 07:21:04 -07:00
Dillon Kearns
8a35d49d1c Remove unused arguments. 2020-05-05 07:19:16 -07:00
Dillon Kearns
d79fc80233 Remove unused arguments. 2020-05-05 07:14:24 -07:00
Dillon Kearns
ed2d671586 Change hook based on dev/prod mode. 2020-05-05 06:58:58 -07:00
Dillon Kearns
2e8e9754d1 Remove unused code. 2020-05-04 20:46:14 -07:00
Dillon Kearns
d676064acf Remove some unused code. 2020-05-04 14:00:53 -07:00
Dillon Kearns
03315da320 Change error message string. 2020-05-04 14:00:33 -07:00
Dillon Kearns
a210fcfd35 Remove unused require. 2020-05-03 20:15:52 -07:00
Dillon Kearns
73c4a2dec2 Make sure gen directory exists. 2020-05-03 17:38:34 -07:00
Dillon Kearns
8171f205fe Get build process working with new webpack setup. 2020-05-03 17:31:19 -07:00
Dillon Kearns
4c43d02f32 Remove unused code. 2020-05-03 15:57:24 -07:00
Dillon Kearns
09402d13c2 Remove unused code. 2020-05-03 15:48:02 -07:00
Dillon Kearns
0d7620935f Add a hack to make sure metadata changes come through in HMR. 2020-05-03 11:46:11 -07:00
Dillon Kearns
d2968fff89 Show error overlay for metadata parsing errors. 2020-05-03 07:10:27 -07:00
Dillon Kearns
cb0f4cbed4 Generate Pages.elm module from a Webpack plugin so it hooks into the lifecycle more smoothly. 2020-05-02 17:22:53 -07:00
Dillon Kearns
701e27953e Get dev server running when there is an error on initial run. 2020-04-22 18:15:37 -07:00
Dillon Kearns
003f35be3a Pull up require statement. 2020-04-22 18:03:37 -07:00
Dillon Kearns
171eefbb05 Remove unused argument. 2020-04-22 18:00:46 -07:00
Dillon Kearns
e31f6d3977 Update ANSI color scheme. 2020-04-20 17:33:08 -07:00
Dillon Kearns
20339f7256 Display build errors in overlay. 2020-04-20 17:12:16 -07:00
Dillon Kearns
4aae309665 Add wiring for setting up HMR plugin with custom styling. 2020-04-20 15:12:20 -07:00
Dillon Kearns
b2e66174e9 Reorder constant declaration. 2020-04-20 15:06:58 -07:00
Dillon Kearns
53b8b014fe Don't exit dev server process on CLI phase error, just print error for now. Eventually want to display the error like a compiler error in the browser window Webpack banner. 2020-04-19 20:03:00 -07:00
Dillon Kearns
ccc13a4ad1 Remove unneeded .emu exclusion. Fixes #78. 2020-04-19 19:52:13 -07:00
Dillon Kearns
4e8a82bd35 Change formatting. 2020-04-19 18:32:44 -07:00
Dillon Kearns
299d73d807 Remove coupling to elm-markup library. 2020-04-19 18:32:39 -07:00
Dillon Kearns
d31a59c7c5 Add missing symbols. 2020-04-19 18:31:29 -07:00
Dillon Kearns
3c690106f4 Wire in static http cache to prevent making extra requests. 2020-04-19 08:17:51 -07:00
Dillon Kearns
33272b6c54 Use a promise to subscribe to static http data as it is updated. 2020-04-18 11:08:35 -07:00
Dillon Kearns
27ef7c2491 Got hot content reloading working with a different hook. 2020-04-14 21:58:16 -07:00
Dillon Kearns
b614a4cd26 Run prettier. 2020-04-13 15:12:16 -07:00
Dillon Kearns
fb9d3e5ed6 Add context dependency to content folder. 2020-04-13 15:03:37 -07:00
Dillon Kearns
1882465938 Hook into after compile instead of emit. 2020-04-13 15:03:22 -07:00
Dillon Kearns
5aa9fa8c26 Merge branch 'master' into content-hot-reloading 2020-04-12 15:18:55 -07:00
Dillon Kearns
a6dcde5dde Merge branch 'master' into phantom-builder 2020-04-07 16:59:02 -07:00
Dillon Kearns
d61d4a38aa Merge branch 'master' into pr/73 2020-03-28 15:03:25 -07:00
Dillon Kearns
9328cf2636 Change formatting to include trailing slash for empty cleaned route. 2020-03-28 14:20:08 -07:00
Dillon Kearns
6649ce7c06 Prevent base href from being set to unknown. 2020-03-28 13:56:05 -07:00
Steven Vandevelde
cafb9846a5 Replace String.chop in generator 2020-03-28 16:28:22 +01:00
Y0hy0h
59e061aa75 Disable Elm-specific optimizations
For the time being, we cannot guarantee that the file to be compressed is generated by Elm. Therefore we cannot apply its special optimizations.
2020-03-23 13:27:55 +01:00
Y0hy0h
0ddb724370 Run terser in parallel 2020-03-23 13:26:38 +01:00
Y0hy0h
60e62c1ec5 Replace Google Closure minifier with terser minifier 2020-03-20 23:05:43 +01:00
Dillon Kearns
b8dcc41835
Merge pull request #84 from vViktorPL/file-content-escaping
Fix content file body string escaping for `"""` case
2020-03-18 08:19:07 -07:00
Wiktor Toporek
d4773d2f35 Fix content file body string escaping for """ case 2020-03-15 23:51:17 +01:00
Wiktor Toporek
dad2fa563d Refactor Win platform path fix to verbose code with comment according to CR comment. 2020-03-15 22:55:53 +01:00
Wiktor Toporek
451ed1ea40 Fix invalid generator output on Win platform due to path separator. 2020-03-15 01:59:54 +01:00
Steven Vandevelde
6cd14f53ef Fix prerendering 2020-03-11 16:55:17 +01:00
Dillon Kearns
279e2c60ce Replace some instances of the old Builder module. 2020-03-10 22:28:22 -07:00
Steven Vandevelde
8f44ddfb05 Fix statichttp and url-change issues 2020-03-10 16:31:28 +01:00
Steven Vandevelde
1a5175d0a0 Make urls relative using the base element 2020-03-10 16:31:28 +01:00
Dillon Kearns
1261b83d96 Store build timestamp in a variable in JS so that the same time is used for the generated CLI and UI modules. 2020-03-05 14:16:42 -08:00
Dillon Kearns
aa42e35376 Reload content cache on hot reload updates. 2020-02-27 17:51:55 -08:00
Dillon Kearns
dd964fe2df Remove offline-ready caching service worker code for now.
Context: this was creating some issues for at least one user where workbox was serving up stale data from the precache. The precache for main.js and index.html were overshadowing the rule for offline navigation fallback routing. So stale data was being served up. This may have been because of a cloudflare CDN patch.
2020-02-25 11:44:41 -08:00
Dillon Kearns
170269003e Colorize elm compiler errors when running initial elm-pages.
This change forks the node-elm-compiler using a suggested fix from https://github.com/rtfeldman/node-elm-compiler/issues/91#issuecomment-583363707
2020-02-08 08:59:33 -08:00
Dillon Kearns
fdaaf02d88 Set network fallback as the NavigationRoute. 2020-02-03 19:04:13 -08:00
Dillon Kearns
64ecc8dc86 Use a catch handler instead of a fetch handler to let other workbox routing take effect. 2020-02-03 18:17:20 -08:00
Dillon Kearns
43cdad50af Only serve up fallback html page if network request fails, not if it 404s. 2020-02-03 17:52:10 -08:00
Dillon Kearns
e7dfab4cb2 Update service worker script to only serve up HTML of root route as an offline fallback. 2020-02-03 12:12:40 -08:00
Steven Vandevelde
b5cf00b52b Properly setup the renderAfterDocumentEvent option 2020-01-30 18:30:45 +01:00
Dillon Kearns
5a1e06c729 Keep dev server running for non-fatal errors. 2020-01-27 15:05:40 -08:00
Dillon Kearns
6195c5a35f Remove some console.log statements. 2020-01-25 20:34:52 -08:00
Dillon Kearns
cae334486a Merge branch 'master' into generate-files 2020-01-23 20:03:18 -08:00
Dillon Kearns
3a4881d002 Change relative path reference for content.json preload tag. 2020-01-20 08:03:59 -08:00
Dillon Kearns
fe6e046610 Add script defer tag. 2020-01-20 07:59:29 -08:00
Dillon Kearns
d9deee076b
Merge pull request #41 from lukewestby/patch-1
Escape frontmatter content in raw records so it handles newlines
2020-01-12 18:53:47 -08:00
Dillon Kearns
2e8fbee58b Merge branch 'master' into generate-files 2020-01-08 15:07:30 -08:00
Dillon Kearns
79e68efba8 Restore --port functionality in dev mode. 2020-01-08 09:55:31 -08:00
Luke Westby
5785d45f66
escape frontmatter content so it handles newlines 2020-01-07 09:33:40 -08:00
Dillon Kearns
a0a99dab52 Ignore files with extensions for service worker shell fallback. 2020-01-06 09:50:51 -08:00
Dillon Kearns
4c4d26e320 Merge branch 'master' into generate-files 2020-01-05 20:59:43 -08:00
Dillon Kearns
dc29eb4ed6 Fix builtAt time format (was divided by 1000 incorrectly). 2020-01-05 20:59:27 -08:00
Dillon Kearns
815dec7d98 Add hardcoded file generation in prep for programmatic file generation from elm. 2020-01-05 13:54:55 -08:00
Dillon Kearns
c846c9ff25 Remove HMR config from production webpack configuration. 2020-01-04 19:09:25 -08:00
Dillon Kearns
48d19ddc72 Setup hot module reloading for dev server. 2020-01-04 18:53:08 -08:00
Dillon Kearns
dd785ea4af Merge branch 'master' into pr/23 2020-01-03 18:22:14 -08:00
Dillon Kearns
cce522862d Change buildTime to builtAt. 2020-01-03 16:18:37 -08:00
Dillon Kearns
70a1e75635 Remove reference to unused internal module in generated file. 2020-01-03 16:00:31 -08:00
Dillon Kearns
1e34faac47 Delete old generated files to prevent compilation errors. 2020-01-03 14:48:42 -08:00
Dillon Kearns
4b75992ab7 Update dependency. 2019-12-11 10:33:26 -08:00
Dillon Kearns
a55440f44e Update to Elm 0.19.1. 2019-12-11 05:54:00 -08:00
Dillon Kearns
b435eb1560 Merge branch 'master' into static-http 2019-12-10 17:26:17 -08:00
Dillon Kearns
d016beb50b Normalize path names so lookups succeed. 2019-12-10 09:51:43 -08:00
Dillon Kearns
1b2d08bc54 Use ilias's latest json library, update docs site, use 19.1 for docs site. 2019-12-09 20:18:48 -08:00
Dillon Kearns
b0213189ca Generate buildTime constant in Pages.elm. 2019-12-09 13:03:53 -08:00
Daniel Marin
362e5ffef5
Delay copying of elm files to /gen folder until cli app is done
Before this change webpack started compiling before the cli version
if the app was compiled in doCliStuff.

Not sure how but this was causing webpack to send the cli version
of the app to the browser when main.js was requested. This caused
the app to not render anything (because it was a worker app) and
not show any errors.

The change just waits until the cli finished compiling to only
then move the .elm files to the /gen folder, triggering webpack
to recompile using the correct (ui version) of the app.
2019-11-14 19:21:56 +00:00
Dillon Kearns
976b8d8e0e Fix regression with .emu frontmatter parsing. 2019-11-14 06:53:08 -08:00
Dillon Kearns
f8766e0472 Only reduce JSON responses in prod build, not dev mode (so that JSON decoders can be safely re-run). 2019-11-12 20:14:34 -08:00
Dillon Kearns
f5ef176306 Generate files for extensions besides md and emu. Fixes #16. 2019-11-04 10:18:49 -08:00
Dillon Kearns
86d14fb8e5 Only check flags for port, not env variables. 2019-11-03 20:18:49 -08:00
Dillon Kearns
f3fbc9ff72 Update docs to use the new StaticHttp module. 2019-11-02 16:32:12 -07:00
Dillon Kearns
8941ae1e84 Print out error string from CLI without extra noise. 2019-10-28 13:16:22 -07:00
Dillon Kearns
5754bfb186 Pass through environment to CLI app for secrets. 2019-10-24 08:58:44 -07:00
Dillon Kearns
34324d7b19 Change StaticHttp design to allow for multiple requests per page. 2019-10-23 21:01:11 -07:00
Dillon Kearns
bbc06c46b3 Remove some log statements. 2019-10-22 18:13:17 -07:00
Dillon Kearns
c04b72c5c2 Wire through StaticRequests end-to-end. 2019-10-22 13:36:41 -07:00
Dillon Kearns
789cc59d88 Send manifest config through port. 2019-10-21 23:06:25 -07:00
Dillon Kearns
4b32547c7c Update generated Pages.elm file template. 2019-10-21 15:57:01 -07:00
Dillon Kearns
1fc2e80294 Stop copying over files that are now moved to public package. 2019-10-21 15:29:44 -07:00
Dillon Kearns
d1d6d91fa8 Make XHR request in CLI with xhr2 package. 2019-10-21 08:40:22 -07:00
Dillon Kearns
899f872223 Add starting point for function to extract StaticRequests for each page. 2019-10-19 10:02:28 -07:00
Leo jPod
ac954f8f4c
introduce an optional argument to the develop command to specify which port it should run 2019-10-16 08:08:18 +02:00
Leo jPod
63477bbd05
check, can we force feed the port via a env var? 2019-10-16 08:08:18 +02:00
Dillon Kearns
40089da983 Initial prototype to fetch static data. 2019-10-15 22:16:49 -07:00
Dillon Kearns
92a2ba9578 Get basic types wired up for static data. 2019-10-15 20:23:52 -07:00
Dillon Kearns
ebc80239a8 Do example of hardcoded static data. 2019-10-14 08:06:31 -07:00
Dillon Kearns
8037ed33f5 Pass in static http no-op request as a prototype. 2019-10-13 17:35:34 -07:00
Dillon Kearns
130fe8c3ad Change structure of the view/head functions in application config. 2019-10-13 09:53:24 -07:00
Dillon Kearns
431b350858 Wire through (Maybe (PagePath pathKey)) as init argument. 2019-10-08 21:12:17 -07:00
Dillon Kearns
fcc3661909 Add onUrlChange to Pages.application (fixes #4). 2019-10-08 20:36:54 -07:00
Dillon Kearns
14fbc84130 Add admin to blacklist temporarily to test out workbox blacklist. 2019-09-28 09:52:46 -07:00
Dillon Kearns
d5d6c91a25 Make sure that directories for generated content are created if they don't exist. 2019-09-24 15:07:32 -07:00
Dillon Kearns
44ab9db1db Change webpack config to load css files from node_modules. 2019-09-24 10:02:42 -07:00
Dillon Kearns
acdf85fcb8 Merge branch 'generate-vendor-files' 2019-09-23 17:23:45 -07:00
Dillon Kearns
70918c1228 Add logging to debug netlify issue. 2019-09-23 16:51:40 -07:00
Dillon Kearns
479ad6267c Generate files to avoid having to manually copy and update vendor files. 2019-09-23 16:11:59 -07:00
Dillon Kearns
daaf47426e Change caching strategy for images. 2019-09-21 16:07:47 -07:00
Dillon Kearns
b028b0bfc8 Get navigation route working with InjectManifest workbox config. 2019-09-20 13:12:45 -07:00
Dillon Kearns
87767bab6f Use runtime caching for .js and .html files. 2019-09-19 17:01:20 -07:00
Dillon Kearns
936f278e32 Use NetworkFirst for fetching content for now. 2019-09-19 16:54:31 -07:00
Dillon Kearns
2e7a65bf1b Use clients claim and skip waiting to make sure that service worker takes over the window on the initial load (not just subsequent refreshes).
See https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle.
2019-09-17 14:14:44 -07:00
Dillon Kearns
86caa4946b Rename generated file to Pages, and former Pages module to Pages.Platform. 2019-09-15 21:51:16 -07:00
Dillon Kearns
e3fafa927f Use opaque type for Document. 2019-09-15 15:00:14 -07:00
Dillon Kearns
1b6eb7fd4c Refactor type. 2019-09-15 14:51:07 -07:00
Dillon Kearns
2b06f0dc9f Correctly generate with or without index. 2019-09-15 13:29:43 -07:00
Dillon Kearns
800e933e12 Track whether directory has index or not to allow getting index. 2019-09-15 13:19:39 -07:00
Dillon Kearns
dd86ac052f Generate directories instead of list of sub-paths. 2019-09-15 12:14:17 -07:00
Dillon Kearns
5e9167353b Pass PagePath for current page to view. 2019-09-15 10:32:38 -07:00
Dillon Kearns
bc0d58e274 Don't precache favicons (assets folder) to prevent caching errors locally. 2019-09-14 16:39:46 -07:00
Dillon Kearns
4623ecf7a5 Pass List PagePath instead of List (List String) to view function. 2019-09-13 17:53:32 -07:00
Dillon Kearns
8ce8792a94 Add missing pieces for PagePath/ImagePath refactor. 2019-09-13 14:43:40 -07:00
Dillon Kearns
0349a1c1db Change webpack alias for entry js file. 2019-09-11 05:31:32 -07:00
Dillon Kearns
8cb8141844 Escape backslashes in content strings. 2019-09-08 13:50:16 -07:00
Dillon Kearns
6b6e1718bc Change config record field name. 2019-09-08 13:40:58 -07:00
Dillon Kearns
6559e5315c Pass manifest under a field, generate body for raw content for elm-pages build for eager evaluation. 2019-09-08 11:18:58 -07:00
Dillon Kearns
f3140e7401 Rename value all to allPages. 2019-09-08 10:01:12 -07:00
Dillon Kearns
07895d8c3f Remove code for generating unused url parser. 2019-09-08 09:57:29 -07:00
Dillon Kearns
f4f435ccaf Print errors from elm parsing and fail on elm-pages build. 2019-09-08 16:32:59 +03:00
Dillon Kearns
2d2602ca9c Add siteUrl to application config record. 2019-09-08 13:01:36 +03:00
Dillon Kearns
7b6f866d79 Remove exposed value that should be private. 2019-09-07 11:13:34 +05:30
Dillon Kearns
073ec3a4c6 Add pathKey type variable to head tags. 2019-09-07 10:50:57 +05:30
Dillon Kearns
a6b25bb53d Update generator code to use new Path type. 2019-09-06 15:49:48 +05:30
Dillon Kearns
8fbd25349d Generate raw content inside of PagesNew module. 2019-09-06 09:03:11 +05:30
Dillon Kearns
2dacc6ae56 Validate links in markdown renderer. 2019-08-30 17:31:45 +05:30
Dillon Kearns
e1ac97706d Generate allImages list. 2019-08-22 07:45:36 -07:00
Dillon Kearns
c8c7efc067 Copy images to images folder. 2019-08-22 07:41:48 -07:00
Dillon Kearns
59435c7b35 Use readline to avoid error in some node versions. 2019-08-22 06:47:01 -07:00
Dillon Kearns
64edb177a6 Change code generation for new Documents API. 2019-08-22 06:33:52 -07:00
Dillon Kearns
f4acb02bc9 Add commented plugin for performance profiling. 2019-08-22 05:55:40 -07:00
Dillon Kearns
609acf0005 Change cache directory name. 2019-08-22 05:54:29 -07:00
Dillon Kearns
aed91bffce Only use progress plugin in prod build. 2019-08-22 05:50:58 -07:00
Dillon Kearns
987e74711e Show progress. 2019-08-22 05:49:12 -07:00
Dillon Kearns
212291f550 Remove comments. 2019-08-22 05:47:12 -07:00
Dillon Kearns
70feacd32a Add helper function. 2019-08-22 05:46:41 -07:00
Dillon Kearns
7a68a8602d Use google closure compiler to minify code. 2019-08-22 05:39:32 -07:00
Dillon Kearns
fac3099d7b Remove unused dependency. 2019-08-22 05:38:47 -07:00
Dillon Kearns
17c710ef44 Add nicer print out of build duration. 2019-08-22 05:38:17 -07:00
Dillon Kearns
29ec7dadd8 Remove unnecessary webpack loader rule. 2019-08-21 22:09:38 -07:00
Dillon Kearns
5e96ba697d Add caching rule to speed up subsequent imagemin builds. 2019-08-21 21:59:06 -07:00
Dillon Kearns
32d88d5537 Extract frontmatter parsing logic to common module. 2019-08-21 21:33:55 -07:00
Dillon Kearns
70611fa0eb Tweak imagemin settings to improve performance. 2019-08-21 21:09:29 -07:00
Dillon Kearns
8408ac60d5 Fix static routes for prerendering. 2019-08-21 21:08:56 -07:00
Dillon Kearns
e770d19254 Include extension in generated content file. 2019-08-21 17:29:49 -07:00
Dillon Kearns
412d500144 Parse out frontmatter in markup documents. 2019-08-21 14:07:29 -07:00
Dillon Kearns
510e904435 Drop extra top-level images field in images record. 2019-08-21 09:01:32 -07:00
Dillon Kearns
7b6b938770 Take in Image for source icon instead of String. 2019-08-21 08:21:15 -07:00
Dillon Kearns
94a3f1d8b5 Generate type-safe image asset record. 2019-08-21 08:18:13 -07:00
Dillon Kearns
9b863c1b9f Generate image assets. 2019-08-21 07:28:18 -07:00
Dillon Kearns
9dbb36f514 Remove typo line. 2019-08-21 07:28:01 -07:00
Dillon Kearns
972218e0cb Remove obsolete conditional. 2019-08-21 06:56:58 -07:00
Dillon Kearns
1b69602e84 Exclude "index" in PageRoute name. 2019-08-20 23:23:39 -07:00
Dillon Kearns
740f334958 Suppress elm --optimize warnings. 2019-08-20 22:20:18 -07:00
Dillon Kearns
c0e7ccd3ab Reduce noise for elm-pages build. 2019-08-20 22:16:33 -07:00
Dillon Kearns
a3b3b30e9a Use options for webpack dev middleware. 2019-08-20 21:53:58 -07:00
Dillon Kearns
8b6d364b49 Remove obsolete files. 2019-08-20 20:51:41 -07:00
Dillon Kearns
055a314dd0 Don't register pre-render SPA in dev mode. 2019-08-20 20:34:16 -07:00
Dillon Kearns
942e55f319 Get file watching working in dev mode for content.txt files. 2019-08-20 20:12:14 -07:00
Dillon Kearns
1310f5cbea Prevent errors when watcher re-runs and tries to evaluate Elm with Elm value in namespace. 2019-08-20 17:18:23 -07:00
Dillon Kearns
2bdf4da5d7 Remove log. 2019-08-20 17:05:19 -07:00
Dillon Kearns
0590f45680 Fix dev server mode. 2019-08-20 14:37:42 -07:00
Dillon Kearns
e34e3510c3 Stop writing image-assets.js file. 2019-08-20 10:45:47 -07:00
Dillon Kearns
dd8f8f7345 Require PageRoute for start_url for manifest. 2019-08-20 09:54:02 -07:00
Dillon Kearns
a68597a3cc Remove url-loader for now. 2019-08-20 09:33:59 -07:00
Dillon Kearns
8bfb568507 Wrap additional loaders in require.resolve. 2019-08-20 09:32:44 -07:00
Dillon Kearns
beb9268de0 Generate new static route records for Cli file in addition to Ui file. 2019-08-20 09:31:04 -07:00
Dillon Kearns
290e79f2c6 Don't generate entry in routes record for 404 pages. 2019-08-20 09:21:15 -07:00
Dillon Kearns
87eaa0dd56 Use common exposing list and imports for generated Cli and Ui modules. 2019-08-20 09:04:24 -07:00
Dillon Kearns
44e8e4a960 Generate urlToString helper. 2019-08-20 09:01:32 -07:00
Dillon Kearns
5ddb958085 Change the way that elmTypes are generated for static route record. 2019-08-20 08:43:38 -07:00
Dillon Kearns
565925c44e Include generated route content. 2019-08-20 08:30:50 -07:00
Dillon Kearns
d2a0bb770a Include code for generating static route record. 2019-08-20 07:48:48 -07:00
Dillon Kearns
3bbd609692 Add jpeg compression to config. 2019-08-19 21:31:33 -07:00
Dillon Kearns
02b6189d13 Add imagemin plugin with basic png configuration. 2019-08-19 21:19:16 -07:00
Dillon Kearns
4f1a8cd205 Extract plugin to module. 2019-08-19 20:57:18 -07:00
Dillon Kearns
ae1f805510 Fix size for files in file plugin. 2019-08-19 20:50:13 -07:00
Dillon Kearns
76c91d6108 Fix AddFile plugin so that it correctly adds files that work in dev mode. 2019-08-19 20:43:37 -07:00
Dillon Kearns
9065b08320 Only include set of known extensions and files for pre-caching, and exclude icons. 2019-08-19 20:06:23 -07:00
Dillon Kearns
d5b50d11bd Prevent double leading / in content.txt for root route. 2019-08-19 19:23:33 -07:00
Dillon Kearns
5cfc291bf8 Move service worker after html and other plugins. 2019-08-19 18:57:14 -07:00
Dillon Kearns
134b66d33c Remove log statement. 2019-08-19 18:05:12 -07:00
Dillon Kearns
f79486b3b2 Reduce noise in webpack dev server. 2019-08-19 18:02:04 -07:00
Dillon Kearns
e2e81803b8 Move html plugin back before favicons. 2019-08-19 18:01:35 -07:00
Dillon Kearns
2fd8320451 Load Html plugin after favicons plugin. 2019-08-19 16:46:20 -07:00
Dillon Kearns
91ab1b328f Remove link to unused package. 2019-08-19 16:36:39 -07:00
Dillon Kearns
be2e29de6c Use sourceIcon from manifest config. 2019-08-19 16:34:48 -07:00
Dillon Kearns
d339ae4f49 Generate PagesNew.elm UI module if not present. 2019-08-19 16:27:35 -07:00
Dillon Kearns
47ff28050c Extract constant to module. 2019-08-19 16:25:30 -07:00
Dillon Kearns
6f4cdc1b05 Run elm code to get manifest config. 2019-08-19 15:58:55 -07:00
Dillon Kearns
61e3a26c0f Fix order of changing directory back after compiling elm code. 2019-08-19 15:58:31 -07:00
Dillon Kearns
8aff334828 Add helper modules to run elm from NodeJS and rewrite elm.json. 2019-08-19 15:20:20 -07:00
Dillon Kearns
07152b8fa3 Hardcode some parameters that shouldn't change. 2019-08-19 14:51:11 -07:00
Dillon Kearns
0de8f269de Include compile-elm code. 2019-08-19 10:38:13 -07:00
Dillon Kearns
df7def2454 Remove comment. 2019-08-17 18:04:43 -07:00
Dillon Kearns
e45fc59283 Fix dev server. 2019-08-17 09:09:57 -07:00
Dillon Kearns
4973e39850 Remove unused constant. 2019-08-16 18:35:07 -07:00
Dillon Kearns
38b6dc8419 Generate all Nothing values (only works for prod for now). 2019-08-16 18:31:25 -07:00
Dillon Kearns
431fd9d5bd Remove hardcoding for preload links. 2019-08-16 18:31:05 -07:00
Dillon Kearns
d527f94e36 Generate content.txt file for all markdown files. 2019-08-16 08:32:15 -07:00
Dillon Kearns
9fabb89c97 Add hardcoded content.txt file to assets. 2019-08-16 08:12:16 -07:00
Dillon Kearns
020228f8ed Use favicons webpack plugin. 2019-08-15 15:51:19 -07:00
Dillon Kearns
824e7bf300 Pass through --debug flag for elm-pages develop. 2019-08-15 12:13:08 -07:00
Dillon Kearns
aab81c137f Use --optimize for production build. 2019-08-14 22:04:56 -07:00
Dillon Kearns
2f394a0dda Move to workbox webpack plugin. 2019-08-14 21:43:12 -07:00
Dillon Kearns
b61d1023fd Skip --optimize for now as it's causing errors. 2019-08-14 19:43:50 -07:00
Dillon Kearns
1eb3653a18 Fix configuration for dev/prod elm loader. 2019-08-14 19:35:00 -07:00
Dillon Kearns
937b079a4f Build service worker once static files are generated. 2019-08-14 19:16:23 -07:00
Dillon Kearns
d85d647dc6 Optimize elm build in production mode. 2019-08-14 18:31:07 -07:00
Dillon Kearns
5679d642b4 Fix service worker to load from absolute url. 2019-08-14 17:55:41 -07:00
Dillon Kearns
6ce8a8d0a2 Fix the way the elm-pages module was being loaded. 2019-08-14 17:42:02 -07:00
Dillon Kearns
f8168edd69 Display webpack errors if present in elm-pages build. 2019-08-14 17:41:26 -07:00
Dillon Kearns
18687b8432 Remove commented line. 2019-08-14 17:40:45 -07:00
Dillon Kearns
025b7ff2af Try different module resolution fix for looking up node_modules. 2019-08-14 16:43:35 -07:00
Dillon Kearns
857cb8e94d Try removing resolve module option to make netlify build happy. 2019-08-14 15:47:14 -07:00
Dillon Kearns
e2c7cbad73 Use template for html file that loads service worker file. 2019-08-14 15:15:00 -07:00
Dillon Kearns
6af5a1ca11 Get css loaders working. 2019-08-14 14:31:05 -07:00
Dillon Kearns
6a6668cf8b Wait for prerender trigger to pre-render pages. 2019-08-14 14:16:28 -07:00
Dillon Kearns
572e3ccb6c Build service worker for elm-pages build step. 2019-08-14 14:15:14 -07:00
Dillon Kearns
4e1b4a7627 Inject script tag in <head> to prevent elm from removing it. 2019-08-14 14:14:47 -07:00
Dillon Kearns
f18a21d3a0 Remove hardcoding of routes. 2019-08-14 13:32:53 -07:00
Dillon Kearns
e4a2be705b Get prerendering working with hardcoded list of routes. 2019-08-14 13:26:10 -07:00
Dillon Kearns
ffc324b21f Clean up repeated code. 2019-08-14 12:50:53 -07:00
Dillon Kearns
5b39c9f46c Implement elm-pages build command. 2019-08-14 12:49:00 -07:00
Dillon Kearns
62f29e151c Correctly route other html pages. 2019-08-14 12:23:54 -07:00
Dillon Kearns
f70ef558cf Serve static assets. 2019-08-14 12:17:07 -07:00
Dillon Kearns
7c89584333 Run webpack server for elm-pages build. 2019-08-14 09:57:04 -07:00
Dillon Kearns
f45cc838e9 Use require.resolve in webpack file to fix issue with local installs. 2019-08-14 09:31:23 -07:00
Dillon Kearns
33697a7043 Add webpack html plugin. 2019-08-13 16:13:07 -07:00
Dillon Kearns
77617f388c Add basic boilerplate for running webpack dev server. 2019-08-13 16:02:58 -07:00
Dillon Kearns
4bd49a6511 Add boilerplate for building with webpack middleware. 2019-08-13 13:55:13 -07:00
Dillon Kearns
a7917cf70e Add import. 2019-08-13 13:00:40 -07:00
Dillon Kearns
57c3a7b0b2 Add function for building service worker with workbox for use with CLI. 2019-08-12 20:10:21 -07:00
Dillon Kearns
2f9a758be9 Include markdown paths in prerender paths. 2019-08-11 20:01:59 -07:00
Dillon Kearns
9ec5923ea1 Rename variables. 2019-08-05 16:01:32 -07:00
Dillon Kearns
3a5dc7c12f Rename type. 2019-08-05 16:00:17 -07:00
Dillon Kearns
2b33dfc451 Add a space before the raw json to avoid invalid elm syntax. 2019-08-05 15:17:55 -07:00
Dillon Kearns
69a5018ca8 Use gray-matter npm package to parse markdown frontmatter. 2019-08-05 15:12:58 -07:00
Dillon Kearns
3790c65a2b Rename Pages.program to Pages.application. 2019-08-05 11:14:29 -07:00
Dillon Kearns
487075ba2c Watch for changes to .md files. 2019-08-02 17:38:26 -07:00
Dillon Kearns
38c9d6dafc Remove some comments. 2019-08-02 06:56:27 -07:00