@featurevisor/site 0.55.0 → 0.55.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -1 +1 @@
1
- export {};
1
+ import "./index.css";
@@ -0,0 +1,278 @@
1
+ {
2
+ "entities": {
3
+ "attributes": [
4
+ {
5
+ "archived": false,
6
+ "description": "country code in lower case (two lettered)",
7
+ "type": "string",
8
+ "key": "country",
9
+ "usedInFeatures": [],
10
+ "usedInSegments": ["germany", "netherlands", "switzerland"]
11
+ },
12
+ {
13
+ "archived": false,
14
+ "description": "device type",
15
+ "type": "string",
16
+ "key": "device",
17
+ "usedInFeatures": [],
18
+ "usedInSegments": ["mobile"]
19
+ },
20
+ {
21
+ "archived": false,
22
+ "description": "is the user already logged in?",
23
+ "type": "boolean",
24
+ "key": "loggedIn",
25
+ "usedInFeatures": [],
26
+ "usedInSegments": []
27
+ },
28
+ {
29
+ "archived": false,
30
+ "description": "User ID",
31
+ "type": "string",
32
+ "capture": true,
33
+ "key": "userId",
34
+ "usedInFeatures": ["foo"],
35
+ "usedInSegments": []
36
+ }
37
+ ],
38
+ "segments": [
39
+ {
40
+ "archived": false,
41
+ "description": "users from Germany",
42
+ "conditions": { "and": [{ "attribute": "country", "operator": "equals", "value": "de" }] },
43
+ "key": "germany",
44
+ "usedInFeatures": ["bar", "foo", "sidebar"]
45
+ },
46
+ {
47
+ "archived": false,
48
+ "description": "mobile users",
49
+ "conditions": {
50
+ "and": [{ "attribute": "device", "operator": "equals", "value": "mobile" }]
51
+ },
52
+ "key": "mobile",
53
+ "usedInFeatures": ["foo"]
54
+ },
55
+ {
56
+ "archived": false,
57
+ "description": "The Netherlands",
58
+ "conditions": [{ "attribute": "country", "operator": "equals", "value": "nl" }],
59
+ "key": "netherlands",
60
+ "usedInFeatures": ["sidebar"]
61
+ },
62
+ {
63
+ "archived": false,
64
+ "description": "users from Switzerland",
65
+ "conditions": { "and": [{ "attribute": "country", "operator": "equals", "value": "ch" }] },
66
+ "key": "switzerland",
67
+ "usedInFeatures": ["bar", "foo"]
68
+ }
69
+ ],
70
+ "features": [
71
+ {
72
+ "tags": ["all"],
73
+ "bucketBy": "userId",
74
+ "defaultVariation": "control",
75
+ "variablesSchema": [
76
+ { "key": "color", "type": "string", "defaultValue": "red" },
77
+ {
78
+ "key": "hero",
79
+ "type": "object",
80
+ "defaultValue": {
81
+ "title": "Hero Title",
82
+ "subtitle": "Hero Subtitle",
83
+ "alignment": "center"
84
+ }
85
+ }
86
+ ],
87
+ "variations": [
88
+ { "type": "string", "value": "control", "weight": 33 },
89
+ {
90
+ "type": "string",
91
+ "value": "b",
92
+ "weight": 33,
93
+ "variables": [
94
+ {
95
+ "key": "hero",
96
+ "value": {
97
+ "title": "Hero Title for B",
98
+ "subtitle": "Hero Subtitle for B",
99
+ "alignment": "center for B"
100
+ },
101
+ "overrides": [
102
+ {
103
+ "segments": { "or": ["germany", "switzerland"] },
104
+ "value": {
105
+ "title": "Hero Title for B in DE or CH",
106
+ "subtitle": "Hero Subtitle for B in DE of CH",
107
+ "alignment": "center for B in DE or CH"
108
+ }
109
+ }
110
+ ]
111
+ }
112
+ ]
113
+ },
114
+ { "type": "string", "value": "c", "weight": 34 }
115
+ ],
116
+ "environments": {
117
+ "staging": { "rules": [{ "key": "1", "segments": "*", "percentage": 100 }] },
118
+ "production": { "rules": [{ "key": "1", "segments": "*", "percentage": 100 }] }
119
+ },
120
+ "key": "bar"
121
+ },
122
+ {
123
+ "description": "Classic on/off switch",
124
+ "tags": ["all"],
125
+ "defaultVariation": false,
126
+ "bucketBy": "userId",
127
+ "variations": [
128
+ { "description": "Enabled for all", "type": "boolean", "value": true, "weight": 100 },
129
+ { "description": "Disabled for all", "type": "boolean", "value": false, "weight": 0 }
130
+ ],
131
+ "environments": {
132
+ "staging": { "rules": [{ "key": "1", "segments": "*", "percentage": 100 }] },
133
+ "production": { "rules": [{ "key": "1", "segments": "*", "percentage": 80 }] }
134
+ },
135
+ "key": "baz"
136
+ },
137
+ {
138
+ "archived": false,
139
+ "description": "blah",
140
+ "tags": ["all", "signIn", "signUp"],
141
+ "bucketBy": "userId",
142
+ "defaultVariation": false,
143
+ "variablesSchema": [
144
+ { "key": "bar", "type": "string", "defaultValue": "" },
145
+ { "key": "baz", "type": "string", "defaultValue": "" }
146
+ ],
147
+ "variations": [
148
+ { "type": "boolean", "value": false, "weight": 50 },
149
+ {
150
+ "type": "boolean",
151
+ "value": true,
152
+ "weight": 50,
153
+ "variables": [
154
+ {
155
+ "key": "bar",
156
+ "value": "bar_here",
157
+ "overrides": [
158
+ { "segments": { "or": ["germany", "switzerland"] }, "value": "bar for DE or CH" }
159
+ ]
160
+ },
161
+ { "key": "baz", "value": "baz_here" }
162
+ ]
163
+ }
164
+ ],
165
+ "environments": {
166
+ "staging": {
167
+ "expose": true,
168
+ "rules": [{ "key": "1", "segments": "*", "percentage": 100 }]
169
+ },
170
+ "production": {
171
+ "expose": true,
172
+ "rules": [
173
+ {
174
+ "key": "1",
175
+ "segments": { "and": ["mobile", { "or": ["germany", "switzerland"] }] },
176
+ "percentage": 80
177
+ },
178
+ { "key": "2", "segments": "*", "percentage": 50 }
179
+ ],
180
+ "force": [
181
+ {
182
+ "conditions": {
183
+ "and": [
184
+ { "attribute": "userId", "operator": "equals", "value": "123" },
185
+ { "attribute": "deviceId", "operator": "equals", "value": "234" }
186
+ ]
187
+ },
188
+ "variation": true,
189
+ "variables": { "bar": "yoooooo" }
190
+ }
191
+ ]
192
+ }
193
+ },
194
+ "key": "foo"
195
+ },
196
+ {
197
+ "description": "Variations with weights having decimal places",
198
+ "tags": ["all"],
199
+ "defaultVariation": "control",
200
+ "bucketBy": "userId",
201
+ "variablesSchema": [
202
+ { "type": "json", "key": "fooConfig", "defaultValue": "{\"foo\": \"bar\"}" }
203
+ ],
204
+ "variations": [
205
+ { "type": "string", "value": "control", "weight": 33.34 },
206
+ {
207
+ "type": "string",
208
+ "value": "b",
209
+ "weight": 33.33,
210
+ "variables": [{ "key": "fooConfig", "value": "{\"foo\": \"bar b\"}" }]
211
+ },
212
+ { "type": "string", "value": "c", "weight": 33.33 }
213
+ ],
214
+ "environments": {
215
+ "staging": { "rules": [{ "key": "1", "segments": "*", "percentage": 100 }] },
216
+ "production": { "rules": [{ "key": "1", "segments": "*", "percentage": 100 }] }
217
+ },
218
+ "key": "qux"
219
+ },
220
+ {
221
+ "description": "Show sidebar or not",
222
+ "tags": ["all"],
223
+ "bucketBy": "userId",
224
+ "defaultVariation": false,
225
+ "variablesSchema": [
226
+ { "key": "position", "type": "string", "defaultValue": "left" },
227
+ { "key": "color", "type": "string", "defaultValue": "red" },
228
+ { "key": "sections", "type": "array", "defaultValue": [] },
229
+ { "key": "title", "type": "string", "defaultValue": "Sidebar Title" }
230
+ ],
231
+ "variations": [
232
+ { "type": "boolean", "value": false, "weight": 10 },
233
+ {
234
+ "type": "boolean",
235
+ "value": true,
236
+ "weight": 90,
237
+ "variables": [
238
+ { "key": "position", "value": "right" },
239
+ {
240
+ "key": "color",
241
+ "value": "red",
242
+ "overrides": [
243
+ { "segments": "germany", "value": "yellow" },
244
+ { "segments": "japan", "value": "white" }
245
+ ]
246
+ },
247
+ {
248
+ "key": "sections",
249
+ "value": ["home", "about", "contact"],
250
+ "overrides": [
251
+ { "segments": "germany", "value": ["home", "about", "contact", "imprint"] },
252
+ {
253
+ "segments": "netherlands",
254
+ "value": ["home", "about", "contact", "bitterballen"]
255
+ }
256
+ ]
257
+ }
258
+ ]
259
+ }
260
+ ],
261
+ "environments": {
262
+ "staging": { "rules": [{ "key": "1", "segments": "*", "percentage": 100 }] },
263
+ "production": {
264
+ "rules": [
265
+ {
266
+ "key": "1",
267
+ "segments": "*",
268
+ "percentage": 100,
269
+ "variables": { "title": "Sidebar Title for production" }
270
+ }
271
+ ]
272
+ }
273
+ },
274
+ "key": "sidebar"
275
+ }
276
+ ]
277
+ }
278
+ }
package/package.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
2
  "name": "@featurevisor/site",
3
- "version": "0.55.0",
3
+ "version": "0.55.1",
4
4
  "description": "Static site for Featurevisor",
5
5
  "main": "dist",
6
6
  "scripts": {
7
7
  "transpile": "echo 'Nothing to transpile in this package'",
8
- "dist:js": "webpack --config ./webpack.config.js",
9
- "dist:css": "tailwindcss -i ./src/index.css -o ./dist/index.css",
10
- "dist": "npm run dist:js && npm run dist:css",
11
- "build": "npm run dist",
8
+ "build": "webpack --mode production --config ./webpack.prod.js",
9
+ "dev": "webpack serve --mode development --config ./webpack.dev.js",
12
10
  "test": "echo 'Nothing to test in types package'",
13
11
  "format": "prettier . --check --cache --loglevel=warn",
14
12
  "lint": "eslint . --cache",
@@ -50,16 +48,22 @@
50
48
  "@tailwindcss/typography": "^0.5.9",
51
49
  "@types/react": "^18.0.29",
52
50
  "@types/react-dom": "^18.0.11",
51
+ "autoprefixer": "^10.4.16",
52
+ "copy-webpack-plugin": "^11.0.0",
53
53
  "css-loader": "^6.7.3",
54
+ "html-webpack-plugin": "^5.5.3",
55
+ "postcss": "^8.4.31",
56
+ "postcss-loader": "^7.3.3",
54
57
  "react": "^18.2.0",
55
58
  "react-dom": "^18.2.0",
56
59
  "react-markdown": "^8.0.6",
57
60
  "react-router-dom": "^6.10.0",
58
61
  "style-loader": "^3.3.2",
59
- "tailwindcss": "^3.3.0"
62
+ "tailwindcss": "^3.3.3",
63
+ "webpack-merge": "^5.10.0"
60
64
  },
61
65
  "dependencies": {
62
66
  "@featurevisor/types": "^0.55.0"
63
67
  },
64
- "gitHead": "b736fb93a9e8bdf76f84a71c482182ab42505b63"
68
+ "gitHead": "8d1f0d66978e079b695537e5575a2f2773614d60"
65
69
  }
@@ -0,0 +1,6 @@
1
+ const tailwindcss = require("tailwindcss");
2
+ const autoprefixer = require("autoprefixer");
3
+
4
+ module.exports = {
5
+ plugins: [tailwindcss("./tailwind.config.js"), autoprefixer],
6
+ };
package/public/index.html CHANGED
@@ -1,15 +1,12 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <title>Featurevisor Status</title>
6
- <link rel="stylesheet" href="./index.css" />
7
6
  <link rel="icon" type="image/png" href="./favicon-128.png" />
8
7
  </head>
9
8
 
10
9
  <body>
11
10
  <div id="root"></div>
12
-
13
- <script src="./index.js"></script>
14
11
  </body>
15
12
  </html>
@@ -27,7 +27,7 @@ export function SearchInput(props: SearchInputProps) {
27
27
  onChange={(e) => props.onChange(e)}
28
28
  placeholder="Type to search..."
29
29
  autoComplete="off"
30
- className="mb-4 mt-2 w-full rounded-full border-slate-300 indent-8 text-xl text-gray-700 placeholder:text-gray-400"
30
+ className="mb-4 mt-2 p-2 w-full rounded-full border border-slate-300 indent-8 text-xl text-gray-700 placeholder:text-gray-400"
31
31
  />
32
32
  </div>
33
33
  );
package/src/index.tsx CHANGED
@@ -1,12 +1,14 @@
1
1
  import * as React from "react";
2
- import * as ReactDOM from "react-dom";
2
+ import { createRoot } from "react-dom/client";
3
3
  import { HashRouter } from "react-router-dom";
4
+ import "./index.css";
4
5
 
5
6
  import { App } from "./components/App";
6
7
 
7
- ReactDOM.render(
8
+ const container = document.getElementById("root");
9
+ const root = createRoot(container!);
10
+ root.render(
8
11
  <HashRouter>
9
12
  <App />
10
13
  </HashRouter>,
11
- document.getElementById("root"),
12
14
  );
@@ -1,8 +1,8 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
2
  module.exports = {
3
- content: ["./src/**/*.html", "./src/**/*.tsx"],
3
+ content: ["./public/index.html", "./src/**/*.{ts,tsx}"],
4
4
  theme: {
5
5
  extend: {},
6
6
  },
7
- plugins: [require("@tailwindcss/typography"), require("@tailwindcss/forms")],
7
+ plugins: [],
8
8
  };
package/tsconfig.cjs.json CHANGED
@@ -3,5 +3,5 @@
3
3
  "compilerOptions": {
4
4
  "outDir": "./lib"
5
5
  },
6
- "include": ["./src/**/*.ts", "./src/**/*.tsx"]
6
+ "include": ["./src/**/*.ts", "./src/**/*.tsx", "./types"]
7
7
  }
@@ -0,0 +1,27 @@
1
+ declare module "*.png" {
2
+ const value: any;
3
+ export = value;
4
+ }
5
+ declare module "*.svg" {
6
+ import type { FunctionComponent, SVGProps } from "react";
7
+
8
+ export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
9
+ const src: string;
10
+ export default src;
11
+ }
12
+ declare module "*.jpg" {
13
+ const value: any;
14
+ export = value;
15
+ }
16
+ declare module "*.jpeg" {
17
+ const value: any;
18
+ export = value;
19
+ }
20
+ declare module "*.gif" {
21
+ const value: any;
22
+ export = value;
23
+ }
24
+ declare module "*.bmp" {
25
+ const value: any;
26
+ export = value;
27
+ }
@@ -0,0 +1,4 @@
1
+ declare module "*.css" {
2
+ const classes: { readonly [key: string]: string };
3
+ export default classes;
4
+ }
@@ -1,14 +1,22 @@
1
1
  const path = require("path");
2
+ const HtmlWebpackPlugin = require("html-webpack-plugin");
2
3
 
3
4
  const getWebpackConfig = require("../../tools/getWebpackConfig");
4
5
 
5
- const wepbackConfig = getWebpackConfig({
6
+ const webpackConfig = getWebpackConfig({
6
7
  entryFilePath: path.join(__dirname, "src", "index.tsx"),
7
8
  entryKey: "index",
8
9
  outputDirectoryPath: path.join(__dirname, "dist"),
9
10
  outputLibrary: "FeaturevisorSite",
10
11
  tsConfigFilePath: path.join(__dirname, "tsconfig.cjs.json"),
11
12
  enableCssModules: true,
13
+ enableTailwind: true,
14
+ enableAssets: true,
15
+ plugins: [
16
+ new HtmlWebpackPlugin({
17
+ template: path.join(__dirname, "public", "index.html"),
18
+ }),
19
+ ],
12
20
  });
13
21
 
14
- module.exports = wepbackConfig;
22
+ module.exports = webpackConfig;
package/webpack.dev.js ADDED
@@ -0,0 +1,27 @@
1
+ const path = require("path");
2
+ const { merge } = require("webpack-merge");
3
+ const HtmlWebpackPlugin = require("html-webpack-plugin");
4
+
5
+ const webpackCommon = require("./webpack.common");
6
+
7
+ const webpackConfig = merge(webpackCommon, {
8
+ devtool: "eval-source-map",
9
+ plugins: [
10
+ new HtmlWebpackPlugin({
11
+ template: path.join(__dirname, "public", "index.html"),
12
+ }),
13
+ ],
14
+ devServer: {
15
+ static: [
16
+ {
17
+ directory: path.join(__dirname, "public"),
18
+ },
19
+ {
20
+ directory: path.join(__dirname, "mock"),
21
+ },
22
+ ],
23
+ hot: true,
24
+ },
25
+ });
26
+
27
+ module.exports = webpackConfig;
@@ -0,0 +1,20 @@
1
+ const { merge } = require("webpack-merge");
2
+ const CopyWebpackPlugin = require("copy-webpack-plugin");
3
+ const webpackCommon = require("./webpack.common");
4
+
5
+ const webpackConfig = merge(webpackCommon, {
6
+ plugins: [
7
+ new CopyWebpackPlugin({
8
+ patterns: [
9
+ {
10
+ from: "public",
11
+ globOptions: {
12
+ ignore: ["**/index.html"],
13
+ },
14
+ },
15
+ ],
16
+ }),
17
+ ],
18
+ });
19
+
20
+ module.exports = webpackConfig;