What is the equivalent of 'Installer squeaksource' in Pharo? - smalltalk

I want to execute this in the context of Pharo, was initially for Squeak.
Installer squeaksource
project: 'MetacelloRepository';
install: 'ConfigurationOfMagritte2'.
(Smalltalk at: #ConfigurationOfMagritte2) project latestVersion load: 'Magritte-Seaside'.

This code will work:
Gofer new
squeaksource: 'MetacelloRepository';
configurationOf: 'Magritte2';
load.
(Smalltalk at: #ConfigurationOfMagritte2) project latestVersion load: 'Magritte-Seaside'.
There are other ways, but this is the most "direct" translation :)

That won't result in working code in a recent version of Pharo. Magritte2 is old and unsupported. Use Magritte3. That is maintained on Smalltalkhub.

For anyone with the same question today, in Pharo 6.x - current (9.0 as of writing):
Metacello new
baseline: 'Magritte';
repository: 'github://magritte-metamodel/Magritte';
load

Related

Separate Ember Addon from vendor.js file to a separate file

I'm using a "core"-addon which contains logic that is used in multiple "boilerplate" - ember applications, when I build a boilerplate-application, the addon code is added to the "vendor.js" file found in the "assets"-folder. Is there a way I can make this code build to a separate "my-addon-vendor.js" file?
While browsing I found others with the same need, but an answer has yet to be found.
My "core"-addon is linked to my "boilerplate"-project using "npm link my-core-addon".
Thanks in advance
Versions:
Ember Version: 3.5.0
Ember CLI: 3.5.0
Node: 8.11.3
npm: 5.6.0
You could do something like this:
var qrScannerWorker = new Funnel(
'node_modules/qr-scanner/', {
include: ['qr-scanner-worker.min.js'],
destDir: '/libraries/qr-scanner/'
}
);
https://github.com/NullVoxPopuli/emberclear/blob/master/packages/frontend/ember-cli-build.js#L139
this won't work for addons, but it'll work for underlying dependencies. So, if an addon is doing the bundling for you, you may want to do it yourself.

Protractor 5.1.1 selenium-webdriver version inconsitency

I've recently upgraded to Protractor 5.1.1 and am facing some issues when setting cookies via browser.manage().addCookie()
The API has changed between versions 2 and 3 of Selenium-webdriver to expect an object rather than the previous 2..6 arguments. When I make the changes to my code to use the object, the typescript compiler complains saying that it expects 2..6 arguments.
old api:
browser.manage().addCookie('cookieName', 'cookieVal');
new api:
browser.manage().addCookie({name:'cookieName', value: 'cookieVal'});
I think this is because the #types/selenium-webdriver in the package.json of protractor v5.1.1 is pointing at version 2.53.39. The version of the actual selenium-webdriver the same package.json is referencing is 3.0.1.
Should this be the same value? Is anyone else experiencing problems with this?
Yup, this is happening because the type definitions was not written at the time.
workaround
Here is the workaround for now:
(browser.manage() as any).addCookie({name:'cookieName', value: 'cookieVal'});
We are setting browser.manage returned options object to any. Then we can give it the addCookie method.
OR
upgrade definitions
you could upgrade your #types/selenium-webdriver type definitions to version 3.
I'm having the same problem! I do know that the #types/selenium-driver is now updated to version 3.0.0.
I haven't had luck with this, but you could try installing it directly (i.e. npm install --save-dev #types/selenium-webdriver) and adding it to your list of types in your tsconfig.json file (i.e. types: [ "selenium-webdriver" ].

angular bootstrap older versions removed from npmjs?

We had been using version 0.11.0 of angular-bootstrap from npmjs. It appears that version is no longer available on npmjs. From the commands below does this mean that someone actually unpublished the older packages?
prompt:~$ npm view angular-bootstrap time
{ modified: '2015-01-12T06:48:54.881Z',
created: '2014-01-29T21:54:32.213Z',
'0.0.1': '2014-01-29T21:54:37.589Z',
'0.0.2': '2014-01-29T22:03:08.814Z',
'0.0.3': '2014-01-29T22:51:49.998Z',
'0.0.4': '2014-02-11T15:14:17.078Z',
'0.11.0': '2014-06-24T07:06:56.435Z',
'0.13.0-SNAPSHOT': '2014-12-02T13:05:43.151Z',
'0.12.0': '2015-01-12T06:46:41.986Z' }
prompt:~$ npm view angular-bootstrap versions
0.12.0
I agree, the package seems to have been unpublished. You can still access it from the github history, as follows:
$ npm install "angular-ui/bootstrap#0.11.0"
(note that you may not need quoting, but some shells will interpret the # as a comment-begin character.) You can also use this syntax in dependencies inside package.json
If you have a project in production that depends on this, you should probably make a fork of the angular-ui/bootstrap repository and point towards that.
(I had some difficulty making this work on Windows, but it looks like you're on a Unixy system, so you should be fine.)
Ticket discussing this and the future is at https://github.com/angular-ui/bootstrap/issues/1636

Couldn't load FFI package in pharo 3.0 MacOS

I am using monticello's location as "http://source.squeak.org/FFI" and then trying to load FFI package for MacOS. I could load FFI-Pools,FFI-Kernel. But was unable to load FFI-MacOS, It throws error on "getenv" method. Synatx error:'>'expected. I think I am doing something wrong. Could someone direct me to appropriate link?
Thanks
In Pharo 3, use the configuration from Configuration Browser:
World Menu > Tools > Configuration Browser, then Install Stable Version.
All tests are green on OSX 10.9.
alternatively, you can execute this in your workspace:
Gofer it
smalltalkhubUser: 'Pharo' project: 'MetaRepoForPharo30';
configurationOf: 'FFI';
loadStable

How to load VMMaker in Squeak?

I am using Squeak 4.4 update 12327, and VM version 4.1.1. I tried to load VMMaker with ConfigurationOf scripts but always fails with exceptions mainly in the Freetype package.
Gofer new
squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfVMMaker';
load.
((Smalltalk at: #ConfigurationOfVMMaker) project version: '1.4') load
or
Gofer new
squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfVMMaker';
load.
(Smalltalk at:#ConfigurationOfVMMaker) project lastVersion load.
or
Gofer new
squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfVMMaker';
load.
(ConfigurationOfVMMaker project version: '1.5') load.
Neither the package repository page, nor the wiki pages (this one, or this one) include instructions or a link to load the VMMaker, although contains a lot of explanations.
This is thanks to David Lewis, in the CI scripts we use to test the Interpreter VM:
MCMcmUpdater updateFromRepositories: #('http://source.squeak.org/VMMaker').
(Smalltalk at: #VMMaker) initializeBrowserSupport. "activate Slang browsing"
Unfortunately, the Metacello configuration has been created and used only by Pharo-centric users until now...
You could eventually correct the Squeak branch in the configuration, but that ain't going to be easy to boot up from there.
If you are interested in oscog VM branch, then there is one prebuilt 4.3 image with pre-loaded packages distributed in this svn repository
http://squeakvm.org/svn/squeak/branches/Cog
Look under image subdirectory, open the CogTrunk43.image, there is a workspace explaining how the packages were loaded in the image.
If you are interested in classical Interpreter, then the way to load it was by using the update MCM:
Open a Monticello browser
Add the VMMaker repository
(MCHttpRepository
location: 'http://source.squeak.org/trunk'
user: 'squeak'
password: 'squeak')
Select and open the VMMaker repository
On the left pane, select 'update' (bottom item)
On the right pane select the top item (update-dtl.12.mcm)
Select 'browse' button
You get a list of packages displayed, click on 'Install' button
The update configuration is a few versions late though, not sure if it is still maintained, the best is also to ask on "Squeak Virtual Machine Development Discussion"
EDIT I think that this magical incantation can replace all GUI oriented operations above:
MCMcmUpdater updateFromRepositories: {'http://source.squeak.org/VMMaker'}.
Or you can open a SqueakMap package browser and load the VMMaker 'head' release. This does the same thing as loading the update from Monticello as described above. Either way you will be getting the latest version of VMMaker and related packages.