Commit Graph

14 Commits

Author SHA1 Message Date
Cameron Diver
20a83e8e0a Add more typescript conversions and export utilities from existing
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-07-09 13:21:05 +01:00
Cameron Diver
9dab00d156
Allow writing test files in typescript
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-06-19 10:55:15 +01:00
Pagan Gazzard
c0c805d072 Use webpack watching for sync.js for a faster dev cycle
Change-type: patch
2018-12-20 17:40:45 +00:00
Pagan Gazzard
1130ecd3ce Force devtool: none to avoid issues with env.noOptimize
Change-type: patch
2018-12-20 16:42:32 +00:00
Pagan Gazzard
77dd1d0a44 Use fork-ts-checker to speed up the webpack build
Change-type: patch
2018-12-20 16:41:30 +00:00
Pagan Gazzard
655c476ccd Update to webpack 4
Change-type: minor
2018-12-19 17:12:55 +00:00
Pablo Carranza Velez
7854c48f5a Ignore additional knex mssql dependencies in webpack build
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2018-12-12 13:42:31 -03:00
Pagan Gazzard
055648a992 Fix migrations/jsonstream custom resolvers on windows
Change-type: patch
2018-11-05 18:35:33 +00:00
Pablo Carranza Velez
a205c3e72b Update docker-delta to v2.2.2
This fixes occasional timeouts in rsync after applying v2 deltas, which
cause unnecessary fallbacks to a regular pull.

This change also removes the need for the mkfifo native dependency (since
docker-delta 2.2.2 stops using it).

Change-type: patch
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2018-10-25 12:36:20 -07:00
Cameron Diver
cfddbf65e4
Start initial typescript conversion, and add validation debugging
Add webpack config and dependencies to have typescript built, and also
convert src/lib/validation.coffee to typescript.

In this conversion I also added a lot of debugging which should help the
upcoming local mode development.

Change-type: minor
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-04-27 16:09:50 +01:00
Pablo Carranza Velez
b003f48d7b Switch to using knex migrations to set up the database, and change the database format to use integers for ids instead of strings.
Also includes various improvements and bugfixes to services and the migration from legacy /data to volumes.

The switch ti migrations involves a dirty hack for webpack to properly resolve the paths to the migrations js files - it uses an expression
that webpack can't resolve, so we hardcode it to a value and use the ContextReplacementPlugin to make that value resolve to the migrations folder.

The downsides to this approach are:
- a change in knex code would break this
- the migration code is added twice to the supervisor image: once in the migrations folder (because knex needs to loop through the directory to find the files),
and once inside app.js (because I can't make webpack treat them as external)

Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2018-03-06 10:32:28 -08:00
Pablo Carranza Velez
88291f08a8 Use uglifyjs-webpack-plugin ^1.0.1 to optimize the supervisor code
We've been using UglifyJS 0.4.6 (the webpack default) so far, but this doesn't support ES6 and some dependency
updates are starting to cause builds to break (e.g. https://github.com/request/request/issues/2772, which also happens to break
my builds in the multicontainer branch).

Here we switch to the latest uglifyjs-webpack-plugin which is designed for ES2015 support.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-11-08 19:03:19 -08:00
Pablo Carranza Velez
c422c91b66 Use a custom webpack loader to avoid uncaught exceptions from JSONStream
JSONStream is a hybrid executable-library that doesn't get along well with webpack: it tries to run its binary code
which can throw uncaught exceptions. So we use a custom loader for it - which replaces remove-hashbang-loader, as it only
affected JSONStream too.

(I tried replacing JSONStream altogether, but turns out dockerode uses it too)

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-31 13:29:59 -07:00
Pablo Carranza Velez
1790939046 Use webpack to join all modules
This saves around 13MB in the resulting uncompressed docker image.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-07-11 14:01:16 -07:00