Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uniorg/localneo

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uniorg/localneo - npm Package Compare versions

Comparing version 1.7.1 to 1.7.2

2

package.json
{
"name": "@uniorg/localneo",
"version": "1.7.1",
"version": "1.7.2",
"author": "m.schmale@uniorg.de",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -99,7 +99,3 @@ const fs = require('fs')

if (!reg.has(`srv:${targetInfo.name}@${targetInfo.entryPath}`)) {
reg.put(`srv:${targetInfo.name}@${targetInfo.entryPath}`, ServiceFactory.create(targetInfo, targetPath, serviceConfig))
}
return reg.get(`srv:${targetInfo.name}@${targetInfo.entryPath}`)
return ServiceFactory.create(targetInfo, targetPath, serviceConfig)
}

@@ -168,5 +164,6 @@ }

if (fs.existsSync(fullDir + '/destinations.json')) {
dest = require(fullDir + '/destinations.json')
dest = JSON.parse(fs.readFileSync(fullDir + '/destinations.json'))
}
return new MapReader(require(fullDir + '/neo-app.json'), dest, fullDir)
const neoApp = fs.readFileSync(fullDir + '/neo-app.json')
return new MapReader(JSON.parse(neoApp), dest, fullDir)
} catch (err) {

@@ -173,0 +170,0 @@ console.error(`Error while reading application files from "${fullDir}": ${err.message}`)

@@ -20,2 +20,7 @@ let instance

clear () {
this.cache = {}
return this
}
has (key) {

@@ -22,0 +27,0 @@ return this.cache[key] !== undefined

@@ -20,4 +20,7 @@ const Router = require('../Router')

}
if (remotePath.startsWith('/')) {
prefix = prefix.replace(/\/+$/, '')
}
console.log('Serving UI5 from %s', prefix)
console.log('Serving UI5 from %s%s', prefix, localPath)
this.proxy = proxy.createProxyServer({

@@ -24,0 +27,0 @@ target: prefix + remotePath,

@@ -9,2 +9,3 @@ const test = require('tape')

const MapReader = require('../src/MapReader')
const AppRegistry = require('../src/Registry')

@@ -43,2 +44,3 @@ function buildMockServer (prepare, config) {

process.chdir(oldWd)
AppRegistry.getInstance().clear()
}

@@ -208,1 +210,150 @@

})
test('service loads openui5', function (t) {
t.plan(1)
buildMockServer(
() => { },
{
neoApp: {
routes: [
{
path: '/resources',
target: {
type: 'service',
name: 'sapui5',
entryPath: '/resources'
}
}
]
},
destinations: {
service: {
sapui5: {}
}
}
}
).then(({url, cleanup}) => {
const fileUrl = `${url}/resources/sap-ui-version.json`
got(fileUrl)
.then(response => {
cleanup()
const json = JSON.parse(response.body)
t.equal(json.name, 'OpenUI5 Distribution')
})
.catch(err => {
cleanup()
console.error(err)
t.ok(false)
})
})
})
test('service loads sapui5 when requested to do so', function (t) {
t.plan(1)
buildMockServer(
() => { },
{
neoApp: {
routes: [
{
path: '/resources',
target: {
type: 'service',
name: 'sapui5',
entryPath: '/resources'
}
}
]
},
destinations: {
service: {
sapui5: {
useSAPUI5: true
}
}
}
}
).then(({url, cleanup}) => {
const fileUrl = `${url}/resources/sap-ui-version.json`
got(fileUrl)
.then(response => {
cleanup()
const json = JSON.parse(response.body)
t.equal(json.name, 'SAPUI5 Distribution')
})
.catch(err => {
cleanup()
console.error(err)
t.ok(false)
})
})
})
test('service loads sapui5 when requested to do so', function (t) {
t.plan(1)
buildMockServer(
() => {
fs.mkdirSync('./app')
fs.writeFileSync('./app/neo-app.json', JSON.stringify({
routes: [{
'path': '/resources',
'target': {
'type': 'service',
'name': 'sapui5',
'entryPath': '/resources'
},
'description': 'SAPUI5 Resources'
}]
}))
},
{
neoApp: {
routes: [
{
path: '/app',
target: {
type: 'application',
name: 'app'
}
},
{
path: '/resources',
target: {
type: 'service',
name: 'sapui5',
entryPath: '/resources'
}
}
]
},
destinations: {
applications: {
app: {
path: './app'
}
},
service: {
sapui5: {
useSAPUI5: true
}
}
}
}
).then(({url, cleanup}) => {
const fileUrl = `${url}/resources/sap-ui-version.json`
got(fileUrl)
.then(response => {
const json = JSON.parse(response.body)
t.equal(json.name, 'SAPUI5 Distribution')
cleanup()
})
.catch(err => {
cleanup()
console.error(err)
t.ok(false)
})
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc