Skip to content

Commit 37358b3

Browse files
jleveuglejleveugle
authored andcommitted
feat: init new package for manager configuration
1 parent 03385b8 commit 37358b3

File tree

6 files changed

+63
-0
lines changed

6 files changed

+63
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
alpha
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "@ovh-ux/manager-config",
3+
"version": "0.0.0",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/ovh-ux/manager.git",
7+
"directory": "packages/manager/modules/config"
8+
},
9+
"license": "BSD-3-Clause",
10+
"files": [
11+
"dist"
12+
],
13+
"main": "./dist/cjs/index.js",
14+
"module": "./dist/esm/index.js",
15+
"browser": "./dist/umd/config.js",
16+
"scripts": {
17+
"build": "rollup -c --environment BUILD:production",
18+
"dev": "rollup -c --environment BUILD:development",
19+
"dev:watch": "yarn run dev --watch",
20+
"prepare": "yarn run build",
21+
"start": "lerna exec --stream --scope='@ovh-ux/manager-config' --include-filtered-dependencies -- yarn run build",
22+
"start:dev": "lerna exec --stream --scope='@ovh-ux/manager-config' --include-filtered-dependencies -- yarn run dev",
23+
"start:watch": "lerna exec --stream --parallel --scope='@ovh-ux/manager-config' --include-filtered-dependencies -- yarn run dev:watch"
24+
}
25+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import rollupConfig from '@ovh-ux/component-rollup-config';
2+
3+
const config = rollupConfig({
4+
input: 'src/index.js',
5+
});
6+
7+
const outputs = [config.es()];
8+
9+
if (process.env.BUILD === 'production') {
10+
outputs.push(config.cjs());
11+
outputs.push(config.umd());
12+
}
13+
14+
export default outputs;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default class EnvironmentService {
2+
constructor() {
3+
this.region = 'EU';
4+
}
5+
6+
setRegion(region = 'EU') {
7+
this.region = region;
8+
}
9+
10+
getRegion() {
11+
return this.region;
12+
}
13+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import EnvironmentService from './environment.service';
2+
3+
export default new EnvironmentService();
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import _Environment from './environment';
2+
3+
export const Environment = _Environment;
4+
5+
export default {
6+
Environment,
7+
};

0 commit comments

Comments
 (0)