Skip to content

Commit a160a4b

Browse files
committed
Build dependencies
1 parent a5983f7 commit a160a4b

80 files changed

Lines changed: 23036 additions & 40 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.eslintrc.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ module.exports = {
1313
plugins: [
1414
'@typescript-eslint'
1515
],
16+
ignorePatterns: [
17+
'src/vendor/**',
18+
'src/solid/**',
19+
'src/opus-recorder/**',
20+
'public/**'
21+
],
1622
overrides: [{
1723
files: ['*.ts'],
1824

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
node_modules
22
coverage
33
__pycache__
4-
dist
4+
/dist
55
**/.DS_Store
66
stats.json
77
certs

‎.gitmodules‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
[submodule "src/solid"]
1111
path = src/solid
1212
url = https://github.com/morethanwords/solid
13+
branch = no-errors

‎package.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"generate-changelog": "node ./src/scripts/generate_changelog.js",
1515
"generate-icons": "node ./src/scripts/icomoon/icomoon_generate.js",
1616
"change-version": "node ./src/scripts/change_version.js",
17-
"lint": "npx eslint \"src/**/**.ts\""
17+
"lint": "npx eslint \"src/**/**.ts\"",
18+
"build:solid": "node ./src/scripts/build_solid.js"
1819
},
1920
"author": "",
2021
"license": "GPL-3.0-only",
@@ -38,6 +39,7 @@
3839
"big-integer": "^1.6.51",
3940
"browserslist": "^4.21.5",
4041
"compression": "^1.7.4",
42+
"csstype": "^3.1.2",
4143
"eslint": "^8.21.0",
4244
"express": "^4.18.2",
4345
"fast-png": "^6.1.0",
@@ -50,7 +52,6 @@
5052
"qr-code-styling": "^1.5.0",
5153
"rollup-plugin-visualizer": "^5.9.0",
5254
"sass": "^1.64.2",
53-
"solid-js": "^1.7.9",
5455
"solid-transition-group": "^0.2.2",
5556
"text-encoding": "^0.7.0",
5657
"typescript": "^4.9.5",

‎pnpm-lock.yaml‎

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

‎src/scripts/build_solid.js‎

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
const {execSync} = require('child_process');
2+
const path = require('path');
3+
const fs = require('fs');
4+
5+
const solidPath = path.join(__dirname, '../solid');
6+
console.log(solidPath);
7+
8+
const solidPackagePath = path.join(solidPath, 'packages/solid');
9+
10+
const json = require(path.join(solidPackagePath, 'package.json'));
11+
12+
execSync(`pnpm run build`, {
13+
cwd: solidPath
14+
});
15+
16+
const copy = ['package.json'].concat(json.files).map((file) => {
17+
return path.join(solidPackagePath, file);
18+
});
19+
20+
copy.push(path.join(solidPath, 'LICENSE'));
21+
22+
function deleteFolderRecursive(directoryPath) {
23+
if(fs.existsSync(directoryPath)) {
24+
fs.readdirSync(directoryPath).forEach((file) => {
25+
const currentPath = path.join(directoryPath, file);
26+
27+
if(fs.lstatSync(currentPath).isDirectory()) {
28+
// Recursively delete subdirectory
29+
deleteFolderRecursive(currentPath);
30+
} else {
31+
// Remove file
32+
fs.unlinkSync(currentPath);
33+
}
34+
});
35+
36+
// Remove now-empty directory
37+
fs.rmdirSync(directoryPath);
38+
} else {
39+
console.error("Directory path " + directoryPath + " not found.");
40+
}
41+
}
42+
43+
function copyFile(source, target) {
44+
// Ensure that the directory exists. If not, create it.
45+
const targetDir = path.dirname(target);
46+
if(!fs.existsSync(targetDir)) {
47+
fs.mkdirSync(targetDir, {recursive: true});
48+
}
49+
50+
fs.copyFileSync(source, target);
51+
}
52+
53+
function copyFolder(source, target) {
54+
// Ensure that the directory exists. If not, create it.
55+
if(!fs.existsSync(target)) {
56+
fs.mkdirSync(target, {recursive: true});
57+
}
58+
59+
const items = fs.readdirSync(source);
60+
61+
for(const item of items) {
62+
const sourcePath = path.join(source, item);
63+
const targetPath = path.join(target, item);
64+
65+
const stats = fs.statSync(sourcePath);
66+
67+
if(stats.isDirectory()) {
68+
copyFolder(sourcePath, targetPath);
69+
} else if(stats.isFile()) {
70+
copyFile(sourcePath, targetPath);
71+
}
72+
}
73+
}
74+
75+
const buildedSolidPath = path.join(__dirname, '../vendor/solid');
76+
deleteFolderRecursive(buildedSolidPath);
77+
copy.forEach((source) => {
78+
const lastParts = source.split('/').slice(-5);
79+
for(let i = 0; i < lastParts.length; ++i) {
80+
if(lastParts[i] === 'packages') {
81+
lastParts.splice(0, i + 2);
82+
break;
83+
}
84+
}
85+
86+
const solidIndex = lastParts.indexOf('solid');
87+
if(solidIndex !== -1) {
88+
lastParts.splice(0, solidIndex + 1);
89+
}
90+
91+
console.log(lastParts);
92+
93+
const target = path.join(buildedSolidPath, lastParts.join('/'));
94+
if(fs.statSync(source).isDirectory()) {
95+
copyFolder(source, target);
96+
} else {
97+
copyFile(source, target);
98+
}
99+
});
100+
101+
// console.log(copy);

‎src/vendor/solid/LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016-2023 Ryan Carniato
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)