2.14.3 • Published 8 months ago

@informaticon/web.compiler v2.14.3

Weekly downloads
6
License
ISC
Repository
github
Last release
8 months ago

web.compiler

A precompiler to run, compile and update (multi-layered) web projects.

LanguageCompilesInfo
javaKnown Issues
typescriptKnown Issues
twirlKnown Issues
svelteKnown Issues
sbtKnown Issues
scalaKnown Issues

Requirements

  1. Current version of SBT
  2. Current version of watchman

Compatibility

wompilerNode 14Node 16Node 18
<2.12YESnono
2.12.xYESYESuntested
>=2.13untestedYESYES

Note: See Contributing for compatibility while developing.

Usage

In most modern web projects utilizing version 2+, wompiler does not need to be executed manually. Projects integrating the web.compiler.plugin SBT Plugin will start wompiler automatically as part of the Play! Run-Hook.

For a full list of commands please execute the wompiler --help command.

Note For creating a distributable package, you should use sbt dist instead of wompiler dist if your project uses the web.compiler.plugin plugin.

Note about wompiler clean

This will delete the following directories or files relative to your current working directory.
Wompiler will not check whether you are located in a valid project. It also will not validate the type of file it deletes (file / directory).

PathReason
./targetGenerated by scala
./project/targetGenerated by scala
./public/bundlesGenerated by webpack
./package-lock.jsonGenerated by npm (using a generated package.json)
./package.jsonGenerated by wompiler
./settings.jsonGenerated by wompiler
./conf/application.confGenerated by wompiler
./conf/routesGenerated by wompiler
./app/mirrorGenerated by wompiler
./app/inclMirrorGenerated by wompiler
./node_modulesGenerated by npm (using a generated package.json)

Limitations

Annotations

No extends clause is permitted in Java annotation types. Therefore, they cannot be overridden in the traditional sense.
See Java Language Specification - Chapter 9.6.

Create a layered type like public @interface MyAnnotationL1 {..} anyway, because wompiler copies the members of the highest layer to the mirror. This means that if you "override" an annotation using wompiler, you have to copy the member declarations from all other layers! When you add a new member, it must have a default value so that the usages of the annotation in the code of the other layers are not broken.

Ebean Models

Ebean Model classes are handled in a different way from other java classes. The code of all layers including fields, constructors, and methods are copied to the mirror instead of the mirror class extending from the highest layer class. The reason is that ebean doesn't handle fields of parent classes. The Ebean Model compiler is limitted in the following ways:

  • Generic Supertype: Nested generic supertypes are not supported
    OK: public class XyzL2 extends SuperModel<Abc>
    Bad: public class XyzL2 extends SuperModel<List<String>>
  • Method and Constructor Annotations: Only repeatable or the following marker annotations are supported when the annotation is repeated on the overridden method in further layers. Using a non-marker variant of one of the following annotations or any other annotation might lead to a compiler error stating that a non-repeatable annotation was repeated in the mirror class.
    Supported annotations are: @Override, @Nonnull, @Nullable, @CheckReturnValue, @CheckForNull, @Deprecated, @Transactional
    OK: @Nonnull @Override public void test()
    Bad: @Nonnull(when = When.MAYBE) @Override public void test()
  • Super Calls: Calling super(...) or super.method(...) only has a defined behaviour in the constructor or method that overrides the excact super method to call.
    OK:
    public void test() {
      super.test();
    }
    Bad:
    public void test() {
      super.doSomething();
    }

Contributing

Note: Building the project requires Node 16 or 18. Running and debugging should still work with Node 14.

If you want to contribute to the wompiler project, follow the steps below.

  1. Clone the Repository
  2. Run npm i to install dependencies
  3. Implement your fixes or features on a separate branch
  4. Test your code
  5. Build the project: npm run build (requires Node 16 or 18)
  6. Change directories to a web project you can test your changes with
  7. Run your local wompiler with: node <PATH-TO-WOMPILER-PROJECT>\dist\cli.js <command>\ eg. node C:\Java\rb_web\web.compiler\dist\cli.js precompile
  8. Commit your changes
  9. Open a Pull Request on GitHub

Release

Only create a new release if your changes have been reviewed and merged into master/next.

  1. Update version and automatically create git tag\ npm version (major|minor|patch) on master\ or npm version (premajor|preminor|prepatch|prerelease) --preid=rc on next
  2. Push the newly created tag\ git push origin --tags
2.14.3

8 months ago

2.14.1

9 months ago

2.14.2

9 months ago

2.14.0

10 months ago

2.14.0-rc.0

10 months ago

2.14.0-rc.1

10 months ago

2.13.0

12 months ago

2.13.0-rc.0

12 months ago

2.13.0-rc.1

12 months ago

2.12.3

1 year ago

2.12.0

1 year ago

2.12.1

1 year ago

2.12.2

1 year ago

2.12.0-rc.6

1 year ago

2.11.9

2 years ago

2.11.10

2 years ago

2.11.11

2 years ago

2.11.9-rc.0

2 years ago

2.12.0-rc.0

2 years ago

2.12.0-rc.1

2 years ago

2.12.0-rc.2

2 years ago

2.12.0-rc.3

2 years ago

2.12.0-rc.4

2 years ago

2.12.0-rc.5

2 years ago

2.11.8

2 years ago

2.11.7

2 years ago

2.11.6

2 years ago

2.11.5

2 years ago

2.11.4

2 years ago

2.11.3

2 years ago

2.11.2

2 years ago

2.11.0

2 years ago

2.11.1

2 years ago

2.10.0

3 years ago

2.9.1

3 years ago

2.9.0

3 years ago

2.8.1

3 years ago

2.8.0

3 years ago

2.7.0

3 years ago

2.6.4

4 years ago

2.6.3

4 years ago

2.6.2

4 years ago

2.6.1

4 years ago

2.6.0

4 years ago

2.5.4

4 years ago

2.5.2

4 years ago

2.5.3

4 years ago

2.5.1

4 years ago

2.5.0

4 years ago

2.4.0

4 years ago

2.3.4

4 years ago

2.3.3

4 years ago

2.3.2

4 years ago

2.3.0

4 years ago

2.2.8

4 years ago

2.2.7

4 years ago

2.2.6

4 years ago

2.2.5

4 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0-18

5 years ago

2.0.0-17

5 years ago

2.0.0-16

5 years ago

2.0.0-15

5 years ago

2.0.0-14

5 years ago

2.0.0-13

5 years ago

2.0.0-12

5 years ago

2.0.0-11

5 years ago

2.0.0-10

5 years ago

2.0.0-9

5 years ago

2.0.0-8

5 years ago

2.0.0-7

5 years ago

2.0.0-6

5 years ago

2.0.0-5

5 years ago

2.0.0-4

5 years ago

2.0.0-3

5 years ago

2.0.0-2

5 years ago

2.0.0-1

5 years ago

2.0.0-0

5 years ago

1.11.12

5 years ago

1.11.11

5 years ago

1.11.10

5 years ago

1.11.9

5 years ago

1.11.8

5 years ago

1.11.7

5 years ago

1.11.6

5 years ago

1.11.5

5 years ago

1.11.4

5 years ago

1.11.3

5 years ago

1.11.2

5 years ago

1.11.1

5 years ago

1.11.0

5 years ago

1.10.0

5 years ago

1.9.3

5 years ago

1.9.2

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.8.1

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.7

5 years ago

1.3.6

5 years ago

1.3.5

5 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

2.0.0

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago