extension-create 1.0.7 → 1.2.1
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/README.md +16 -6
- package/dist/cli.js +49 -8
- package/dist/module.d.ts +3 -0
- package/dist/module.js +255 -0
- package/dist/stylelint.config.js +7 -0
- package/dist/tailwind.config.js +25 -0
- package/package.json +10 -7
package/README.md
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
[action-image]: https://github.com/cezaraugusto/extension-create/workflows/
|
|
1
|
+
[action-image]: https://github.com/cezaraugusto/extension-create/actions/workflows/ci.yml/badge.svg?branch=main
|
|
2
2
|
[action-url]: https://github.com/cezaraugusto/extension-create/actions
|
|
3
3
|
[npm-image]: https://img.shields.io/npm/v/extension-create.svg
|
|
4
4
|
[npm-url]: https://npmjs.org/package/extension-create
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
[downloads-image]: https://img.shields.io/npm/dm/extension-create.svg
|
|
6
|
+
[downloads-url]: https://npmjs.org/package/extension-create
|
|
7
|
+
[node]: https://img.shields.io/node/v/extension-create.svg
|
|
8
|
+
[node-url]: https://nodejs.org
|
|
9
|
+
[prs]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
|
|
10
|
+
[prs-url]: https://github.com/cezaraugusto/extension-create/blob/main/CONTRIBUTING.md
|
|
11
|
+
[vunlerabilities]: https://snyk.io/test/github/cezaraugusto/extension-create/badge.svg
|
|
12
|
+
[fossa-image]: https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcezaraugusto%2Fextension-create.svg?type=shield
|
|
13
|
+
[fossa-url]: https://app.fossa.com/projects/git%2Bgithub.com%2Fcezaraugusto%2Fextension-create?ref=badge_large
|
|
14
|
+
|
|
15
|
+
# extension-create [![npm][npm-image]][npm-url] [![fossa][fossa-image]][fossa-url] [![workflow][action-image]][action-url] [![downloads][downloads-image]][downloads-url] [![PR's welcome][prs]][prs-url]
|
|
9
16
|
|
|
10
17
|
<img alt="Logo" align="right" src="https://user-images.githubusercontent.com/4672033/102850460-4d22aa80-43f8-11eb-82db-9efce586f73e.png" width="25%" />
|
|
11
18
|
|
|
@@ -20,7 +27,7 @@ Create cross-browser extensions with no build configuration.
|
|
|
20
27
|
## Creating an Extension
|
|
21
28
|
|
|
22
29
|
```sh
|
|
23
|
-
npx extension-create create my-extension-hello
|
|
30
|
+
npx extension-create@latest create my-extension-hello
|
|
24
31
|
cd my-extension-hello
|
|
25
32
|
npm run dev
|
|
26
33
|
```
|
|
@@ -78,6 +85,9 @@ Just add `extension-create` to your npm scripts. Here's how it should look in yo
|
|
|
78
85
|
"start": "npx extension-create start",
|
|
79
86
|
"dev": "npx extension-create dev",
|
|
80
87
|
"build": "npx extension-create build"
|
|
88
|
+
},
|
|
89
|
+
"devDependencies": {
|
|
90
|
+
"extension-create": "latest"
|
|
81
91
|
}
|
|
82
92
|
}
|
|
83
93
|
```
|
package/dist/cli.js
CHANGED
|
@@ -110,13 +110,14 @@ var package_default = {
|
|
|
110
110
|
license: "MIT",
|
|
111
111
|
repository: {
|
|
112
112
|
type: "git",
|
|
113
|
-
url: "https://github.com/cezaraugusto/extension-create.git"
|
|
113
|
+
url: "https://github.com/cezaraugusto/extension-create.git",
|
|
114
|
+
directory: "programs/cli"
|
|
114
115
|
},
|
|
115
116
|
engines: {
|
|
116
117
|
node: ">=18"
|
|
117
118
|
},
|
|
118
119
|
name: "extension-create",
|
|
119
|
-
version: "1.
|
|
120
|
+
version: "1.2.1",
|
|
120
121
|
description: "Create cross-browser extensions with no build configuration.",
|
|
121
122
|
main: "./dist/cli.js",
|
|
122
123
|
types: "./dist/cli.d.ts",
|
|
@@ -132,9 +133,12 @@ var package_default = {
|
|
|
132
133
|
url: "https://cezaraugusto.com"
|
|
133
134
|
},
|
|
134
135
|
scripts: {
|
|
135
|
-
|
|
136
|
+
"compile:readme-files": "node ./scripts/copyMarkdownFilesToCli.js",
|
|
137
|
+
"compile:tailwind-config": "node ./scripts/copyTailwindConfig.js",
|
|
138
|
+
"compile:stylelint-config": "node ./scripts/copyStylelintConfig.js",
|
|
139
|
+
"compile:cli": "tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
140
|
+
compile: "yarn compile:readme-files && yarn compile:tailwind-config && yarn compile:stylelint-config &&yarn compile:cli",
|
|
136
141
|
clean: "rm -rf dist",
|
|
137
|
-
compile: "yarn copyMarkdownFilesToCli && tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
138
142
|
test: "jest"
|
|
139
143
|
},
|
|
140
144
|
keywords: [
|
|
@@ -160,14 +164,13 @@ var package_default = {
|
|
|
160
164
|
"@types/jest": "^29.5.11",
|
|
161
165
|
"@types/mock-fs": "^4.13.4",
|
|
162
166
|
"@types/node": "^20.11.5",
|
|
163
|
-
"@types/pacote": "^11.1.8",
|
|
164
167
|
"@types/semver": "^7.5.6",
|
|
165
168
|
jest: "^29.7.0",
|
|
166
169
|
"mock-fs": "^5.2.0",
|
|
167
170
|
"ts-jest": "^29.1.2",
|
|
168
171
|
tsconfig: "*",
|
|
169
172
|
tsup: "^8.0.1",
|
|
170
|
-
typescript: "
|
|
173
|
+
typescript: "5.3.3"
|
|
171
174
|
}
|
|
172
175
|
};
|
|
173
176
|
|
|
@@ -180,12 +183,50 @@ if (import_semver.default.lte(process.version, "18.0.0")) {
|
|
|
180
183
|
}
|
|
181
184
|
var extensionCreate = import_commander.program;
|
|
182
185
|
var isExtensionCreateNamespace = package_default.name === "extension-create";
|
|
186
|
+
if (process.env.EXTENSION_ENV === "development") {
|
|
187
|
+
console.log(`Running extension-create via ${package_default.name}...`);
|
|
188
|
+
}
|
|
183
189
|
extensionCreate.name(package_default.name).description(package_default.description).version(package_default.version).addHelpText("after", messages_default.programHelp());
|
|
184
190
|
extensionCreate.command("create", { isDefault: isExtensionCreateNamespace }).arguments("<project-name|project-path>").usage("create <project-name|project-path> [options]").description("Creates a new extension.").option(
|
|
185
191
|
"-t, --template <template-name>",
|
|
186
192
|
"specify a template for the created project"
|
|
187
|
-
).action(async function(
|
|
188
|
-
|
|
193
|
+
).action(async function(pathOrRemoteUrl, {
|
|
194
|
+
browser = "chrome",
|
|
195
|
+
template,
|
|
196
|
+
...otherCommandOptions
|
|
197
|
+
}) {
|
|
198
|
+
const vendors = browser.split(",");
|
|
199
|
+
switch (pathOrRemoteUrl) {
|
|
200
|
+
case "dev":
|
|
201
|
+
for (const vendor of vendors) {
|
|
202
|
+
await (0, import_develop.extensionDev)(pathOrRemoteUrl, {
|
|
203
|
+
mode: "development",
|
|
204
|
+
browser: vendor,
|
|
205
|
+
...otherCommandOptions
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
209
|
+
case "start":
|
|
210
|
+
for (const vendor of vendors) {
|
|
211
|
+
await (0, import_develop.extensionStart)(pathOrRemoteUrl, {
|
|
212
|
+
mode: "production",
|
|
213
|
+
browser: vendor,
|
|
214
|
+
...otherCommandOptions
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
break;
|
|
218
|
+
case "build":
|
|
219
|
+
for (const vendor of vendors) {
|
|
220
|
+
await (0, import_develop.extensionBuild)(pathOrRemoteUrl, {
|
|
221
|
+
browser: vendor,
|
|
222
|
+
...otherCommandOptions
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
break;
|
|
226
|
+
default:
|
|
227
|
+
await (0, import_create.default)(pathOrRemoteUrl, { template });
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
189
230
|
});
|
|
190
231
|
extensionCreate.command("dev").arguments("[project-path|remote-url]").usage("dev [project-path|remote-url] [options]").description("Starts the development server (development mode)").option(
|
|
191
232
|
"-u, --user-data-dir <path-to-file | boolean>",
|
package/dist/module.d.ts
ADDED
package/dist/module.js
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// module.ts
|
|
31
|
+
var module_exports = {};
|
|
32
|
+
__export(module_exports, {
|
|
33
|
+
default: () => cli
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(module_exports);
|
|
36
|
+
var import_semver = __toESM(require("semver"));
|
|
37
|
+
var import_commander = require("commander");
|
|
38
|
+
|
|
39
|
+
// messages/blockingErrors.ts
|
|
40
|
+
var blockingErrors_exports = {};
|
|
41
|
+
__export(blockingErrors_exports, {
|
|
42
|
+
noURLWithoutStart: () => noURLWithoutStart,
|
|
43
|
+
notImplemented: () => notImplemented,
|
|
44
|
+
unsupportedNodeVersion: () => unsupportedNodeVersion
|
|
45
|
+
});
|
|
46
|
+
function unsupportedNodeVersion() {
|
|
47
|
+
return `
|
|
48
|
+
You are using an unsupported Node version (${process.version}).
|
|
49
|
+
|
|
50
|
+
Please update to a version higher than 18.
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
function noURLWithoutStart(argument) {
|
|
54
|
+
return `
|
|
55
|
+
The default \`create\` command does not accept URLs.
|
|
56
|
+
Are you forgetting a \`start\` command? Maybe:
|
|
57
|
+
|
|
58
|
+
npx extension-create \`start\` ${argument}
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
61
|
+
function notImplemented(argument) {
|
|
62
|
+
return `${argument} command not implemented yet.`;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// messages/programHelp.ts
|
|
66
|
+
function programHelp() {
|
|
67
|
+
return `
|
|
68
|
+
# Help center for the extension-create program
|
|
69
|
+
|
|
70
|
+
## Usage: \`extension-create [command] [options]\`
|
|
71
|
+
|
|
72
|
+
**Note:** If you are looking for a specific list of options,
|
|
73
|
+
all high-level commands offer their own \`--help\` file with
|
|
74
|
+
information about usage and a list of command flags available.
|
|
75
|
+
|
|
76
|
+
For example:
|
|
77
|
+
|
|
78
|
+
\`extension-create create --help\`
|
|
79
|
+
outputs information about the \`create\` command.
|
|
80
|
+
|
|
81
|
+
## Options available
|
|
82
|
+
|
|
83
|
+
\`extension-create create <extension-name>\`
|
|
84
|
+
Creates a new extension from template. The "create" command
|
|
85
|
+
is optional and can be ommitted.
|
|
86
|
+
|
|
87
|
+
\`extension-create dev <extension-path>\`
|
|
88
|
+
Starts a new browser instance in development mode, with the target
|
|
89
|
+
extension loaded and auto-reloaded based on file changes.
|
|
90
|
+
|
|
91
|
+
\`extension-create start <extension-path>\`
|
|
92
|
+
Starts a new browser instance in production mode, with the target
|
|
93
|
+
extension compiled based on the browser choice.
|
|
94
|
+
|
|
95
|
+
\`extension-create build <extension-path>\`
|
|
96
|
+
Builds the target extension with browser defaults, ready for packaging.
|
|
97
|
+
|
|
98
|
+
\`extension-create --help\`
|
|
99
|
+
This command ;) Outputs a help file with key command options.
|
|
100
|
+
|
|
101
|
+
Feels something is wrong? Help by reporting a bug:
|
|
102
|
+
https://github.com/cezaraugusto/extension-create/issues/new
|
|
103
|
+
`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// messages/index.ts
|
|
107
|
+
var messages = {
|
|
108
|
+
...blockingErrors_exports,
|
|
109
|
+
programHelp
|
|
110
|
+
};
|
|
111
|
+
var messages_default = messages;
|
|
112
|
+
|
|
113
|
+
// package.json
|
|
114
|
+
var package_default = {
|
|
115
|
+
license: "MIT",
|
|
116
|
+
repository: {
|
|
117
|
+
type: "git",
|
|
118
|
+
url: "https://github.com/cezaraugusto/extension-create.git",
|
|
119
|
+
directory: "programs/cli"
|
|
120
|
+
},
|
|
121
|
+
engines: {
|
|
122
|
+
node: ">=18"
|
|
123
|
+
},
|
|
124
|
+
name: "@extension-create/cli",
|
|
125
|
+
version: "1.2.0",
|
|
126
|
+
description: "Create cross-browser extensions with no build configuration.",
|
|
127
|
+
main: "./dist/module.js",
|
|
128
|
+
types: "./dist/module.d.ts",
|
|
129
|
+
files: [
|
|
130
|
+
"dist"
|
|
131
|
+
],
|
|
132
|
+
author: {
|
|
133
|
+
name: "Cezar Augusto",
|
|
134
|
+
email: "boss@cezaraugusto.net",
|
|
135
|
+
url: "https://cezaraugusto.com"
|
|
136
|
+
},
|
|
137
|
+
scripts: {
|
|
138
|
+
"compile:tailwind-config": "node ./scripts/copyTailwindConfig.js",
|
|
139
|
+
"compile:stylelint-config": "node ./scripts/copyStylelintConfig.js",
|
|
140
|
+
"compile:module": "tsup-node ./module.ts --format cjs --dts --target=node18",
|
|
141
|
+
compile: "yarn compile:tailwind-config && yarn compile:stylelint-config && yarn compile:module",
|
|
142
|
+
clean: "rm -rf dist",
|
|
143
|
+
test: "jest"
|
|
144
|
+
},
|
|
145
|
+
keywords: [
|
|
146
|
+
"zero-config",
|
|
147
|
+
"build",
|
|
148
|
+
"develop",
|
|
149
|
+
"browser",
|
|
150
|
+
"extension",
|
|
151
|
+
"chrome extension",
|
|
152
|
+
"edge extension",
|
|
153
|
+
"firefox extension",
|
|
154
|
+
"web",
|
|
155
|
+
"react",
|
|
156
|
+
"typescript"
|
|
157
|
+
],
|
|
158
|
+
dependencies: {
|
|
159
|
+
"@extension-create/create": "*",
|
|
160
|
+
"@extension-create/develop": "*",
|
|
161
|
+
commander: "^11.1.0",
|
|
162
|
+
semver: "^7.5.4"
|
|
163
|
+
},
|
|
164
|
+
devDependencies: {
|
|
165
|
+
"@types/jest": "^29.5.11",
|
|
166
|
+
"@types/mock-fs": "^4.13.4",
|
|
167
|
+
"@types/node": "^20.11.5",
|
|
168
|
+
"@types/semver": "^7.5.6",
|
|
169
|
+
jest: "^29.7.0",
|
|
170
|
+
"mock-fs": "^5.2.0",
|
|
171
|
+
"ts-jest": "^29.1.2",
|
|
172
|
+
tsconfig: "*",
|
|
173
|
+
tsup: "^8.0.1",
|
|
174
|
+
typescript: "5.3.3"
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// module.ts
|
|
179
|
+
var import_create = __toESM(require("@extension-create/create"));
|
|
180
|
+
var import_develop = require("@extension-create/develop");
|
|
181
|
+
if (import_semver.default.lte(process.version, "18.0.0")) {
|
|
182
|
+
messages_default.unsupportedNodeVersion();
|
|
183
|
+
process.exit(1);
|
|
184
|
+
}
|
|
185
|
+
var extensionCreate = import_commander.program;
|
|
186
|
+
var isExtensionCreateNamespace = package_default.name === "extension-create";
|
|
187
|
+
extensionCreate.name(package_default.name).description(package_default.description).version(package_default.version).addHelpText("after", messages_default.programHelp());
|
|
188
|
+
extensionCreate.command("create", { isDefault: isExtensionCreateNamespace }).arguments("<project-name|project-path>").usage("create <project-name|project-path> [options]").description("Creates a new extension.").option(
|
|
189
|
+
"-t, --template <template-name>",
|
|
190
|
+
"specify a template for the created project"
|
|
191
|
+
).action(async function(projectName, { template, targetDir }) {
|
|
192
|
+
await (0, import_create.default)(projectName, { targetDir, template });
|
|
193
|
+
});
|
|
194
|
+
extensionCreate.command("dev").arguments("[project-path|remote-url]").usage("dev [project-path|remote-url] [options]").description("Starts the development server (development mode)").option(
|
|
195
|
+
"-u, --user-data-dir <path-to-file | boolean>",
|
|
196
|
+
"what path to use for the browser profile. A boolean value of false sets the profile to the default user profile. Defaults to a fresh profile"
|
|
197
|
+
).option(
|
|
198
|
+
"-b, --browser <chrome | edge>",
|
|
199
|
+
"specify a browser to run your extension in development mode"
|
|
200
|
+
).option(
|
|
201
|
+
"--polyfill <boolean>",
|
|
202
|
+
"whether or not to apply the cross-browser polyfill. Defaults to `true`"
|
|
203
|
+
).option(
|
|
204
|
+
"-p, --port <number>",
|
|
205
|
+
"what port should extension-create/develop run. Defaults to `3000`"
|
|
206
|
+
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...devOptions }) {
|
|
207
|
+
const vendors = browser.split(",");
|
|
208
|
+
for (const vendor of vendors) {
|
|
209
|
+
await (0, import_develop.extensionDev)(pathOrRemoteUrl, {
|
|
210
|
+
mode: "development",
|
|
211
|
+
browser: vendor,
|
|
212
|
+
...devOptions
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
extensionCreate.command("start").arguments("[project-path|remote-url]").usage("start [project-path|remote-url] [options]").description("Starts the development server (production mode)").option(
|
|
217
|
+
"-u, --user-data-dir <path-to-file | boolean>",
|
|
218
|
+
"what path to use for the browser profile. A boolean value of false sets the profile to the default user profile. Defaults to a fresh profile"
|
|
219
|
+
).option(
|
|
220
|
+
"-b, --browser <chrome | edge>",
|
|
221
|
+
"specify a browser to run your extension in development mode"
|
|
222
|
+
).option(
|
|
223
|
+
"--polyfill <boolean>",
|
|
224
|
+
"whether or not to apply the cross-browser polyfill. Defaults to `true`"
|
|
225
|
+
).option(
|
|
226
|
+
"-p, --port <number>",
|
|
227
|
+
"what port should extension-create/develop run. Defaults to `3000`"
|
|
228
|
+
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...startOptions }) {
|
|
229
|
+
const vendors = browser.split(",");
|
|
230
|
+
for (const vendor of vendors) {
|
|
231
|
+
await (0, import_develop.extensionStart)(pathOrRemoteUrl, {
|
|
232
|
+
mode: "production",
|
|
233
|
+
browser: vendor,
|
|
234
|
+
...startOptions
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
extensionCreate.command("build").arguments("[project-name]").usage("build [path-to-remote-extension] [options]").description("Builds the extension for production").option(
|
|
239
|
+
"-b, --browser <chrome | edge>",
|
|
240
|
+
"specify a browser to run your extension in development mode"
|
|
241
|
+
).option(
|
|
242
|
+
"--polyfill <boolean>",
|
|
243
|
+
"whether or not to apply the cross-browser polyfill. Defaults to `false`"
|
|
244
|
+
).action(async function(pathOrRemoteUrl, { browser = "chrome", ...buildOptions }) {
|
|
245
|
+
const vendors = browser.split(",");
|
|
246
|
+
for (const vendor of vendors) {
|
|
247
|
+
await (0, import_develop.extensionBuild)(pathOrRemoteUrl, {
|
|
248
|
+
browser: vendor,
|
|
249
|
+
...buildOptions
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
function cli() {
|
|
254
|
+
extensionCreate.parse();
|
|
255
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
|
|
4
|
+
const [, pathOrRemoteUrl] = process.argv.slice(2)
|
|
5
|
+
const projectDir = pathOrRemoteUrl.startsWith('http')
|
|
6
|
+
? process.cwd() + path.basename(pathOrRemoteUrl)
|
|
7
|
+
: path.resolve(__dirname, pathOrRemoteUrl)
|
|
8
|
+
|
|
9
|
+
const tailwindConfig = path.join(projectDir, 'tailwind.config.js')
|
|
10
|
+
|
|
11
|
+
/** @type {import('tailwindcss').Config} */
|
|
12
|
+
const tailwindConfigData = fs.existsSync(tailwindConfig)
|
|
13
|
+
? require(tailwindConfig)
|
|
14
|
+
: {content: []}
|
|
15
|
+
|
|
16
|
+
/** @type {import('tailwindcss').Config} */
|
|
17
|
+
const tailwindRootConfig = {
|
|
18
|
+
...tailwindConfigData,
|
|
19
|
+
content: [
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
21
|
+
...tailwindConfigData.content.map((file) => path.join(projectDir, file))
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = tailwindRootConfig
|
package/package.json
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
"license": "MIT",
|
|
3
3
|
"repository": {
|
|
4
4
|
"type": "git",
|
|
5
|
-
"url": "https://github.com/cezaraugusto/extension-create.git"
|
|
5
|
+
"url": "https://github.com/cezaraugusto/extension-create.git",
|
|
6
|
+
"directory": "programs/cli"
|
|
6
7
|
},
|
|
7
8
|
"engines": {
|
|
8
9
|
"node": ">=18"
|
|
9
10
|
},
|
|
10
11
|
"name": "extension-create",
|
|
11
|
-
"version": "1.
|
|
12
|
+
"version": "1.2.1",
|
|
12
13
|
"description": "Create cross-browser extensions with no build configuration.",
|
|
13
14
|
"main": "./dist/cli.js",
|
|
14
15
|
"types": "./dist/cli.d.ts",
|
|
@@ -24,9 +25,12 @@
|
|
|
24
25
|
"url": "https://cezaraugusto.com"
|
|
25
26
|
},
|
|
26
27
|
"scripts": {
|
|
27
|
-
"
|
|
28
|
+
"compile:readme-files": "node ./scripts/copyMarkdownFilesToCli.js",
|
|
29
|
+
"compile:tailwind-config": "node ./scripts/copyTailwindConfig.js",
|
|
30
|
+
"compile:stylelint-config": "node ./scripts/copyStylelintConfig.js",
|
|
31
|
+
"compile:cli": "tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
32
|
+
"compile": "yarn compile:readme-files && yarn compile:tailwind-config && yarn compile:stylelint-config &&yarn compile:cli",
|
|
28
33
|
"clean": "rm -rf dist",
|
|
29
|
-
"compile": "yarn copyMarkdownFilesToCli && tsup-node ./cli.ts --format cjs --dts --target=node18",
|
|
30
34
|
"test": "jest"
|
|
31
35
|
},
|
|
32
36
|
"keywords": [
|
|
@@ -52,13 +56,12 @@
|
|
|
52
56
|
"@types/jest": "^29.5.11",
|
|
53
57
|
"@types/mock-fs": "^4.13.4",
|
|
54
58
|
"@types/node": "^20.11.5",
|
|
55
|
-
"@types/pacote": "^11.1.8",
|
|
56
59
|
"@types/semver": "^7.5.6",
|
|
57
60
|
"jest": "^29.7.0",
|
|
58
61
|
"mock-fs": "^5.2.0",
|
|
59
62
|
"ts-jest": "^29.1.2",
|
|
60
63
|
"tsconfig": "*",
|
|
61
64
|
"tsup": "^8.0.1",
|
|
62
|
-
"typescript": "
|
|
65
|
+
"typescript": "5.3.3"
|
|
63
66
|
}
|
|
64
|
-
}
|
|
67
|
+
}
|