@stencil/angular-output-target 0.0.1-dev.11735332610.1971f219 → 0.0.1-dev.11741888614.1fd07d67
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/dist/generate-angular-component.js +1 -1
- package/dist/index.cjs.js +24 -18
- package/dist/index.js +1 -1
- package/package.json +5 -4
|
@@ -12,7 +12,7 @@ function createPropertyDeclaration(prop, type, inlinePropertyAsSetter = false) {
|
|
|
12
12
|
let eventName = prop.name;
|
|
13
13
|
if (/[-/]/.test(prop.name)) {
|
|
14
14
|
// If a member name includes a dash or a forward slash, we need to wrap it in quotes.
|
|
15
|
-
// https://github.com/
|
|
15
|
+
// https://github.com/stenciljs/output-targets/issues/212
|
|
16
16
|
eventName = `'${prop.name}'`;
|
|
17
17
|
}
|
|
18
18
|
if (inlinePropertyAsSetter) {
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var path = require('path');
|
|
4
6
|
var os = require('os');
|
|
5
7
|
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
11
|
+
|
|
6
12
|
const OutputTypes = {
|
|
7
13
|
Component: 'component',
|
|
8
14
|
Scam: 'scam',
|
|
@@ -52,18 +58,18 @@ function normalizePath(str) {
|
|
|
52
58
|
return str;
|
|
53
59
|
}
|
|
54
60
|
function relativeImport(pathFrom, pathTo, ext) {
|
|
55
|
-
let relativePath =
|
|
61
|
+
let relativePath = path__default["default"].relative(path__default["default"].dirname(pathFrom), path__default["default"].dirname(pathTo));
|
|
56
62
|
if (relativePath === '') {
|
|
57
63
|
relativePath = '.';
|
|
58
64
|
}
|
|
59
65
|
else if (relativePath[0] !== '.') {
|
|
60
66
|
relativePath = './' + relativePath;
|
|
61
67
|
}
|
|
62
|
-
return normalizePath(`${relativePath}/${
|
|
68
|
+
return normalizePath(`${relativePath}/${path__default["default"].basename(pathTo, ext)}`);
|
|
63
69
|
}
|
|
64
70
|
async function readPackageJson(config, rootDir) {
|
|
65
71
|
var _a;
|
|
66
|
-
const pkgJsonPath =
|
|
72
|
+
const pkgJsonPath = path__default["default"].join(rootDir, 'package.json');
|
|
67
73
|
let pkgJson;
|
|
68
74
|
try {
|
|
69
75
|
pkgJson = (await ((_a = config.sys) === null || _a === void 0 ? void 0 : _a.readFile(pkgJsonPath, 'utf8')));
|
|
@@ -151,7 +157,7 @@ function createPropertyDeclaration(prop, type, inlinePropertyAsSetter = false) {
|
|
|
151
157
|
let eventName = prop.name;
|
|
152
158
|
if (/[-/]/.test(prop.name)) {
|
|
153
159
|
// If a member name includes a dash or a forward slash, we need to wrap it in quotes.
|
|
154
|
-
// https://github.com/
|
|
160
|
+
// https://github.com/stenciljs/output-targets/issues/212
|
|
155
161
|
eventName = `'${prop.name}'`;
|
|
156
162
|
}
|
|
157
163
|
if (inlinePropertyAsSetter) {
|
|
@@ -352,7 +358,7 @@ async function generateValueAccessors(compilerCtx, components, outputTarget, con
|
|
|
352
358
|
if (!Array.isArray(outputTarget.valueAccessorConfigs) || outputTarget.valueAccessorConfigs.length === 0) {
|
|
353
359
|
return;
|
|
354
360
|
}
|
|
355
|
-
const targetDir =
|
|
361
|
+
const targetDir = path__default["default"].dirname(outputTarget.directivesProxyFile);
|
|
356
362
|
const normalizedValueAccessors = outputTarget.valueAccessorConfigs.reduce((allAccessors, va) => {
|
|
357
363
|
const elementSelectors = Array.isArray(va.elementSelectors) ? va.elementSelectors : [va.elementSelectors];
|
|
358
364
|
const type = va.type;
|
|
@@ -370,8 +376,8 @@ async function generateValueAccessors(compilerCtx, components, outputTarget, con
|
|
|
370
376
|
await Promise.all(Object.keys(normalizedValueAccessors).map(async (type) => {
|
|
371
377
|
const valueAccessorType = type; // Object.keys converts to string
|
|
372
378
|
const targetFileName = `${type}-value-accessor.ts`;
|
|
373
|
-
const targetFilePath =
|
|
374
|
-
const srcFilePath =
|
|
379
|
+
const targetFilePath = path__default["default"].join(targetDir, targetFileName);
|
|
380
|
+
const srcFilePath = path__default["default"].join(__dirname, '../resources/control-value-accessors/', targetFileName);
|
|
375
381
|
const srcFileContents = await compilerCtx.fs.readFile(srcFilePath);
|
|
376
382
|
const finalText = createValueAccessor(srcFileContents, normalizedValueAccessors[valueAccessorType], outputTarget.outputType);
|
|
377
383
|
await compilerCtx.fs.writeFile(targetFilePath, finalText);
|
|
@@ -391,14 +397,14 @@ function copyResources$1(config, resourcesFilesToCopy, directory) {
|
|
|
391
397
|
}
|
|
392
398
|
const copyTasks = resourcesFilesToCopy.map((rf) => {
|
|
393
399
|
return {
|
|
394
|
-
src:
|
|
395
|
-
dest:
|
|
400
|
+
src: path__default["default"].join(__dirname, '../resources/control-value-accessors/', rf),
|
|
401
|
+
dest: path__default["default"].join(directory, rf),
|
|
396
402
|
keepDirStructure: false,
|
|
397
403
|
warn: false,
|
|
398
404
|
ignore: [],
|
|
399
405
|
};
|
|
400
406
|
});
|
|
401
|
-
return config.sys.copy(copyTasks,
|
|
407
|
+
return config.sys.copy(copyTasks, path__default["default"].join(directory));
|
|
402
408
|
}
|
|
403
409
|
const VALUE_ACCESSOR_SELECTORS = `<VALUE_ACCESSOR_SELECTORS>`;
|
|
404
410
|
const VALUE_ACCESSOR_EVENT = `<VALUE_ACCESSOR_EVENT>`;
|
|
@@ -442,8 +448,8 @@ async function copyResources(config, outputTarget) {
|
|
|
442
448
|
if (!config.sys || !config.sys.copy || !config.sys.glob) {
|
|
443
449
|
throw new Error('stencil is not properly initialized at this step. Notify the developer');
|
|
444
450
|
}
|
|
445
|
-
const srcDirectory =
|
|
446
|
-
const destDirectory =
|
|
451
|
+
const srcDirectory = path__default["default"].join(__dirname, '..', 'angular-component-lib');
|
|
452
|
+
const destDirectory = path__default["default"].join(path__default["default"].dirname(outputTarget.directivesProxyFile), 'angular-component-lib');
|
|
447
453
|
return config.sys.copy([
|
|
448
454
|
{
|
|
449
455
|
src: srcDirectory,
|
|
@@ -455,8 +461,8 @@ async function copyResources(config, outputTarget) {
|
|
|
455
461
|
], srcDirectory);
|
|
456
462
|
}
|
|
457
463
|
function generateProxies(components, pkgData, outputTarget, rootDir) {
|
|
458
|
-
const distTypesDir =
|
|
459
|
-
const dtsFilePath =
|
|
464
|
+
const distTypesDir = path__default["default"].dirname(pkgData.types);
|
|
465
|
+
const dtsFilePath = path__default["default"].join(rootDir, distTypesDir, GENERATED_DTS);
|
|
460
466
|
const { outputType } = outputTarget;
|
|
461
467
|
const componentsTypeFile = relativeImport(outputTarget.directivesProxyFile, dtsFilePath, '.d.ts');
|
|
462
468
|
const includeSingleComponentAngularModules = outputType === OutputTypes.Scam;
|
|
@@ -582,11 +588,11 @@ function normalizeOutputTarget(config, outputTarget) {
|
|
|
582
588
|
if (outputTarget.directivesProxyFile == null) {
|
|
583
589
|
throw new Error('directivesProxyFile is required. Please set it in the Stencil config.');
|
|
584
590
|
}
|
|
585
|
-
if (outputTarget.directivesProxyFile && !
|
|
586
|
-
results.directivesProxyFile = normalizePath(
|
|
591
|
+
if (outputTarget.directivesProxyFile && !path__default["default"].isAbsolute(outputTarget.directivesProxyFile)) {
|
|
592
|
+
results.directivesProxyFile = normalizePath(path__default["default"].join(config.rootDir, outputTarget.directivesProxyFile));
|
|
587
593
|
}
|
|
588
|
-
if (outputTarget.directivesArrayFile && !
|
|
589
|
-
results.directivesArrayFile = normalizePath(
|
|
594
|
+
if (outputTarget.directivesArrayFile && !path__default["default"].isAbsolute(outputTarget.directivesArrayFile)) {
|
|
595
|
+
results.directivesArrayFile = normalizePath(path__default["default"].join(config.rootDir, outputTarget.directivesArrayFile));
|
|
590
596
|
}
|
|
591
597
|
if (outputTarget.includeSingleComponentAngularModules !== undefined) {
|
|
592
598
|
throw new Error("The 'includeSingleComponentAngularModules' option has been removed. Please use 'outputType' instead.");
|
package/dist/index.js
CHANGED
|
@@ -149,7 +149,7 @@ function createPropertyDeclaration(prop, type, inlinePropertyAsSetter = false) {
|
|
|
149
149
|
let eventName = prop.name;
|
|
150
150
|
if (/[-/]/.test(prop.name)) {
|
|
151
151
|
// If a member name includes a dash or a forward slash, we need to wrap it in quotes.
|
|
152
|
-
// https://github.com/
|
|
152
|
+
// https://github.com/stenciljs/output-targets/issues/212
|
|
153
153
|
eventName = `'${prop.name}'`;
|
|
154
154
|
}
|
|
155
155
|
if (inlinePropertyAsSetter) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/angular-output-target",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.11741888614.1fd07d67",
|
|
4
4
|
"description": "Angular output target for @stencil/core components.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -39,17 +39,18 @@
|
|
|
39
39
|
},
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|
|
42
|
-
"url": "git+https://github.com/
|
|
42
|
+
"url": "git+https://github.com/stenciljs/output-targets.git"
|
|
43
43
|
},
|
|
44
44
|
"author": "Ionic Team",
|
|
45
45
|
"homepage": "https://stenciljs.com/",
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"bugs": {
|
|
48
|
-
"url": "https://github.com/
|
|
48
|
+
"url": "https://github.com/stenciljs/output-targets/issues"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@angular/core": "8.2.14",
|
|
52
52
|
"@angular/forms": "8.2.14",
|
|
53
|
+
"@stencil/core": "^4.27.2",
|
|
53
54
|
"@types/node": "^18.0.0",
|
|
54
55
|
"npm-run-all2": "^6.2.4",
|
|
55
56
|
"rimraf": "^5.0.0",
|
|
@@ -60,5 +61,5 @@
|
|
|
60
61
|
"peerDependencies": {
|
|
61
62
|
"@stencil/core": ">=2.0.0 || >=3 || >= 4.0.0-beta.0 || >= 4.0.0"
|
|
62
63
|
},
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "fd07d673f05a09d222b263be6ad7c4308fda13a2"
|
|
64
65
|
}
|