Fix missing namespace in amber init

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fix missing namespace in amber init

Herby Vojčík
Hello!

FYI:

I just fixed a bug which cause namespace to disappear in `amber
init`-created files. The bug was in grunt-init-amber template, in
Gruntfile.js. In amberc:all target, it missed this line:

   amd_namespace: "...the namespace...",

The result was, the project lost its namespace in .js files after
running `grunt`, which `amber init` ran automatically as the last
command, to recompile .st in template to latest form.

How to update `amber init`:

(sudo) npm -g update (amber-cli)

Solution if your project suffers from this:

Just add the previously mentioned amd_namespace line to amberc:{ all: {
... } } part in Gruntfile.js (or if lazy or not comfortable with editing
Gruntfile.js directly, just `amber init` in in empty directory, answer
all questions so it mimics your existing project, and just copy new
Gruntfile.js over the old one), then run `grunt` in your project dir.

Herby

P.S.: Strange that no one had problems with this...

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Fix missing namespace in amber init

laci
Regarding: Strange that no one had problems with this...
I guess because not too many users favour setting up amber this way.

I am using amber in two projects. I am maintaining my own packages outside of amber installation.
This way I can update the amber installation easily or switch from one amber version to another.
Typically I am using the amber WinZip file, unzip it in a folder and install the bower components.
From index page I refer to the new amber installation.

I am investigating using the 'amber init' path.
It looks like I can achieve the same objective this way too.
Not interested though in the generated st/js files.

It seems like amber installation cannot be updated.
Running 'amber init' in directory, which has been configured already gives error - see below.
If that's correct then the only way update amber installation is setting it up in a new folder.

C:\development\amber\test>amber init --force
Welcome to Amber version 0.13.0-pre (NodeJS 0.10.26).

Running "init:C\:\\Users\\laci\\AppData\\Roaming\\npm\\node_modules\\amber-cli\\node_modules\\grunt-init-amber" (init) task
This task will create one or more files in the current directory, based on the
environment and the answers to a few questions. Note that answering "?" to any
question will show question-specific help and answering "none" to most questions
will leave its value blank.

Warning: Existing files may be overwritten! Use --force to continue.

Aborted due to warnings.
grunt-init exec error:
{ [Error: Command failed: ] killed: false, code: 6, signal: null }