@sasjs/cli 6.27.3 → 6.29.0

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.
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ var __generator = (this && this.__generator) || function (thisArg, body) {
45
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
46
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
47
+ function verb(n) { return function (v) { return step([n, v]); }; }
48
+ function step(op) {
49
+ if (f) throw new TypeError("Generator is already executing.");
50
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
51
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
52
+ if (y = 0, t) op = [op[0] & 2, t.value];
53
+ switch (op[0]) {
54
+ case 0: case 1: t = op; break;
55
+ case 4: _.label++; return { value: op[1], done: false };
56
+ case 5: _.label++; y = op[1]; op = [0]; continue;
57
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
58
+ default:
59
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
60
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
61
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
62
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
63
+ if (t[2]) _.ops.pop();
64
+ _.trys.pop(); continue;
65
+ }
66
+ op = body.call(thisArg, _);
67
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
68
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
69
+ }
70
+ };
71
+ var __rest = (this && this.__rest) || function (s, e) {
72
+ var t = {};
73
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
74
+ t[p] = s[p];
75
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
76
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
77
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
78
+ t[p[i]] = s[p[i]];
79
+ }
80
+ return t;
81
+ };
82
+ Object.defineProperty(exports, "__esModule", { value: true });
83
+ var promises_1 = require("fs/promises");
84
+ var os = __importStar(require("os"));
85
+ var path = __importStar(require("path"));
86
+ var lint_1 = require("@sasjs/lint");
87
+ var utils_1 = require("@sasjs/utils");
88
+ var createLintConfigFile_1 = require("../createLintConfigFile");
89
+ /**
90
+ * The file this writes is the first thing a new project has to edit, and the
91
+ * only place its settings are described: it is read as strict JSON, so it cannot
92
+ * carry comments, and `$schema` is what gives an editor the description of each
93
+ * setting where it is written.
94
+ */
95
+ describe('createLintConfigFile', function () {
96
+ var originalProjectDir = process.projectDir;
97
+ var projectDir;
98
+ beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
99
+ return __generator(this, function (_a) {
100
+ switch (_a.label) {
101
+ case 0:
102
+ projectDir = path.join(os.tmpdir(), "sasjs-lint-config-".concat(Date.now(), "-").concat(Math.random().toString(36).slice(2)));
103
+ return [4 /*yield*/, (0, utils_1.createFolder)(projectDir)];
104
+ case 1:
105
+ _a.sent();
106
+ process.projectDir = projectDir;
107
+ return [2 /*return*/];
108
+ }
109
+ });
110
+ }); });
111
+ afterEach(function () {
112
+ process.projectDir = originalProjectDir;
113
+ });
114
+ it('writes every default setting, with the schema', function () { return __awaiter(void 0, void 0, void 0, function () {
115
+ var written, _a, _b, _schema, settings;
116
+ return __generator(this, function (_c) {
117
+ switch (_c.label) {
118
+ case 0: return [4 /*yield*/, (0, createLintConfigFile_1.createLintConfigFile)('.')];
119
+ case 1:
120
+ _c.sent();
121
+ _b = (_a = JSON).parse;
122
+ return [4 /*yield*/, (0, promises_1.readFile)(path.join(projectDir, '.sasjslint'), 'utf-8')];
123
+ case 2:
124
+ written = _b.apply(_a, [_c.sent()]);
125
+ expect(written.$schema).toEqual('https://cli.sasjs.io/sasjslint-schema.json');
126
+ _schema = written.$schema, settings = __rest(written, ["$schema"]);
127
+ expect(settings).toEqual(lint_1.DefaultLintConfiguration);
128
+ return [2 /*return*/];
129
+ }
130
+ });
131
+ }); });
132
+ });
@@ -585,9 +585,11 @@ var verifyPackageJsonContent = function () {
585
585
  case 2:
586
586
  packageJsonContent = _a.sent();
587
587
  packageJson = JSON.parse(packageJsonContent);
588
- expect(parentFolderName.includes('minimal')
589
- ? packageJson.devDependencies
590
- : packageJson.dependencies).toEqual(expect.objectContaining({ '@sasjs/core': expect.anything() }));
588
+ // Which map the seed app declares its SASjs dependency in is the seed's
589
+ // business - a web app carries @sasjs/core as a devDependency (it compiles
590
+ // the macros in) while the jobs template installs it as a dependency. What
591
+ // this asserts is that the template brings the macros with it at all.
592
+ expect(__assign(__assign({}, packageJson.devDependencies), packageJson.dependencies)).toEqual(expect.objectContaining({ '@sasjs/core': expect.anything() }));
591
593
  return [2 /*return*/];
592
594
  }
593
595
  });
package/package.json CHANGED
@@ -125,5 +125,5 @@
125
125
  "ws": "8.21.0",
126
126
  "nanoid": "3.3.18"
127
127
  },
128
- "version": "6.27.3"
128
+ "version": "6.29.0"
129
129
  }