@linktr.ee/create-link-app 0.3.0-next.6 → 0.3.0-next.7
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 -0
- package/dist/commands/storybook.js +28 -0
- package/dist/postcss/postcss.config.js +20 -0
- package/dist/storybook/main.js +62 -0
- package/dist/storybook/preview.js +12 -0
- package/dist/webpack/webpack.config.js +25 -13
- package/oclif.manifest.json +21 -1
- package/package.json +14 -1
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ yarn create @linktr.ee/create-link-app my-link-app
|
|
|
27
27
|
* [`create-link-app help [COMMANDS]`](#create-link-app-help-commands)
|
|
28
28
|
* [`create-link-app login`](#create-link-app-login)
|
|
29
29
|
* [`create-link-app logout`](#create-link-app-logout)
|
|
30
|
+
* [`create-link-app storybook`](#create-link-app-storybook)
|
|
30
31
|
|
|
31
32
|
## `create-link-app build`
|
|
32
33
|
|
|
@@ -168,4 +169,19 @@ USAGE
|
|
|
168
169
|
DESCRIPTION
|
|
169
170
|
Logout and clear browser session
|
|
170
171
|
```
|
|
172
|
+
|
|
173
|
+
## `create-link-app storybook`
|
|
174
|
+
|
|
175
|
+
Start the Stortybook development server
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
USAGE
|
|
179
|
+
$ create-link-app storybook [-p <value>]
|
|
180
|
+
|
|
181
|
+
FLAGS
|
|
182
|
+
-p, --port=<value> [default: 6006] Port to run the Storybook server on
|
|
183
|
+
|
|
184
|
+
DESCRIPTION
|
|
185
|
+
Start the Stortybook development server
|
|
186
|
+
```
|
|
171
187
|
<!-- commandsstop -->
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const base_1 = __importDefault(require("../base"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
class Storybook extends base_1.default {
|
|
11
|
+
async run() {
|
|
12
|
+
const configPath = path_1.default.resolve(__dirname, '..', 'storybook');
|
|
13
|
+
const { flags } = await this.parse(Storybook);
|
|
14
|
+
const storybook = (0, child_process_1.spawn)(`start-storybook -p ${flags.port} -c ${configPath}`, { shell: true, stdio: 'inherit' });
|
|
15
|
+
storybook.on('error', (err) => {
|
|
16
|
+
throw err;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.default = Storybook;
|
|
21
|
+
Storybook.description = 'Start the Stortybook development server';
|
|
22
|
+
Storybook.flags = {
|
|
23
|
+
port: core_1.Flags.integer({
|
|
24
|
+
char: 'p',
|
|
25
|
+
description: 'Port to run the Storybook server on',
|
|
26
|
+
default: 6006,
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const tailwindcss_1 = __importDefault(require("tailwindcss"));
|
|
8
|
+
const autoprefixer_1 = __importDefault(require("autoprefixer"));
|
|
9
|
+
const componentLibraryContentPath = path_1.default.join(require.resolve('@linktr.ee/component-library/tailwind.config').split('/').slice(0, -1).join('/'), 'dist', '**', '*.js');
|
|
10
|
+
const config = {
|
|
11
|
+
plugins: [
|
|
12
|
+
(0, tailwindcss_1.default)({
|
|
13
|
+
content: [`${process.cwd()}/src/**/*.{js,jsx,ts,tsx}`, componentLibraryContentPath],
|
|
14
|
+
presets: [require('@linktr.ee/component-library/tailwind.config')],
|
|
15
|
+
plugins: [],
|
|
16
|
+
}),
|
|
17
|
+
(0, autoprefixer_1.default)(),
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
module.exports = config;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const postcss_1 = __importDefault(require("postcss"));
|
|
30
|
+
const postcssOptions = __importStar(require("../postcss/postcss.config"));
|
|
31
|
+
const config = {
|
|
32
|
+
stories: [`${process.cwd()}/src/**/*.stories.@(js|jsx|ts|tsx)`],
|
|
33
|
+
addons: [
|
|
34
|
+
'@storybook/addon-links',
|
|
35
|
+
'@storybook/addon-essentials',
|
|
36
|
+
{
|
|
37
|
+
name: 'storybook-addon-turbo-build',
|
|
38
|
+
options: {
|
|
39
|
+
optimizationLevel: 2,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
/**
|
|
44
|
+
* Fix Storybook issue with PostCSS@8
|
|
45
|
+
* @see https://github.com/storybookjs/storybook/issues/12668#issuecomment-773958085
|
|
46
|
+
*/
|
|
47
|
+
name: '@storybook/addon-postcss',
|
|
48
|
+
options: {
|
|
49
|
+
cssLoaderOptions: { importLoaders: 1 },
|
|
50
|
+
postcssLoaderOptions: {
|
|
51
|
+
implementation: postcss_1.default,
|
|
52
|
+
postcssOptions: { ...postcssOptions },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
framework: '@storybook/react',
|
|
58
|
+
core: {
|
|
59
|
+
builder: 'webpack5',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
module.exports = config;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parameters = void 0;
|
|
4
|
+
exports.parameters = {
|
|
5
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
6
|
+
controls: {
|
|
7
|
+
matchers: {
|
|
8
|
+
color: /(background|color)$/i,
|
|
9
|
+
date: /Date$/,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
3
26
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
28
|
};
|
|
@@ -13,8 +36,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
13
36
|
const webpack_1 = require("webpack");
|
|
14
37
|
const camelcase_1 = __importDefault(require("camelcase"));
|
|
15
38
|
const slugify_1 = __importDefault(require("slugify"));
|
|
16
|
-
const
|
|
17
|
-
const autoprefixer_1 = __importDefault(require("autoprefixer"));
|
|
39
|
+
const postcssOptions = __importStar(require("../postcss/postcss.config"));
|
|
18
40
|
const { ModuleFederationPlugin } = webpack_1.container;
|
|
19
41
|
function default_1(env, options) {
|
|
20
42
|
const appDir = process.cwd();
|
|
@@ -25,7 +47,6 @@ function default_1(env, options) {
|
|
|
25
47
|
const linkTypeSlug = (0, slugify_1.default)(linkTypeName, { lower: true });
|
|
26
48
|
const linkTypeId = (0, camelcase_1.default)(linkTypeSlug, { pascalCase: true });
|
|
27
49
|
const hasTsconfig = fileExists(path_1.default.resolve(appDir, 'tsconfig.json'));
|
|
28
|
-
const componentLibraryContentPath = path_1.default.join(require.resolve('@linktr.ee/component-library/tailwind.config').split('/').slice(0, -1).join('/'), 'dist', '**', '*.js');
|
|
29
50
|
const config = {
|
|
30
51
|
target: 'web',
|
|
31
52
|
mode: env,
|
|
@@ -62,16 +83,7 @@ function default_1(env, options) {
|
|
|
62
83
|
{
|
|
63
84
|
loader: 'postcss-loader',
|
|
64
85
|
options: {
|
|
65
|
-
postcssOptions: {
|
|
66
|
-
plugins: [
|
|
67
|
-
(0, tailwindcss_1.default)({
|
|
68
|
-
content: [`${appDir}/src/**/*.{js,jsx,ts,tsx}`, componentLibraryContentPath],
|
|
69
|
-
presets: [require('@linktr.ee/component-library/tailwind.config')],
|
|
70
|
-
plugins: [],
|
|
71
|
-
}),
|
|
72
|
-
(0, autoprefixer_1.default)(),
|
|
73
|
-
],
|
|
74
|
-
},
|
|
86
|
+
postcssOptions: { ...postcssOptions },
|
|
75
87
|
},
|
|
76
88
|
},
|
|
77
89
|
],
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.3.0-next.
|
|
2
|
+
"version": "0.3.0-next.7",
|
|
3
3
|
"commands": {
|
|
4
4
|
"build": {
|
|
5
5
|
"id": "build",
|
|
@@ -216,6 +216,26 @@
|
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
"args": {}
|
|
219
|
+
},
|
|
220
|
+
"storybook": {
|
|
221
|
+
"id": "storybook",
|
|
222
|
+
"description": "Start the Stortybook development server",
|
|
223
|
+
"strict": true,
|
|
224
|
+
"pluginName": "@linktr.ee/create-link-app",
|
|
225
|
+
"pluginAlias": "@linktr.ee/create-link-app",
|
|
226
|
+
"pluginType": "core",
|
|
227
|
+
"aliases": [],
|
|
228
|
+
"flags": {
|
|
229
|
+
"port": {
|
|
230
|
+
"name": "port",
|
|
231
|
+
"type": "option",
|
|
232
|
+
"char": "p",
|
|
233
|
+
"description": "Port to run the Storybook server on",
|
|
234
|
+
"multiple": false,
|
|
235
|
+
"default": 6006
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"args": {}
|
|
219
239
|
}
|
|
220
240
|
}
|
|
221
241
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linktr.ee/create-link-app",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.7",
|
|
4
4
|
"description": "Create a Link App on Linktr.ee.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Linktree",
|
|
@@ -37,6 +37,16 @@
|
|
|
37
37
|
"@linktr.ee/component-library": "^7.0.17",
|
|
38
38
|
"@oclif/core": "^1.9.0",
|
|
39
39
|
"@oclif/plugin-help": "^5.1.12",
|
|
40
|
+
"@storybook/addon-actions": "^6.5.9",
|
|
41
|
+
"@storybook/addon-essentials": "^6.5.9",
|
|
42
|
+
"@storybook/addon-interactions": "^6.5.9",
|
|
43
|
+
"@storybook/addon-links": "^6.5.9",
|
|
44
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
45
|
+
"@storybook/builder-webpack5": "^6.5.9",
|
|
46
|
+
"@storybook/manager-webpack5": "^6.5.9",
|
|
47
|
+
"@storybook/react": "^6.5.9",
|
|
48
|
+
"@testing-library/react": "^12.1.4",
|
|
49
|
+
"@testing-library/user-event": "14",
|
|
40
50
|
"archiver": "^5.3.1",
|
|
41
51
|
"autoprefixer": "^10.4.14",
|
|
42
52
|
"axios": "^0.27.2",
|
|
@@ -54,9 +64,12 @@
|
|
|
54
64
|
"openid-client": "^5.1.6",
|
|
55
65
|
"postcss": "^8.4.21",
|
|
56
66
|
"postcss-loader": "^4.3.0",
|
|
67
|
+
"prop-types": "^15.8.1",
|
|
57
68
|
"react": "^17.0.2",
|
|
58
69
|
"react-dom": "^17.0.2",
|
|
59
70
|
"slugify": "^1.6.6",
|
|
71
|
+
"storybook-addon-designs": "^6.3.1",
|
|
72
|
+
"storybook-addon-turbo-build": "^1.1.0",
|
|
60
73
|
"style-loader": "^3.3.2",
|
|
61
74
|
"styled-components": "^5.3.5",
|
|
62
75
|
"tailwindcss": "^3.3.1",
|