Skip to content

Commit 33d1c5c

Browse files
authored
Merge pull request #1169 from valadas/nuke8.1.0
Bumped Nuke to 8.1.0
2 parents fd82326 + 47c661d commit 33d1c5c

File tree

14 files changed

+276
-82
lines changed

14 files changed

+276
-82
lines changed

.github/workflows/Deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
name: ubuntu-latest
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3232
with:
3333
fetch-depth: 0
3434
- name: 'Run: Deploy'

.github/workflows/PR_Validation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name: ubuntu-latest
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
3333
with:
3434
fetch-depth: 0
3535
- name: 'Run: Compile'

.github/workflows/Publish_Site.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
name: ubuntu-latest
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3232
with:
3333
fetch-depth: 0
3434
- name: 'Run: PublishSite'

.nuke/build.schema.json

+66-68
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,78 @@
11
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"$ref": "#/definitions/build",
4-
"title": "Build Schema",
3+
"properties": {
4+
"Configuration": {
5+
"type": "string",
6+
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
7+
"enum": [
8+
"Debug",
9+
"Release"
10+
]
11+
},
12+
"GithubToken": {
13+
"type": "string",
14+
"description": "Github Token"
15+
}
16+
},
517
"definitions": {
6-
"build": {
7-
"type": "object",
18+
"Host": {
19+
"type": "string",
20+
"enum": [
21+
"AppVeyor",
22+
"AzurePipelines",
23+
"Bamboo",
24+
"Bitbucket",
25+
"Bitrise",
26+
"GitHubActions",
27+
"GitLab",
28+
"Jenkins",
29+
"Rider",
30+
"SpaceAutomation",
31+
"TeamCity",
32+
"Terminal",
33+
"TravisCI",
34+
"VisualStudio",
35+
"VSCode"
36+
]
37+
},
38+
"ExecutableTarget": {
39+
"type": "string",
40+
"enum": [
41+
"Clean",
42+
"Compile",
43+
"CreateDeployBranch",
44+
"Deploy",
45+
"GenerateReleaseNotes",
46+
"PublishSite",
47+
"Release",
48+
"SetupGithubActor",
49+
"SetupGitHubClient",
50+
"TagRelease"
51+
]
52+
},
53+
"Verbosity": {
54+
"type": "string",
55+
"description": "",
56+
"enum": [
57+
"Verbose",
58+
"Normal",
59+
"Minimal",
60+
"Quiet"
61+
]
62+
},
63+
"NukeBuild": {
864
"properties": {
9-
"Configuration": {
10-
"type": "string",
11-
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
12-
"enum": [
13-
"Debug",
14-
"Release"
15-
]
16-
},
1765
"Continue": {
1866
"type": "boolean",
1967
"description": "Indicates to continue a previously failed build attempt"
2068
},
21-
"GithubToken": {
22-
"type": "string",
23-
"description": "Github Token"
24-
},
2569
"Help": {
2670
"type": "boolean",
2771
"description": "Shows the help text for this build assembly"
2872
},
2973
"Host": {
30-
"type": "string",
3174
"description": "Host for execution. Default is 'automatic'",
32-
"enum": [
33-
"AppVeyor",
34-
"AzurePipelines",
35-
"Bamboo",
36-
"Bitbucket",
37-
"Bitrise",
38-
"GitHubActions",
39-
"GitLab",
40-
"Jenkins",
41-
"Rider",
42-
"SpaceAutomation",
43-
"TeamCity",
44-
"Terminal",
45-
"TravisCI",
46-
"VisualStudio",
47-
"VSCode"
48-
]
75+
"$ref": "#/definitions/Host"
4976
},
5077
"NoLogo": {
5178
"type": "boolean",
@@ -74,51 +101,22 @@
74101
"type": "array",
75102
"description": "List of targets to be skipped. Empty list skips all dependencies",
76103
"items": {
77-
"type": "string",
78-
"enum": [
79-
"Clean",
80-
"Compile",
81-
"CreateDeployBranch",
82-
"Deploy",
83-
"GenerateReleaseNotes",
84-
"PublishSite",
85-
"Release",
86-
"SetupGithubActor",
87-
"SetupGitHubClient",
88-
"TagRelease"
89-
]
104+
"$ref": "#/definitions/ExecutableTarget"
90105
}
91106
},
92107
"Target": {
93108
"type": "array",
94109
"description": "List of targets to be invoked. Default is '{default_target}'",
95110
"items": {
96-
"type": "string",
97-
"enum": [
98-
"Clean",
99-
"Compile",
100-
"CreateDeployBranch",
101-
"Deploy",
102-
"GenerateReleaseNotes",
103-
"PublishSite",
104-
"Release",
105-
"SetupGithubActor",
106-
"SetupGitHubClient",
107-
"TagRelease"
108-
]
111+
"$ref": "#/definitions/ExecutableTarget"
109112
}
110113
},
111114
"Verbosity": {
112-
"type": "string",
113115
"description": "Logging verbosity during build execution. Default is 'Normal'",
114-
"enum": [
115-
"Minimal",
116-
"Normal",
117-
"Quiet",
118-
"Verbose"
119-
]
116+
"$ref": "#/definitions/Verbosity"
120117
}
121118
}
122119
}
123-
}
120+
},
121+
"$ref": "#/definitions/NukeBuild"
124122
}

_build/_build.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Nuke.Common" Version="8.0.0" />
14+
<PackageReference Include="Nuke.Common" Version="8.1.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "8.0.400",
44
"rollForward": "latestMajor"
55
}
66
}

package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
import { camelToDashCase } from './case';
2+
3+
export const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {
4+
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
5+
if (node instanceof Element) {
6+
// add any classes in className to the class list
7+
const className = getClassName(node.classList, newProps, oldProps);
8+
if (className !== '') {
9+
node.className = className;
10+
}
11+
12+
Object.keys(newProps).forEach((name) => {
13+
if (
14+
name === 'children' ||
15+
name === 'style' ||
16+
name === 'ref' ||
17+
name === 'class' ||
18+
name === 'className' ||
19+
name === 'forwardedRef'
20+
) {
21+
return;
22+
}
23+
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
24+
const eventName = name.substring(2);
25+
const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
26+
27+
if (!isCoveredByReact(eventNameLc)) {
28+
syncEvent(node, eventNameLc, newProps[name]);
29+
}
30+
} else {
31+
(node as any)[name] = newProps[name];
32+
const propType = typeof newProps[name];
33+
if (propType === 'string') {
34+
node.setAttribute(camelToDashCase(name), newProps[name]);
35+
}
36+
}
37+
});
38+
}
39+
};
40+
41+
export const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {
42+
const newClassProp: string = newProps.className || newProps.class;
43+
const oldClassProp: string = oldProps.className || oldProps.class;
44+
// map the classes to Maps for performance
45+
const currentClasses = arrayToMap(classList);
46+
const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
47+
const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
48+
const finalClassNames: string[] = [];
49+
// loop through each of the current classes on the component
50+
// to see if it should be a part of the classNames added
51+
currentClasses.forEach((currentClass) => {
52+
if (incomingPropClasses.has(currentClass)) {
53+
// add it as its already included in classnames coming in from newProps
54+
finalClassNames.push(currentClass);
55+
incomingPropClasses.delete(currentClass);
56+
} else if (!oldPropClasses.has(currentClass)) {
57+
// add it as it has NOT been removed by user
58+
finalClassNames.push(currentClass);
59+
}
60+
});
61+
incomingPropClasses.forEach((s) => finalClassNames.push(s));
62+
return finalClassNames.join(' ');
63+
};
64+
65+
/**
66+
* Transforms a React event name to a browser event name.
67+
*/
68+
export const transformReactEventName = (eventNameSuffix: string) => {
69+
switch (eventNameSuffix) {
70+
case 'doubleclick':
71+
return 'dblclick';
72+
}
73+
return eventNameSuffix;
74+
};
75+
76+
/**
77+
* Checks if an event is supported in the current execution environment.
78+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
79+
*/
80+
export const isCoveredByReact = (eventNameSuffix: string) => {
81+
if (typeof document === 'undefined') {
82+
return true;
83+
} else {
84+
const eventName = 'on' + transformReactEventName(eventNameSuffix);
85+
let isSupported = eventName in document;
86+
87+
if (!isSupported) {
88+
const element = document.createElement('div');
89+
element.setAttribute(eventName, 'return;');
90+
isSupported = typeof (element as any)[eventName] === 'function';
91+
}
92+
93+
return isSupported;
94+
}
95+
};
96+
97+
export const syncEvent = (
98+
node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },
99+
eventName: string,
100+
newEventHandler?: (e: Event) => any
101+
) => {
102+
const eventStore = node.__events || (node.__events = {});
103+
const oldEventHandler = eventStore[eventName];
104+
105+
// Remove old listener so they don't double up.
106+
if (oldEventHandler) {
107+
node.removeEventListener(eventName, oldEventHandler);
108+
}
109+
110+
// Bind new listener.
111+
node.addEventListener(
112+
eventName,
113+
(eventStore[eventName] = function handler(e: Event) {
114+
if (newEventHandler) {
115+
newEventHandler.call(this, e);
116+
}
117+
})
118+
);
119+
};
120+
121+
const arrayToMap = (arr: string[] | DOMTokenList) => {
122+
const map = new Map<string, string>();
123+
(arr as string[]).forEach((s: string) => map.set(s, s));
124+
return map;
125+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const dashToPascalCase = (str: string) =>
2+
str
3+
.toLowerCase()
4+
.split('-')
5+
.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
6+
.join('');
7+
export const camelToDashCase = (str: string) => str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`);

0 commit comments

Comments
 (0)