@netlify/angular-runtime
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "@netlify/angular-runtime", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Netlify Angular Runtime - Run Angular seamlessly on Netlify.", | ||
@@ -25,3 +25,3 @@ "main": "src/index.js", | ||
"prepublishOnly:test": "npm test", | ||
"test": "" | ||
"test": "cd demo && npm ci && netlify build --cwd . --offline && cd .. && node --test" | ||
}, | ||
@@ -53,3 +53,3 @@ "repository": { | ||
"engines": { | ||
"node": ">=16.0.0" | ||
"node": ">=18.13.0" | ||
}, | ||
@@ -61,2 +61,4 @@ "devDependencies": { | ||
"husky": "^4.3.0", | ||
"netlify-cli": "^17.2.0", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.1.2" | ||
@@ -63,0 +65,0 @@ }, |
@@ -77,3 +77,3 @@ ![Netlify Angular Runtime – Run Angular seamlessly on Netlify](netlify-plugin-angular.png) | ||
```sh | ||
netlify serve --dir dist/<your-project-name>/browser | ||
netlify serve | ||
``` | ||
@@ -80,0 +80,0 @@ |
@@ -5,2 +5,3 @@ const { Buffer } = require('node:buffer') | ||
const { join, relative, sep, posix } = require('node:path') | ||
const process = require('node:process') | ||
@@ -17,3 +18,3 @@ const { readJson } = require('fs-extra') | ||
if (dirent.isDirectory()) { | ||
return getAllFilesIn(join(dir, dirent.name)).map((path) => join(dirent.name, path)) | ||
return getAllFilesIn(join(dir, dirent.name)) | ||
} | ||
@@ -25,4 +26,22 @@ return [join(dir, dirent.name)] | ||
const getProject = (angularJson) => { | ||
const projectName = angularJson.defaultProject ?? Object.keys(angularJson.projects)[0] | ||
const getProject = (angularJson, failBuild) => { | ||
const selectedProject = process.env.ANGULAR_PROJECT | ||
if (selectedProject) { | ||
const project = angularJson.projects[selectedProject] | ||
if (!project) { | ||
return failBuild( | ||
`Could not find project selected project "${selectedProject}" in angular.json. Please update the ANGULAR_PROJECT environment variable.`, | ||
) | ||
} | ||
return project | ||
} | ||
const projectNames = Object.keys(angularJson.projects) | ||
const [projectName] = projectNames | ||
if (projectNames.length > 1) { | ||
console.warn( | ||
`Found multiple projects in angular.json, deploying "${projectName}". To deploy a different one, set the ANGULAR_PROJECT environment variable to the project name.`, | ||
) | ||
} | ||
return angularJson.projects[projectName] | ||
@@ -60,3 +79,3 @@ } | ||
const { routes: prerenderedRoutes } = await readJson(join(outputDir, 'prerendered-routes.json')) | ||
const excludedPaths = [...staticFiles, ...prerenderedRoutes] | ||
const excludedPaths = [...staticFiles, ...prerenderedRoutes].map(toPosix) | ||
@@ -69,3 +88,2 @@ // buy putting this into a separate module that's imported first, | ||
globalThis.process = process | ||
globalThis.global = globalThis | ||
globalThis.DenoEvent = globalThis.Event // storing this for fixup-event.mjs | ||
@@ -72,0 +90,0 @@ ` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
17117
251
0
7
6