Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend-clients
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
frontend-clients
Commits
76d0d018
Commit
76d0d018
authored
1 year ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-4320 OZG-4488 Remove obsolete post install hook
parent
ae2d3d73
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
goofy-client/decorate-angular-cli.js
+0
-105
0 additions, 105 deletions
goofy-client/decorate-angular-cli.js
goofy-client/package.json
+0
-1
0 additions, 1 deletion
goofy-client/package.json
with
0 additions
and
106 deletions
goofy-client/decorate-angular-cli.js
deleted
100644 → 0
+
0
−
105
View file @
ae2d3d73
/*
* Copyright (C) 2022 Das Land Schleswig-Holstein vertreten durch den
* Ministerpräsidenten des Landes Schleswig-Holstein
* Staatskanzlei
* Abteilung Digitalisierung und zentrales IT-Management der Landesregierung
*
* Lizenziert unter der EUPL, Version 1.2 oder - sobald
* diese von der Europäischen Kommission genehmigt wurden -
* Folgeversionen der EUPL ("Lizenz");
* Sie dürfen dieses Werk ausschließlich gemäß
* dieser Lizenz nutzen.
* Eine Kopie der Lizenz finden Sie hier:
*
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
* Sofern nicht durch anwendbare Rechtsvorschriften
* gefordert oder in schriftlicher Form vereinbart, wird
* die unter der Lizenz verbreitete Software "so wie sie
* ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN -
* ausdrücklich oder stillschweigend - verbreitet.
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
/**
* This file decorates the Angular CLI with the Nx CLI to enable features such as computation caching
* and faster execution of tasks.
*
* It does this by:
*
* - Patching the Angular CLI to warn you in case you accidentally use the undecorated ng command.
* - Symlinking the ng to nx command, so all commands run through the Nx CLI
* - Updating the package.json postinstall script to give you control over this script
*
* The Nx CLI decorates the Angular CLI, so the Nx CLI is fully compatible with it.
* Every command you run should work the same when using the Nx CLI, except faster.
*
* Because of symlinking you can still type `ng build/test/lint` in the terminal. The ng command, in this case,
* will point to nx, which will perform optimizations before invoking ng. So the Angular CLI is always invoked.
* The Nx CLI simply does some optimizations before invoking the Angular CLI.
*
* To opt out of this patch:
* - Replace occurrences of nx with ng in your package.json
* - Remove the script from your postinstall script in your package.json
* - Delete and reinstall your node_modules
*/
const
fs
=
require
(
'
fs
'
);
const
os
=
require
(
'
os
'
);
const
cp
=
require
(
'
child_process
'
);
const
isWindows
=
os
.
platform
()
===
'
win32
'
;
let
output
;
try
{
output
=
require
(
'
@nx/workspace
'
).
output
;
}
catch
(
e
)
{
console
.
warn
(
'
Angular CLI could not be decorated to enable computation caching. Please ensure @nx/workspace is installed.
'
);
process
.
exit
(
0
);
}
/**
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still
* invoke the Nx CLI and get the benefits of computation caching.
*/
function
symlinkNgCLItoNxCLI
()
{
try
{
const
ngPath
=
'
./node_modules/.bin/ng
'
;
const
nxPath
=
'
./node_modules/.bin/nx
'
;
if
(
isWindows
)
{
/**
* This is the most reliable way to create symlink-like behavior on Windows.
* Such that it works in all shells and works with npx.
*/
[
''
,
'
.cmd
'
,
'
.ps1
'
].
forEach
((
ext
)
=>
{
if
(
fs
.
existsSync
(
nxPath
+
ext
))
fs
.
writeFileSync
(
ngPath
+
ext
,
fs
.
readFileSync
(
nxPath
+
ext
)
);
});
}
else
{
// If unix-based, symlink
cp
.
execSync
(
`ln -sf ./nx
${
ngPath
}
`
);
}
}
catch
(
e
)
{
output
.
error
({
title
:
'
Unable to create a symlink from the Angular CLI to the Nx CLI:
'
+
e
.
message
,
});
throw
e
;
}
}
try
{
symlinkNgCLItoNxCLI
();
require
(
'
@nrwl/cli/lib/decorate-cli
'
).
decorateCli
();
output
.
log
({
title
:
'
Angular CLI has been decorated to enable computation caching.
'
,
});
}
catch
(
e
)
{
output
.
error
({
title
:
'
Decoration of the Angular CLI did not complete successfully
'
,
});
}
This diff is collapsed.
Click to expand it.
goofy-client/package.json
+
0
−
1
View file @
76d0d018
...
...
@@ -3,7 +3,6 @@
"version"
:
"0.0.0"
,
"license"
:
"MIT"
,
"scripts"
:
{
"postinstall"
:
"node ./decorate-angular-cli.js"
,
"start"
:
"nx serve --port=4300 --disable-host-check"
,
"start:debug"
:
"nx serve --port=4300 --disable-host-check --verbose"
,
"start-for-screenreader"
:
"nx serve --host=192.168.178.20 --port=4300 --disable-host-check --verbose"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment