-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: Replace parcel bundler with webpack
As parcel lead to issues with webpack, we now also use webpack as bundler. For more information look at parcel-bundler/parcel#2883
- Loading branch information
1 parent
3db500c
commit 1d461d4
Showing
32 changed files
with
1,096 additions
and
2,976 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"modules": false | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
.cache | ||
/node_modules | ||
.cache/ | ||
coverage/ | ||
node_modules/ | ||
*.log | ||
|
||
# OS generated files | ||
.DS_Store | ||
.DS_Store? | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { isNil } from '../Helper' | ||
|
||
export default class ApiService { | ||
constructor(_basePath, _csrfToken) { | ||
if (isNil(_basePath)) { | ||
const pathError = 'Tried to create API service without a base uri. ' | ||
pathError += 'Please initialize the API service with a base path ' | ||
pathError += 'like "/neos/impersonate/"' | ||
console.error(pathError) | ||
} | ||
this._basePath = _basePath | ||
|
||
if (isNil(_csrfToken)) { | ||
const csrfError = 'Tried to create API service without a CSFR ' | ||
csrfError += 'token. Please initialize the API service with a token' | ||
console.error(csrfError) | ||
} | ||
this._csrfToken = _csrfToken | ||
} | ||
|
||
async callUserChange(identifier) { | ||
const data = { | ||
user: identifier, | ||
format: 'json', | ||
} | ||
const response = await fetch(this._basePath + 'user-change', { | ||
method: 'POST', | ||
credentials: 'include', | ||
headers: this._getHeader(), | ||
body: JSON.stringify(data), | ||
}) | ||
|
||
return await response.json() | ||
} | ||
|
||
async callStatus() { | ||
const response = await fetch(this._basePath + 'status', { | ||
method: 'GET', | ||
credentials: 'include', | ||
headers: this._getHeader(), | ||
}) | ||
|
||
return await response.json() | ||
} | ||
|
||
async callRestore() { | ||
const response = await fetch(this._basePath + 'restore', { | ||
method: 'POST', | ||
credentials: 'include', | ||
headers: this._getHeader(), | ||
}) | ||
|
||
return await response.json() | ||
} | ||
|
||
_getHeader() { | ||
return { | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json', | ||
'X-Flow-Csrftoken': this._csrfToken, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,3 @@ | ||
import { isNil } from './Helper' | ||
import ApiService from './Service/ApiService' | ||
|
||
export default class ApiService { | ||
constructor(_basePath, _csrfToken) { | ||
if (isNil(_basePath)) { | ||
const pathError = 'Tried to create API service without a base uri. ' | ||
pathError += 'Please initialize the API service with a base path ' | ||
pathError += 'like "/neos/impersonate/"' | ||
console.error(pathError) | ||
} | ||
this._basePath = _basePath | ||
|
||
if (isNil(_csrfToken)) { | ||
const csrfError = 'Tried to create API service without a CSFR ' | ||
csrfError += 'token. Please initialize the API service with a token' | ||
console.error(csrfError) | ||
} | ||
this._csrfToken = _csrfToken | ||
} | ||
|
||
async callUserChange(identifier) { | ||
const data = { | ||
user: identifier, | ||
format: 'json', | ||
} | ||
const response = await fetch(this._basePath + 'user-change', { | ||
method: 'POST', | ||
credentials: 'include', | ||
headers: this._getHeader(), | ||
body: JSON.stringify(data), | ||
}) | ||
|
||
return await response.json() | ||
} | ||
|
||
async callStatus() { | ||
const response = await fetch(this._basePath + 'status', { | ||
method: 'GET', | ||
credentials: 'include', | ||
headers: this._getHeader(), | ||
}) | ||
|
||
return await response.json() | ||
} | ||
|
||
async callRestore() { | ||
const response = await fetch(this._basePath + 'restore', { | ||
method: 'POST', | ||
credentials: 'include', | ||
headers: this._getHeader(), | ||
}) | ||
|
||
return await response.json() | ||
} | ||
|
||
_getHeader() { | ||
return { | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json', | ||
'X-Flow-Csrftoken': this._csrfToken, | ||
} | ||
} | ||
} | ||
export default ApiService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const webpack = require('webpack') | ||
const path = require('path') | ||
|
||
const config = { | ||
entry: './src/index.js', | ||
output: { | ||
path: path.resolve('dist'), | ||
filename: 'index.js', | ||
libraryTarget: 'commonjs2', | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
use: 'babel-loader', | ||
exclude: /node_modules/, | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['.js'], | ||
}, | ||
} | ||
|
||
module.exports = config |
Oops, something went wrong.