innetjs 2.0.0 → 2.0.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/README.md CHANGED
@@ -58,9 +58,6 @@ Use the command in the project folder to build it.
58
58
  innetjs build
59
59
  ```
60
60
 
61
- ## Links
62
- Check [README.md](https://github.com/d8corp/innetjs/tree/main/src/templates/fe) of `fe` template
63
-
64
61
  ## Issues
65
62
  If you find a bug or have a suggestion, please file an issue on [GitHub](https://github.com/d8corp/innetjs/issues).
66
63
 
package/bin/innet CHANGED
@@ -23,6 +23,7 @@ var proxy = require('express-http-proxy');
23
23
  var selector = require('cli-select');
24
24
  var jsx = require('rollup-plugin-innet-jsx');
25
25
  var filesize = require('rollup-plugin-filesize');
26
+ var image = require('@rollup/plugin-image');
26
27
  var unzipper = require('unzipper');
27
28
  var commander = require('commander');
28
29
 
@@ -47,6 +48,7 @@ var proxy__default = /*#__PURE__*/_interopDefaultLegacy(proxy);
47
48
  var selector__default = /*#__PURE__*/_interopDefaultLegacy(selector);
48
49
  var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx);
49
50
  var filesize__default = /*#__PURE__*/_interopDefaultLegacy(filesize);
51
+ var image__default = /*#__PURE__*/_interopDefaultLegacy(image);
50
52
 
51
53
  /******************************************************************************
52
54
  Copyright (c) Microsoft Corporation.
@@ -155,6 +157,28 @@ const reporter = (options, outputOptions, info) => {
155
157
  logger__default["default"].log(`${chalk__default["default"].yellow(info.fileName)} ${chalk__default["default"].green(info.bundleSize)} [ gzip: ${chalk__default["default"].green(info.gzipSize)} ]`);
156
158
  return '';
157
159
  };
160
+ const stringExcludeDom = [
161
+ '**/*.ts',
162
+ '**/*.tsx',
163
+ '**/*.js',
164
+ '**/*.jsx',
165
+ '**/*.json',
166
+ '**/*.css',
167
+ '**/*.scss',
168
+ '**/*.webp',
169
+ '**/*.gif',
170
+ '**/*.png',
171
+ '**/*.jpeg',
172
+ '**/*.jpg',
173
+ '**/*.svg',
174
+ ];
175
+ const stringExcludeNode = [
176
+ '**/*.ts',
177
+ '**/*.tsx',
178
+ '**/*.js',
179
+ '**/*.jsx',
180
+ '**/*.json',
181
+ ];
158
182
  class InnetJS {
159
183
  constructor({ projectFolder = process.env.PROJECT_FOLDER || '', publicFolder = process.env.PUBLIC_FOLDER || 'public', buildFolder = process.env.BUILD_FOLDER || 'build', srcFolder = process.env.SRC_FOLDER || 'src', sourcemap = process.env.SOURCEMAP ? process.env.SOURCEMAP === 'true' : false, cssModules = process.env.CSS_MODULES ? process.env.CSS_MODULES === 'true' : true, cssInJs = process.env.CSS_IN_JS ? process.env.CSS_IN_JS === 'true' : true, sslKey = process.env.SSL_KEY || 'localhost.key', sslCrt = process.env.SSL_CRT || 'localhost.crt', proxy = process.env.PROXY || '', port = process.env.PORT ? +process.env.PORT : 3000, api = process.env.API || '*', } = {}) {
160
184
  this.projectFolder = path__default["default"].resolve(projectFolder);
@@ -248,27 +272,13 @@ class InnetJS {
248
272
  moduleDirectories: [path__default["default"].resolve(this.buildFolder, 'node_modules')]
249
273
  }), string({
250
274
  include: '**/*.*',
251
- exclude: [
252
- '**/*.ts',
253
- '**/*.tsx',
254
- '**/*.js',
255
- '**/*.jsx',
256
- '**/*.json',
257
- ]
275
+ exclude: stringExcludeNode,
258
276
  }));
259
277
  }
260
278
  else {
261
- inputOptions.plugins.push(pluginNodeResolve.nodeResolve(), string({
279
+ inputOptions.plugins.push(pluginNodeResolve.nodeResolve(), image__default["default"](), string({
262
280
  include: '**/*.*',
263
- exclude: [
264
- '**/*.ts',
265
- '**/*.tsx',
266
- '**/*.js',
267
- '**/*.jsx',
268
- '**/*.json',
269
- '**/*.css',
270
- '**/*.scss',
271
- ]
281
+ exclude: stringExcludeDom,
272
282
  }), styles__default["default"]({
273
283
  mode: this.cssInJs ? 'inject' : 'extract',
274
284
  url: true,
@@ -344,13 +354,7 @@ class InnetJS {
344
354
  moduleDirectories: [path__default["default"].resolve(this.srcFolder, 'node_modules')]
345
355
  }), string({
346
356
  include: '**/*.*',
347
- exclude: [
348
- '**/*.ts',
349
- '**/*.tsx',
350
- '**/*.js',
351
- '**/*.jsx',
352
- '**/*.json',
353
- ]
357
+ exclude: stringExcludeNode,
354
358
  }), this.createServer(options.external));
355
359
  }
356
360
  else {
@@ -365,17 +369,9 @@ class InnetJS {
365
369
  ? fs__default["default"].readFileSync(this.sslCrt)
366
370
  : undefined;
367
371
  options.output.format = 'es';
368
- options.plugins.push(pluginNodeResolve.nodeResolve(), string({
372
+ options.plugins.push(pluginNodeResolve.nodeResolve(), image__default["default"](), string({
369
373
  include: '**/*.*',
370
- exclude: [
371
- '**/*.ts',
372
- '**/*.tsx',
373
- '**/*.js',
374
- '**/*.jsx',
375
- '**/*.json',
376
- '**/*.css',
377
- '**/*.scss',
378
- ]
374
+ exclude: stringExcludeDom,
379
375
  }), styles__default["default"]({
380
376
  mode: this.cssInJs ? 'inject' : 'extract',
381
377
  url: true,
@@ -536,7 +532,7 @@ class InnetJS {
536
532
  }
537
533
  }
538
534
 
539
- var version = "2.0.0";
535
+ var version = "2.0.1";
540
536
 
541
537
  require('dotenv').config();
542
538
  const innetJS = new InnetJS();
@@ -0,0 +1,39 @@
1
+ declare module '*.scss' {
2
+ const content: Record<string, string>
3
+ export default content
4
+ }
5
+
6
+ declare module '*.css' {
7
+ const content: Record<string, string>
8
+ export default content
9
+ }
10
+
11
+ declare module '*.svg' {
12
+ const content: string
13
+ export default content
14
+ }
15
+
16
+ declare module '*.jpg' {
17
+ const content: string
18
+ export default content
19
+ }
20
+
21
+ declare module '*.jpeg' {
22
+ const content: string
23
+ export default content
24
+ }
25
+
26
+ declare module '*.png' {
27
+ const content: string
28
+ export default content
29
+ }
30
+
31
+ declare module '*.gif' {
32
+ const content: string
33
+ export default content
34
+ }
35
+
36
+ declare module '*.webp' {
37
+ const content: string
38
+ export default content
39
+ }
package/index.es6.js CHANGED
@@ -20,6 +20,7 @@ import proxy from 'express-http-proxy';
20
20
  import selector from 'cli-select';
21
21
  import jsx from 'rollup-plugin-innet-jsx';
22
22
  import filesize from 'rollup-plugin-filesize';
23
+ import image from '@rollup/plugin-image';
23
24
  import { Parse } from 'unzipper';
24
25
 
25
26
  /******************************************************************************
@@ -129,6 +130,28 @@ const reporter = (options, outputOptions, info) => {
129
130
  logger.log(`${chalk.yellow(info.fileName)} ${chalk.green(info.bundleSize)} [ gzip: ${chalk.green(info.gzipSize)} ]`);
130
131
  return '';
131
132
  };
133
+ const stringExcludeDom = [
134
+ '**/*.ts',
135
+ '**/*.tsx',
136
+ '**/*.js',
137
+ '**/*.jsx',
138
+ '**/*.json',
139
+ '**/*.css',
140
+ '**/*.scss',
141
+ '**/*.webp',
142
+ '**/*.gif',
143
+ '**/*.png',
144
+ '**/*.jpeg',
145
+ '**/*.jpg',
146
+ '**/*.svg',
147
+ ];
148
+ const stringExcludeNode = [
149
+ '**/*.ts',
150
+ '**/*.tsx',
151
+ '**/*.js',
152
+ '**/*.jsx',
153
+ '**/*.json',
154
+ ];
132
155
  class InnetJS {
133
156
  constructor({ projectFolder = process.env.PROJECT_FOLDER || '', publicFolder = process.env.PUBLIC_FOLDER || 'public', buildFolder = process.env.BUILD_FOLDER || 'build', srcFolder = process.env.SRC_FOLDER || 'src', sourcemap = process.env.SOURCEMAP ? process.env.SOURCEMAP === 'true' : false, cssModules = process.env.CSS_MODULES ? process.env.CSS_MODULES === 'true' : true, cssInJs = process.env.CSS_IN_JS ? process.env.CSS_IN_JS === 'true' : true, sslKey = process.env.SSL_KEY || 'localhost.key', sslCrt = process.env.SSL_CRT || 'localhost.crt', proxy = process.env.PROXY || '', port = process.env.PORT ? +process.env.PORT : 3000, api = process.env.API || '*', } = {}) {
134
157
  this.projectFolder = path$1.resolve(projectFolder);
@@ -222,27 +245,13 @@ class InnetJS {
222
245
  moduleDirectories: [path$1.resolve(this.buildFolder, 'node_modules')]
223
246
  }), string({
224
247
  include: '**/*.*',
225
- exclude: [
226
- '**/*.ts',
227
- '**/*.tsx',
228
- '**/*.js',
229
- '**/*.jsx',
230
- '**/*.json',
231
- ]
248
+ exclude: stringExcludeNode,
232
249
  }));
233
250
  }
234
251
  else {
235
- inputOptions.plugins.push(nodeResolve(), string({
252
+ inputOptions.plugins.push(nodeResolve(), image(), string({
236
253
  include: '**/*.*',
237
- exclude: [
238
- '**/*.ts',
239
- '**/*.tsx',
240
- '**/*.js',
241
- '**/*.jsx',
242
- '**/*.json',
243
- '**/*.css',
244
- '**/*.scss',
245
- ]
254
+ exclude: stringExcludeDom,
246
255
  }), styles({
247
256
  mode: this.cssInJs ? 'inject' : 'extract',
248
257
  url: true,
@@ -318,13 +327,7 @@ class InnetJS {
318
327
  moduleDirectories: [path$1.resolve(this.srcFolder, 'node_modules')]
319
328
  }), string({
320
329
  include: '**/*.*',
321
- exclude: [
322
- '**/*.ts',
323
- '**/*.tsx',
324
- '**/*.js',
325
- '**/*.jsx',
326
- '**/*.json',
327
- ]
330
+ exclude: stringExcludeNode,
328
331
  }), this.createServer(options.external));
329
332
  }
330
333
  else {
@@ -339,17 +342,9 @@ class InnetJS {
339
342
  ? fs.readFileSync(this.sslCrt)
340
343
  : undefined;
341
344
  options.output.format = 'es';
342
- options.plugins.push(nodeResolve(), string({
345
+ options.plugins.push(nodeResolve(), image(), string({
343
346
  include: '**/*.*',
344
- exclude: [
345
- '**/*.ts',
346
- '**/*.tsx',
347
- '**/*.js',
348
- '**/*.jsx',
349
- '**/*.json',
350
- '**/*.css',
351
- '**/*.scss',
352
- ]
347
+ exclude: stringExcludeDom,
353
348
  }), styles({
354
349
  mode: this.cssInJs ? 'inject' : 'extract',
355
350
  url: true,
package/index.js CHANGED
@@ -22,6 +22,7 @@ var proxy = require('express-http-proxy');
22
22
  var selector = require('cli-select');
23
23
  var jsx = require('rollup-plugin-innet-jsx');
24
24
  var filesize = require('rollup-plugin-filesize');
25
+ var image = require('@rollup/plugin-image');
25
26
  var unzipper = require('unzipper');
26
27
 
27
28
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -45,6 +46,7 @@ var proxy__default = /*#__PURE__*/_interopDefaultLegacy(proxy);
45
46
  var selector__default = /*#__PURE__*/_interopDefaultLegacy(selector);
46
47
  var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx);
47
48
  var filesize__default = /*#__PURE__*/_interopDefaultLegacy(filesize);
49
+ var image__default = /*#__PURE__*/_interopDefaultLegacy(image);
48
50
 
49
51
  /******************************************************************************
50
52
  Copyright (c) Microsoft Corporation.
@@ -153,6 +155,28 @@ const reporter = (options, outputOptions, info) => {
153
155
  logger__default["default"].log(`${chalk__default["default"].yellow(info.fileName)} ${chalk__default["default"].green(info.bundleSize)} [ gzip: ${chalk__default["default"].green(info.gzipSize)} ]`);
154
156
  return '';
155
157
  };
158
+ const stringExcludeDom = [
159
+ '**/*.ts',
160
+ '**/*.tsx',
161
+ '**/*.js',
162
+ '**/*.jsx',
163
+ '**/*.json',
164
+ '**/*.css',
165
+ '**/*.scss',
166
+ '**/*.webp',
167
+ '**/*.gif',
168
+ '**/*.png',
169
+ '**/*.jpeg',
170
+ '**/*.jpg',
171
+ '**/*.svg',
172
+ ];
173
+ const stringExcludeNode = [
174
+ '**/*.ts',
175
+ '**/*.tsx',
176
+ '**/*.js',
177
+ '**/*.jsx',
178
+ '**/*.json',
179
+ ];
156
180
  class InnetJS {
157
181
  constructor({ projectFolder = process.env.PROJECT_FOLDER || '', publicFolder = process.env.PUBLIC_FOLDER || 'public', buildFolder = process.env.BUILD_FOLDER || 'build', srcFolder = process.env.SRC_FOLDER || 'src', sourcemap = process.env.SOURCEMAP ? process.env.SOURCEMAP === 'true' : false, cssModules = process.env.CSS_MODULES ? process.env.CSS_MODULES === 'true' : true, cssInJs = process.env.CSS_IN_JS ? process.env.CSS_IN_JS === 'true' : true, sslKey = process.env.SSL_KEY || 'localhost.key', sslCrt = process.env.SSL_CRT || 'localhost.crt', proxy = process.env.PROXY || '', port = process.env.PORT ? +process.env.PORT : 3000, api = process.env.API || '*', } = {}) {
158
182
  this.projectFolder = path__default["default"].resolve(projectFolder);
@@ -246,27 +270,13 @@ class InnetJS {
246
270
  moduleDirectories: [path__default["default"].resolve(this.buildFolder, 'node_modules')]
247
271
  }), string({
248
272
  include: '**/*.*',
249
- exclude: [
250
- '**/*.ts',
251
- '**/*.tsx',
252
- '**/*.js',
253
- '**/*.jsx',
254
- '**/*.json',
255
- ]
273
+ exclude: stringExcludeNode,
256
274
  }));
257
275
  }
258
276
  else {
259
- inputOptions.plugins.push(pluginNodeResolve.nodeResolve(), string({
277
+ inputOptions.plugins.push(pluginNodeResolve.nodeResolve(), image__default["default"](), string({
260
278
  include: '**/*.*',
261
- exclude: [
262
- '**/*.ts',
263
- '**/*.tsx',
264
- '**/*.js',
265
- '**/*.jsx',
266
- '**/*.json',
267
- '**/*.css',
268
- '**/*.scss',
269
- ]
279
+ exclude: stringExcludeDom,
270
280
  }), styles__default["default"]({
271
281
  mode: this.cssInJs ? 'inject' : 'extract',
272
282
  url: true,
@@ -342,13 +352,7 @@ class InnetJS {
342
352
  moduleDirectories: [path__default["default"].resolve(this.srcFolder, 'node_modules')]
343
353
  }), string({
344
354
  include: '**/*.*',
345
- exclude: [
346
- '**/*.ts',
347
- '**/*.tsx',
348
- '**/*.js',
349
- '**/*.jsx',
350
- '**/*.json',
351
- ]
355
+ exclude: stringExcludeNode,
352
356
  }), this.createServer(options.external));
353
357
  }
354
358
  else {
@@ -363,17 +367,9 @@ class InnetJS {
363
367
  ? fs__default["default"].readFileSync(this.sslCrt)
364
368
  : undefined;
365
369
  options.output.format = 'es';
366
- options.plugins.push(pluginNodeResolve.nodeResolve(), string({
370
+ options.plugins.push(pluginNodeResolve.nodeResolve(), image__default["default"](), string({
367
371
  include: '**/*.*',
368
- exclude: [
369
- '**/*.ts',
370
- '**/*.tsx',
371
- '**/*.js',
372
- '**/*.jsx',
373
- '**/*.json',
374
- '**/*.css',
375
- '**/*.scss',
376
- ]
372
+ exclude: stringExcludeDom,
377
373
  }), styles__default["default"]({
378
374
  mode: this.cssInJs ? 'inject' : 'extract',
379
375
  url: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innetjs",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "CLI for innet boilerplate",
5
5
  "homepage": "https://github.com/d8corp/innetjs",
6
6
  "author": "Mikhail Lysikov <d8corp@mail.ru>",
@@ -33,6 +33,7 @@
33
33
  "dependencies": {
34
34
  "@cantinc/logger": "^1.1.0",
35
35
  "@rollup/plugin-commonjs": "^22.0.2",
36
+ "@rollup/plugin-image": "^2.1.1",
36
37
  "@rollup/plugin-json": "^4.1.0",
37
38
  "@rollup/plugin-node-resolve": "^13.3.0",
38
39
  "autoprefixer": "^10.4.8",
@@ -49,7 +50,6 @@
49
50
  "rollup": "^2.77.2",
50
51
  "rollup-plugin-filesize": "^9.1.2",
51
52
  "rollup-plugin-innet-jsx": "^1.3.0",
52
- "rollup-plugin-lit-css": "^4.0.0",
53
53
  "rollup-plugin-livereload": "^2.0.5",
54
54
  "rollup-plugin-string": "^3.0.0",
55
55
  "rollup-plugin-styles": "^4.0.0",