@labeg/code-style 2.0.32 → 2.0.37

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/.eslintrc.js CHANGED
@@ -3,20 +3,21 @@ module.exports = {
3
3
  parserOptions: {
4
4
  project: "tsconfig.json",
5
5
  sourceType: "module",
6
+ ecmaVersion: "latest",
6
7
  ecmaFeatures: {
7
8
  jsx: true
8
9
  }
9
10
  },
10
- plugins: ["react", "@typescript-eslint"],
11
11
  extends: [
12
12
  "eslint:all",
13
13
  "plugin:react/all",
14
- "plugin:@typescript-eslint/all"
14
+ "plugin:@typescript-eslint/all",
15
+ "plugin:jsx-a11y/strict"
15
16
  ],
16
17
  root: true,
17
18
  env: {
18
19
  browser: true,
19
- es2021: true
20
+ es2022: true
20
21
  },
21
22
  ignorePatterns: ["node_modules/*"],
22
23
  settings: {
package/package.json CHANGED
@@ -1,32 +1,7 @@
1
1
  {
2
2
  "name": "@labeg/code-style",
3
- "version": "2.0.32",
3
+ "version": "2.0.37",
4
4
  "scripts": {
5
- "cs:eslint": "eslint --fix -c .eslintrc.js --ext .tsx,.ts,.jsx,.js ./src/",
6
- "cs:stylelint": "stylelint --fix ./src/**/*.scss",
7
- "cs": "concurrently \"npm run cs:eslint\" \"npm run cs:stylelint\"",
8
- "serve:browser-sync": "browser-sync start --config bs-config.js",
9
- "serve:styles": "postcss ./src/**/*.scss --watch --base ./src/ --dir ./dist.tmp/",
10
- "serve:scripts": "tsc --project tsconfig.json --watch --preserveWatchOutput",
11
- "serve:bundle_landing_es2015": "rollup --config --watch --environment NODE_ENV:development,APP:Landing_es2015",
12
- "serve:bundle_landing_es5": "rollup --config --watch --environment NODE_ENV:development,APP:Landing_es5",
13
- "serve:bundle_cabinete_es2015": "rollup --config --watch --environment NODE_ENV:development,APP:Cabinet_es2015",
14
- "serve:bundle_cabinete_es5": "rollup --config --watch --environment NODE_ENV:development,APP:Cabinet_es5",
15
- "serve:bundle_polyfills_es2015": "rollup --config --watch --environment NODE_ENV:development,APP:Polyfills_es2015",
16
- "serve:bundle_polyfills_es5": "rollup --config --watch --environment NODE_ENV:development,APP:Polyfills_es5",
17
- "serve": "concurrently \"npm run build:styles\" \"npm run build:scripts\" && concurrently --kill-others \"npm run serve:browser-sync\" \"npm run serve:styles\" \"npm run serve:scripts\" \"npm run serve:bundle_landing_es2015\" \"npm run serve:bundle_landing_es5\" \"npm run serve:bundle_polyfills_es2015\" \"npm run serve:bundle_polyfills_es5\" \"npm run serve:bundle_cabinete_es2015\" \"npm run serve:bundle_cabinete_es5\"",
18
- "build:static": "copyfiles -u 1 ./src/**/*.{ico,svg,eot,ttf,woff,woff2,pdf,gif,webmanifest} ./dist/",
19
- "build:images": "node ./buildscripts/min-images.js",
20
- "build:html": "html-minifier --input-dir ./src/ --output-dir ./dist/ --file-ext html --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --use-short-doctype --minify-css true --minify-js true && node ./buildscripts/set-html-timestmap.js",
21
- "build:styles": "postcss ./src/**/*.scss --base ./src/ --dir ./dist.tmp/",
22
- "build:scripts": "tsc --project tsconfig.json",
23
- "build:bundle_landing_es2015": "rollup --config --environment NODE_ENV:production,APP:Landing_es2015",
24
- "build:bundle_landing_es5": "rollup --config --environment NODE_ENV:production,APP:Landing_es5",
25
- "build:bundle_cabinete_es2015": "rollup --config --environment NODE_ENV:production,APP:Cabinet_es2015",
26
- "build:bundle_cabinete_es5": "rollup --config --environment NODE_ENV:production,APP:Cabinet_es5",
27
- "build:bundle_polyfills_es2015": "rollup --config --environment NODE_ENV:production,APP:Polyfills_es2015",
28
- "build:bundle_polyfills_es5": "rollup --config --environment NODE_ENV:production,APP:Polyfills_es5",
29
- "build": "concurrently \"npm run build:styles\" \"npm run build:scripts\" && concurrently \"npm run build:static\" \"npm run build:images\" \"npm run build:html\" \"npm run build:bundle_landing_es2015\" \"npm run build:bundle_landing_es5\" \"npm run build:bundle_polyfills_es2015\" \"npm run build:bundle_polyfills_es5\" \"npm run build:bundle_cabinete_es2015\" \"npm run build:bundle_cabinete_es5\"",
30
5
  "prepublishOnly": "npm version patch"
31
6
  },
32
7
  "repository": {
@@ -40,15 +15,16 @@
40
15
  },
41
16
  "homepage": "https://github.com/LabEG/code-style#readme",
42
17
  "dependencies": {
43
- "@typescript-eslint/eslint-plugin": "^5.22.0",
44
- "@typescript-eslint/parser": "^5.22.0",
45
- "eslint": "^8.15.0",
46
- "eslint-plugin-react": "^7.29.4",
18
+ "@typescript-eslint/eslint-plugin": "^5.27.0",
19
+ "@typescript-eslint/parser": "^5.27.0",
20
+ "eslint": "^8.16.0",
21
+ "eslint-plugin-react": "^7.30.0",
22
+ "eslint-plugin-jsx-a11y": "^6.5.1",
47
23
  "react": "^18.1.0",
48
- "stylelint": "^14.8.2",
24
+ "stylelint": "^14.8.5",
49
25
  "stylelint-config-standard": "^25.0.0",
50
26
  "tslib": "^2.4.0",
51
- "typescript": "^4.6.4"
27
+ "typescript": "^4.7.2"
52
28
  },
53
29
  "devDependencies": {}
54
30
  }
package/bs-config.js DELETED
@@ -1,49 +0,0 @@
1
-
2
- /*
3
- |--------------------------------------------------------------------------
4
- | Browser-sync config file
5
- |--------------------------------------------------------------------------
6
- |
7
- | For up-to-date information about the options:
8
- | http://www.browsersync.io/docs/options/
9
- |
10
- | There are more options than you see here, these are just the ones that are
11
- | set internally. See the website for more info.
12
- |
13
- |
14
- */
15
-
16
- const { createProxyMiddleware } = require('http-proxy-middleware');
17
- const proxy = createProxyMiddleware(
18
- (pathname, req) => pathname.match('^/api'),
19
- {
20
- target: "https://labeg.ru",
21
- secure: false,
22
- // changeOrigin: true,
23
- headers: {
24
- "Authorization": "Basic 111"
25
- }
26
- }
27
- );
28
-
29
- module.exports = {
30
- https: true,
31
- open: false,
32
- watch: true,
33
- server: {
34
- baseDir: "./dist/",
35
- middleware: [
36
- proxy,
37
- {
38
- route: "/",
39
- handle: function (req, res, next) {
40
- res.writeHead(302, {
41
- 'Location': '/landing/'
42
- });
43
- res.end();
44
- next();
45
- }
46
- }
47
- ]
48
- }
49
- };
package/rollup.config.js DELETED
@@ -1,179 +0,0 @@
1
- import nodeResolve from "rollup-plugin-node-resolve";
2
- import commonJs from "rollup-plugin-commonjs";
3
- import visualizer from "rollup-plugin-visualizer";
4
- import replace from "rollup-plugin-replace";
5
- import { terser } from "rollup-plugin-terser";
6
- import { string } from "rollup-plugin-string";
7
- import babel from "rollup-plugin-babel";
8
- import react from 'react';
9
- import reactDom from 'react-dom';
10
- import reactRouterDom from 'react-router-dom';
11
- import tslib from 'tslib';
12
-
13
- const isSourceMap = false;
14
- const isRelease = process.env.NODE_ENV === "production";
15
- const app = process.env.APP;
16
-
17
- const getPlugins = (config) => {
18
- const plugins = [];
19
- const isESNext = config.isESNext;
20
-
21
- plugins.push(nodeResolve({
22
- mainFields: isESNext ? ["module", "jsnext:main", "main"] : ["main"],
23
- extensions: isESNext ? [".mjs", ".js", ".jsx", ".json"] : [".js", ".jsx", ".json"]
24
- }));
25
-
26
- plugins.push(commonJs({
27
- namedExports: {
28
- "react-is": ["isValidElementType"],
29
- "react": Object.keys(react),
30
- "react-dom": Object.keys(reactDom),
31
- "mobx": ["observable", "computed", "action"],
32
- "mobx-react": ["observer"],
33
- "class-validator": [
34
- "Validate", "ValidatorConstraint", "IsOptional", "MaxLength", "ValidationError",
35
- "ValidatorConstraintInterface", "ValidationArguments"
36
- ],
37
- "tslib": Object.keys(tslib),
38
- "react-router-dom": Object.keys(reactRouterDom),
39
- "classnames": ["classnames"]
40
- },
41
- include: "node_modules/**"
42
- }));
43
-
44
- if (!isESNext) {
45
- plugins.push(babel({
46
- // exclude: 'node_modules/**',
47
- runtimeHelpers: true,
48
- presets: [],
49
- plugins: [
50
- "@babel/plugin-transform-classes",
51
- "@babel/plugin-transform-arrow-functions",
52
- "@babel/plugin-transform-template-literals",
53
- "@babel/plugin-transform-spread",
54
- "@babel/plugin-transform-parameters",
55
- "@babel/plugin-transform-async-to-generator",
56
- "@babel/plugin-transform-regenerator",
57
- "@babel/plugin-transform-for-of",
58
- "@babel/plugin-transform-destructuring",
59
- "@babel/plugin-transform-shorthand-properties",
60
- "@babel/plugin-transform-runtime",
61
- "@babel/plugin-transform-block-scoping",
62
- "@babel/plugin-transform-unicode-regex"
63
- ]
64
- }));
65
- }
66
-
67
- plugins.push(string({
68
- include: "**/*.scss",
69
- }));
70
-
71
- plugins.push(replace({
72
- "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV)
73
- }));
74
-
75
- if (isRelease) {
76
- plugins.push(terser({
77
- toplevel: true,
78
- sourcemap: isSourceMap
79
- }));
80
- }
81
-
82
- plugins.push(visualizer({
83
- filename: `.stats/${config.appName.toLowerCase().replace(" ", "_")}_stat.html`,
84
- title: config.appName,
85
- sourcemap: isSourceMap
86
- }));
87
-
88
- return plugins;
89
- };
90
-
91
- /**
92
- * Tasks
93
- */
94
-
95
- const tasks = [];
96
-
97
- if (app === "Landing_es2015") {
98
- tasks.push({
99
- input: "dist.tmp/landing/scripts/Main.js",
100
- output: {
101
- file: "dist/landing/scripts/main.es2015.min.js",
102
- format: "iife",
103
- sourcemap: isSourceMap
104
- },
105
- plugins: getPlugins({ appName: "LandingES2015", isESNext: true }),
106
- });
107
- }
108
-
109
- if (app === "Landing_es5") {
110
- tasks.push({
111
- input: "dist.tmp/landing/scripts/Main.js",
112
- output: {
113
- file: "dist/landing/scripts/main.es5.min.js",
114
- format: "iife",
115
- sourcemap: isSourceMap
116
- },
117
- plugins: getPlugins({ appName: "LandingES5", isESNext: false }),
118
- });
119
- }
120
-
121
- if (app === "Cabinet_es2015") {
122
- tasks.push({
123
- input: "dist.tmp/cabinet/scripts/Main.js",
124
- output: {
125
- file: "dist/cabinet/scripts/main.es2015.min.js",
126
- format: "iife",
127
- sourcemap: isSourceMap
128
- },
129
- plugins: getPlugins({ appName: "CabinetES2015", isESNext: true }),
130
- });
131
- }
132
-
133
- if (app === "Cabinet_es5") {
134
- tasks.push({
135
- input: "dist.tmp/cabinet/scripts/Main.js",
136
- output: {
137
- file: "dist/cabinet/scripts/main.es5.min.js",
138
- format: "iife",
139
- sourcemap: isSourceMap
140
- },
141
- plugins: getPlugins({ appName: "CabinetES5", isESNext: false }),
142
- });
143
- }
144
-
145
- if (app === "Polyfills_es2015") {
146
- tasks.push({
147
- input: "dist.tmp/core/scripts/polyfills.es2015.js",
148
- output: {
149
- file: "dist/core/scripts/polyfills.es2015.min.js",
150
- format: "iife",
151
- sourcemap: isSourceMap
152
- },
153
- plugins: getPlugins({ appName: "PolyfillsES2015", isESNext: true }),
154
- });
155
- }
156
-
157
- if (app === "Polyfills_es5") {
158
- tasks.push({
159
- input: "dist.tmp/core/scripts/polyfills.es5.js",
160
- output: {
161
- file: "dist/core/scripts/polyfills.es5.min.js",
162
- format: "iife",
163
- sourcemap: isSourceMap
164
- },
165
- plugins: getPlugins({ appName: "PolyfillsES5", isESNext: false }),
166
- });
167
- }
168
-
169
- tasks.push({
170
- input: "dist.tmp/core/scripts/pwa.serviceworker.js",
171
- output: {
172
- file: "dist/pwa.serviceworker.min.js",
173
- format: "iife",
174
- sourcemap: isSourceMap
175
- },
176
- plugins: getPlugins({appName: "ServiceWorker", tsconfig: "tsconfig.pwa.json"})
177
- });
178
-
179
- export default tasks;
package/tsconfig.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "compileOnSave": false,
3
- "compilerOptions": {
4
- "baseUrl": "./",
5
- "outDir": "./dist/out-tsc",
6
- "sourceMap": true,
7
- "declaration": false,
8
- "module": "es2015",
9
- "moduleResolution": "node",
10
- "emitDecoratorMetadata": true,
11
- "experimentalDecorators": true,
12
- "target": "es5",
13
- "allowJs": true,
14
- "allowSyntheticDefaultImports": true,
15
- "checkJs": false,
16
- "diagnostics": true,
17
- "downlevelIteration": false,
18
- "importHelpers": true,
19
- "noEmitHelpers": true,
20
- "noImplicitReturns": true,
21
- "noUnusedLocals": true,
22
- "preserveConstEnums": false,
23
- "pretty": true,
24
- "strict": true,
25
- "strictFunctionTypes": false,
26
- "typeRoots": [
27
- "node_modules/@types"
28
- ],
29
- "lib": [
30
- "es2017",
31
- "dom"
32
- ]
33
- }
34
- }
package/tsconfig.pwa.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "lib": [
5
- "es2017",
6
- "webworker"
7
- ]
8
- },
9
- "include": [
10
- "./src/core/scripts/pwa.serviceworker.ts"
11
- ]
12
- }