@dword-design/base 8.7.1 → 8.7.3

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.
@@ -87,6 +87,9 @@ Object {
87
87
  "run": "yarn --frozen-lockfile",
88
88
  },
89
89
  Object {
90
+ "env": Object {
91
+ "GH_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
92
+ },
90
93
  "run": "yarn test",
91
94
  },
92
95
  Object {
@@ -179,6 +182,297 @@ Object {
179
182
  "run": "yarn --frozen-lockfile",
180
183
  },
181
184
  Object {
185
+ "env": Object {
186
+ "GH_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
187
+ },
188
+ "run": "yarn test",
189
+ },
190
+ Object {
191
+ "if": "failure()",
192
+ "uses": "actions/upload-artifact@v3",
193
+ "with": Object {
194
+ "name": "Image Snapshot Diffs",
195
+ "path": "**/__image_snapshots__/__diff_output__",
196
+ },
197
+ },
198
+ Object {
199
+ "uses": "codecov/codecov-action@v2",
200
+ "with": Object {
201
+ "fail_ci_if_error": true,
202
+ "token": "\${{ secrets.CODECOV_TOKEN }}",
203
+ },
204
+ },
205
+ Object {
206
+ "run": "yarn checkUnknownFiles",
207
+ },
208
+ Object {
209
+ "env": Object {
210
+ "GITHUB_REPOSITORY": "\${{ secrets.GITHUB_REPOSITORY }}",
211
+ "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
212
+ },
213
+ "name": "Push changed files",
214
+ "run": "yarn dw-ci push-changed-files",
215
+ },
216
+ Object {
217
+ "env": Object {
218
+ "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
219
+ "NPM_TOKEN": "\${{ secrets.NPM_TOKEN }}",
220
+ },
221
+ "if": "github.ref == 'refs/heads/master'",
222
+ "name": "Release",
223
+ "run": "yarn semantic-release",
224
+ },
225
+ ],
226
+ },
227
+ },
228
+ "name": "build",
229
+ "on": Object {
230
+ "pull_request": Object {},
231
+ "push": Object {
232
+ "branches": Array [
233
+ "master",
234
+ ],
235
+ },
236
+ },
237
+ }
238
+ `;
239
+
240
+ exports[`index package.json 1`] = `
241
+ Object {
242
+ "jobs": Object {
243
+ "cancel-existing": Object {
244
+ "if": "!contains(github.event.head_commit.message, '[skip ci]')",
245
+ "runs-on": "ubuntu-latest",
246
+ "steps": Array [
247
+ Object {
248
+ "env": Object {
249
+ "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
250
+ },
251
+ "uses": "rokroskar/workflow-run-cleanup-action@v0.3.3",
252
+ },
253
+ ],
254
+ },
255
+ "release": Object {
256
+ "needs": "test",
257
+ "runs-on": "ubuntu-latest",
258
+ "steps": Array [
259
+ Object {
260
+ "uses": "actions/checkout@v3",
261
+ "with": Object {
262
+ "lfs": true,
263
+ "ref": "\${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.head.ref || '' }}",
264
+ },
265
+ },
266
+ Object {
267
+ "uses": "actions/setup-node@v3",
268
+ "with": Object {
269
+ "node-version": 14,
270
+ },
271
+ },
272
+ Object {
273
+ "run": "git config --global user.email \\"actions@github.com\\"",
274
+ },
275
+ Object {
276
+ "run": "git config --global user.name \\"GitHub Actions\\"",
277
+ },
278
+ Object {
279
+ "run": "yarn --frozen-lockfile",
280
+ },
281
+ Object {
282
+ "run": "yarn checkUnknownFiles",
283
+ },
284
+ Object {
285
+ "run": "yarn lint",
286
+ },
287
+ Object {
288
+ "env": Object {
289
+ "GITHUB_REPOSITORY": "\${{ secrets.GITHUB_REPOSITORY }}",
290
+ "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
291
+ },
292
+ "name": "Push changed files",
293
+ "run": "yarn dw-ci push-changed-files",
294
+ },
295
+ Object {
296
+ "env": Object {
297
+ "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
298
+ "NPM_TOKEN": "\${{ secrets.NPM_TOKEN }}",
299
+ },
300
+ "if": "github.ref == 'refs/heads/master'",
301
+ "name": "Release",
302
+ "run": "yarn semantic-release",
303
+ },
304
+ ],
305
+ },
306
+ "test": Object {
307
+ "needs": "cancel-existing",
308
+ "runs-on": "\${{ matrix.os }}",
309
+ "steps": Array [
310
+ Object {
311
+ "uses": "actions/checkout@v3",
312
+ "with": Object {
313
+ "fetch-depth": 0,
314
+ "lfs": true,
315
+ },
316
+ },
317
+ Object {
318
+ "uses": "actions/setup-node@v3",
319
+ "with": Object {
320
+ "node-version": "\${{ matrix.node }}",
321
+ },
322
+ },
323
+ Object {
324
+ "run": "yarn --frozen-lockfile",
325
+ },
326
+ Object {
327
+ "env": Object {
328
+ "GH_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
329
+ },
330
+ "run": "yarn test",
331
+ },
332
+ Object {
333
+ "if": "failure()",
334
+ "uses": "actions/upload-artifact@v3",
335
+ "with": Object {
336
+ "name": "Image Snapshot Diffs",
337
+ "path": "**/__image_snapshots__/__diff_output__",
338
+ },
339
+ },
340
+ Object {
341
+ "if": "matrix.os == 'ubuntu-latest' && matrix.node == 14",
342
+ "uses": "codecov/codecov-action@v2",
343
+ "with": Object {
344
+ "fail_ci_if_error": true,
345
+ "token": "\${{ secrets.CODECOV_TOKEN }}",
346
+ },
347
+ },
348
+ ],
349
+ "strategy": Object {
350
+ "matrix": Object {
351
+ "include": Array [
352
+ Object {
353
+ "node": 12,
354
+ "os": "ubuntu-latest",
355
+ },
356
+ Object {
357
+ "node": 14,
358
+ "os": "ubuntu-latest",
359
+ },
360
+ Object {
361
+ "os": "macos-latest",
362
+ "version": 14,
363
+ },
364
+ Object {
365
+ "os": "windows-latest",
366
+ "version": 14,
367
+ },
368
+ ],
369
+ },
370
+ },
371
+ },
372
+ },
373
+ "name": "build",
374
+ "on": Object {
375
+ "pull_request": Object {},
376
+ "push": Object {
377
+ "branches": Array [
378
+ "master",
379
+ ],
380
+ },
381
+ },
382
+ }
383
+ `;
384
+
385
+ exports[`index package.json same path as .env.schema.json 1`] = `
386
+ Object {
387
+ "jobs": Object {
388
+ "cancel-existing": Object {
389
+ "if": "!contains(github.event.head_commit.message, '[skip ci]')",
390
+ "runs-on": "ubuntu-latest",
391
+ "steps": Array [
392
+ Object {
393
+ "env": Object {
394
+ "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
395
+ },
396
+ "uses": "rokroskar/workflow-run-cleanup-action@v0.3.3",
397
+ },
398
+ ],
399
+ },
400
+ "release": Object {
401
+ "needs": "test",
402
+ "runs-on": "ubuntu-latest",
403
+ "steps": Array [
404
+ Object {
405
+ "uses": "actions/checkout@v3",
406
+ "with": Object {
407
+ "lfs": true,
408
+ "ref": "\${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.head.ref || '' }}",
409
+ },
410
+ },
411
+ Object {
412
+ "uses": "actions/setup-node@v3",
413
+ "with": Object {
414
+ "node-version": 14,
415
+ },
416
+ },
417
+ Object {
418
+ "run": "git config --global user.email \\"actions@github.com\\"",
419
+ },
420
+ Object {
421
+ "run": "git config --global user.name \\"GitHub Actions\\"",
422
+ },
423
+ Object {
424
+ "run": "yarn --frozen-lockfile",
425
+ },
426
+ Object {
427
+ "run": "yarn checkUnknownFiles",
428
+ },
429
+ Object {
430
+ "run": "yarn lint",
431
+ },
432
+ Object {
433
+ "env": Object {
434
+ "GITHUB_REPOSITORY": "\${{ secrets.GITHUB_REPOSITORY }}",
435
+ "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
436
+ },
437
+ "name": "Push changed files",
438
+ "run": "yarn dw-ci push-changed-files",
439
+ },
440
+ Object {
441
+ "env": Object {
442
+ "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
443
+ "NPM_TOKEN": "\${{ secrets.NPM_TOKEN }}",
444
+ },
445
+ "if": "github.ref == 'refs/heads/master'",
446
+ "name": "Release",
447
+ "run": "yarn semantic-release",
448
+ },
449
+ ],
450
+ },
451
+ "test": Object {
452
+ "needs": "cancel-existing",
453
+ "runs-on": "\${{ matrix.os }}",
454
+ "steps": Array [
455
+ Object {
456
+ "uses": "actions/checkout@v3",
457
+ "with": Object {
458
+ "fetch-depth": 0,
459
+ "lfs": true,
460
+ },
461
+ },
462
+ Object {
463
+ "uses": "actions/setup-node@v3",
464
+ "with": Object {
465
+ "node-version": "\${{ matrix.node }}",
466
+ },
467
+ },
468
+ Object {
469
+ "run": "yarn --frozen-lockfile",
470
+ },
471
+ Object {
472
+ "env": Object {
473
+ "GH_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
474
+ "TEST_FOO": "\${{ secrets.TEST_FOO }}",
475
+ },
182
476
  "run": "yarn test",
183
477
  },
184
478
  Object {
@@ -190,15 +484,97 @@ Object {
190
484
  },
191
485
  },
192
486
  Object {
487
+ "if": "matrix.os == 'ubuntu-latest' && matrix.node == 14",
193
488
  "uses": "codecov/codecov-action@v2",
194
489
  "with": Object {
195
490
  "fail_ci_if_error": true,
196
491
  "token": "\${{ secrets.CODECOV_TOKEN }}",
197
492
  },
198
493
  },
494
+ ],
495
+ "strategy": Object {
496
+ "matrix": Object {
497
+ "include": Array [
498
+ Object {
499
+ "node": 12,
500
+ "os": "ubuntu-latest",
501
+ },
502
+ Object {
503
+ "node": 14,
504
+ "os": "ubuntu-latest",
505
+ },
506
+ Object {
507
+ "os": "macos-latest",
508
+ "version": 14,
509
+ },
510
+ Object {
511
+ "os": "windows-latest",
512
+ "version": 14,
513
+ },
514
+ ],
515
+ },
516
+ },
517
+ },
518
+ },
519
+ "name": "build",
520
+ "on": Object {
521
+ "pull_request": Object {},
522
+ "push": Object {
523
+ "branches": Array [
524
+ "master",
525
+ ],
526
+ },
527
+ },
528
+ }
529
+ `;
530
+
531
+ exports[`index subdir 1`] = `
532
+ Object {
533
+ "jobs": Object {
534
+ "cancel-existing": Object {
535
+ "if": "!contains(github.event.head_commit.message, '[skip ci]')",
536
+ "runs-on": "ubuntu-latest",
537
+ "steps": Array [
538
+ Object {
539
+ "env": Object {
540
+ "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
541
+ },
542
+ "uses": "rokroskar/workflow-run-cleanup-action@v0.3.3",
543
+ },
544
+ ],
545
+ },
546
+ "release": Object {
547
+ "needs": "test",
548
+ "runs-on": "ubuntu-latest",
549
+ "steps": Array [
550
+ Object {
551
+ "uses": "actions/checkout@v3",
552
+ "with": Object {
553
+ "lfs": true,
554
+ "ref": "\${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.head.ref || '' }}",
555
+ },
556
+ },
557
+ Object {
558
+ "uses": "actions/setup-node@v3",
559
+ "with": Object {
560
+ "node-version": 14,
561
+ },
562
+ },
563
+ Object {
564
+ "run": "git config --global user.email \\"actions@github.com\\"",
565
+ },
566
+ Object {
567
+ "run": "git config --global user.name \\"GitHub Actions\\"",
568
+ },
569
+ Object {
570
+ "run": "yarn --frozen-lockfile",
571
+ },
199
572
  Object {
200
573
  "run": "yarn checkUnknownFiles",
201
574
  },
575
+ Object {
576
+ "run": "yarn lint",
577
+ },
202
578
  Object {
203
579
  "env": Object {
204
580
  "GITHUB_REPOSITORY": "\${{ secrets.GITHUB_REPOSITORY }}",
@@ -218,6 +594,69 @@ Object {
218
594
  },
219
595
  ],
220
596
  },
597
+ "test": Object {
598
+ "needs": "cancel-existing",
599
+ "runs-on": "\${{ matrix.os }}",
600
+ "steps": Array [
601
+ Object {
602
+ "uses": "actions/checkout@v3",
603
+ "with": Object {
604
+ "fetch-depth": 0,
605
+ "lfs": true,
606
+ },
607
+ },
608
+ Object {
609
+ "uses": "actions/setup-node@v3",
610
+ "with": Object {
611
+ "node-version": "\${{ matrix.node }}",
612
+ },
613
+ },
614
+ Object {
615
+ "run": "yarn --frozen-lockfile",
616
+ },
617
+ Object {
618
+ "run": "yarn test",
619
+ },
620
+ Object {
621
+ "if": "failure()",
622
+ "uses": "actions/upload-artifact@v3",
623
+ "with": Object {
624
+ "name": "Image Snapshot Diffs",
625
+ "path": "**/__image_snapshots__/__diff_output__",
626
+ },
627
+ },
628
+ Object {
629
+ "if": "matrix.os == 'ubuntu-latest' && matrix.node == 14",
630
+ "uses": "codecov/codecov-action@v2",
631
+ "with": Object {
632
+ "fail_ci_if_error": true,
633
+ "token": "\${{ secrets.CODECOV_TOKEN }}",
634
+ },
635
+ },
636
+ ],
637
+ "strategy": Object {
638
+ "matrix": Object {
639
+ "include": Array [
640
+ Object {
641
+ "node": 12,
642
+ "os": "ubuntu-latest",
643
+ },
644
+ Object {
645
+ "node": 14,
646
+ "os": "ubuntu-latest",
647
+ },
648
+ Object {
649
+ "os": "macos-latest",
650
+ "version": 14,
651
+ },
652
+ Object {
653
+ "os": "windows-latest",
654
+ "version": 14,
655
+ },
656
+ ],
657
+ },
658
+ },
659
+ },
221
660
  },
222
661
  "name": "build",
223
662
  "on": Object {
@@ -269,6 +708,7 @@ Object {
269
708
  },
270
709
  Object {
271
710
  "env": Object {
711
+ "GH_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
272
712
  "TEST_BAR": "\${{ secrets.TEST_BAR }}",
273
713
  "TEST_FOO": "\${{ secrets.TEST_FOO }}",
274
714
  },
@@ -361,6 +801,9 @@ Object {
361
801
  "run": "yarn --frozen-lockfile",
362
802
  },
363
803
  Object {
804
+ "env": Object {
805
+ "GH_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
806
+ },
364
807
  "run": "yarn test",
365
808
  },
366
809
  Object {
@@ -15,11 +15,25 @@ var _constantCase = require("constant-case");
15
15
 
16
16
  var _findUp = _interopRequireDefault(require("find-up"));
17
17
 
18
+ var _fsExtra = require("fs-extra");
19
+
20
+ var _path = _interopRequireDefault(require("path"));
21
+
18
22
  var _ref, _ref2, _ref3, _envVariableNames;
19
23
 
20
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
25
 
22
- const envSchemaPath = _findUp.default.sync('.env.schema.json');
26
+ const envSchemaPath = _findUp.default.sync(path => {
27
+ if ((0, _fsExtra.existsSync)('.env.schema.json')) {
28
+ return '.env.schema.json';
29
+ }
30
+
31
+ if ((0, _fsExtra.existsSync)(_path.default.join(path, 'package.json'))) {
32
+ return _findUp.default.stop;
33
+ }
34
+
35
+ return undefined;
36
+ });
23
37
 
24
38
  const envVariableNames = (_ref = (_ref2 = envSchemaPath ? require(envSchemaPath) : {}, (0, _keys.default)(_ref2)), (0, _map.default)(name => {
25
39
  var _name;
@@ -27,10 +41,10 @@ const envVariableNames = (_ref = (_ref2 = envSchemaPath ? require(envSchemaPath)
27
41
  return `TEST_${(_name = name, (0, _constantCase.constantCase)(_name))}`;
28
42
  })(_ref));
29
43
  var _default = [{
30
- run: 'yarn test',
31
- ...(envVariableNames.length > 0 ? {
32
- env: (_ref3 = (_envVariableNames = envVariableNames, (0, _map.default)(name => [name, `\${{ secrets.${name} }}`])(_envVariableNames)), (0, _fromPairs.default)(_ref3))
33
- } : {})
44
+ env: { ...(_ref3 = (_envVariableNames = envVariableNames, (0, _map.default)(name => [name, `\${{ secrets.${name} }}`])(_envVariableNames)), (0, _fromPairs.default)(_ref3)),
45
+ GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
46
+ },
47
+ run: 'yarn test'
34
48
  }, {
35
49
  if: 'failure()',
36
50
  uses: 'actions/upload-artifact@v3',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base",
3
- "version": "8.7.1",
3
+ "version": "8.7.3",
4
4
  "description": "Base package for projects.",
5
5
  "repository": "dword-design/base",
6
6
  "funding": "https://github.com/sponsors/dword-design",