Add automated versioning and deployment system
This commit is contained in:
1
lite/VERSION
Normal file
1
lite/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.1.3
|
||||
@@ -131,6 +131,25 @@ if (typeof window !== 'undefined') {
|
||||
|
||||
let modalContent = fs.readFileSync(modalPath, 'utf8');
|
||||
|
||||
// Read version from VERSION file and inject into modal title
|
||||
const versionPath = path.join(__dirname, 'VERSION');
|
||||
let versionTitle = 'Nostr Login';
|
||||
|
||||
if (fs.existsSync(versionPath)) {
|
||||
try {
|
||||
const version = fs.readFileSync(versionPath, 'utf8').trim();
|
||||
versionTitle = `Nostr Login v${version}`;
|
||||
console.log(`🔢 Using version: ${version}`);
|
||||
} catch (error) {
|
||||
console.warn('⚠️ Could not read VERSION file, using default title');
|
||||
}
|
||||
} else {
|
||||
console.log('📋 No VERSION file found, using default title');
|
||||
}
|
||||
|
||||
// Replace the modal title in the content
|
||||
modalContent = modalContent.replace(/modalTitle\.textContent = 'Nostr Login';/, `modalTitle.textContent = '${versionTitle}';`);
|
||||
|
||||
// Skip header comments
|
||||
let lines = modalContent.split('\n');
|
||||
let contentStartIndex = 0;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Two-file architecture:
|
||||
* 1. Load nostr.bundle.js (official nostr-tools bundle)
|
||||
* 2. Load nostr-lite.js (this file - NOSTR_LOGIN_LITE library with CSS-only themes)
|
||||
* Generated on: 2025-09-20T19:25:01.143Z
|
||||
* Generated on: 2025-09-21T15:22:26.408Z
|
||||
*/
|
||||
|
||||
// Verify dependencies are loaded
|
||||
@@ -381,7 +381,7 @@ class Modal {
|
||||
`;
|
||||
|
||||
const modalTitle = document.createElement('h2');
|
||||
modalTitle.textContent = 'Nostr Login';
|
||||
modalTitle.textContent = 'Nostr Login v0.1.3';
|
||||
modalTitle.style.cssText = `
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
@@ -1253,24 +1253,28 @@ class Modal {
|
||||
nsecLabel.style.cssText = 'margin-bottom: 4px; font-size: 12px; font-weight: 600;';
|
||||
|
||||
const nsecContainer = document.createElement('div');
|
||||
nsecContainer.style.cssText = 'display: flex; align-items: flex-start; margin-bottom: 8px;';
|
||||
nsecContainer.style.cssText = 'margin-bottom: 8px;';
|
||||
|
||||
const nsecCode = document.createElement('code');
|
||||
nsecCode.textContent = nsec;
|
||||
nsecCode.style.cssText = `
|
||||
flex: 1;
|
||||
word-break: break-all;
|
||||
display: block;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
background: #f3f4f6;
|
||||
padding: 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
line-height: 1.3;
|
||||
font-family: 'Courier New', monospace;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
`;
|
||||
|
||||
const nsecCopyBtn = createCopyButton(nsec, 'nsec');
|
||||
nsecCopyBtn.style.cssText += 'display: inline-block; margin-left: 0;';
|
||||
|
||||
nsecContainer.appendChild(nsecCode);
|
||||
nsecContainer.appendChild(createCopyButton(nsec, 'nsec'));
|
||||
nsecContainer.appendChild(nsecCopyBtn);
|
||||
nsecSection.appendChild(nsecLabel);
|
||||
nsecSection.appendChild(nsecContainer);
|
||||
|
||||
@@ -1281,24 +1285,28 @@ class Modal {
|
||||
secretHexLabel.style.cssText = 'margin-bottom: 4px; font-size: 12px; font-weight: 600;';
|
||||
|
||||
const secretHexContainer = document.createElement('div');
|
||||
secretHexContainer.style.cssText = 'display: flex; align-items: flex-start; margin-bottom: 8px;';
|
||||
secretHexContainer.style.cssText = 'margin-bottom: 8px;';
|
||||
|
||||
const secretHexCode = document.createElement('code');
|
||||
secretHexCode.textContent = secretKeyHex;
|
||||
secretHexCode.style.cssText = `
|
||||
flex: 1;
|
||||
word-break: break-all;
|
||||
display: block;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
background: #f3f4f6;
|
||||
padding: 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
line-height: 1.3;
|
||||
font-family: 'Courier New', monospace;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
`;
|
||||
|
||||
const secretHexCopyBtn = createCopyButton(secretKeyHex, 'hex');
|
||||
secretHexCopyBtn.style.cssText += 'display: inline-block; margin-left: 0;';
|
||||
|
||||
secretHexContainer.appendChild(secretHexCode);
|
||||
secretHexContainer.appendChild(createCopyButton(secretKeyHex, 'hex'));
|
||||
secretHexContainer.appendChild(secretHexCopyBtn);
|
||||
nsecSection.appendChild(secretHexLabel);
|
||||
nsecSection.appendChild(secretHexContainer);
|
||||
}
|
||||
@@ -1314,24 +1322,28 @@ class Modal {
|
||||
npubLabel.style.cssText = 'margin-bottom: 4px; font-size: 12px; font-weight: 600;';
|
||||
|
||||
const npubContainer = document.createElement('div');
|
||||
npubContainer.style.cssText = 'display: flex; align-items: flex-start; margin-bottom: 8px;';
|
||||
npubContainer.style.cssText = 'margin-bottom: 8px;';
|
||||
|
||||
const npubCode = document.createElement('code');
|
||||
npubCode.textContent = npub;
|
||||
npubCode.style.cssText = `
|
||||
flex: 1;
|
||||
word-break: break-all;
|
||||
display: block;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
background: #f3f4f6;
|
||||
padding: 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
line-height: 1.3;
|
||||
font-family: 'Courier New', monospace;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
`;
|
||||
|
||||
const npubCopyBtn = createCopyButton(npub, 'npub');
|
||||
npubCopyBtn.style.cssText += 'display: inline-block; margin-left: 0;';
|
||||
|
||||
npubContainer.appendChild(npubCode);
|
||||
npubContainer.appendChild(createCopyButton(npub, 'npub'));
|
||||
npubContainer.appendChild(npubCopyBtn);
|
||||
npubSection.appendChild(npubLabel);
|
||||
npubSection.appendChild(npubContainer);
|
||||
|
||||
@@ -1341,24 +1353,28 @@ class Modal {
|
||||
pubHexLabel.style.cssText = 'margin-bottom: 4px; font-size: 12px; font-weight: 600;';
|
||||
|
||||
const pubHexContainer = document.createElement('div');
|
||||
pubHexContainer.style.cssText = 'display: flex; align-items: flex-start;';
|
||||
pubHexContainer.style.cssText = '';
|
||||
|
||||
const pubHexCode = document.createElement('code');
|
||||
pubHexCode.textContent = pubkeyHex;
|
||||
pubHexCode.style.cssText = `
|
||||
flex: 1;
|
||||
word-break: break-all;
|
||||
display: block;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
background: #f3f4f6;
|
||||
padding: 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
line-height: 1.3;
|
||||
font-family: 'Courier New', monospace;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
`;
|
||||
|
||||
const pubHexCopyBtn = createCopyButton(pubkeyHex, 'hex');
|
||||
pubHexCopyBtn.style.cssText += 'display: inline-block; margin-left: 0;';
|
||||
|
||||
pubHexContainer.appendChild(pubHexCode);
|
||||
pubHexContainer.appendChild(createCopyButton(pubkeyHex, 'hex'));
|
||||
pubHexContainer.appendChild(pubHexCopyBtn);
|
||||
npubSection.appendChild(pubHexLabel);
|
||||
npubSection.appendChild(pubHexContainer);
|
||||
|
||||
|
||||
@@ -956,24 +956,28 @@ class Modal {
|
||||
nsecLabel.style.cssText = 'margin-bottom: 4px; font-size: 12px; font-weight: 600;';
|
||||
|
||||
const nsecContainer = document.createElement('div');
|
||||
nsecContainer.style.cssText = 'display: flex; align-items: flex-start; margin-bottom: 8px;';
|
||||
nsecContainer.style.cssText = 'margin-bottom: 8px;';
|
||||
|
||||
const nsecCode = document.createElement('code');
|
||||
nsecCode.textContent = nsec;
|
||||
nsecCode.style.cssText = `
|
||||
flex: 1;
|
||||
word-break: break-all;
|
||||
display: block;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
background: #f3f4f6;
|
||||
padding: 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
line-height: 1.3;
|
||||
font-family: 'Courier New', monospace;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
`;
|
||||
|
||||
const nsecCopyBtn = createCopyButton(nsec, 'nsec');
|
||||
nsecCopyBtn.style.cssText += 'display: inline-block; margin-left: 0;';
|
||||
|
||||
nsecContainer.appendChild(nsecCode);
|
||||
nsecContainer.appendChild(createCopyButton(nsec, 'nsec'));
|
||||
nsecContainer.appendChild(nsecCopyBtn);
|
||||
nsecSection.appendChild(nsecLabel);
|
||||
nsecSection.appendChild(nsecContainer);
|
||||
|
||||
@@ -984,24 +988,28 @@ class Modal {
|
||||
secretHexLabel.style.cssText = 'margin-bottom: 4px; font-size: 12px; font-weight: 600;';
|
||||
|
||||
const secretHexContainer = document.createElement('div');
|
||||
secretHexContainer.style.cssText = 'display: flex; align-items: flex-start; margin-bottom: 8px;';
|
||||
secretHexContainer.style.cssText = 'margin-bottom: 8px;';
|
||||
|
||||
const secretHexCode = document.createElement('code');
|
||||
secretHexCode.textContent = secretKeyHex;
|
||||
secretHexCode.style.cssText = `
|
||||
flex: 1;
|
||||
word-break: break-all;
|
||||
display: block;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
background: #f3f4f6;
|
||||
padding: 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
line-height: 1.3;
|
||||
font-family: 'Courier New', monospace;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
`;
|
||||
|
||||
const secretHexCopyBtn = createCopyButton(secretKeyHex, 'hex');
|
||||
secretHexCopyBtn.style.cssText += 'display: inline-block; margin-left: 0;';
|
||||
|
||||
secretHexContainer.appendChild(secretHexCode);
|
||||
secretHexContainer.appendChild(createCopyButton(secretKeyHex, 'hex'));
|
||||
secretHexContainer.appendChild(secretHexCopyBtn);
|
||||
nsecSection.appendChild(secretHexLabel);
|
||||
nsecSection.appendChild(secretHexContainer);
|
||||
}
|
||||
@@ -1017,24 +1025,28 @@ class Modal {
|
||||
npubLabel.style.cssText = 'margin-bottom: 4px; font-size: 12px; font-weight: 600;';
|
||||
|
||||
const npubContainer = document.createElement('div');
|
||||
npubContainer.style.cssText = 'display: flex; align-items: flex-start; margin-bottom: 8px;';
|
||||
npubContainer.style.cssText = 'margin-bottom: 8px;';
|
||||
|
||||
const npubCode = document.createElement('code');
|
||||
npubCode.textContent = npub;
|
||||
npubCode.style.cssText = `
|
||||
flex: 1;
|
||||
word-break: break-all;
|
||||
display: block;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
background: #f3f4f6;
|
||||
padding: 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
line-height: 1.3;
|
||||
font-family: 'Courier New', monospace;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
`;
|
||||
|
||||
const npubCopyBtn = createCopyButton(npub, 'npub');
|
||||
npubCopyBtn.style.cssText += 'display: inline-block; margin-left: 0;';
|
||||
|
||||
npubContainer.appendChild(npubCode);
|
||||
npubContainer.appendChild(createCopyButton(npub, 'npub'));
|
||||
npubContainer.appendChild(npubCopyBtn);
|
||||
npubSection.appendChild(npubLabel);
|
||||
npubSection.appendChild(npubContainer);
|
||||
|
||||
@@ -1044,24 +1056,28 @@ class Modal {
|
||||
pubHexLabel.style.cssText = 'margin-bottom: 4px; font-size: 12px; font-weight: 600;';
|
||||
|
||||
const pubHexContainer = document.createElement('div');
|
||||
pubHexContainer.style.cssText = 'display: flex; align-items: flex-start;';
|
||||
pubHexContainer.style.cssText = '';
|
||||
|
||||
const pubHexCode = document.createElement('code');
|
||||
pubHexCode.textContent = pubkeyHex;
|
||||
pubHexCode.style.cssText = `
|
||||
flex: 1;
|
||||
word-break: break-all;
|
||||
display: block;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
background: #f3f4f6;
|
||||
padding: 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
line-height: 1.3;
|
||||
font-family: 'Courier New', monospace;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
`;
|
||||
|
||||
const pubHexCopyBtn = createCopyButton(pubkeyHex, 'hex');
|
||||
pubHexCopyBtn.style.cssText += 'display: inline-block; margin-left: 0;';
|
||||
|
||||
pubHexContainer.appendChild(pubHexCode);
|
||||
pubHexContainer.appendChild(createCopyButton(pubkeyHex, 'hex'));
|
||||
pubHexContainer.appendChild(pubHexCopyBtn);
|
||||
npubSection.appendChild(pubHexLabel);
|
||||
npubSection.appendChild(pubHexContainer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user