Skip to content

Commit 2e57aae

Browse files
committed
feat: dlightjs upgrade to 1.0.0-alpha
1 parent 3064694 commit 2e57aae

File tree

5 files changed

+146
-150
lines changed

5 files changed

+146
-150
lines changed

frameworks/keyed/dlightjs/package-lock.json

Lines changed: 55 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/keyed/dlightjs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"url": "https://github.com/dlight-js/dlight.git"
1919
},
2020
"dependencies": {
21-
"@dlightjs/dlight": "^0.10.2"
21+
"@dlightjs/dlight": "1.0.0-alpha.1"
2222
},
2323
"devDependencies": {
24-
"babel-preset-dlight": "^0.10.5",
24+
"babel-preset-dlight": "1.0.0-alpha.1",
2525
"@babel/core": "7.15.0",
2626
"@babel/plugin-proposal-class-properties": "^7.18.6",
2727
"@babel/plugin-proposal-decorators": "^7.23.0",

frameworks/keyed/dlightjs/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const plugins = [
66
babel({
77
babelHelpers: "bundled",
88
exclude: "node_modules/**",
9-
presets: ["dlight"]
9+
presets: [["dlight", { files: "**/*.js" }]]
1010
}),
1111
babel({
1212
babelHelpers: "bundled",

frameworks/keyed/dlightjs/src/data.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
let idCounter = 1
2+
3+
const adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]
4+
const colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]
5+
const nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]
6+
7+
function _random(max) { return Math.round(Math.random() * 1000) % max };
8+
9+
export function buildData(count) {
10+
const data = new Array(count)
11+
for (let i = 0; i < count; i++) {
12+
data[i] = {
13+
id: idCounter++,
14+
label: `${adjectives[_random(adjectives.length)]} ${colours[_random(colours.length)]} ${nouns[_random(nouns.length)]}`
15+
}
16+
}
17+
return data
18+
}

0 commit comments

Comments
 (0)