@spinnaker/scripts 2026.2.2 → 2026.3.0

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.
@@ -25,7 +25,7 @@ const plugins = [
25
25
  nodeResolve(),
26
26
  commonjs({
27
27
  // Ensure CommonJS modules that use require() get the full module.exports
28
- // rather than trying to find a default export (fixes ngimport interop)
28
+ // rather than trying to find a default export
29
29
  defaultIsModuleExports: true,
30
30
  // Treat external ESM dependencies correctly when they're required from CJS
31
31
  esmExternals: true,
@@ -2,7 +2,6 @@ const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
4
  const baseRollupConfig = require('./rollup.config.base');
5
- const angularJsTemplateLoader = require('../helpers/rollup-plugin-angularjs-template-loader');
6
5
  const externalConfigurer = require('../helpers/rollup-node-auto-external-configurer');
7
6
 
8
7
  const packageJSON = JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8'));
@@ -11,6 +10,6 @@ module.exports = {
11
10
  ...baseRollupConfig,
12
11
  input: 'src/index.ts',
13
12
  output: [{ dir: 'dist', format: 'es', sourcemap: true }],
14
- plugins: [angularJsTemplateLoader({ sourceMap: true }), ...baseRollupConfig.plugins],
13
+ plugins: baseRollupConfig.plugins,
15
14
  external: externalConfigurer(packageJSON.dependencies),
16
15
  };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/spinnaker/spinnaker.git"
6
6
  },
7
- "version": "2026.2.2",
7
+ "version": "2026.3.0",
8
8
  "description": "Spinnaker scripts",
9
9
  "main": "index.js",
10
10
  "bin": {
@@ -50,5 +50,5 @@
50
50
  "devDependencies": {
51
51
  "@types/yargs": "^17.0.3"
52
52
  },
53
- "gitHead": "db086c61529c9421e8c0c2d4a2b8eca88c675ac8"
53
+ "gitHead": "0f7d75f5d4b42c1675e2ecc69a53f8eb73090eb9"
54
54
  }
@@ -1,91 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const MagicString = require('magic-string');
4
-
5
- // This rollup plugin finds AngularJS templates and loads them into the $templateCache
6
- // This is a rollup replacement for the ngtemplate-loader webpack loader
7
- module.exports = function angularJsTemplateLoader(options = {}) {
8
- function isSourceMapEnabled() {
9
- return options.sourceMap !== false && options.sourcemap !== false;
10
- }
11
-
12
- return {
13
- name: 'angularJSTemplateLoader',
14
- transform(originalCode, id) {
15
- const code = originalCode;
16
- const templateRegex = /require\(['"]([^'"]+\.html)['"]\)/g;
17
-
18
- // look for things like require('./template.html')
19
- if (
20
- (!code.includes("require('") && !code.includes(`require("`)) ||
21
- id.includes('node_modules') ||
22
- id.includes('react-refresh')
23
- ) {
24
- return;
25
- }
26
-
27
- if (!fs.existsSync(id)) {
28
- throw new Error('Unable to load AngularJS template; could not find source file ' + id);
29
- }
30
-
31
- // Find the directory the JS source file is in
32
- const baseDir = fs.lstatSync(id).isDirectory() ? id : path.dirname(id);
33
- const moduleRootDir = path.resolve('.');
34
- const moduleDirName = path.basename(moduleRootDir);
35
-
36
- let match = templateRegex.exec(code);
37
- if (!match) {
38
- return;
39
- }
40
-
41
- const magicString = new MagicString(code);
42
-
43
- while (match) {
44
- // i.e., './template.html'
45
- const templatePath = match[1];
46
- // Absolute path to the actual template.html file
47
- const contentPath = path.resolve(baseDir, templatePath);
48
- if (!fs.existsSync(contentPath)) {
49
- throw new Error('Unable to load AngularJS template; could not find template file ' + contentPath);
50
- }
51
-
52
- const templatePathFromModuleRoot = `${moduleDirName}${path.sep}${path.relative(moduleRootDir, contentPath)}`;
53
-
54
- const startIdx = match.index;
55
- const endIdx = startIdx + match[0].length;
56
-
57
- // read the contents of template.html
58
- const content = fs.readFileSync(contentPath, { encoding: 'UTF8' }).replace(/`/g, '\\`');
59
-
60
- // Replace: templateUrl: require('./template.html')
61
- // With: templateUrl: 'path/from/module/root/to/template.html'
62
- magicString.overwrite(startIdx, endIdx, `'${templatePathFromModuleRoot}'`);
63
-
64
- // Append a run block that adds the HTML content into the $templateCache (used by angularjs when loading templates)
65
- magicString.append(`
66
-
67
- /*********************************************************************
68
- * angularjs-template-loader rollup plugin -- ${templatePathFromModuleRoot} start *
69
- ********************************************************************/
70
-
71
- window.angular.module('ng').run(['$templateCache', function(templateCache) {
72
- templateCache.put('${templatePathFromModuleRoot}',
73
- \`${content}\`)
74
- }]);
75
-
76
- /*********************************************************************
77
- * angularjs-template-loader rollup plugin -- ${templatePathFromModuleRoot} end *
78
- ********************************************************************/
79
- `);
80
- // look for another match
81
- match = templateRegex.exec(code);
82
- }
83
-
84
- if (isSourceMapEnabled()) {
85
- return { code: magicString.toString(), map: magicString.generateMap({ hires: true }) };
86
- } else {
87
- return { code: magicString.toString() };
88
- }
89
- },
90
- };
91
- };