create-digigov-app 0.3.24 → 0.6.0
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.json +66 -0
- package/CHANGELOG.md +36 -1
- package/README.md +34 -0
- package/package.json +3 -3
- package/saofile.js +19 -14
- package/template/_package.json +4 -1
- package/template/_postcss.config.js +3 -0
- package/template/_tailwind.config.js +1 -0
- package/template/javascript/index.css +3 -0
- package/template/javascript/src/components/CommonLayout.js +37 -0
- package/template/javascript/src/locales/en.js +1 -1
- package/template/javascript/src/pages/404.js +17 -0
- package/template/javascript/src/pages/_app.js +4 -2
- package/template/javascript/src/pages/index.js +18 -39
- package/template/typescript/index.css +3 -0
- package/template/typescript/src/components/CommonLayout.tsx +37 -0
- package/template/typescript/src/pages/404.tsx +18 -0
- package/template/typescript/src/pages/_app.tsx +4 -2
- package/template/typescript/src/pages/index.tsx +18 -39
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-digigov-app",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.6.0",
|
|
6
|
+
"tag": "create-digigov-app_v0.6.0",
|
|
7
|
+
"date": "Mon, 31 Jan 2022 13:42:21 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Add and remove css files for ts and js projects and add needed dependencies"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"minor": [
|
|
15
|
+
{
|
|
16
|
+
"comment": "Refactor templates to use @digigov/react-core"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"version": "0.5.0",
|
|
23
|
+
"tag": "create-digigov-app_v0.5.0",
|
|
24
|
+
"date": "Thu, 30 Dec 2021 12:54:03 GMT",
|
|
25
|
+
"comments": {
|
|
26
|
+
"minor": [
|
|
27
|
+
{
|
|
28
|
+
"comment": "Update scaffolder's templates including @digigov/css configuration"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"version": "0.4.1",
|
|
35
|
+
"tag": "create-digigov-app_v0.4.1",
|
|
36
|
+
"date": "Tue, 02 Nov 2021 13:03:39 GMT",
|
|
37
|
+
"comments": {
|
|
38
|
+
"dependency": [
|
|
39
|
+
{
|
|
40
|
+
"comment": "Updating dependency \"@digigov/cli\" from `0.5.24` to `0.5.25`"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"version": "0.4.0",
|
|
47
|
+
"tag": "create-digigov-app_v0.4.0",
|
|
48
|
+
"date": "Wed, 22 Sep 2021 10:15:42 GMT",
|
|
49
|
+
"comments": {
|
|
50
|
+
"minor": [
|
|
51
|
+
{
|
|
52
|
+
"comment": "create common layout component"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"comment": "Create a default `src/pages/404.js|ts` page when a new Digigov app codebase is generated from scratch"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"patch": [
|
|
59
|
+
{
|
|
60
|
+
"comment": "Add README to the tool codebase"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"dependency": [
|
|
64
|
+
{
|
|
65
|
+
"comment": "Updating dependency \"@digigov/cli-lint\" from `0.5.24` to `0.5.25`"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
4
70
|
{
|
|
5
71
|
"version": "0.3.24",
|
|
6
72
|
"tag": "create-digigov-app_v0.3.24",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
# Change Log - create-digigov-app
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 31 Jan 2022 13:42:21 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.6.0
|
|
6
|
+
Mon, 31 Jan 2022 13:42:21 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- Refactor templates to use @digigov/react-core
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Add and remove css files for ts and js projects and add needed dependencies
|
|
15
|
+
|
|
16
|
+
## 0.5.0
|
|
17
|
+
Thu, 30 Dec 2021 12:54:03 GMT
|
|
18
|
+
|
|
19
|
+
### Minor changes
|
|
20
|
+
|
|
21
|
+
- Update scaffolder's templates including @digigov/css configuration
|
|
22
|
+
|
|
23
|
+
## 0.4.1
|
|
24
|
+
Tue, 02 Nov 2021 13:03:39 GMT
|
|
25
|
+
|
|
26
|
+
_Version update only_
|
|
27
|
+
|
|
28
|
+
## 0.4.0
|
|
29
|
+
Wed, 22 Sep 2021 10:15:42 GMT
|
|
30
|
+
|
|
31
|
+
### Minor changes
|
|
32
|
+
|
|
33
|
+
- create common layout component
|
|
34
|
+
- Create a default `src/pages/404.js|ts` page when a new Digigov app codebase is generated from scratch
|
|
35
|
+
|
|
36
|
+
### Patches
|
|
37
|
+
|
|
38
|
+
- Add README to the tool codebase
|
|
4
39
|
|
|
5
40
|
## 0.3.24
|
|
6
41
|
Tue, 24 Aug 2021 13:55:40 GMT
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# create-digigov-app
|
|
2
|
+
|
|
3
|
+
> `create-digigov-app` tool is a scaffolder CLI tool that helps devs to quickly
|
|
4
|
+
> create new empty codebases without writing any code
|
|
5
|
+
|
|
6
|
+
## How to run the scaffolder
|
|
7
|
+
|
|
8
|
+
Create a new service app in a folder called `my-digigov-service`. The tool
|
|
9
|
+
will ask you for a few options to customize the newly created codebase.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
yarn create digigov-app my-digigov-service
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
or if you prefer to use `npx`
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npx create-digigov-app my-digigov-service
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Test the scaffolder locally
|
|
22
|
+
|
|
23
|
+
If you done some changes in the tool and you need to test that it works as
|
|
24
|
+
expected, you can run the `cli.js` in your terminal as a node script and
|
|
25
|
+
instruct the tool to create the new folder to the `/tmp` directory thus keeping
|
|
26
|
+
the `digigov-sdk` repository clean.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
node cli.js /tmp/test-service
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
After the script ends successfully, you can visit the `/tmp/test-service` and
|
|
33
|
+
make sure that the files were generated as expected and run scripts like `yarn
|
|
34
|
+
dev` and `yarn build` as in any other application.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-digigov-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Create a DigiGOV App with ease",
|
|
5
5
|
"bin": "cli.js",
|
|
6
6
|
"files": [
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"validate-npm-package-name": "3.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@digigov/cli": "0.5.
|
|
29
|
-
"@digigov/cli-lint": "0.5.
|
|
28
|
+
"@digigov/cli": "0.5.25",
|
|
29
|
+
"@digigov/cli-lint": "0.5.25",
|
|
30
30
|
"@digigov/cli-test": "0.5.24",
|
|
31
31
|
"typescript": "4.2.3"
|
|
32
32
|
},
|
package/saofile.js
CHANGED
|
@@ -2,17 +2,20 @@ const { relative } = require('path');
|
|
|
2
2
|
const validate = require('validate-npm-package-name');
|
|
3
3
|
|
|
4
4
|
const digigovDepsDev = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
]
|
|
5
|
+
'@digigov/cli',
|
|
6
|
+
'@digigov/cli-lint',
|
|
7
|
+
'@digigov/cli-app',
|
|
8
|
+
'@digigov/cli-build',
|
|
9
|
+
'@digigov/cli-test',
|
|
10
|
+
];
|
|
11
11
|
|
|
12
12
|
const digigovDeps = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
'@digigov/ui',
|
|
14
|
+
'@digigov/nextjs',
|
|
15
|
+
'@digigov/react-core',
|
|
16
|
+
'@digigov/css',
|
|
17
|
+
'tailwindcss',
|
|
18
|
+
];
|
|
16
19
|
|
|
17
20
|
module.exports = {
|
|
18
21
|
prompts: require('./prompts'),
|
|
@@ -58,8 +61,10 @@ module.exports = {
|
|
|
58
61
|
'_package.json': 'package.json',
|
|
59
62
|
'_.prettierrc.js': '.prettierrc.js',
|
|
60
63
|
'_.eslintrc.js': '.eslintrc.js',
|
|
64
|
+
'_postcss.config.js': 'postcss.config.js',
|
|
65
|
+
'_tailwind.config.js': 'tailwind.config.js',
|
|
61
66
|
'_tsconfig.json': 'tsconfig.json',
|
|
62
|
-
|
|
67
|
+
_Dockerfile: 'Dockerfile',
|
|
63
68
|
},
|
|
64
69
|
});
|
|
65
70
|
|
|
@@ -74,13 +79,13 @@ module.exports = {
|
|
|
74
79
|
await this.npmInstall({ npmClient: this.answers.pm });
|
|
75
80
|
await this.npmInstall({
|
|
76
81
|
npmClient: this.answers.pm,
|
|
77
|
-
packages: digigovDeps
|
|
78
|
-
})
|
|
82
|
+
packages: digigovDeps,
|
|
83
|
+
});
|
|
79
84
|
await this.npmInstall({
|
|
80
85
|
npmClient: this.answers.pm,
|
|
81
86
|
packages: digigovDepsDev,
|
|
82
|
-
saveDev: true
|
|
83
|
-
})
|
|
87
|
+
saveDev: true,
|
|
88
|
+
});
|
|
84
89
|
}
|
|
85
90
|
|
|
86
91
|
const chalk = this.chalk;
|
package/template/_package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@digigov/cli-app/tailwindrc')();
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Head from 'next/head';
|
|
3
|
+
import { useTranslation } from '@digigov/ui/app/i18n';
|
|
4
|
+
import {
|
|
5
|
+
Layout,
|
|
6
|
+
Top,
|
|
7
|
+
Container,
|
|
8
|
+
Bottom,
|
|
9
|
+
Header,
|
|
10
|
+
GovGRFooter,
|
|
11
|
+
GovGRLogo,
|
|
12
|
+
} from '@digigov/react-core';
|
|
13
|
+
|
|
14
|
+
const CommonLayout = ({ children }) => {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
return (
|
|
17
|
+
<Layout>
|
|
18
|
+
<Head>
|
|
19
|
+
<title>{t('app.name')}</title>
|
|
20
|
+
</Head>
|
|
21
|
+
<Top>
|
|
22
|
+
<Header>
|
|
23
|
+
<GovGRLogo />
|
|
24
|
+
{/* <HeaderTitle>
|
|
25
|
+
{t('app.name')}
|
|
26
|
+
</HeaderTitle> */}
|
|
27
|
+
</Header>
|
|
28
|
+
</Top>
|
|
29
|
+
<Container>{children}</Container>
|
|
30
|
+
<Bottom>
|
|
31
|
+
<GovGRFooter />
|
|
32
|
+
</Bottom>
|
|
33
|
+
</Layout>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default CommonLayout;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import NotFound from '@digigov/ui/app/NotFound';
|
|
3
|
+
import { Main, ASide } from '@digigov/react-core'
|
|
4
|
+
import CommonLayout from '<%= name %>/components/CommonLayout';
|
|
5
|
+
|
|
6
|
+
const NotFoundPage = () => {
|
|
7
|
+
return (
|
|
8
|
+
<CommonLayout>
|
|
9
|
+
<Main>
|
|
10
|
+
<NotFound />
|
|
11
|
+
</Main>
|
|
12
|
+
<ASide></ASide>
|
|
13
|
+
</CommonLayout>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default NotFoundPage;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import App from '@digigov/nextjs/App';
|
|
2
2
|
import initI18n from '@digigov/nextjs/i18n';
|
|
3
|
-
import el from '
|
|
4
|
-
import en from '
|
|
3
|
+
import el from '<%= name %>/locales/el';
|
|
4
|
+
import en from '<%= name %>/locales/en';
|
|
5
|
+
import 'tailwindcss/tailwind.css';
|
|
6
|
+
import '../../index.css';
|
|
5
7
|
|
|
6
8
|
initI18n({
|
|
7
9
|
el: {
|
|
@@ -1,49 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Head from 'next/head';
|
|
3
2
|
import { useTranslation } from '@digigov/ui/app/i18n';
|
|
4
|
-
|
|
5
|
-
import BasicLayout, {
|
|
6
|
-
Top,
|
|
7
|
-
Content,
|
|
3
|
+
import {
|
|
8
4
|
Main,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
import PageTitle, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
|
|
5
|
+
Aside,
|
|
6
|
+
PageTitle,
|
|
7
|
+
PageTitleHeading,
|
|
8
|
+
CallToAction,
|
|
9
|
+
Paragraph,
|
|
10
|
+
} from '@digigov/react-core';
|
|
11
|
+
import CommonLayout from '<%= name %>/components/CommonLayout';
|
|
17
12
|
|
|
18
13
|
const Home = () => {
|
|
19
14
|
const { t } = useTranslation();
|
|
20
15
|
return (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</HeaderTitle>
|
|
32
|
-
</Header>
|
|
33
|
-
</Top>
|
|
34
|
-
<Content>
|
|
35
|
-
<Main>
|
|
36
|
-
<PageTitle>
|
|
37
|
-
<PageTitleHeading>{t('app.name')}</PageTitleHeading>
|
|
38
|
-
</PageTitle>
|
|
39
|
-
<div>{t('app.intro_text')}</div>
|
|
40
|
-
</Main>
|
|
41
|
-
<Side></Side>
|
|
42
|
-
</Content>
|
|
43
|
-
<Bottom>
|
|
44
|
-
<GovGRFooter />
|
|
45
|
-
</Bottom>
|
|
46
|
-
</BasicLayout>
|
|
16
|
+
<CommonLayout>
|
|
17
|
+
<Main>
|
|
18
|
+
<PageTitle>
|
|
19
|
+
<PageTitleHeading>{t('app.name')}</PageTitleHeading>
|
|
20
|
+
</PageTitle>
|
|
21
|
+
<Paragraph>{t('app.intro_text')}</Paragraph>
|
|
22
|
+
<CallToAction href="/login">{t('button.start')}</CallToAction>
|
|
23
|
+
</Main>
|
|
24
|
+
<Aside></Aside>
|
|
25
|
+
</CommonLayout>
|
|
47
26
|
);
|
|
48
27
|
};
|
|
49
28
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Head from 'next/head';
|
|
3
|
+
import { useTranslation } from '@digigov/ui/app/i18n';
|
|
4
|
+
import {
|
|
5
|
+
Layout,
|
|
6
|
+
Top,
|
|
7
|
+
Container,
|
|
8
|
+
Bottom,
|
|
9
|
+
Header,
|
|
10
|
+
GovGRFooter,
|
|
11
|
+
GovGRLogo,
|
|
12
|
+
} from '@digigov/react-core';
|
|
13
|
+
|
|
14
|
+
const CommonLayout: React.FC = ({ children }) => {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
return (
|
|
17
|
+
<Layout>
|
|
18
|
+
<Head>
|
|
19
|
+
<title>{t('app.name')}</title>
|
|
20
|
+
</Head>
|
|
21
|
+
<Top>
|
|
22
|
+
<Header>
|
|
23
|
+
<GovGRLogo />
|
|
24
|
+
{/* <HeaderTitle>
|
|
25
|
+
{t('app.name')}
|
|
26
|
+
</HeaderTitle> */}
|
|
27
|
+
</Header>
|
|
28
|
+
</Top>
|
|
29
|
+
<Container>{children}</Container>
|
|
30
|
+
<Bottom>
|
|
31
|
+
<GovGRFooter />
|
|
32
|
+
</Bottom>
|
|
33
|
+
</Layout>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default CommonLayout;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import NotFound from '@digigov/ui/app/NotFound';
|
|
3
|
+
import { Main, Aside } from '@digigov/react-core'
|
|
4
|
+
import CommonLayout from '<%= name %>/components/CommonLayout';
|
|
5
|
+
|
|
6
|
+
const NotFoundPage: React.FC = () => {
|
|
7
|
+
return (
|
|
8
|
+
<CommonLayout>
|
|
9
|
+
<Main>
|
|
10
|
+
<NotFound />
|
|
11
|
+
</Main>
|
|
12
|
+
<Aside></Aside>
|
|
13
|
+
</CommonLayout>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default NotFoundPage;
|
|
18
|
+
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import App from '@digigov/nextjs/App';
|
|
2
2
|
import initI18n from '@digigov/nextjs/i18n';
|
|
3
|
-
import el from '
|
|
4
|
-
import en from '
|
|
3
|
+
import el from '<%= name %>/locales/el';
|
|
4
|
+
import en from '<%= name %>/locales/en';
|
|
5
|
+
import 'tailwindcss/tailwind.css';
|
|
6
|
+
import '../../index.css';
|
|
5
7
|
|
|
6
8
|
initI18n({
|
|
7
9
|
el: {
|
|
@@ -1,49 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Head from 'next/head';
|
|
3
2
|
import { useTranslation } from '@digigov/ui/app/i18n';
|
|
4
|
-
|
|
5
|
-
import BasicLayout, {
|
|
6
|
-
Top,
|
|
7
|
-
Content,
|
|
3
|
+
import {
|
|
8
4
|
Main,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
import PageTitle, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
|
|
5
|
+
Aside,
|
|
6
|
+
PageTitle,
|
|
7
|
+
PageTitleHeading,
|
|
8
|
+
CallToAction,
|
|
9
|
+
Paragraph,
|
|
10
|
+
} from '@digigov/react-core';
|
|
11
|
+
import CommonLayout from '<%= name %>/components/CommonLayout';
|
|
17
12
|
|
|
18
13
|
const Home: React.FC = () => {
|
|
19
14
|
const { t } = useTranslation();
|
|
20
15
|
return (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</HeaderTitle>
|
|
32
|
-
</Header>
|
|
33
|
-
</Top>
|
|
34
|
-
<Content>
|
|
35
|
-
<Main>
|
|
36
|
-
<PageTitle>
|
|
37
|
-
<PageTitleHeading>{t('app.name')}</PageTitleHeading>
|
|
38
|
-
</PageTitle>
|
|
39
|
-
<div>{t('app.intro_text')}</div>
|
|
40
|
-
</Main>
|
|
41
|
-
<Side></Side>
|
|
42
|
-
</Content>
|
|
43
|
-
<Bottom>
|
|
44
|
-
<GovGRFooter />
|
|
45
|
-
</Bottom>
|
|
46
|
-
</BasicLayout>
|
|
16
|
+
<CommonLayout>
|
|
17
|
+
<Main>
|
|
18
|
+
<PageTitle>
|
|
19
|
+
<PageTitleHeading>{t('app.name')}</PageTitleHeading>
|
|
20
|
+
</PageTitle>
|
|
21
|
+
<Paragraph>{t('app.intro_text')}</Paragraph>
|
|
22
|
+
<CallToAction href="/login">{t('button.start')}</CallToAction>
|
|
23
|
+
</Main>
|
|
24
|
+
<Aside></Aside>
|
|
25
|
+
</CommonLayout>
|
|
47
26
|
);
|
|
48
27
|
};
|
|
49
28
|
|