Closed nandanrao closed 8 years ago
Might want to check out stormpath-sdk-express which is in Beta on NPM. They talk about integrating it with Angular.
Hi @nandanrao
I created an NPM package for this module, so you'll see it in NPM now. However I haven't put much thought into how this library will work with Browserify etc, so please share your thoughts as you give it a try!
Thanks :)
I notice you're not deploying the build artifacts in the npm deployment.
Are you referring to what's in /dist
? If so then no, at the moment I'm using those for the Bower package. Would these files be useful for Node / Browserify?
Yes.
The best way to think of Webpack / Browserify is that it's exactly like Bower, except instead of inserting a script tag at the top of a page (or concat'ing all your files together) you simply refer to the module with a require("") just like a Node.js module.
It's more in-line with what you'll see happening in future iterations of JavaScript. It's also neato.
Ah I see, thanks for the heads up! I'm going to leave this issue open, I'll address this soon!
@robertjd Could you remove dist folder from .npmignore, please? I wanna use only with NPM.
Example of browserify (package.json):
(...)
"browser": {
(...)
"angular": "./node_modules/angular/angular.js",
"stormpath": "./node_modules/stormpath-sdk-angularjs/dist/stormpath-sdk-angularjs.js"
},
"browserify": {
"transform": [
"browserify-shim"
]
},
"browserify-shim": {
(...)
"stormpath": {
"exports": "stormpath",
"depends": [
"angular"
]
},
"angular": "angular",
(...)
}
(...)
Thanks
@robertjd We'd like to use this with browserify as well. Removing the dist folder from npmignore as suggested would be great!
If the source code in src/
were using node-style requires, would you still prefer the dist/
files? Or would you require the source js instead?
When I DL the lastest version 0.7.2 via npm or via github I do not have the dist folder
and in the index.js (the main defined in package.json) those files are required.
I end up having the webpack build broken:
If you guys want a version that work with webpack you can install:
npm install shprink/stormpath-sdk-angularjs#patch-1 --save
Till the owner merges #71
@shprink
I really like the webpack idea for Stormpath. Have you used it for any project so far? Any Github repo that you'd like to share to see how you've used it?
@AbdullahAlger Do you mean how to use stormpath with webpack or how to build a lib such as stormpath with webpack?
If it is about building a lib with CommonJS and Webpack these are good examples:
https://github.com/shprink/wp-api-angularjs https://github.com/shprink/ionic-native-transitions https://github.com/shprink/volkswagen.js
If it is about using strompath with webpack, just install the fork I created and import the lib like this:
import 'stormpath-sdk-angularjs';
let mod = angular.module('yourModule.api', [
'stormpath',
'stormpath.templates'
]);
Thanks to everyone for your input! I've merged #71 so that you can use the dist/
assets. The new release on npm is 0.8.0.
In the future I'd like to refactor this library to be Common JS.
Would love to be have the angular sdk on NPM (to install via Browserify or other browser npm package manager). Thoughts?