Skip to content

Commit 9701e9f

Browse files
committed
Ensure latest version is fetched from CDN
1 parent 51c3673 commit 9701e9f

File tree

8 files changed

+124
-40
lines changed

8 files changed

+124
-40
lines changed

dist/angular-ts.esm.js

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Version: 0.9.6 - October 23, 2025 19:46:24 */
1+
/* Version: 0.9.7 - October 26, 2025 04:17:19 */
22
const VALID_CLASS = "ng-valid";
33
const INVALID_CLASS = "ng-invalid";
44
const PRISTINE_CLASS = "ng-pristine";
@@ -4010,7 +4010,7 @@ function SceProvider() {
40104010
*/
40114011

40124012
/**
4013-
* @type {Record<string, import("../../interface.js").DirectiveFactory>}
4013+
* @type {Record<string, ng.DirectiveFactory>}
40144014
*/
40154015
const ngEventDirectives = {};
40164016

@@ -4023,7 +4023,7 @@ const ngEventDirectives = {};
40234023
"$exceptionHandler",
40244024
/**
40254025
* @param {import("../../core/parse/interface.ts").ParseService} $parse
4026-
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
4026+
* @param {ng.ExceptionHandlerService} $exceptionHandler
40274027
* @returns
40284028
*/
40294029
($parse, $exceptionHandler) => {
@@ -4039,11 +4039,11 @@ const ngEventDirectives = {};
40394039

40404040
/**
40414041
*
4042-
* @param {import("../../core/parse/interface.ts").ParseService} $parse
4043-
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
4042+
* @param {ng.ParseService} $parse
4043+
* @param {ng.ExceptionHandlerService} $exceptionHandler
40444044
* @param {string} directiveName
40454045
* @param {string} eventName
4046-
* @returns {import("../../interface.ts").Directive}
4046+
* @returns {ng.Directive}
40474047
*/
40484048
function createEventDirective(
40494049
$parse,
@@ -13343,17 +13343,17 @@ const patternDirective = [
1334313343
const maxlengthDirective = [
1334413344
$injectTokens.$parse,
1334513345
/**
13346-
* @param {import("../../core/parse/interface.ts").ParseService} $parse
13347-
* @returns {import("../../interface.ts").Directive}
13346+
* @param {ng.ParseService} $parse
13347+
* @returns {ng.Directive}
1334813348
*/
1334913349
($parse) => ({
1335013350
restrict: "A",
1335113351
require: "?ngModel",
1335213352
link:
1335313353
/**
13354-
* @param {import("../../core/scope/scope.js").Scope} scope
13355-
* @param {*} _elm
13356-
* @param {import("../../core/compile/attributes.js").Attributes} attr
13354+
* @param {ng.Scope} scope
13355+
* @param {Element} _elm
13356+
* @param {ng.Attributes} attr
1335713357
* @param {import("../../interface.ts").NgModelController} ctrl
1335813358
* @returns
1335913359
*/
@@ -35469,6 +35469,37 @@ function ngInjectDirective($log, $injector) {
3546935469
};
3547035470
}
3547135471

35472+
/**
35473+
* @returns {ng.Directive}
35474+
*/
35475+
function ngElDirective() {
35476+
return {
35477+
restrict: "A",
35478+
link(scope, element, attrs) {
35479+
const expr = attrs["ngEl"];
35480+
const key = !expr ? element.id : expr;
35481+
35482+
scope.$target[key] = element;
35483+
const parent = element.parentNode;
35484+
if (!parent) return;
35485+
35486+
const observer = new MutationObserver((mutations) => {
35487+
for (const mutation of mutations) {
35488+
Array.from(mutation.removedNodes).forEach((removedNode) => {
35489+
if (removedNode === element) {
35490+
//
35491+
delete scope.$target[key];
35492+
observer.disconnect();
35493+
}
35494+
});
35495+
}
35496+
});
35497+
35498+
observer.observe(parent, { childList: true });
35499+
},
35500+
};
35501+
}
35502+
3547235503
/**
3547335504
* Initializes core `ng` module.
3547435505
* @param {import('./angular.js').Angular} angular
@@ -35508,6 +35539,7 @@ function registerNgModule(angular) {
3550835539
ngController: ngControllerDirective,
3550935540
ngDelete: ngDeleteDirective,
3551035541
ngDisabled: ngDisabledAriaDirective,
35542+
ngEl: ngElDirective,
3551135543
ngForm: ngFormDirective,
3551235544
ngGet: ngGetDirective,
3551335545
ngHide: ngHideDirective,
@@ -35641,7 +35673,7 @@ class Angular {
3564135673
/**
3564235674
* @type {string} `version` from `package.json`
3564335675
*/
35644-
this.version = "0.9.6"; //inserted via rollup plugin
35676+
this.version = "0.9.7"; //inserted via rollup plugin
3564535677

3564635678
/** @type {!Array<string|any>} */
3564735679
this.bootsrappedModules = [];

dist/angular-ts.umd.js

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Version: 0.9.6 - October 23, 2025 19:46:22 */
1+
/* Version: 0.9.7 - October 26, 2025 04:17:18 */
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
44
typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -4016,7 +4016,7 @@
40164016
*/
40174017

40184018
/**
4019-
* @type {Record<string, import("../../interface.js").DirectiveFactory>}
4019+
* @type {Record<string, ng.DirectiveFactory>}
40204020
*/
40214021
const ngEventDirectives = {};
40224022

@@ -4029,7 +4029,7 @@
40294029
"$exceptionHandler",
40304030
/**
40314031
* @param {import("../../core/parse/interface.ts").ParseService} $parse
4032-
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
4032+
* @param {ng.ExceptionHandlerService} $exceptionHandler
40334033
* @returns
40344034
*/
40354035
($parse, $exceptionHandler) => {
@@ -4045,11 +4045,11 @@
40454045

40464046
/**
40474047
*
4048-
* @param {import("../../core/parse/interface.ts").ParseService} $parse
4049-
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
4048+
* @param {ng.ParseService} $parse
4049+
* @param {ng.ExceptionHandlerService} $exceptionHandler
40504050
* @param {string} directiveName
40514051
* @param {string} eventName
4052-
* @returns {import("../../interface.ts").Directive}
4052+
* @returns {ng.Directive}
40534053
*/
40544054
function createEventDirective(
40554055
$parse,
@@ -13349,17 +13349,17 @@
1334913349
const maxlengthDirective = [
1335013350
$injectTokens.$parse,
1335113351
/**
13352-
* @param {import("../../core/parse/interface.ts").ParseService} $parse
13353-
* @returns {import("../../interface.ts").Directive}
13352+
* @param {ng.ParseService} $parse
13353+
* @returns {ng.Directive}
1335413354
*/
1335513355
($parse) => ({
1335613356
restrict: "A",
1335713357
require: "?ngModel",
1335813358
link:
1335913359
/**
13360-
* @param {import("../../core/scope/scope.js").Scope} scope
13361-
* @param {*} _elm
13362-
* @param {import("../../core/compile/attributes.js").Attributes} attr
13360+
* @param {ng.Scope} scope
13361+
* @param {Element} _elm
13362+
* @param {ng.Attributes} attr
1336313363
* @param {import("../../interface.ts").NgModelController} ctrl
1336413364
* @returns
1336513365
*/
@@ -35475,6 +35475,37 @@
3547535475
};
3547635476
}
3547735477

35478+
/**
35479+
* @returns {ng.Directive}
35480+
*/
35481+
function ngElDirective() {
35482+
return {
35483+
restrict: "A",
35484+
link(scope, element, attrs) {
35485+
const expr = attrs["ngEl"];
35486+
const key = !expr ? element.id : expr;
35487+
35488+
scope.$target[key] = element;
35489+
const parent = element.parentNode;
35490+
if (!parent) return;
35491+
35492+
const observer = new MutationObserver((mutations) => {
35493+
for (const mutation of mutations) {
35494+
Array.from(mutation.removedNodes).forEach((removedNode) => {
35495+
if (removedNode === element) {
35496+
//
35497+
delete scope.$target[key];
35498+
observer.disconnect();
35499+
}
35500+
});
35501+
}
35502+
});
35503+
35504+
observer.observe(parent, { childList: true });
35505+
},
35506+
};
35507+
}
35508+
3547835509
/**
3547935510
* Initializes core `ng` module.
3548035511
* @param {import('./angular.js').Angular} angular
@@ -35514,6 +35545,7 @@
3551435545
ngController: ngControllerDirective,
3551535546
ngDelete: ngDeleteDirective,
3551635547
ngDisabled: ngDisabledAriaDirective,
35548+
ngEl: ngElDirective,
3551735549
ngForm: ngFormDirective,
3551835550
ngGet: ngGetDirective,
3551935551
ngHide: ngHideDirective,
@@ -35647,7 +35679,7 @@
3564735679
/**
3564835680
* @type {string} `version` from `package.json`
3564935681
*/
35650-
this.version = "0.9.6"; //inserted via rollup plugin
35682+
this.version = "0.9.7"; //inserted via rollup plugin
3565135683

3565235684
/** @type {!Array<string|any>} */
3565335685
this.bootsrappedModules = [];

dist/angular-ts.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
<script src="
2-
https://cdn.jsdelivr.net/npm/@angular-wave/angular.ts@latest/dist/angular-ts.umd.js
3-
"></script>
1+
<script src="https://cdn.jsdelivr.net/npm/@angular-wave/angular.ts@0.9.7/dist/angular-ts.umd.js"></script>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<p>Version: 0.9.6</p>
1+
<p>Version: 0.9.7</p>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@angular-wave/angular.ts",
33
"description": "A modern, optimized and type-safe version of AngularJS",
44
"license": "MIT",
5-
"version": "0.9.6",
5+
"version": "0.9.7",
66
"type": "module",
77
"main": "dist/angular-ts.esm.js",
88
"module": "dist/angular-ts.esm.js",

utils/version.cjs

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,45 @@
11
const fs = require("fs");
22
const path = require("path");
33

4+
// Path to package.json
45
const packageJsonPath = path.resolve(__dirname, "../package.json");
56

6-
const outputPath = path.resolve(
7-
__dirname,
8-
"../docs/layouts/shortcodes/version.html",
9-
);
7+
// Define files to generate
8+
const filesToGenerate = [
9+
{
10+
outputPath: path.resolve(
11+
__dirname,
12+
"../docs/layouts/shortcodes/version.html",
13+
),
14+
getContent: (version) => `<p>Version: ${version}</p>\n`,
15+
},
16+
{
17+
outputPath: path.resolve(
18+
__dirname,
19+
"../docs/layouts/partials/hooks/head-end.html",
20+
),
21+
getContent: (version) => `
22+
<script src="https://cdn.jsdelivr.net/npm/@angular-wave/angular.ts@${version}/dist/angular-ts.umd.js"></script>
23+
`,
24+
},
25+
];
1026

1127
try {
28+
// Read package.json once
1229
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
1330
const version = packageJson.version || "unknown";
1431

15-
const htmlContent = `<p>Version: ${version}</p>\n`;
32+
// Generate all files
33+
filesToGenerate.forEach(({ outputPath, getContent }) => {
34+
const content = getContent(version);
1635

17-
fs.writeFileSync(outputPath, htmlContent);
36+
// Ensure the directory exists
37+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
1838

19-
console.log(`✅ Version HTML file generated at ${outputPath}`);
39+
fs.writeFileSync(outputPath, content, "utf-8");
40+
console.log(`✅ Generated: ${outputPath}`);
41+
});
2042
} catch (error) {
21-
console.error("❌ Error generating version HTML:", error);
43+
console.error("❌ Error generating files:", error);
2244
process.exit(1);
2345
}

0 commit comments

Comments
 (0)