@temir.ra/create-template 0.4.1 → 0.4.3

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Version 0
2
2
 
3
+ ## 0.4.3
4
+
5
+ 1. Fixed versioning issue.
6
+
7
+ ## 0.4.2
8
+
9
+ 1. Updated from `ts-lib@0.12.0-pre.1` template.
10
+
3
11
  ## 0.4.1
4
12
 
5
13
  1. Minor updates in the README.
package/buildinfo.txt CHANGED
@@ -1 +1 @@
1
- 0.4.1+78fe6f9
1
+ 0.4.3+42c009c
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temir.ra/create-template",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "A template for a template package.",
5
5
  "private": false,
6
6
  "keywords": [
@@ -17,7 +17,7 @@
17
17
  "files": [
18
18
  "scripts/buildinfo.ts",
19
19
  "scripts/build-bundle.ts",
20
- "scripts/cdn-rewrite-map.json",
20
+ "scripts/import-map.json",
21
21
  "CHANGELOG.md",
22
22
  "buildinfo.txt",
23
23
  "dist/",
@@ -11,7 +11,7 @@ import {
11
11
  type BuildResult
12
12
  } from 'esbuild';
13
13
 
14
- import CDN_REWRITE_MAP from './cdn-rewrite-map.json';
14
+ import IMPORT_MAP from './import-map.json';
15
15
 
16
16
 
17
17
  interface ExportConditions {
@@ -122,20 +122,20 @@ const esbuildLog: EsbuildPlugin = {
122
122
  });
123
123
  }
124
124
  }
125
- const cdnRewrite: EsbuildPlugin = {
126
- name: 'cdn-rewrite',
125
+ const importMap: EsbuildPlugin = {
126
+ name: 'import-map',
127
127
  setup(build: PluginBuild) {
128
128
 
129
- for (const [importSpecifier, urlTemplate] of Object.entries(CDN_REWRITE_MAP) as [string, string][]) {
129
+ for (const [importSpecifier, urlTemplate] of Object.entries(IMPORT_MAP) as [string, string | null][]) {
130
130
 
131
- const url = resolveVersionInCdnUrl(importSpecifier, urlTemplate);
132
- console.log(`[cdn-rewrite plugin] '${importSpecifier}' → '${url}'`);
131
+ const url = urlTemplate ? resolveVersionInCdnUrl(importSpecifier, urlTemplate) : null;
132
+ console.log(`[import-map plugin] '${importSpecifier}' → ${url ? `'${url}'` : 'external (no rewrite)'}`);
133
133
 
134
134
  const escapedSpecifier = importSpecifier.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
135
135
  build.onResolve(
136
136
  { filter: new RegExp(`^${escapedSpecifier}$`) },
137
137
  (args: OnResolveArgs): OnResolveResult | undefined => {
138
- return { path: url, external: true };
138
+ return { path: url ?? args.path, external: true };
139
139
  }
140
140
  );
141
141
 
@@ -157,7 +157,7 @@ const buildOptions: BuildOptions = {
157
157
  bundle: true,
158
158
  minify: true,
159
159
  sourcemap: 'external',
160
- plugins: [esbuildLog, cdnRewrite],
160
+ plugins: [esbuildLog, importMap],
161
161
 
162
162
  };
163
163
 
@@ -0,0 +1 @@
1
+ {}
@@ -17,7 +17,7 @@
17
17
  "files": [
18
18
  "scripts/buildinfo.ts",
19
19
  "scripts/build-bundle.ts",
20
- "scripts/cdn-rewrite-map.json",
20
+ "scripts/import-map.json",
21
21
  "CHANGELOG.md",
22
22
  "buildinfo.txt",
23
23
  "dist/",
@@ -11,7 +11,7 @@ import {
11
11
  type BuildResult
12
12
  } from 'esbuild';
13
13
 
14
- import CDN_REWRITE_MAP from './cdn-rewrite-map.json';
14
+ import IMPORT_MAP from './import-map.json';
15
15
 
16
16
 
17
17
  interface ExportConditions {
@@ -122,20 +122,20 @@ const esbuildLog: EsbuildPlugin = {
122
122
  });
123
123
  }
124
124
  }
125
- const cdnRewrite: EsbuildPlugin = {
126
- name: 'cdn-rewrite',
125
+ const importMap: EsbuildPlugin = {
126
+ name: 'import-map',
127
127
  setup(build: PluginBuild) {
128
128
 
129
- for (const [importSpecifier, urlTemplate] of Object.entries(CDN_REWRITE_MAP) as [string, string][]) {
129
+ for (const [importSpecifier, urlTemplate] of Object.entries(IMPORT_MAP) as [string, string | null][]) {
130
130
 
131
- const url = resolveVersionInCdnUrl(importSpecifier, urlTemplate);
132
- console.log(`[cdn-rewrite plugin] '${importSpecifier}' → '${url}'`);
131
+ const url = urlTemplate ? resolveVersionInCdnUrl(importSpecifier, urlTemplate) : null;
132
+ console.log(`[import-map plugin] '${importSpecifier}' → ${url ? `'${url}'` : 'external (no rewrite)'}`);
133
133
 
134
134
  const escapedSpecifier = importSpecifier.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
135
135
  build.onResolve(
136
136
  { filter: new RegExp(`^${escapedSpecifier}$`) },
137
137
  (args: OnResolveArgs): OnResolveResult | undefined => {
138
- return { path: url, external: true };
138
+ return { path: url ?? args.path, external: true };
139
139
  }
140
140
  );
141
141
 
@@ -157,7 +157,7 @@ const buildOptions: BuildOptions = {
157
157
  bundle: true,
158
158
  minify: true,
159
159
  sourcemap: 'external',
160
- plugins: [esbuildLog, cdnRewrite],
160
+ plugins: [esbuildLog, importMap],
161
161
 
162
162
  };
163
163
 
@@ -0,0 +1 @@
1
+ {}
@@ -1 +0,0 @@
1
- {}
@@ -1 +0,0 @@
1
- {}