@pnp/cli-microsoft365 7.0.0-beta.b7c2a8d → 7.0.0-beta.c0afb7b
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.cjs +1 -3
- package/dist/GlobalOptions.js +1 -7
- package/dist/cli/Cli.js +19 -2
- package/dist/m365/aad/commands/{o365group/o365group-add.js → m365group/m365group-add.js} +17 -17
- package/dist/m365/aad/commands/{o365group/o365group-conversation-list.js → m365group/m365group-conversation-list.js} +10 -10
- package/dist/m365/aad/commands/{o365group/o365group-conversation-post-list.js → m365group/m365group-conversation-post-list.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-get.js → m365group/m365group-get.js} +13 -10
- package/dist/m365/aad/commands/{o365group/o365group-list.js → m365group/m365group-list.js} +13 -28
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-clear.js → m365group/m365group-recyclebinitem-clear.js} +15 -15
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-list.js → m365group/m365group-recyclebinitem-list.js} +10 -10
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-remove.js → m365group/m365group-recyclebinitem-remove.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-restore.js → m365group/m365group-recyclebinitem-restore.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-remove.js → m365group/m365group-remove.js} +12 -12
- package/dist/m365/aad/commands/{o365group/o365group-renew.js → m365group/m365group-renew.js} +10 -10
- package/dist/m365/aad/commands/{o365group/o365group-report-activitycounts.js → m365group/m365group-report-activitycounts.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activitydetail.js → m365group/m365group-report-activitydetail.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activityfilecounts.js → m365group/m365group-report-activityfilecounts.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activitygroupcounts.js → m365group/m365group-report-activitygroupcounts.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activitystorage.js → m365group/m365group-report-activitystorage.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-set.js → m365group/m365group-set.js} +17 -17
- package/dist/m365/aad/commands/{o365group/o365group-teamify.js → m365group/m365group-teamify.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-user-add.js → m365group/m365group-user-add.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-user-list.js → m365group/m365group-user-list.js} +12 -12
- package/dist/m365/aad/commands/{o365group/o365group-user-remove.js → m365group/m365group-user-remove.js} +14 -14
- package/dist/m365/aad/commands/{o365group/o365group-user-set.js → m365group/m365group-user-set.js} +15 -15
- package/dist/m365/aad/commands.js +22 -22
- package/dist/m365/pa/commands/app/app-permission-list.js +2 -2
- package/dist/m365/pa/commands/app/app-permission-remove.js +3 -3
- package/dist/m365/pa/commands.js +1 -4
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.1.js → doctor-1.18.0-beta.5.js} +1 -1
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.18.0-beta.1.js → upgrade-1.18.0-beta.5.js} +26 -26
- package/dist/m365/spfx/commands/project/project-upgrade.js +1 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +3 -3
- package/dist/m365/spo/commands/app/SpoAppBaseCommand.js +27 -26
- package/dist/m365/spo/commands/app/app-add.js +9 -9
- package/dist/m365/spo/commands/file/file-copy.js +1 -1
- package/dist/m365/spo/commands/file/file-move.js +73 -97
- package/dist/m365/spo/commands/folder/folder-copy.js +89 -45
- package/dist/m365/spo/commands/folder/folder-move.js +89 -47
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +32 -3
- package/dist/m365/spo/commands/page/clientsidepages.js +1 -81
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +63 -59
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +28 -31
- package/dist/m365/spo/commands/site/FlowsPolicy.js +7 -0
- package/dist/m365/spo/commands/site/site-ensure.js +3 -3
- package/dist/m365/spo/commands/site/site-hubsite-disconnect.js +22 -22
- package/dist/m365/spo/commands/site/site-list.js +27 -43
- package/dist/m365/spo/commands/site/site-set.js +60 -49
- package/dist/m365/spo/commands/theme/theme-list.js +1 -9
- package/dist/m365/spo/commands/theme/theme-remove.js +24 -24
- package/dist/m365/spo/commands/theme/theme-set.js +0 -1
- package/dist/m365/spo/commands/user/user-remove.js +27 -27
- package/dist/m365/spo/commands/web/web-reindex.js +35 -42
- package/dist/m365/spo/commands/web/web-remove.js +21 -21
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +16 -31
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +33 -44
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +18 -18
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +19 -19
- package/dist/m365/yammer/commands/message/message-like-set.js +27 -28
- package/dist/m365/yammer/commands/message/message-list.js +62 -81
- package/dist/m365/yammer/commands/message/message-remove.js +18 -18
- package/dist/m365/yammer/commands/yammer-search.js +53 -69
- package/dist/utils/spo.js +12 -53
- package/dist/utils/validation.js +0 -3
- package/docs/docs/cmd/aad/{o365group/o365group-add.mdx → m365group/m365group-add.mdx} +13 -13
- package/docs/docs/cmd/aad/{o365group/o365group-conversation-list.mdx → m365group/m365group-conversation-list.mdx} +4 -4
- package/docs/docs/cmd/aad/{o365group/o365group-conversation-post-list.mdx → m365group/m365group-conversation-post-list.mdx} +8 -8
- package/docs/docs/cmd/aad/{o365group/o365group-get.mdx → m365group/m365group-get.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-list.mdx → m365group/m365group-list.mdx} +12 -29
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-clear.mdx → m365group/m365group-recyclebinitem-clear.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-list.mdx → m365group/m365group-recyclebinitem-list.mdx} +8 -8
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-remove.mdx → m365group/m365group-recyclebinitem-remove.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-restore.mdx → m365group/m365group-recyclebinitem-restore.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-remove.mdx → m365group/m365group-remove.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-renew.mdx → m365group/m365group-renew.mdx} +4 -4
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitycounts.mdx → m365group/m365group-report-activitycounts.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitydetail.mdx → m365group/m365group-report-activitydetail.mdx} +7 -7
- package/docs/docs/cmd/aad/{o365group/o365group-report-activityfilecounts.mdx → m365group/m365group-report-activityfilecounts.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitygroupcounts.mdx → m365group/m365group-report-activitygroupcounts.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitystorage.mdx → m365group/m365group-report-activitystorage.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-set.mdx → m365group/m365group-set.mdx} +8 -8
- package/docs/docs/cmd/aad/{o365group/o365group-teamify.mdx → m365group/m365group-teamify.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-user-add.mdx → m365group/m365group-user-add.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-user-list.mdx → m365group/m365group-user-list.mdx} +7 -7
- package/docs/docs/cmd/aad/{o365group/o365group-user-remove.mdx → m365group/m365group-user-remove.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-user-set.mdx → m365group/m365group-user-set.mdx} +5 -5
- package/docs/docs/cmd/pa/app/app-permission-remove.mdx +1 -1
- package/docs/docs/cmd/planner/plan/plan-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-move.mdx +36 -18
- package/docs/docs/cmd/spo/folder/folder-copy.mdx +39 -12
- package/docs/docs/cmd/spo/folder/folder-move.mdx +40 -13
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +14 -1
- package/docs/docs/cmd/spo/site/site-add.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-list.mdx +3 -78
- package/docs/docs/cmd/teams/team/team-add.mdx +1 -1
- package/npm-shrinkwrap.json +178 -1304
- package/package.json +5 -7
- package/dist/m365/pa/cds-project-mutator.js +0 -91
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/generated/ManifestTypes.d.ts +0 -11
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_index.ts +0 -51
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/generated/ManifestTypes.d.ts +0 -12
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_index.ts +0 -48
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/index.ts +0 -0
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_index.tsx +0 -58
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_index.tsx +0 -55
- package/dist/m365/pa/commands/pcf/pcf-init/assets/package.json +0 -19
- package/dist/m365/pa/commands/pcf/pcf-init/assets/pcfconfig.json +0 -3
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_.gitignore +0 -14
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_pcfprojecttype.pcfproj +0 -45
- package/dist/m365/pa/commands/pcf/pcf-init/pcf-init-variables.js +0 -2
- package/dist/m365/pa/commands/pcf/pcf-init.js +0 -120
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Customizations.xml +0 -18
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Relationships.xml +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/template_Solution.xml +0 -94
- package/dist/m365/pa/commands/solution/solution-init/assets/template_.gitignore +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/template_solutionprojecttype.cdsproj +0 -44
- package/dist/m365/pa/commands/solution/solution-init/solution-init-variables.js +0 -2
- package/dist/m365/pa/commands/solution/solution-init.js +0 -126
- package/dist/m365/pa/commands/solution/solution-reference-add.js +0 -88
- package/dist/m365/pa/template-instantiator.js +0 -57
- package/docs/docs/cmd/pa/pcf/pcf-init.mdx +0 -56
- package/docs/docs/cmd/pa/solution/solution-init.mdx +0 -46
- package/docs/docs/cmd/pa/solution/solution-reference-add.mdx +0 -42
- /package/dist/m365/aad/commands/{o365group → m365group}/GroupExtended.js +0 -0
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _PaPcfInitCommand_instances, _PaPcfInitCommand_initTelemetry, _PaPcfInitCommand_initOptions, _PaPcfInitCommand_initValidators;
|
|
7
|
-
import chalk from 'chalk';
|
|
8
|
-
import fs from 'fs';
|
|
9
|
-
import path from 'path';
|
|
10
|
-
import url from 'url';
|
|
11
|
-
import { v4 } from 'uuid';
|
|
12
|
-
import { validation } from '../../../../utils/validation.js';
|
|
13
|
-
import AnonymousCommand from "../../../base/AnonymousCommand.js";
|
|
14
|
-
import commands from '../../commands.js';
|
|
15
|
-
import TemplateInstantiator from "../../template-instantiator.js";
|
|
16
|
-
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
17
|
-
/*
|
|
18
|
-
* Logic extracted from bolt.module.pcf.dll
|
|
19
|
-
* Version: 1.0.6
|
|
20
|
-
* Class: bolt.module.pcf.PcfInitVerb
|
|
21
|
-
*/
|
|
22
|
-
class PaPcfInitCommand extends AnonymousCommand {
|
|
23
|
-
get name() {
|
|
24
|
-
return commands.PCF_INIT;
|
|
25
|
-
}
|
|
26
|
-
get description() {
|
|
27
|
-
return 'Creates new PowerApps component framework project';
|
|
28
|
-
}
|
|
29
|
-
constructor() {
|
|
30
|
-
super();
|
|
31
|
-
_PaPcfInitCommand_instances.add(this);
|
|
32
|
-
__classPrivateFieldGet(this, _PaPcfInitCommand_instances, "m", _PaPcfInitCommand_initTelemetry).call(this);
|
|
33
|
-
__classPrivateFieldGet(this, _PaPcfInitCommand_instances, "m", _PaPcfInitCommand_initOptions).call(this);
|
|
34
|
-
__classPrivateFieldGet(this, _PaPcfInitCommand_instances, "m", _PaPcfInitCommand_initValidators).call(this);
|
|
35
|
-
}
|
|
36
|
-
async commandAction(logger, args) {
|
|
37
|
-
try {
|
|
38
|
-
const pcfTemplatePath = path.join(__dirname, 'pcf-init', 'assets');
|
|
39
|
-
const pcfComponentTemplatePath = path.join(pcfTemplatePath, 'control', `${args.options.template.toLowerCase()}-template`);
|
|
40
|
-
const workingDirectory = process.cwd();
|
|
41
|
-
const workingDirectoryName = path.basename(workingDirectory);
|
|
42
|
-
const componentDirectory = path.join(workingDirectory, args.options.name);
|
|
43
|
-
const variables = {
|
|
44
|
-
"$namespaceplaceholder$": args.options.namespace,
|
|
45
|
-
"$controlnameplaceholder$": args.options.name,
|
|
46
|
-
"$pcfProjectName$": workingDirectoryName,
|
|
47
|
-
"pcfprojecttype": workingDirectoryName,
|
|
48
|
-
"$pcfProjectGuid$": v4()
|
|
49
|
-
};
|
|
50
|
-
if (this.verbose) {
|
|
51
|
-
await logger.logToStderr(`name: ${args.options.name}`);
|
|
52
|
-
await logger.logToStderr(`namespace: ${args.options.namespace}`);
|
|
53
|
-
await logger.logToStderr(`template: ${args.options.template}`);
|
|
54
|
-
await logger.logToStderr(`pcfTemplatePath: ${pcfTemplatePath}`);
|
|
55
|
-
await logger.logToStderr(`pcfComponentTemplatePath: ${pcfComponentTemplatePath}`);
|
|
56
|
-
await logger.logToStderr(`workingDirectory: ${workingDirectory}`);
|
|
57
|
-
await logger.logToStderr(`workingDirectoryName: ${workingDirectoryName}`);
|
|
58
|
-
await logger.logToStderr(`componentDirectory: ${componentDirectory}`);
|
|
59
|
-
}
|
|
60
|
-
TemplateInstantiator.instantiate(logger, pcfTemplatePath, workingDirectory, false, variables, this.verbose);
|
|
61
|
-
TemplateInstantiator.instantiate(logger, pcfComponentTemplatePath, componentDirectory, true, variables, this.verbose);
|
|
62
|
-
if (this.verbose) {
|
|
63
|
-
await logger.logToStderr(` `);
|
|
64
|
-
}
|
|
65
|
-
await logger.log(chalk.green(`The PowerApps component framework project was successfully created in '${workingDirectory}'.`));
|
|
66
|
-
await logger.log(`Be sure to run '${chalk.grey('npm install')}' in this directory to install project dependencies.`);
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
throw err;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
_PaPcfInitCommand_instances = new WeakSet(), _PaPcfInitCommand_initTelemetry = function _PaPcfInitCommand_initTelemetry() {
|
|
74
|
-
this.telemetry.push((args) => {
|
|
75
|
-
Object.assign(this.telemetryProperties, {
|
|
76
|
-
template: args.options.template
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}, _PaPcfInitCommand_initOptions = function _PaPcfInitCommand_initOptions() {
|
|
80
|
-
this.options.unshift({
|
|
81
|
-
option: '--namespace <namespace>'
|
|
82
|
-
}, {
|
|
83
|
-
option: '--name <name>'
|
|
84
|
-
}, {
|
|
85
|
-
option: '--template <template>',
|
|
86
|
-
autocomplete: ['Field', 'Dataset']
|
|
87
|
-
});
|
|
88
|
-
}, _PaPcfInitCommand_initValidators = function _PaPcfInitCommand_initValidators() {
|
|
89
|
-
this.validators.push(async (args) => {
|
|
90
|
-
if (fs.readdirSync(process.cwd()).some(fn => path.extname(fn).toLowerCase().endsWith('proj'))) {
|
|
91
|
-
return 'PowerApps component framework project creation failed. The current directory already contains a project. Please create a new directory and retry the operation.';
|
|
92
|
-
}
|
|
93
|
-
const workingDirectoryName = path.basename(process.cwd());
|
|
94
|
-
if (!validation.isValidFileName(workingDirectoryName)) {
|
|
95
|
-
return `Empty or invalid project name '${workingDirectoryName}'`;
|
|
96
|
-
}
|
|
97
|
-
if (!/^(?!\d)[a-zA-Z0-9]+$/i.test(args.options.name)) {
|
|
98
|
-
return `Value of 'name' is invalid. Only characters within the ranges [A - Z], [a - z] or [0 - 9] are allowed. The first character may not be a number.`;
|
|
99
|
-
}
|
|
100
|
-
if (validation.isJavaScriptReservedWord(args.options.name)) {
|
|
101
|
-
return `The value '${args.options.name}' passed for 'name' is a reserved word.`;
|
|
102
|
-
}
|
|
103
|
-
if (!/^(?!\.|\d)(?!.*\.$)(?!.*?\.\d)(?!.*?\.\.)[a-zA-Z0-9.]+$/i.test(args.options.namespace)) {
|
|
104
|
-
return `Value of 'namespace' is invalid. Only characters within the ranges [A - Z], [a - z], [0 - 9], or '.' are allowed. The first and last character may not be the '.' character. Consecutive '.' characters are not allowed. Numbers are not allowed as the first character or immediately after a period.`;
|
|
105
|
-
}
|
|
106
|
-
if (validation.isJavaScriptReservedWord(args.options.namespace)) {
|
|
107
|
-
return `The value '${args.options.namespace}' passed for 'namespace' is or includes a reserved word.`;
|
|
108
|
-
}
|
|
109
|
-
if (args.options.namespace && args.options.name && (args.options.namespace + args.options.name).length > 75) {
|
|
110
|
-
return `The total length of values for 'name' and 'namespace' cannot exceed 75. Length of 'name' is ${args.options.name.length}, length of 'namespace' is ${args.options.namespace.length}.`;
|
|
111
|
-
}
|
|
112
|
-
const testTemplate = args.options.template.toLowerCase();
|
|
113
|
-
if (!(testTemplate === 'field' || testTemplate === 'dataset')) {
|
|
114
|
-
return `Template must be either 'Field' or 'Dataset', but '${args.options.template}' was provided.`;
|
|
115
|
-
}
|
|
116
|
-
return true;
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
|
-
export default new PaPcfInitCommand();
|
|
120
|
-
//# sourceMappingURL=pcf-init.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<ImportExportXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
3
|
-
<Entities />
|
|
4
|
-
<Roles />
|
|
5
|
-
<Workflows />
|
|
6
|
-
<FieldSecurityProfiles />
|
|
7
|
-
<Templates />
|
|
8
|
-
<EntityMaps />
|
|
9
|
-
<EntityRelationships />
|
|
10
|
-
<OrganizationSettings />
|
|
11
|
-
<optionsets />
|
|
12
|
-
<CustomControls />
|
|
13
|
-
<SolutionPluginAssemblies />
|
|
14
|
-
<EntityDataProviders />
|
|
15
|
-
<Languages>
|
|
16
|
-
<Language>1033</Language>
|
|
17
|
-
</Languages>
|
|
18
|
-
</ImportExportXml>
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<ImportExportXml version="9.1.0.643" SolutionPackageVersion="9.1" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
3
|
-
<SolutionManifest>
|
|
4
|
-
<!-- Unique Name of Cds Solution-->
|
|
5
|
-
<UniqueName>$solutionName$</UniqueName>
|
|
6
|
-
<LocalizedNames>
|
|
7
|
-
<!-- Localized Solution Name in language code -->
|
|
8
|
-
<LocalizedName description="$solutionName$" languagecode="1033" />
|
|
9
|
-
</LocalizedNames>
|
|
10
|
-
<Descriptions />
|
|
11
|
-
<Version>1.0</Version>
|
|
12
|
-
<!-- Solution Package Type: Unmanaged(0)/Managed(1)/Both(2)-->
|
|
13
|
-
<Managed>2</Managed>
|
|
14
|
-
<Publisher>
|
|
15
|
-
<!-- Unique Publisher Name of Cds Solution -->
|
|
16
|
-
<UniqueName>$publisherName$</UniqueName>
|
|
17
|
-
<LocalizedNames>
|
|
18
|
-
<!-- Localized Cds Publisher Name in language code-->
|
|
19
|
-
<LocalizedName description="$publisherName$" languagecode="1033" />
|
|
20
|
-
</LocalizedNames>
|
|
21
|
-
<Descriptions>
|
|
22
|
-
<!-- Description of Cds Publisher in language code -->
|
|
23
|
-
<Description description="$publisherName$" languagecode="1033" />
|
|
24
|
-
</Descriptions>
|
|
25
|
-
<EMailAddress xsi:nil="true"></EMailAddress>
|
|
26
|
-
<SupportingWebsiteUrl xsi:nil="true"></SupportingWebsiteUrl>
|
|
27
|
-
<!-- Customization Prefix for the Cds Publisher-->
|
|
28
|
-
<CustomizationPrefix>$customizationPrefix$</CustomizationPrefix>
|
|
29
|
-
<!-- Derived Option Value Prefix for the Customization Prefix of Cds Publisher -->
|
|
30
|
-
<CustomizationOptionValuePrefix>$customizationOptionValuePrefix$</CustomizationOptionValuePrefix>
|
|
31
|
-
<Addresses>
|
|
32
|
-
<!-- Address of the Publisher-->
|
|
33
|
-
<Address>
|
|
34
|
-
<AddressNumber>1</AddressNumber>
|
|
35
|
-
<AddressTypeCode>1</AddressTypeCode>
|
|
36
|
-
<City xsi:nil="true"></City>
|
|
37
|
-
<County xsi:nil="true"></County>
|
|
38
|
-
<Country xsi:nil="true"></Country>
|
|
39
|
-
<Fax xsi:nil="true"></Fax>
|
|
40
|
-
<FreightTermsCode xsi:nil="true"></FreightTermsCode>
|
|
41
|
-
<ImportSequenceNumber xsi:nil="true"></ImportSequenceNumber>
|
|
42
|
-
<Latitude xsi:nil="true"></Latitude>
|
|
43
|
-
<Line1 xsi:nil="true"></Line1>
|
|
44
|
-
<Line2 xsi:nil="true"></Line2>
|
|
45
|
-
<Line3 xsi:nil="true"></Line3>
|
|
46
|
-
<Longitude xsi:nil="true"></Longitude>
|
|
47
|
-
<Name xsi:nil="true"></Name>
|
|
48
|
-
<PostalCode xsi:nil="true"></PostalCode>
|
|
49
|
-
<PostOfficeBox xsi:nil="true"></PostOfficeBox>
|
|
50
|
-
<PrimaryContactName xsi:nil="true"></PrimaryContactName>
|
|
51
|
-
<ShippingMethodCode>1</ShippingMethodCode>
|
|
52
|
-
<StateOrProvince xsi:nil="true"></StateOrProvince>
|
|
53
|
-
<Telephone1 xsi:nil="true"></Telephone1>
|
|
54
|
-
<Telephone2 xsi:nil="true"></Telephone2>
|
|
55
|
-
<Telephone3 xsi:nil="true"></Telephone3>
|
|
56
|
-
<TimeZoneRuleVersionNumber xsi:nil="true"></TimeZoneRuleVersionNumber>
|
|
57
|
-
<UPSZone xsi:nil="true"></UPSZone>
|
|
58
|
-
<UTCOffset xsi:nil="true"></UTCOffset>
|
|
59
|
-
<UTCConversionTimeZoneCode xsi:nil="true"></UTCConversionTimeZoneCode>
|
|
60
|
-
</Address>
|
|
61
|
-
<Address>
|
|
62
|
-
<AddressNumber>2</AddressNumber>
|
|
63
|
-
<AddressTypeCode>1</AddressTypeCode>
|
|
64
|
-
<City xsi:nil="true"></City>
|
|
65
|
-
<County xsi:nil="true"></County>
|
|
66
|
-
<Country xsi:nil="true"></Country>
|
|
67
|
-
<Fax xsi:nil="true"></Fax>
|
|
68
|
-
<FreightTermsCode xsi:nil="true"></FreightTermsCode>
|
|
69
|
-
<ImportSequenceNumber xsi:nil="true"></ImportSequenceNumber>
|
|
70
|
-
<Latitude xsi:nil="true"></Latitude>
|
|
71
|
-
<Line1 xsi:nil="true"></Line1>
|
|
72
|
-
<Line2 xsi:nil="true"></Line2>
|
|
73
|
-
<Line3 xsi:nil="true"></Line3>
|
|
74
|
-
<Longitude xsi:nil="true"></Longitude>
|
|
75
|
-
<Name xsi:nil="true"></Name>
|
|
76
|
-
<PostalCode xsi:nil="true"></PostalCode>
|
|
77
|
-
<PostOfficeBox xsi:nil="true"></PostOfficeBox>
|
|
78
|
-
<PrimaryContactName xsi:nil="true"></PrimaryContactName>
|
|
79
|
-
<ShippingMethodCode>1</ShippingMethodCode>
|
|
80
|
-
<StateOrProvince xsi:nil="true"></StateOrProvince>
|
|
81
|
-
<Telephone1 xsi:nil="true"></Telephone1>
|
|
82
|
-
<Telephone2 xsi:nil="true"></Telephone2>
|
|
83
|
-
<Telephone3 xsi:nil="true"></Telephone3>
|
|
84
|
-
<TimeZoneRuleVersionNumber xsi:nil="true"></TimeZoneRuleVersionNumber>
|
|
85
|
-
<UPSZone xsi:nil="true"></UPSZone>
|
|
86
|
-
<UTCOffset xsi:nil="true"></UTCOffset>
|
|
87
|
-
<UTCConversionTimeZoneCode xsi:nil="true"></UTCConversionTimeZoneCode>
|
|
88
|
-
</Address>
|
|
89
|
-
</Addresses>
|
|
90
|
-
</Publisher>
|
|
91
|
-
<RootComponents />
|
|
92
|
-
<MissingDependencies />
|
|
93
|
-
</SolutionManifest>
|
|
94
|
-
</ImportExportXml>
|
package/dist/m365/pa/commands/solution/solution-init/assets/template_solutionprojecttype.cdsproj
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
-
<PropertyGroup>
|
|
4
|
-
<PowerAppsTargetsPath>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\PowerApps</PowerAppsTargetsPath>
|
|
5
|
-
</PropertyGroup>
|
|
6
|
-
|
|
7
|
-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
|
8
|
-
<Import Project="$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.props" Condition="Exists('$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.props')"/>
|
|
9
|
-
|
|
10
|
-
<PropertyGroup>
|
|
11
|
-
<ProjectGuid>$cdsProjectGuid$</ProjectGuid>
|
|
12
|
-
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
|
13
|
-
<!--Remove TargetFramework when this is available in 16.1-->
|
|
14
|
-
<TargetFramework>net462</TargetFramework>
|
|
15
|
-
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
|
16
|
-
</PropertyGroup>
|
|
17
|
-
|
|
18
|
-
<!-- Solution Packager overrides, un-comment to use: SolutionPackagerType (Managed, Unmanaged, Both)
|
|
19
|
-
<PropertyGroup>
|
|
20
|
-
<SolutionPackageType>Managed</SolutionPackageType>
|
|
21
|
-
</PropertyGroup>
|
|
22
|
-
-->
|
|
23
|
-
|
|
24
|
-
<ItemGroup>
|
|
25
|
-
<PackageReference Include="Microsoft.PowerApps.MSBuild.Solution" Version="1.*"/>
|
|
26
|
-
</ItemGroup>
|
|
27
|
-
|
|
28
|
-
<ItemGroup>
|
|
29
|
-
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\.gitignore"/>
|
|
30
|
-
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\bin\**"/>
|
|
31
|
-
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\obj\**"/>
|
|
32
|
-
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\*.cdsproj"/>
|
|
33
|
-
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\*.cdsproj.user"/>
|
|
34
|
-
<ExcludeDirectories Include="$(MSBuildThisFileDirectory)\*.sln"/>
|
|
35
|
-
</ItemGroup>
|
|
36
|
-
|
|
37
|
-
<ItemGroup>
|
|
38
|
-
<None Include="$(MSBuildThisFileDirectory)\**" Exclude="@(ExcludeDirectories)" />
|
|
39
|
-
</ItemGroup>
|
|
40
|
-
|
|
41
|
-
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
|
|
42
|
-
<Import Project="$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.targets" Condition="Exists('$(PowerAppsTargetsPath)\Microsoft.PowerApps.VisualStudio.Solution.targets')"/>
|
|
43
|
-
|
|
44
|
-
</Project>
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _PaSolutionInitCommand_instances, _PaSolutionInitCommand_initOptions, _PaSolutionInitCommand_initValidators;
|
|
7
|
-
import chalk from 'chalk';
|
|
8
|
-
import fs from 'fs';
|
|
9
|
-
import path from 'path';
|
|
10
|
-
import url from 'url';
|
|
11
|
-
import { v4 } from 'uuid';
|
|
12
|
-
import { validation } from '../../../../utils/validation.js';
|
|
13
|
-
import AnonymousCommand from '../../../base/AnonymousCommand.js';
|
|
14
|
-
import commands from '../../commands.js';
|
|
15
|
-
import TemplateInstantiator from '../../template-instantiator.js';
|
|
16
|
-
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
17
|
-
/*
|
|
18
|
-
* Logic extracted from bolt.module.solution.dll
|
|
19
|
-
* Version: 1.0.6
|
|
20
|
-
* Class: bolt.module.solution.SolutionInitVerb
|
|
21
|
-
*/
|
|
22
|
-
class PaSolutionInitCommand extends AnonymousCommand {
|
|
23
|
-
get name() {
|
|
24
|
-
return commands.SOLUTION_INIT;
|
|
25
|
-
}
|
|
26
|
-
get description() {
|
|
27
|
-
return 'Initializes a directory with a new CDS solution project';
|
|
28
|
-
}
|
|
29
|
-
constructor() {
|
|
30
|
-
super();
|
|
31
|
-
_PaSolutionInitCommand_instances.add(this);
|
|
32
|
-
__classPrivateFieldGet(this, _PaSolutionInitCommand_instances, "m", _PaSolutionInitCommand_initOptions).call(this);
|
|
33
|
-
__classPrivateFieldGet(this, _PaSolutionInitCommand_instances, "m", _PaSolutionInitCommand_initValidators).call(this);
|
|
34
|
-
}
|
|
35
|
-
async commandAction(logger, args) {
|
|
36
|
-
try {
|
|
37
|
-
const solutionInitTemplatePath = path.join(__dirname, 'solution-init', 'assets');
|
|
38
|
-
const cdsAssetsTemplatePath = path.join(solutionInitTemplatePath, 'Other');
|
|
39
|
-
const workingDirectory = process.cwd();
|
|
40
|
-
const workingDirectoryName = path.basename(workingDirectory);
|
|
41
|
-
const cdsAssetsDirectory = path.join(workingDirectory, 'Other');
|
|
42
|
-
const cdsAssetsDirectorySolutionsFile = path.join(workingDirectory, 'Other', 'Solution.xml');
|
|
43
|
-
const publisherName = args.options.publisherName;
|
|
44
|
-
const publisherPrefix = args.options.publisherPrefix.toLocaleLowerCase();
|
|
45
|
-
const customizationOptionValuePrefix = this.generateOptionValuePrefixForPublisher(publisherPrefix);
|
|
46
|
-
const variables = {
|
|
47
|
-
"$publisherName$": publisherName,
|
|
48
|
-
"$customizationPrefix$": publisherPrefix,
|
|
49
|
-
"$customizationOptionValuePrefix$": customizationOptionValuePrefix,
|
|
50
|
-
"$cdsProjectGuid$": v4(),
|
|
51
|
-
"solutionprojecttype": workingDirectoryName,
|
|
52
|
-
"$solutionName$": workingDirectoryName
|
|
53
|
-
};
|
|
54
|
-
if (this.verbose) {
|
|
55
|
-
await logger.logToStderr(`publisherName: ${publisherName}`);
|
|
56
|
-
await logger.logToStderr(`publisherPrefix: ${publisherPrefix}`);
|
|
57
|
-
await logger.logToStderr(`customizationOptionValuePrefix: ${customizationOptionValuePrefix}`);
|
|
58
|
-
await logger.logToStderr(`solutionInitTemplatePath: ${solutionInitTemplatePath}`);
|
|
59
|
-
await logger.logToStderr(`cdsAssetsTemplatePath: ${cdsAssetsTemplatePath}`);
|
|
60
|
-
await logger.logToStderr(`workingDirectory: ${workingDirectory}`);
|
|
61
|
-
await logger.logToStderr(`workingDirectoryName: ${workingDirectoryName}`);
|
|
62
|
-
await logger.logToStderr(`cdsAssetsDirectory: ${cdsAssetsDirectory}`);
|
|
63
|
-
await logger.logToStderr(`cdsAssetsDirectorySolutionsFile: ${cdsAssetsDirectorySolutionsFile}`);
|
|
64
|
-
}
|
|
65
|
-
TemplateInstantiator.instantiate(logger, solutionInitTemplatePath, workingDirectory, false, variables, this.verbose);
|
|
66
|
-
if (this.verbose) {
|
|
67
|
-
await logger.logToStderr(` `);
|
|
68
|
-
}
|
|
69
|
-
await logger.log(chalk.green(`CDS solution project with name '${workingDirectoryName}' created successfully in current directory.`));
|
|
70
|
-
const cdsAssetsExist = fs.existsSync(cdsAssetsDirectory) && fs.existsSync(cdsAssetsDirectorySolutionsFile);
|
|
71
|
-
if (cdsAssetsExist) {
|
|
72
|
-
await logger.log(chalk.yellow(`CDS solution files already exist in the current directory. Skipping CDS solution files creation.`));
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
TemplateInstantiator.instantiate(logger, cdsAssetsTemplatePath, cdsAssetsDirectory, false, variables, this.verbose);
|
|
76
|
-
await logger.log(chalk.green(`CDS solution files were successfully created for this project in the sub-directory 'Other', using solution name '${workingDirectory}', publisher name '${publisherName}', and customization prefix '${publisherPrefix}'.`));
|
|
77
|
-
await logger.log(`Please verify the publisher information and solution name found in the '${chalk.grey('Solution.xml')}' file.`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch (err) {
|
|
81
|
-
throw err;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
generateOptionValuePrefixForPublisher(customizationPrefix) {
|
|
85
|
-
if (customizationPrefix.toLocaleLowerCase() !== "new") {
|
|
86
|
-
return this.generateOptionValuePrefixForPublisherInternal(this.getHashCode(customizationPrefix));
|
|
87
|
-
}
|
|
88
|
-
return "10000";
|
|
89
|
-
}
|
|
90
|
-
generateOptionValuePrefixForPublisherInternal(customizationPrefixHashCode) {
|
|
91
|
-
return Math.abs(customizationPrefixHashCode % 90000) + 10000 + "";
|
|
92
|
-
}
|
|
93
|
-
getHashCode(s) {
|
|
94
|
-
let h = 0;
|
|
95
|
-
for (let i = 0; i < s.length; i++) {
|
|
96
|
-
h = Math.imul(31, h) + s.charCodeAt(i) | 0;
|
|
97
|
-
}
|
|
98
|
-
return h;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
_PaSolutionInitCommand_instances = new WeakSet(), _PaSolutionInitCommand_initOptions = function _PaSolutionInitCommand_initOptions() {
|
|
102
|
-
this.options.unshift({
|
|
103
|
-
option: '--publisherName <publisherName>'
|
|
104
|
-
}, {
|
|
105
|
-
option: '--publisherPrefix <publisherPrefix>'
|
|
106
|
-
});
|
|
107
|
-
}, _PaSolutionInitCommand_initValidators = function _PaSolutionInitCommand_initValidators() {
|
|
108
|
-
this.validators.push(async (args) => {
|
|
109
|
-
if (fs.readdirSync(process.cwd()).some(fn => path.extname(fn).toLowerCase() === '.cdsproj')) {
|
|
110
|
-
return 'CDS project creation failed. The current directory already contains a project. Please create a new directory and retry the operation.';
|
|
111
|
-
}
|
|
112
|
-
const workingDirectoryName = path.basename(process.cwd());
|
|
113
|
-
if (!validation.isValidFileName(workingDirectoryName)) {
|
|
114
|
-
return `Empty or invalid project name '${workingDirectoryName}'`;
|
|
115
|
-
}
|
|
116
|
-
if (args.options.publisherPrefix.length < 2 || args.options.publisherPrefix.length > 8 || !/^(?!mscrm)^([a-zA-Z])\w*$/i.test(args.options.publisherPrefix)) {
|
|
117
|
-
return `Value of 'publisherPrefix' is invalid. The prefix must be 2 to 8 characters long, can only consist of alpha-numerics, must start with a letter, and cannot start with 'mscrm'.`;
|
|
118
|
-
}
|
|
119
|
-
if (!/^([a-zA-Z_])\w*$/i.test(args.options.publisherName)) {
|
|
120
|
-
return `Value of 'publisherName' is invalid. Only characters within the ranges [A-Z], [a-z], [0-9], or _ are allowed. The first character may only be in the ranges [A-Z], [a-z], or _.`;
|
|
121
|
-
}
|
|
122
|
-
return true;
|
|
123
|
-
});
|
|
124
|
-
};
|
|
125
|
-
export default new PaSolutionInitCommand();
|
|
126
|
-
//# sourceMappingURL=solution-init.js.map
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _PaSolutionReferenceAddCommand_instances, _PaSolutionReferenceAddCommand_initOptions, _PaSolutionReferenceAddCommand_initValidators;
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
import path from 'path';
|
|
9
|
-
import AnonymousCommand from '../../../base/AnonymousCommand.js';
|
|
10
|
-
import CdsProjectMutator from '../../cds-project-mutator.js';
|
|
11
|
-
import commands from '../../commands.js';
|
|
12
|
-
/*
|
|
13
|
-
* Logic extracted from bolt.module.solution.dll
|
|
14
|
-
* Version: 1.0.6
|
|
15
|
-
* Class: bolt.module.solution.verbs.SolutionAddReferenceVerb
|
|
16
|
-
*/
|
|
17
|
-
class PaSolutionReferenceAddCommand extends AnonymousCommand {
|
|
18
|
-
get name() {
|
|
19
|
-
return commands.SOLUTION_REFERENCE_ADD;
|
|
20
|
-
}
|
|
21
|
-
get description() {
|
|
22
|
-
return 'Adds a project reference to the solution in the current directory';
|
|
23
|
-
}
|
|
24
|
-
constructor() {
|
|
25
|
-
super();
|
|
26
|
-
_PaSolutionReferenceAddCommand_instances.add(this);
|
|
27
|
-
__classPrivateFieldGet(this, _PaSolutionReferenceAddCommand_instances, "m", _PaSolutionReferenceAddCommand_initOptions).call(this);
|
|
28
|
-
__classPrivateFieldGet(this, _PaSolutionReferenceAddCommand_instances, "m", _PaSolutionReferenceAddCommand_initValidators).call(this);
|
|
29
|
-
}
|
|
30
|
-
async commandAction(logger, args) {
|
|
31
|
-
try {
|
|
32
|
-
const referencedProjectFilePath = this.getSupportedProjectFiles(args.options.projectPath)[0];
|
|
33
|
-
const relativeReferencedProjectFilePath = path.relative(process.cwd(), referencedProjectFilePath);
|
|
34
|
-
const cdsProjectFilePath = this.getCdsProjectFile(process.cwd())[0];
|
|
35
|
-
const cdsProjectFileContent = fs.readFileSync(cdsProjectFilePath, 'utf8');
|
|
36
|
-
const cdsProjectMutator = new CdsProjectMutator(cdsProjectFileContent);
|
|
37
|
-
cdsProjectMutator.addProjectReference(relativeReferencedProjectFilePath);
|
|
38
|
-
fs.writeFileSync(cdsProjectFilePath, cdsProjectMutator.cdsProjectDocument);
|
|
39
|
-
}
|
|
40
|
-
catch (err) {
|
|
41
|
-
throw err;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
getCdsProjectFile(rootPath) {
|
|
45
|
-
return fs.readdirSync(rootPath)
|
|
46
|
-
.filter(fn => path.extname(fn).toLowerCase() === '.cdsproj')
|
|
47
|
-
.map(entry => path.join(rootPath, entry));
|
|
48
|
-
}
|
|
49
|
-
getSupportedProjectFiles(rootPath) {
|
|
50
|
-
return fs.readdirSync(rootPath).filter(fn => {
|
|
51
|
-
const ext = path.extname(fn).toLowerCase();
|
|
52
|
-
return ext === '.pcfproj' || ext === '.csproj';
|
|
53
|
-
}).map(entry => path.join(rootPath, entry));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
_PaSolutionReferenceAddCommand_instances = new WeakSet(), _PaSolutionReferenceAddCommand_initOptions = function _PaSolutionReferenceAddCommand_initOptions() {
|
|
57
|
-
this.options.unshift({
|
|
58
|
-
option: '-p, --projectPath <projectPath>'
|
|
59
|
-
});
|
|
60
|
-
}, _PaSolutionReferenceAddCommand_initValidators = function _PaSolutionReferenceAddCommand_initValidators() {
|
|
61
|
-
this.validators.push(async (args) => {
|
|
62
|
-
const existingCdsProjects = this.getCdsProjectFile(process.cwd());
|
|
63
|
-
if (existingCdsProjects.length === 0) {
|
|
64
|
-
return 'CDS solution project file with extension cdsproj was not found in the current directory.';
|
|
65
|
-
}
|
|
66
|
-
if (existingCdsProjects.length > 1) {
|
|
67
|
-
return 'Multiple CDS solution project files with extension cdsproj were found in the current directory.';
|
|
68
|
-
}
|
|
69
|
-
if (!fs.existsSync(args.options.projectPath)) {
|
|
70
|
-
return `Path ${args.options.projectPath} is not a valid path.`;
|
|
71
|
-
}
|
|
72
|
-
const existingSupportedProjects = this.getSupportedProjectFiles(args.options.projectPath);
|
|
73
|
-
if (existingSupportedProjects.length === 0) {
|
|
74
|
-
return `No supported project type found in path ${args.options.projectPath}.`;
|
|
75
|
-
}
|
|
76
|
-
if (existingSupportedProjects.length !== 1) {
|
|
77
|
-
return `More than one supported project type found in path ${args.options.projectPath}.`;
|
|
78
|
-
}
|
|
79
|
-
const cdsProjectName = path.parse(path.basename(existingCdsProjects[0])).name;
|
|
80
|
-
const pcfProjectName = path.parse(path.basename(existingSupportedProjects[0])).name;
|
|
81
|
-
if (cdsProjectName === pcfProjectName) {
|
|
82
|
-
return `Not able to add reference to a project with same name as CDS project with name: ${pcfProjectName}.`;
|
|
83
|
-
}
|
|
84
|
-
return true;
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
export default new PaSolutionReferenceAddCommand();
|
|
88
|
-
//# sourceMappingURL=solution-reference-add.js.map
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
/*
|
|
4
|
-
* Logic extracted from bolt.cli.dll
|
|
5
|
-
* Version: 1.0.6
|
|
6
|
-
* Class: bolt.cli.TemplateInstantiator
|
|
7
|
-
*/
|
|
8
|
-
export default class TemplateInstantiator {
|
|
9
|
-
static async instantiate(logger, sourcePath, destinationPath, recursive, variables, verbose) {
|
|
10
|
-
await TemplateInstantiator.mkdirSyncIfNotExists(logger, destinationPath, verbose);
|
|
11
|
-
const files = this.getFiles(sourcePath, recursive);
|
|
12
|
-
for await (const file of files) {
|
|
13
|
-
const filePath = path.relative(sourcePath, path.dirname(file));
|
|
14
|
-
const destinationFilePath = path.join(destinationPath, filePath);
|
|
15
|
-
await TemplateInstantiator.mkdirSyncIfNotExists(logger, destinationFilePath, verbose);
|
|
16
|
-
this.instantiateTemplate(file, destinationFilePath, variables);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
static async mkdirSyncIfNotExists(logger, destinationPath, verbose) {
|
|
20
|
-
if (!fs.existsSync(destinationPath)) {
|
|
21
|
-
if (verbose) {
|
|
22
|
-
await logger.logToStderr(`Create directory: ${destinationPath}`);
|
|
23
|
-
}
|
|
24
|
-
fs.mkdirSync(destinationPath);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
static instantiateTemplate(templatePath, destinationPath, variables) {
|
|
28
|
-
let isTemplateFile = false;
|
|
29
|
-
let fileName = path.basename(templatePath);
|
|
30
|
-
if (fileName.toLowerCase().startsWith('template_')) {
|
|
31
|
-
isTemplateFile = true;
|
|
32
|
-
fileName = fileName.substring('template_'.length, fileName.length);
|
|
33
|
-
}
|
|
34
|
-
for (const variable in variables) {
|
|
35
|
-
fileName = fileName.replace(variable, variables[variable]);
|
|
36
|
-
}
|
|
37
|
-
const destinationFilePath = path.join(destinationPath, fileName);
|
|
38
|
-
if (!isTemplateFile) {
|
|
39
|
-
fs.copyFileSync(templatePath, destinationFilePath);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
let fileContent = fs.readFileSync(templatePath, 'utf8');
|
|
43
|
-
for (const variable in variables) {
|
|
44
|
-
fileContent = fileContent.replace(new RegExp(variable.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), 'g'), variables[variable]);
|
|
45
|
-
}
|
|
46
|
-
fs.writeFileSync(destinationFilePath, fileContent, 'utf8');
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
static getFiles(folderPath, recursive) {
|
|
50
|
-
const entryPaths = fs.readdirSync(folderPath).map(entry => path.join(folderPath, entry));
|
|
51
|
-
const filePaths = entryPaths.filter(entryPath => fs.statSync(entryPath).isFile());
|
|
52
|
-
const dirPaths = entryPaths.filter(entryPath => !filePaths.includes(entryPath));
|
|
53
|
-
const dirFiles = recursive ? dirPaths.reduce((prev, curr) => prev.concat(this.getFiles(curr, recursive)), []) : [];
|
|
54
|
-
return [...filePaths, ...dirFiles];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=template-instantiator.js.map
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
-
|
|
3
|
-
# pa pcf init
|
|
4
|
-
|
|
5
|
-
Creates new PowerApps component framework project
|
|
6
|
-
|
|
7
|
-
## Usage
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
m365 pa pcf init [options]
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Options
|
|
14
|
-
|
|
15
|
-
```md definition-list
|
|
16
|
-
`--namespace <namespace>`
|
|
17
|
-
: The namespace for the component.
|
|
18
|
-
|
|
19
|
-
`--name <name>`
|
|
20
|
-
: The name for the component.
|
|
21
|
-
|
|
22
|
-
`--template <template>`
|
|
23
|
-
: Choose a template for the component. `Field,Dataset`.
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
<Global />
|
|
27
|
-
|
|
28
|
-
## Remarks
|
|
29
|
-
|
|
30
|
-
Name cannot contain reserved Javascript words. Only characters within the ranges [A-Z], [a-z] or [0-9] are allowed. The first character may not be a number.
|
|
31
|
-
|
|
32
|
-
Namespace cannot contain reserved Javascript words. Only characters within the ranges [A-Z], [a-z], [0-9], or '.' are allowed. The first and last character may not be the '.' character. Consecutive '.' characters are not allowed. Numbers are not allowed as the first character or immediately after a period.
|
|
33
|
-
|
|
34
|
-
Template currently only supports Field or Dataset.
|
|
35
|
-
|
|
36
|
-
## Examples
|
|
37
|
-
|
|
38
|
-
Initialize the PowerApps Component Framework for a Field component
|
|
39
|
-
|
|
40
|
-
```sh
|
|
41
|
-
m365 pa pcf init --namespace yourNamespace --name yourCustomFieldComponent --template Field
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Initialize the PowerApps Component Framework for a Dataset component
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
m365 pa pcf init --namespace yourNamespace --name yourCustomFieldComponent --template Dataset
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Response
|
|
51
|
-
|
|
52
|
-
The response is a custom message which will show the location where the component framework has been created and a message to remind you to run `npm install` in the directory.
|
|
53
|
-
|
|
54
|
-
## More information
|
|
55
|
-
|
|
56
|
-
- Create and build a custom component: [https://docs.microsoft.com/en-us/powerapps/developer/component-framework/create-custom-controls-using-pcf](https://docs.microsoft.com/en-us/powerapps/developer/component-framework/create-custom-controls-using-pcf)
|