Compare commits
30 Commits
@advdomini
...
@advdomini
| Author | SHA1 | Date | |
|---|---|---|---|
|
f30793af80
|
|||
|
3605551f16
|
|||
|
f8d793195c
|
|||
|
a655e7b5e4
|
|||
|
fc11cdfa48
|
|||
|
650008ad76
|
|||
|
96ae522a8f
|
|||
|
9dc95dd47a
|
|||
|
bce960599a
|
|||
|
6f24952680
|
|||
|
e1756bd60f
|
|||
|
ea33198344
|
|||
|
ca88f622d1
|
|||
|
9131e220d2
|
|||
|
4012b982a6
|
|||
|
d6aec9ed14
|
|||
|
e8a3ea043f
|
|||
|
cc8d0b7ab3
|
|||
|
dfb04760f1
|
|||
|
db9022c00b
|
|||
|
00c079c029
|
|||
|
53dc2d3092
|
|||
|
|
9ac5f6bd28 | ||
|
|
09f069b727 | ||
|
|
f9dc305aae | ||
|
|
7d56c06702 | ||
|
|
0bb60a0e0a | ||
|
|
205ea19086 | ||
|
|
1eff119186 | ||
|
|
78e4fa36c0 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -22,9 +22,10 @@ node_modules
|
|||||||
|
|
||||||
.stylelintcache
|
.stylelintcache
|
||||||
|
|
||||||
# Composer
|
# https://github.com/github/gitignore/blob/main/Composer.gitignore
|
||||||
|
|
||||||
vendor
|
composer.phar
|
||||||
|
/vendor/
|
||||||
|
|
||||||
# https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
|
# https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
|
||||||
|
|
||||||
|
|||||||
5
.vscode/extensions.json
vendored
5
.vscode/extensions.json
vendored
@@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"arcanis.vscode-zipfs",
|
"arcanis.vscode-zipfs",
|
||||||
"esbenp.prettier-vscode"
|
"dbaeumer.vscode-eslint",
|
||||||
|
"EditorConfig.EditorConfig",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"stylelint.vscode-stylelint"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -3,5 +3,6 @@
|
|||||||
"**/.yarn": true,
|
"**/.yarn": true,
|
||||||
"**/.pnp.*": true
|
"**/.pnp.*": true
|
||||||
},
|
},
|
||||||
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs"
|
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
|
||||||
|
"eslint.nodePath": ".yarn/sdks"
|
||||||
}
|
}
|
||||||
|
|||||||
893
.yarn/releases/yarn-4.1.1.cjs
vendored
893
.yarn/releases/yarn-4.1.1.cjs
vendored
File diff suppressed because one or more lines are too long
942
.yarn/releases/yarn-4.12.0.cjs
vendored
Executable file
942
.yarn/releases/yarn-4.12.0.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
32
.yarn/sdks/eslint/bin/eslint.js
vendored
Executable file
32
.yarn/sdks/eslint/bin/eslint.js
vendored
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
|
if (existsSync(absPnpApiPath)) {
|
||||||
|
if (!process.versions.pnp) {
|
||||||
|
// Setup the environment to be able to require eslint/bin/eslint.js
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real eslint/bin/eslint.js your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`eslint/bin/eslint.js`));
|
||||||
32
.yarn/sdks/eslint/lib/api.js
vendored
Normal file
32
.yarn/sdks/eslint/lib/api.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
|
if (existsSync(absPnpApiPath)) {
|
||||||
|
if (!process.versions.pnp) {
|
||||||
|
// Setup the environment to be able to require eslint
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real eslint your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
|
||||||
32
.yarn/sdks/eslint/lib/config-api.js
vendored
Normal file
32
.yarn/sdks/eslint/lib/config-api.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
|
if (existsSync(absPnpApiPath)) {
|
||||||
|
if (!process.versions.pnp) {
|
||||||
|
// Setup the environment to be able to require eslint/config
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real eslint/config your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`eslint/config`));
|
||||||
32
.yarn/sdks/eslint/lib/types/config-api.d.ts
vendored
Normal file
32
.yarn/sdks/eslint/lib/types/config-api.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
|
if (existsSync(absPnpApiPath)) {
|
||||||
|
if (!process.versions.pnp) {
|
||||||
|
// Setup the environment to be able to require eslint/config
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real eslint/config your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`eslint/config`));
|
||||||
32
.yarn/sdks/eslint/lib/types/index.d.ts
vendored
Normal file
32
.yarn/sdks/eslint/lib/types/index.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
|
if (existsSync(absPnpApiPath)) {
|
||||||
|
if (!process.versions.pnp) {
|
||||||
|
// Setup the environment to be able to require eslint
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real eslint your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`eslint`));
|
||||||
32
.yarn/sdks/eslint/lib/types/rules.d.ts
vendored
Normal file
32
.yarn/sdks/eslint/lib/types/rules.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
|
if (existsSync(absPnpApiPath)) {
|
||||||
|
if (!process.versions.pnp) {
|
||||||
|
// Setup the environment to be able to require eslint/rules
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real eslint/rules your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`eslint/rules`));
|
||||||
32
.yarn/sdks/eslint/lib/types/universal.d.ts
vendored
Normal file
32
.yarn/sdks/eslint/lib/types/universal.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
|
if (existsSync(absPnpApiPath)) {
|
||||||
|
if (!process.versions.pnp) {
|
||||||
|
// Setup the environment to be able to require eslint/universal
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real eslint/universal your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`eslint/universal`));
|
||||||
32
.yarn/sdks/eslint/lib/types/use-at-your-own-risk.d.ts
vendored
Normal file
32
.yarn/sdks/eslint/lib/types/use-at-your-own-risk.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
|
if (existsSync(absPnpApiPath)) {
|
||||||
|
if (!process.versions.pnp) {
|
||||||
|
// Setup the environment to be able to require eslint/use-at-your-own-risk
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real eslint/use-at-your-own-risk your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));
|
||||||
32
.yarn/sdks/eslint/lib/universal.js
vendored
Normal file
32
.yarn/sdks/eslint/lib/universal.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
|
if (existsSync(absPnpApiPath)) {
|
||||||
|
if (!process.versions.pnp) {
|
||||||
|
// Setup the environment to be able to require eslint/universal
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real eslint/universal your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`eslint/universal`));
|
||||||
32
.yarn/sdks/eslint/lib/unsupported-api.js
vendored
Normal file
32
.yarn/sdks/eslint/lib/unsupported-api.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const {existsSync} = require(`fs`);
|
||||||
|
const {createRequire, register} = require(`module`);
|
||||||
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||||
|
|
||||||
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
|
if (existsSync(absPnpApiPath)) {
|
||||||
|
if (!process.versions.pnp) {
|
||||||
|
// Setup the environment to be able to require eslint/use-at-your-own-risk
|
||||||
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
|
// Defer to the real eslint/use-at-your-own-risk your application uses
|
||||||
|
module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));
|
||||||
31
.yarn/sdks/eslint/package.json
vendored
Normal file
31
.yarn/sdks/eslint/package.json
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"name": "eslint",
|
||||||
|
"version": "9.39.2-sdk",
|
||||||
|
"main": "./lib/api.js",
|
||||||
|
"type": "commonjs",
|
||||||
|
"bin": {
|
||||||
|
"eslint": "./bin/eslint.js"
|
||||||
|
},
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./lib/types/index.d.ts",
|
||||||
|
"default": "./lib/api.js"
|
||||||
|
},
|
||||||
|
"./config": {
|
||||||
|
"types": "./lib/types/config-api.d.ts",
|
||||||
|
"default": "./lib/config-api.js"
|
||||||
|
},
|
||||||
|
"./package.json": "./package.json",
|
||||||
|
"./use-at-your-own-risk": {
|
||||||
|
"types": "./lib/types/use-at-your-own-risk.d.ts",
|
||||||
|
"default": "./lib/unsupported-api.js"
|
||||||
|
},
|
||||||
|
"./rules": {
|
||||||
|
"types": "./lib/types/rules.d.ts"
|
||||||
|
},
|
||||||
|
"./universal": {
|
||||||
|
"types": "./lib/types/universal.d.ts",
|
||||||
|
"default": "./lib/universal.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16
.yarn/sdks/prettier/bin/prettier.cjs
vendored
16
.yarn/sdks/prettier/bin/prettier.cjs
vendored
@@ -1,20 +1,32 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const {existsSync} = require(`fs`);
|
const {existsSync} = require(`fs`);
|
||||||
const {createRequire} = require(`module`);
|
const {createRequire, register} = require(`module`);
|
||||||
const {resolve} = require(`path`);
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||||
|
|
||||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
const absRequire = createRequire(absPnpApiPath);
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
if (existsSync(absPnpApiPath)) {
|
if (existsSync(absPnpApiPath)) {
|
||||||
if (!process.versions.pnp) {
|
if (!process.versions.pnp) {
|
||||||
// Setup the environment to be able to require prettier/bin/prettier.cjs
|
// Setup the environment to be able to require prettier/bin/prettier.cjs
|
||||||
require(absPnpApiPath).setup();
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
// Defer to the real prettier/bin/prettier.cjs your application uses
|
// Defer to the real prettier/bin/prettier.cjs your application uses
|
||||||
module.exports = absRequire(`prettier/bin/prettier.cjs`);
|
module.exports = wrapWithUserWrapper(absRequire(`prettier/bin/prettier.cjs`));
|
||||||
|
|||||||
16
.yarn/sdks/prettier/index.cjs
vendored
16
.yarn/sdks/prettier/index.cjs
vendored
@@ -1,20 +1,32 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const {existsSync} = require(`fs`);
|
const {existsSync} = require(`fs`);
|
||||||
const {createRequire} = require(`module`);
|
const {createRequire, register} = require(`module`);
|
||||||
const {resolve} = require(`path`);
|
const {resolve} = require(`path`);
|
||||||
|
const {pathToFileURL} = require(`url`);
|
||||||
|
|
||||||
const relPnpApiPath = "../../../.pnp.cjs";
|
const relPnpApiPath = "../../../.pnp.cjs";
|
||||||
|
|
||||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||||
|
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
|
||||||
const absRequire = createRequire(absPnpApiPath);
|
const absRequire = createRequire(absPnpApiPath);
|
||||||
|
|
||||||
|
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
||||||
|
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
||||||
|
|
||||||
if (existsSync(absPnpApiPath)) {
|
if (existsSync(absPnpApiPath)) {
|
||||||
if (!process.versions.pnp) {
|
if (!process.versions.pnp) {
|
||||||
// Setup the environment to be able to require prettier
|
// Setup the environment to be able to require prettier
|
||||||
require(absPnpApiPath).setup();
|
require(absPnpApiPath).setup();
|
||||||
|
if (isPnpLoaderEnabled && register) {
|
||||||
|
register(pathToFileURL(absPnpLoaderPath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
|
||||||
|
? exports => absRequire(absUserWrapperPath)(exports)
|
||||||
|
: exports => exports;
|
||||||
|
|
||||||
// Defer to the real prettier your application uses
|
// Defer to the real prettier your application uses
|
||||||
module.exports = absRequire(`prettier`);
|
module.exports = wrapWithUserWrapper(absRequire(`prettier`));
|
||||||
|
|||||||
2
.yarn/sdks/prettier/package.json
vendored
2
.yarn/sdks/prettier/package.json
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "prettier",
|
"name": "prettier",
|
||||||
"version": "3.2.5-sdk",
|
"version": "3.8.0-sdk",
|
||||||
"main": "./index.cjs",
|
"main": "./index.cjs",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"bin": "./bin/prettier.cjs"
|
"bin": "./bin/prettier.cjs"
|
||||||
|
|||||||
@@ -1 +1,8 @@
|
|||||||
yarnPath: .yarn/releases/yarn-4.1.1.cjs
|
enableGlobalCache: false
|
||||||
|
|
||||||
|
packageExtensions:
|
||||||
|
'lerna@*':
|
||||||
|
dependencies:
|
||||||
|
ci-info: '*'
|
||||||
|
|
||||||
|
yarnPath: .yarn/releases/yarn-4.12.0.cjs
|
||||||
|
|||||||
25
README.md
Normal file
25
README.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# frontend
|
||||||
|
|
||||||
|
## Добавление нового пакета
|
||||||
|
|
||||||
|
1. Скопировать один из существующих пакетов в папке `packages`
|
||||||
|
2. На его основе подготовить новый пакет
|
||||||
|
3. Запустить `yarn`
|
||||||
|
|
||||||
|
## Публикация новых версий
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn lerna publish
|
||||||
|
```
|
||||||
|
|
||||||
|
## Обновление зависимостей
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn set version stable
|
||||||
|
|
||||||
|
yarn install
|
||||||
|
|
||||||
|
yarn upgrade-interactive
|
||||||
|
|
||||||
|
yarn dlx @yarnpkg/sdks
|
||||||
|
```
|
||||||
9
eslint.config.js
Normal file
9
eslint.config.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import config from '@advdominion/eslint-config';
|
||||||
|
import { defineConfig } from 'eslint/config';
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
...config,
|
||||||
|
{
|
||||||
|
ignores: ['.yarn', '.pnp.*'],
|
||||||
|
},
|
||||||
|
]);
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
|
||||||
"version": "independent",
|
"version": "independent",
|
||||||
"npmClient": "yarn"
|
"npmClient": "yarn"
|
||||||
}
|
}
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -1,13 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "root",
|
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"packageManager": "yarn@4.12.0",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"lerna": "^8.1.2",
|
"@advdominion/eslint-config": "workspace:*",
|
||||||
"prettier": "^3.2.5"
|
"eslint": "^9.39.2",
|
||||||
},
|
"lerna": "^9.0.3",
|
||||||
"packageManager": "yarn@4.1.1"
|
"prettier": "^3.8.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
70
packages/babel-plugin-nunjucks/README.md
Normal file
70
packages/babel-plugin-nunjucks/README.md
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# babel-plugin-nunjucks
|
||||||
|
|
||||||
|
Плагин для [babel-loader](https://github.com/babel/babel-loader), позволяющий использовать шаблонизатор [Nunjucks](https://mozilla.github.io/nunjucks/) внутри JS-файлов.
|
||||||
|
|
||||||
|
## Установка
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn add -D @advdominion/babel-plugin-nunjucks
|
||||||
|
```
|
||||||
|
|
||||||
|
## Использование
|
||||||
|
|
||||||
|
Используются [Tagged templates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) с тегом `njk`:
|
||||||
|
|
||||||
|
```js
|
||||||
|
njk`
|
||||||
|
{% from "./item.njk" import item as item %}
|
||||||
|
|
||||||
|
<div class="items">
|
||||||
|
{% for n in range(0, 10) %}
|
||||||
|
{{item()}}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
```
|
||||||
|
|
||||||
|
Пример конфигурации Webpack:
|
||||||
|
|
||||||
|
```js
|
||||||
|
[
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
exclude: [/mocks\.js$/],
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'babel-loader',
|
||||||
|
options: {
|
||||||
|
cacheDirectory: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /mocks\.js$/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'babel-loader',
|
||||||
|
options: {
|
||||||
|
compact: false,
|
||||||
|
plugins: [
|
||||||
|
[
|
||||||
|
'@advdominion/babel-plugin-nunjucks',
|
||||||
|
{
|
||||||
|
templatesFolder: 'src/templates/',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
## Опции
|
||||||
|
|
||||||
|
- `templatesFolder` - строка, обязательный параметр. Путь до папки с файлами шаблонов
|
||||||
|
- `globals` - массив, необязательный параметр. Глобальные переменные для Nunjucks (например, `[{name: "message", value: "Hello, world!"}]`)
|
||||||
|
|
||||||
|
**Важно:** Параметр `cacheDirectory` в опциях babel-loader должен быть отключён.
|
||||||
25
packages/babel-plugin-nunjucks/index.js
Normal file
25
packages/babel-plugin-nunjucks/index.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import nunjucks from 'nunjucks';
|
||||||
|
|
||||||
|
const babelPluginNunjucks = ({types: t}) => {
|
||||||
|
return {
|
||||||
|
pre(state) {
|
||||||
|
const options = state.opts.plugins[0].options;
|
||||||
|
this.njkenv = new nunjucks.Environment(new nunjucks.FileSystemLoader(options.templatesFolder));
|
||||||
|
if (options.globals) {
|
||||||
|
for (const {name, value} of options.globals) {
|
||||||
|
this.njkenv.addGlobal(name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
visitor: {
|
||||||
|
TaggedTemplateExpression(path) {
|
||||||
|
if (path.get('tag').isIdentifier({name: 'njk'})) {
|
||||||
|
const render = this.njkenv.renderString(path.node.quasi.quasis[0].value.raw);
|
||||||
|
path.replaceWith(t.stringLiteral(render));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default babelPluginNunjucks;
|
||||||
18
packages/babel-plugin-nunjucks/package.json
Normal file
18
packages/babel-plugin-nunjucks/package.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "@advdominion/babel-plugin-nunjucks",
|
||||||
|
"version": "3.1.0",
|
||||||
|
"type": "module",
|
||||||
|
"main": "index.js",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@babel/core": "^7.0.0",
|
||||||
|
"nunjucks": "^3.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
28
packages/eslint-config/README.md
Normal file
28
packages/eslint-config/README.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Конфигурация для ESLint
|
||||||
|
|
||||||
|
Включает в себя:
|
||||||
|
|
||||||
|
- [js/recommended](https://eslint.org/docs/latest/use/configure/configuration-files#using-predefined-configurations) из ESLint
|
||||||
|
- [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier)
|
||||||
|
- [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort)
|
||||||
|
- [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
|
||||||
|
- [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue)
|
||||||
|
- [globals](https://github.com/sindresorhus/globals) (`browser` и `nodeBuiltin`)
|
||||||
|
|
||||||
|
## Использование
|
||||||
|
|
||||||
|
### Требования
|
||||||
|
|
||||||
|
- [ESLint](https://eslint.org/)
|
||||||
|
|
||||||
|
### Подключание
|
||||||
|
|
||||||
|
```js
|
||||||
|
import config from '@advdominion/eslint-config';
|
||||||
|
import { defineConfig } from 'eslint/config';
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
...config,
|
||||||
|
// Дополнительная конфигурация проекта
|
||||||
|
]);
|
||||||
|
```
|
||||||
129
packages/eslint-config/index.js
Normal file
129
packages/eslint-config/index.js
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
/* eslint-disable unicorn/no-useless-spread */
|
||||||
|
|
||||||
|
import js from '@eslint/js';
|
||||||
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||||
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
||||||
|
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
||||||
|
import pluginVue from 'eslint-plugin-vue';
|
||||||
|
import globals from 'globals';
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 'latest',
|
||||||
|
sourceType: 'module',
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.nodeBuiltin,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
js.configs.recommended,
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
...{
|
||||||
|
'array-callback-return': 'error',
|
||||||
|
'no-await-in-loop': 'warn',
|
||||||
|
'no-duplicate-imports': 'warn',
|
||||||
|
'no-promise-executor-return': 'error',
|
||||||
|
'no-self-compare': 'error',
|
||||||
|
'no-template-curly-in-string': 'warn',
|
||||||
|
'no-unassigned-vars': 'warn',
|
||||||
|
'no-unmodified-loop-condition': 'error',
|
||||||
|
'no-unreachable-loop': 'error',
|
||||||
|
'no-use-before-define': 'error',
|
||||||
|
'no-useless-assignment': 'warn',
|
||||||
|
},
|
||||||
|
...{
|
||||||
|
'dot-notation': 'warn',
|
||||||
|
'eqeqeq': 'error',
|
||||||
|
'no-implicit-coercion': 'warn',
|
||||||
|
'no-negated-condition': 'warn',
|
||||||
|
'no-useless-concat': 'warn',
|
||||||
|
'object-shorthand': 'warn',
|
||||||
|
'func-style': 'error',
|
||||||
|
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
||||||
|
'no-param-reassign': 'error',
|
||||||
|
'no-var': 'error',
|
||||||
|
'one-var': ['warn', 'never'],
|
||||||
|
'prefer-const': 'warn',
|
||||||
|
'prefer-template': 'warn',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
plugins: {
|
||||||
|
'simple-import-sort': simpleImportSort,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'simple-import-sort/imports': 'warn',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
plugins: {
|
||||||
|
unicorn: eslintPluginUnicorn,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...Object.fromEntries(
|
||||||
|
Object.entries(eslintPluginUnicorn.configs.recommended.rules).map(([rule, level]) => [
|
||||||
|
rule,
|
||||||
|
level === 'off' ? 'off' : 'warn',
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
'unicorn/better-regex': 'warn',
|
||||||
|
'unicorn/filename-case': ['warn', { cases: { kebabCase: true, pascalCase: true } }],
|
||||||
|
'unicorn/prefer-global-this': 'off',
|
||||||
|
'unicorn/prefer-import-meta-properties': 'warn',
|
||||||
|
'unicorn/prefer-top-level-await': 'off',
|
||||||
|
'unicorn/prevent-abbreviations': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
...pluginVue.configs['flat/recommended'],
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
...{
|
||||||
|
'vue/no-v-html': 'off',
|
||||||
|
'vue/one-component-per-file': 'off',
|
||||||
|
},
|
||||||
|
...{
|
||||||
|
'vue/component-name-in-template-casing': 'warn',
|
||||||
|
'vue/component-options-name-casing': 'warn',
|
||||||
|
'vue/custom-event-name-casing': 'warn',
|
||||||
|
'vue/match-component-file-name': ['warn', { extensions: ['vue'], shouldMatchCase: true }],
|
||||||
|
'vue/match-component-import-name': 'warn',
|
||||||
|
'vue/no-boolean-default': 'warn',
|
||||||
|
'vue/no-potential-component-option-typo': 'warn',
|
||||||
|
'vue/no-useless-mustaches': 'warn',
|
||||||
|
'vue/no-useless-v-bind': 'warn',
|
||||||
|
'vue/require-direct-export': 'warn',
|
||||||
|
'vue/require-name-property': 'warn',
|
||||||
|
'vue/v-for-delimiter-style': 'warn',
|
||||||
|
'vue/v-on-handler-style': ['warn', 'inline'],
|
||||||
|
},
|
||||||
|
...{
|
||||||
|
'vue/dot-notation': 'warn',
|
||||||
|
'vue/eqeqeq': 'error',
|
||||||
|
'vue/no-console': ['warn', { allow: ['warn', 'error'] }],
|
||||||
|
'vue/no-constant-condition': 'error',
|
||||||
|
'vue/no-empty-pattern': 'error',
|
||||||
|
'vue/no-implicit-coercion': 'warn',
|
||||||
|
'vue/no-irregular-whitespace': 'error',
|
||||||
|
'vue/no-loss-of-precision': 'error',
|
||||||
|
'vue/no-negated-condition': 'warn',
|
||||||
|
'vue/no-sparse-arrays': 'error',
|
||||||
|
'vue/no-useless-concat': 'warn',
|
||||||
|
'vue/object-shorthand': 'warn',
|
||||||
|
'vue/prefer-template': 'warn',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.vue'],
|
||||||
|
rules: {
|
||||||
|
'no-useless-assignment': 'off', // ESLint не умеет работать с этим правилом внутри <template>
|
||||||
|
},
|
||||||
|
},
|
||||||
|
eslintConfigPrettier,
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
||||||
26
packages/eslint-config/package.json
Normal file
26
packages/eslint-config/package.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "@advdominion/eslint-config",
|
||||||
|
"version": "1.1.3",
|
||||||
|
"type": "module",
|
||||||
|
"main": "index.js",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@eslint/js": "^9.39.2",
|
||||||
|
"eslint-config-prettier": "^10.1.8",
|
||||||
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||||
|
"eslint-plugin-unicorn": "^62.0.0",
|
||||||
|
"eslint-plugin-vue": "^10.7.0",
|
||||||
|
"globals": "^17.0.0",
|
||||||
|
"vue-eslint-parser": "^10.2.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"eslint": "^9.39.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@advdominion/get-scrollbar-width",
|
"name": "@advdominion/get-scrollbar-width",
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitea.optiweb.ru/public/helpers.git"
|
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
# is
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
|
|
||||||
```js
|
|
||||||
import { is } from '@advdominion/is';
|
|
||||||
|
|
||||||
console.log(is('Hello, world!', 'String'));
|
|
||||||
```
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export const is = (obj, type) => {
|
|
||||||
return Object.prototype.toString.call(obj).slice(8, -1) === type && obj !== undefined && obj !== null;
|
|
||||||
};
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@advdominion/is",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"type": "module",
|
|
||||||
"main": "index.js",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://gitea.optiweb.ru/public/helpers.git"
|
|
||||||
},
|
|
||||||
"license": "MIT",
|
|
||||||
"publishConfig": {
|
|
||||||
"access": "public"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
53
packages/lightningcss-loader/README.md
Normal file
53
packages/lightningcss-loader/README.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# lightningcss-loader
|
||||||
|
|
||||||
|
[Lightning CSS](https://lightningcss.dev) loader for [Webpack](https://webpack.js.org)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { transform } from 'lightningcss';
|
||||||
|
|
||||||
|
return {
|
||||||
|
...,
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: '@advdominion/lightningcss-loader',
|
||||||
|
options: {
|
||||||
|
implementation: transform,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### Passing options to Lightning CSS
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { transform } from 'lightningcss';
|
||||||
|
|
||||||
|
return {
|
||||||
|
...,
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: '@advdominion/lightningcss-loader',
|
||||||
|
options: {
|
||||||
|
implementation: transform,
|
||||||
|
drafts: {
|
||||||
|
customMedia: true,
|
||||||
|
},
|
||||||
|
minify: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
```
|
||||||
22
packages/lightningcss-loader/index.js
Normal file
22
packages/lightningcss-loader/index.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
const lightningcssLoader = function (source, sourceMap) {
|
||||||
|
const { implementation, ...options } = this.getOptions();
|
||||||
|
const callback = this.async();
|
||||||
|
|
||||||
|
if (typeof implementation !== 'function') {
|
||||||
|
throw new TypeError(
|
||||||
|
`[lightningcss-loader]: The "implementation" option is required and must provide "transform" function of the LightningCSS`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const { code, map } = implementation({
|
||||||
|
filename: this.resourcePath,
|
||||||
|
code: Buffer.from(source),
|
||||||
|
sourceMap: this.sourceMap,
|
||||||
|
inputSourceMap: this.sourceMap && sourceMap ? JSON.stringify(sourceMap) : undefined,
|
||||||
|
...options,
|
||||||
|
});
|
||||||
|
|
||||||
|
callback(undefined, code.toString(), map && JSON.parse(map.toString()));
|
||||||
|
};
|
||||||
|
|
||||||
|
export default lightningcssLoader;
|
||||||
14
packages/lightningcss-loader/package.json
Normal file
14
packages/lightningcss-loader/package.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "@advdominion/lightningcss-loader",
|
||||||
|
"version": "1.0.2",
|
||||||
|
"type": "module",
|
||||||
|
"main": "index.js",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
}
|
||||||
|
}
|
||||||
11
packages/pluralize/README.md
Normal file
11
packages/pluralize/README.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# pluralize
|
||||||
|
|
||||||
|
Склонение существительных в зависимости от числа
|
||||||
|
|
||||||
|
## Использование
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { pluralize } from '@advdominion/pluralize';
|
||||||
|
|
||||||
|
console.log(pluralize(1, ['яблоко', 'яблока', 'яблок']));
|
||||||
|
```
|
||||||
14
packages/pluralize/index.js
Normal file
14
packages/pluralize/index.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
export const pluralize = (count, words) => {
|
||||||
|
const normalizedCount = Math.abs(count) % 100;
|
||||||
|
const count10 = normalizedCount % 10;
|
||||||
|
if (normalizedCount > 10 && normalizedCount < 20) {
|
||||||
|
return words[2];
|
||||||
|
}
|
||||||
|
if (count10 > 1 && count10 < 5) {
|
||||||
|
return words[1];
|
||||||
|
}
|
||||||
|
if (count10 === 1) {
|
||||||
|
return words[0];
|
||||||
|
}
|
||||||
|
return words[2];
|
||||||
|
};
|
||||||
14
packages/pluralize/package.json
Normal file
14
packages/pluralize/package.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "@advdominion/pluralize",
|
||||||
|
"version": "1.0.2",
|
||||||
|
"type": "module",
|
||||||
|
"main": "index.js",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
}
|
||||||
|
}
|
||||||
33
packages/scroll-to/README.md
Normal file
33
packages/scroll-to/README.md
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# scroll-to
|
||||||
|
|
||||||
|
Плавный скролл до элемента с поддержкой нативного события `scrollend` и гибкой настройкой отступов.
|
||||||
|
|
||||||
|
## Использование
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { scrollTo } from '@advdominion/scroll-to';
|
||||||
|
|
||||||
|
// Базовый скролл до элемента
|
||||||
|
await scrollTo(document.querySelector('#example'));
|
||||||
|
|
||||||
|
// Скролл с отступом 100px (например, для фиксированной шапки)
|
||||||
|
await scrollTo(document.querySelector('#example'), 100, true);
|
||||||
|
|
||||||
|
// Скролл с отступом в 10% от высоты экрана
|
||||||
|
await scrollTo(document.querySelector('#example'), 10);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Параметры
|
||||||
|
|
||||||
|
| Параметр | Тип | По умолчанию | Описание |
|
||||||
|
| :--- | :--- | :--- | :--- |
|
||||||
|
| **$el** | `HTMLElement` | — | DOM-элемент, к которому нужно прокрутить страницу |
|
||||||
|
| **offset** | `number` | `0` | Величина отступа сверху от целевого элемента |
|
||||||
|
| **offsetInPx** | `boolean` | `false` | Тип отступа: `true` — в пикселях, `false` — в процентах от высоты вьюпорта |
|
||||||
|
|
||||||
|
## Как это работает
|
||||||
|
|
||||||
|
1. **Точность:** Использует нативное событие `scrollend`, которое срабатывает строго после завершения анимации прокрутки.
|
||||||
|
2. **Безопасность:** Если браузер не поддерживает `scrollend` или анимация прервана, сработает автоматический fallback через 1500 мс.
|
||||||
|
3. **Плавность:** Использует нативный `behavior: 'smooth'`.
|
||||||
|
4. **Очистка данных:** Автоматически удаляет слушатели событий и таймеры после завершения или отмены скролла.
|
||||||
40
packages/scroll-to/index.js
Normal file
40
packages/scroll-to/index.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
export const scrollTo = ($el, offset = 0, offsetInPx = false) => {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
if (!$el) {
|
||||||
|
console.warn('Элемент не найден');
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const elementPosition = $el.getBoundingClientRect().top + window.scrollY;
|
||||||
|
const topOffset = offsetInPx ? offset : (window.innerHeight * offset) / 100;
|
||||||
|
const targetScrollTop = elementPosition - topOffset;
|
||||||
|
|
||||||
|
// Если элемент уже в нужной позиции
|
||||||
|
if (Math.abs(window.scrollY - targetScrollTop) < 1) {
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let resolved = false; // На случай, если scrollend и fallback запустятся одновременно
|
||||||
|
let fallbackTimeout; // eslint-disable-line prefer-const
|
||||||
|
|
||||||
|
const done = () => {
|
||||||
|
if (resolved) return;
|
||||||
|
resolved = true;
|
||||||
|
|
||||||
|
window.removeEventListener('scrollend', done);
|
||||||
|
clearTimeout(fallbackTimeout);
|
||||||
|
|
||||||
|
resolve();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('scrollend', done, { once: true });
|
||||||
|
fallbackTimeout = setTimeout(done, 1500);
|
||||||
|
|
||||||
|
window.scrollTo({
|
||||||
|
top: targetScrollTop,
|
||||||
|
behavior: 'smooth',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
14
packages/scroll-to/package.json
Normal file
14
packages/scroll-to/package.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "@advdominion/scroll-to",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"type": "module",
|
||||||
|
"main": "index.js",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea.optiweb.ru/public/frontend.git"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,13 @@
|
|||||||
export default {
|
export default {
|
||||||
printWidth: 120,
|
printWidth: 120,
|
||||||
tabWidth: 4,
|
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
|
quoteProps: 'consistent',
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: 'packages/*/package.json',
|
||||||
|
options: {
|
||||||
|
tabWidth: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user